Sign in to follow this  
Guest ptwaugh

Slartibartfast Question (following manual tutorial)

Recommended Posts

Hi,I'm trying to complete the exercise walkthrough in the manual, but when I get to the stage where I have to flood-fill the edge of the .bmp which is to become the watermap, I'm stuck.I compile the thing, and it tells me that the watermap has more than 2 colors and no land.I'm lost. I have black as water, white as not water, and a 48% grey around the edges as undefined.Any ideas are appreciated.

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi,It's probably something fairly simple. I suspect you've missed out setting the levels correctly on p48.To start with, pure black and white are fine. At the point you're at though, you're using a watermap instead of a watermask. Instead of black and white, it should contain elevation data and a couple of special values for 'land' and 'undefined'.Undefined is just below 50%, and Land is just above 50%. If all your land is white, it's not at 52% so it won't be recognised as land.Fiddling with the levels (page 48) sets the limits to around 5 (for water) and 120 (for land). Because of the mesh-cling mode, the water elevation doesn't matter. 120/255 ~= 47% - but this is *backwards* because Photoshop is reporting % of black, not % of white, so the land works out at (100-47) = 53% . 132/255 ~= 52% and 100-52 = 48%.I know the % scale seems a bit wierd but it's nothing to do with Slarti :) It's just the way that some editors work when you're in greyscale mode, so I wanted to mention it in the manual. It's certainly easier if you can persuade the editor to show actual values instead of %.HTHJim

Share this post


Link to post
Share on other sites

I'm still lost. I get that photoshop is reversed (and this is what I use), but I'm not getting what the goal is, nor how we are supposed to get terrain info back in the pic after we just killed it off.Thanks

Share this post


Link to post
Share on other sites

Hi,Don't worry, this is the hardest part to get to grips with. It just seems like numbers are flying around everywhere but there are some fairly simple rules about what's going on. Once you can visualise the goal, it should be easy. If you don't care about why things are the way they are, skip on down - but I think it'll help you to understand what's going on.Here's the 'Why':-----------------The goal is to convert the watermask - that is, a simple yes/no image - into a watermap which also contains height information. You can use a watermap to set lakes/rivers at fixed heights *or* to have them mesh-cling.If you just want *entirely* mesh-cling water, you can just stick with a black/white mask. However, switching to using a map lets you pull some tricks - specifically, you can mix mesh-cling and fixed-height in the one pass through the software.There's a special mode where sealevel water is made fixed-height and all other water is mesh-cling. This lets you get nice flat oceans and not worry about the heights of rivers, lakes etc.Think of the watermap as if it were an elevation map or DEM, but for water. For every value in the map, that's how high above sealevel the water is at that point. The problem then becomes how to figure out if the point is water or not. Slarti does this by using one of two special values; one for 'land', one for 'undefined'.Undefined works exactly as it does for the land elevation map; it does nothing. 'Land' simply says that this point is land, so don't define any water at all.The tutorial uses the Levels tool to change the original black/white mask into a map by changing all 0 values (originally black, water) to 5, and all 255 values (white, land) to 120. 120 is within the range of values used to define 'land'.If you process it now with the mixed mesh-cling/fixed-height mode enabled you'll get mesh-cling lakes over the entire map, except where 'land' is defined. Even though all the water is described as a flat sheet, 1280 meters above sealevel, it doesn't matter because it's being converted to mesh-cling. Why 1280? Remember the watermap feature is desiged to be used with 16-bit images, to allow you to set the entire elevation range accurately. We can get away with editing in 8-bit because we don't *care* about the exact values. As it happens, Photoshop tends to only show 8-bit values anyway.You then have the option of going back and using 'levels' again on a selected subset of the image to change it back to 0 for fixed-height, sealevel water. You can also get rid of the undefined borders (which started as 0 and will now also be set to 5 because of the levels operation) to 'undefined'. That's what the business with drawing lines and flood-filling with 132 (48%) is about.You don't need to restore any terrain data because the watermap image is loaded separately from the terrain elevation image. You only need elevation data if:+ You want to create terrain mesh :)+ You want to create fixed-height lakes *and* want Slarti to set the heights for you.+ You have undefined areas in your water data which you want Slarti to set as water or land based on whether the terrain is above or below sealevel.Here's the 'What':------------------What you're aiming for is:- Sealevel at 0 (or whatever you've set SeaLevel to).- Land between (roughly) 98 and 127.- 'Undefined' between 129 and 157.- Non-sealevel water anywhere else.The type of polygons used will vary, depending on the mode you're using for LWMCling:* Fixed-height mode (0) creates all polygons as fixed-height.* Mesh-cling mode (2) creates all polys as mesh-cling.* Hybrid mode (1) creates sealevel polys as fixed and all others as mesh-cling, so the actual value you put into the map doesn't matter as long as it isn't 'Sealevel', 'Land' or 'Undefined'.Usually you'll end up with ocean as pure black, lakes as very dull grey and land/undefined as similar shades of mid-grey.Clear as mud, then :D There are *lots* of different ways of combining land and water data to get what you want. In the tutorial I just go through one or two of the most common/useful ones.Cheers,Jim

Share this post


Link to post
Share on other sites

Jim,Thanks for explaining this more for me. When I get some rest, I'll re-read this and the associated manual pages while attempting it again, and see if I get further this time.I'll post again and let you know, and tell you where I went wrong and why, which may help you tweak the manual.Really though, just reading your manual is fascinating. I had always imagined that mesh stuff was more number crunching (well I guess writing your program was), and turns out it's a bit more like artwork.

Share this post


Link to post
Share on other sites

Also, note that Cinepaint is not available for windows systems.So, it seems that there is currently no tool available to edit the .hgt file under windows!

Share this post


Link to post
Share on other sites

Ok. I get to the bottom of page 50, but no luck compiling at all.Below is the output I get:------------Slartibartfast build Dec 29 2004 20:20:10 - Freeware===== Reading config and data =====This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for detailsLatitude : N0* 58.0914'Longitude : E36* 5.4744'Width : 3216Height : 7504Cell Width : 0.000256Cell Height : 0.000258Raster Smooth : 2.500Vector Smooth : 6.000Peak memory usage will be around 238MbReal boundary area: Lat : 1.05468750 -> -1.05468750 (C253 -> C258) Long : 35.62500000 -> 37.03125000 (C460 -> C462)18 (3x6) cells to be processed.--> Loading terrain dataScaling ".SourceS01E036.hgt"Scaling ".SourceN00E036.hgt"--> SRTM pre-filteringGo get coffee, I may be here some time. Pass 1 - patch holes : - Seeding gaps: 100.00% - Interpolating 0.31% : [#######] - 0.02% left. [#######] - 0.00% left. - Seeding gaps: 100.00% - Interpolating 0.00% : [#######] - 2.88% left. [#######] - 0.00% left. - Seeding gaps: 100.00% - Interpolating 0.00% : [#######] - 2.50% left. [#######] - 0.00% left. - Seeding gaps: 100.00% - Interpolating 0.00% : [#######] - 2.34% left. [#######] - 0.00% left. - Seeding gaps: 100.00% - Interpolating 0.00% : [#######] - 2.40% left. [#######] - 0.00% left. - Seeding gaps: 100.00% - Interpolating 0.00% : [#######] - 2.17% left. [#######] - 0.00% left. - Seeding gaps: 100.00% - Interpolating 0.00% : [#######] - 2.11% left. [#######] - 0.00% left. - Seeding gaps: 100.00% - Interpolating 0.00% : [#######] - 12.50% left. [#######] - 0.00% left.Patched 0.31% of the total area. Pass 2 - despeckle coarse : Patched 0.00% of the total area. Pass 3 - despeckle fine : Patched 0.00% of the total area.--> Loading water dataReprojecting ".Sourcep169r060.bmp" Promoting image type 1 to 16-bit - done.*** The watermap has more than two values but contains no land (0x7F7F).*** Problem preparing watermap - erasing it.===== Pre-processing =====Making watermap===== Processing =====--> Writing reprojected mesh--> Writing coastline> 100.00% [1/18]> 100.00% [2/18]> 100.00% [3/18]> 100.00% [4/18]> 100.00% [5/18]> 100.00% [6/18]> 100.00% [7/18]> 100.00% [8/18]> 100.00% [9/18]> 100.00% [10/18]> 100.00% [11/18]> 100.00% [12/18]> 100.00% [13/18]> 100.00% [14/18]> 100.00% [15/18]> 100.00% [16/18]> 100.00% [17/18]> 100.00% [18/18]Now you can build the project using RiftLake.bat .===== Statistics =====Points considered : 0Points used : 0VTP lines : 0LWM Polys : 0Raster Smoothing : 2.500Vector Smoothing : 6.000Total runtime : 3:33C:DOCUME~1patrickMYDOCU~1MYDEVE~1Scenery>----------------And the files I'm using (both the .inf and the .bmp) are here: http://webpages.charter.net/pwaugh/downloads/I'm at witts end.

Share this post


Link to post
Share on other sites

Hi,the p169r060.bmp contains only black lakes and white land, so the ForceMask should be switched from the default 0 to 1. The smallest black false lakes could be deleted and the shorelines could be simplified by filter (the recommended scheme 1,1,1/1,2,1/1,1,1 needs the divisor 10, not 9). The strip.exe can read also much smaller compressed gif files.With the parallel use of the elevation data SRTM, I thing the fixed elevations of lakes will bring best result in the FS (LWMVersion = 2, LWMCling = 0). The differences between individual LOD13 subpolygons, obtained by this way, can be then edited in SBuilder into one value for one lake. I also very like whole idea of Slartibartfast despite the fact, that most lakes in our country were already created by Ground2k from detailed scanned maps more precisely as the current Slartibartfast can do from free available data. But the reading of the manual in Slarti.pdf this is almost obsession

Share this post


Link to post
Share on other sites

Hi,You can download Cinepaint for Windows from here:http://prdownloads.sourceforge.net/cinepai...17.exe?downloadIt kind of works, but it's extremely heavy on memory and has more bugs than an antfarm. The one benefit over Photoshop is that it shows you real, accurate 16-bit values.I used it for the tutorial simply because it's free. It was the same idea for the data - I concentrated on free data because it was free. If you've got access to commercial data, or are willing to pay for it, that's great but for the majority I thought that they'd probably start with the free sources. There wouldn't have been much point in basing a tutorial on a $600 piece of software and a $30,000 dataset.You can if you wish save the image as PNG or TIF. I think newer versions of the FreeImage library also support GIF. I'd suggest sticking with the version I put in the installer though, for two reasons; I made some changes to the way it was compiled so it will work faster, and will allow you to load larger datafiles. There's nothing stopping you from using newer versions though.Your bitmap still has black/white values. Make sure you do the levels conversion on p48 and you'll end up with something with only shades of grey. That's all that stopping you. Black is OK but will be taken as sealevel but if you've got any white then it's definitely wrong. Everywhere that's white at the moment should be mid-grey.Cheers,Jim

Share this post


Link to post
Share on other sites

Jim,Thanks, but I DID everything up through page 50 of the manual.Seems my GIMP is broken as it didn't make the grey. Now that I know what was supposed to happen, I loaded it into PS CS, and did it.If only the goal of what I was doing had been clearer. But, thanks for the help. GIMP really is just too slow to be useful.

Share this post


Link to post
Share on other sites

Success!http://home.comcast.net/~pwaugh/special/success.bmpStill not sure why you keep mentioning Photoshop as if it can read .hgt files. I am unable to open them with it, and frankly am shocked that there is a .bmp format that I can't see all the colors in! That was news to me.Anyway, I'm guessing Cinepaint is the only way to edit .hgt files on windows. Is that right? Seems strange that there are not more tools.

Share this post


Link to post
Share on other sites

Jim,Really great program, and manual! When I get some extra cash, I'll have to get this thing.http://home.comcast.net/~pwaugh/slarti/LWMView.jpgI noticed on page 56 you said:"Most noticeably, the lower right of the area is still undefined as far as water goes, and because all overlapping water cells are removed by default there are now some missing lakes."I'm not really sure what you mean here. I'm guessing that you are saying any water that was previously present is now gone, and since our watermap/mask doesn't completely cover the terrain, we may have missing lakes. Is that right?and..."To fix this, you would download additional landsat files, for path 168 and rows 60 and 61, and process those in the same way."These would be the files needed to cover the rest of the STRM data we have I take it.and..."Then, you could set the output dimensions in the [Destination] section to entire cell boundaries and get a completely clean border with the patched default files."What "cell boundaries"?? The LOD set in the .inf??

Share this post


Link to post
Share on other sites

Hi,I'm not really sure what you mean here. I'm guessing that you are saying any water that was previously present is now gone, and since our watermap/mask doesn't completely cover the terrain, we may have missing lakes. Is that right?Yes, that's right.These would be the files needed to cover the rest of the STRM data we have I take it.Right again - although then you have more Landsat coverage than SRTM, so you'd need to download some more SRTM :) The problem isn't getting the data, it's *stopping* getting the data!What "cell boundaries"?? The LOD set in the .inf??The edges of the test area are set in the .inf :NorthLat = 0.968190WestLong = 36.091240SouthLat = -0.967569EastLong = 36.914106FS terrain is stored in squares. You can get rid of entire areas fairly easily either by disbling the entire file or by getting Slarti to modify the default files. If you set the boundaries to match the normal divisions between these areas, they can be removed cleanly. The only other way to do it is to use something like SBuilder or Ground2K4 (I think) to manually delete individual lakes.BTW, Ngorongoro is a little further south. I think the one you pointed out is Menengai. I've already done both those areas [A HREF=http://www.jimkeir.co.uk/FlightSim/scenery.html]here[/A] - might save you a little time :) I've also got some pictures of the area [A HREF=http://www.jimkeir.co.uk/Africa/index.html]here[/A].Cheers,Jim

Share this post


Link to post
Share on other sites

Nope, that is definately Ngorongoro crater. I've been there too, and it was one of the best lodges and part of my safari. The gorge to the west of it is the Odivi gorge where Dr. Leki (spelling?) found early man too.Thanks for the link to the scenery.Ngorongoro is at: S0 54.84' E36 27.53'Patrick

Share this post


Link to post
Share on other sites

Stick,Glad things are working for you. If you're interested in making water scenery for the US, be sure to check out the tutorial I've posted called FREEflow - link in my sig. I'm also looking for *ANYONE* who can tell me step-by-step how to get hydrology data from shape files into terrascene, particularly with respect to Canada, but I'll take anything I can get...Best,sg

Share this post


Link to post
Share on other sites

sg,Thanks for the link, I'll check it out.FYI all, turns out that isn't Ngorongora Crater. Bill was right it is at 3.5 degrees south. The first web site I looked at had the wrong location!My bad for believing the first web site I read, haha.Patrick

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this