Sign in to follow this  
Guest cbuchner1

Accurary and problems with the water masks: Screenshots

Recommended Posts

This is with DXT1 tiles containing single bit alpha water masks. This texture format would also be FS9 compatible. The source data is NASA SRTM V2 data rendered to a bitmap at 1 arc second pixel resolution. First, a very small lake near Bolzano, Italy. You see that the data appears to be about 1 "pixel" off. But overall still a pretty good hit.http://forums.avsim.net/user_files/175809.jpgSome lakes obviously haven't been completely scanned by the satellite. Possibly obscured by the shadow of the steep rock formations when viewed from space.http://forums.avsim.net/user_files/175810.jpgParticularly complex coast lines don't quite get resolved so well by the SRTM V2 data.http://forums.avsim.net/user_files/175811.jpgThe next step would be to try to get rid of the jagged edges. The following approach comes to my mind:Upsample the 30 meter data at least 4-fold, interpolating for example with a bilinear algorithm.For DXT1 textures, convert back to 1 bit alpha using single bit quantization. That would make the jagged edges somewhat more diagonal.For DXT3 textures, encode as 4 bit alpha which allows for some blending effect between land and water.In the future, a more advanced (but slow!) algorithm could try to match the bitmap to the image content, potentially allowing for "perfect" rendition of the coast line. Of course this will only work when there is a clear and sharp line between land and water.Note that for the sake of simplicity I have dropped the idea to render NASA's original vector data to a bitmap during flight in the Tileproxy program. This would have created smoother edges, but would have been too slow. Instead I am storing the land/water mask as a bitmap and I am going to interpolate this bitmap. By the way, this worldwide bitmap adds about 52 MB in size to the Tileproxy installer at the resolution you see in the screenshots.Christian

Share this post


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

With the coast lines fixed that is awesome!!

Share this post


Link to post
Share on other sites

You sure know your South Tyrol. ;-) Thanks for correctly pinpointing the screenshot.

Share this post


Link to post
Share on other sites

Could IR data used to differentiate between ground and water?

Share this post


Link to post
Share on other sites

That's looking good - and it's just the beginning...But I still think that all things considered, the best results would be had if TileProxy turned into or added an "offline" mode which could create pre-rendered "stand-alone" scenery. If it created standard BGL scenery files of favorite areas, slow optimizations wouldn't be a problem, it could run for a while and then a finished scenery would be compiled (complete with "add-ons" like water masks and possibly even autogen). The online mode is great for temporarily caching newly or seldomly visited areas, but a permanent version of regular flying areas would be best both for users (speed/quality) and servers (no continuous use of bandwidth). If autogen annotation files could be created and shared by users for their favorite areas, even that could be done. I envision a community-expanded scenery based on photoscenery downloaded individually from one's favorite map provider...Wouldn't that be a possiblity to further expand TileProxy's reach? I'm dreaming of something like it where I simply specify an area and it downloads, optimized and compiles the area! And if I fly outside of it, it dynamically downloads and temporarily stores the newly visited areas. Offering updates when the compiled scenery's photos have been updated by the map service and offering to compile an area if it's visited all the time. Well, one may dream, I'm closely watching how TileProxy evolves whichever way you decide to take it.Keep up the great work! :)

Share this post


Link to post
Share on other sites

Some preliminary results from this weekend:Erosion and Dilation are fundamental operations in mathematical morphology. Not that I have any clue about it, but they seem suited to shape my lakes a bit better.I invented something that I would call "conditional erosion and dilation" where I take water pixels away if the terrain "looks like" land and I add water pixels where terrain "looks like" water.Now that "looks like" criterion is hard to define, and my first experiments resulted in partial flooding of the area. Oh well, it's just experimentation. But there are some very convincing results in some areas.ChristianNicely round lake. Some pixels inside the lake got rejected though.http://forums.avsim.net/user_files/175991.jpgOh no, the villagers are going to hate me. I flooded their fields.http://forums.avsim.net/user_files/175992.jpgNow THAT's a nice coast of Lago Di Garda. Even floods the docks. But why is the water climbing up the hill there?http://forums.avsim.net/user_files/175993.jpg

Share this post


Link to post
Share on other sites

I believe I solved the problem with determining land and water boundaries quite well now.I am using something similar to flood fill algorithm and I am applying a statistical analysis of the R,G,B color components and H,S,V color components of the land and water pixels.The lower the standard deviation of one of these color channels is, the higher I am weighing this color channel in determining whether we have land or water.As a result, the recognition performance has become very good. No more flooding of innocent villages. ;-)Christian

Share this post


Link to post
Share on other sites

Hi Christian,Thanks for all the nice work you are doing. I am very curious about the next version. Are the "FS9 dwell textures" working also that well?Hugo

Share this post


Link to post
Share on other sites

That's a very creative approach to the water boundary issue. I had the instinct you were conjuring up something brilliant CB. For me at least,(with all due respect to the ACES team), TP has brought FS so far so fast it's astonishing that a single creative individual such as yourself could have succeeded in providing for us long time simmers what an entire team of experienced FS designers simply missed entirely, an Earth that looks like Earth. Even with all FSX's improvements (if you'll pardon a culinary metaphor), the default landclass issue was such an astringent libation it simply spoiled the meal. TP is like the fine wine that washed away the bitter taste in one rich, full bodied sip...bursting with flavor and complexity, with an after taste that continues to linger and improve. To #### with autogen...more wine please... Needless to say, I too am looking forward to the next TP release with great anticipation.

Share this post


Link to post
Share on other sites

Iam now trying to generate "smooth" DXT3 blend masks but I have some problems getting the transition to "deep sea" right.This is what I observe:When alpha = 0 and r,g,b channels are 0, FSX displays the default water class.When alpha = 0 and r,g,b contains texture data, FSX displays a blend of shader water and the texture.When alpha descends from 15 to 0 (4 bit quantization) and r,g,b contains texture data, the texture smoothly transitions into water. However even at alpha = 0, the texture remains visible as described above.So I tried fading (modulating) the r,g,b data to 0 with decreasing alpha. But this looked extremely bizarre. It transitioned into black before the deep FSX water kicked in.How can I get the transition to normal FSX water right? Would I have to blend into some shade of blue instead? Hmm, I am clueless here.

Share this post


Link to post
Share on other sites

Wish I could offer some advice CB, but being outside of the "process" you're using it's hard to offer any constructive help. Most of my work with water and other textures that use alpha blends have been with static "replacement" texture sets from FS9 and before and didn't involve creating water masks, so probably wouldn't help much.Your last idea of using a shade of blue to replace the "black transision" could provide a temporary fix, but the problem of course would be to find a "general" color that would pass to emulate the transistion zone in question for a variety of water types. It's understandably not a "perfect" solution though. If TP could somehow "sample" the nearest water body texture color (i.e. that underlying the nearest mask area) and emulate that RGB data into the transistion zone color... Again, being outside the process I don't have a clue if that's even possible.I'd sure love to see some screenshots of what your seeing though. It'd provide a clearer idea of the visual transistion problems you're experiencing and maybe trigger an idea from some other tech-savy user ay?.

Share this post


Link to post
Share on other sites

Hi Christian, Congrats on the pics so far.. didnt think youd be able to get it so close based on that 30m data. I used the photoshop magnetic lasso tool running about 50 pixels away from the lakes shore and letting it stick to the shore based on contrast etc..guess the code your using does something similar. Even manually it wasnt always accurate and had to be adjusted. In regards to the above how far out are you planning to run out from the shore. Are you going to replicate the shoreline as the blend line 50 meters out? Are you blending all the way out to the line. How does it look just blending the alpha and cutting straight to the fsx water. Maybe you can try a black pixel mesh or spary interwoven with the texture increasing in density..Anyway good luck...

Share this post


Link to post
Share on other sites

I am going about 250m from the shore line. A decrement of 1/255th in alpha with each pixel on 1024x1024 pixels textures. I am also dithering the alpha channel with the Floyd-Steinberg algorithm to make it look smoother.I am now blending to a dark blue shade (RGB 0x00, 0x10, 0x20) while decrementing the alpha value. The results in FSX not displaying its default water classes. But the overall result is more consistent.

Share this post


Link to post
Share on other sites

I made the blend radius configurable. The screenshots I posted today in the Avsim screenshots forum and in this forum used a blend radius of 500 meters around land.Ideally the blend radius should depend on the image content. The more details there are, the longer the blending should extend. But how would I distinguish details from surface effects (wavecrests, water spray) from underwater detail?Another problem is with FSX accessing the photoreal tiles one by one. So the tiles are not really independent from each other. A land tile will blend into neighboring water tiles. Since the blending spans tile boundaries, I have to consider some extra surrounding radius (context) around each tile loaded. This drives the processing time up because I have to scan much more pixels.Christian

Share this post


Link to post
Share on other sites

I wonder if you are approaching a situation that will make Tile Proxy more difficult to use for some part of the user community. By this I mean that Tile Proxy's advances will consume more and more resources eventually placing some of its utility functions (such as FSX water) out of reach of some PCs. Obviously, the primary appeal of the program is its ability to provide a real-time photographic view of the world. This is an extremely important development and one that has caught the interest of Microsoft. The question is how to sustain the original premise and also add new utility functions without requiring a very expensive PC to see the full beauty of the results. We already have that exact situation with FSX so adding yet another program, with similar needs, on top of FSX may become a problem for some.There may be two distinct types of users of Tile Proxy. One flies about enjoying views from all over the world. But they never delete anything and thus are content to use very large amounts of disk storage for photo tiles, etc. They occasionally focus on some area but really like to explore the whole globe.The other segment of users focus on a few areas that interest them for a variety of reasons. The make forays into other areas but spend much of their time enhancing a few primary sites. As you add enhancements the first group will need ever more processing power and storage. No problem, since that is an obvious requirement of their goals.The second group really needs all the enhancements you can dream up since their goals are focused on a few areas. Here there becomes a need to offer post processing to improve selected areas. The FSX water addition is a good example. As you say it may become a processor impact unless some other approach can be found. Assuming it does hit the CPU then the ability to post-process off-line selected areas becomes an attractive alternative. Two things accrue from this. One is the ability to reprocess the collected images into FSX BGLs and reduce the impact on the PC. The other is that advanced image enhancements are now easily enjoyed without nasty stutters or blurred textures in a real-time flight. One other advantage is that once a selected area is in FSX BGL format you can now add Autogen using the Annotator adding more depth illusion for low level flights.I would also argue that the first group of world travelers would also benefit since they may find that they want a "base" of operations for various areas of the world. Thus someone who adopts Tokyo as their base for Asian "exploration" may want to dress up the Tokyo area as much as possible with as little impact on the PC as possible.So, as Tile Proxy advances I am suggesting that consideration be given to moving some functions to a post-processing status where real-time may become a burden/compromise for the user.Regards,Dick BoleyA PC, an LCD, speakers, CH yoke

Share this post


Link to post
Share on other sites

Oh well, the post processing is optional and can be turned off. I've tried to use algorithms that aren't too slow.For example the postprocessing of a 1024x1024 tile (highest resolution) requires FSX to process 2048x2048 pixels right now and it typically takes about 1 second to perform the blending.Overall this additional procedure only adds a few seconds to the initial terrain loading. As for the impact during flight I haven't made a lot of benchmarks yet.

Share this post


Link to post
Share on other sites

>So, as Tile Proxy advances I am suggesting that consideration>be given to moving some functions to a post-processing status>where real-time may become a burden/compromise for the user.I second that, as I always did, but I know Christian's vision for TP is an online tool. But if you prefer offline creation and usage of scenery, I'd recommend giving FS Earth Tiles a try. I believe both tools complement each other very well, FS Earth Tiles for static scenery (your home base, for instance) and TP so you can fly anyhwere and still have photo scenery.Here's the link: http://www.fspassengers.com/forum/read.php?f=9&i=4634&t=4634I hope both tools keep growing and learning from each other... :)

Share this post


Link to post
Share on other sites

OMG he's quick. He even tried out water blending. He sure provides what you guys have been asking - so stop bothering me to make an offline version. lol.I am ahead of him when it comes to determine the land/water boundaries. After all, I've got 52 MB of highly compressed NASA data backing this ;-)

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