Sign in to follow this  
LuisFelizTirado

Improving TileProxy -- need some technical help

Recommended Posts

Hey everyone,I've previously received some very competent assistance in this message board that helped me a great deal in implementing TileProxy, so I would like to try again:How would I retain Microsoft's vector water polys when I define my own photoscenery areas? Is it all about the priorities or layers in the scenery.cfg file? Or is the only way to do this by defining my own polygons as part of the TileProxy World folder? Is it possible to copy (or softlink) the Microsoft vectors into the TileProxy folder so I can avoid creating my own?How can I create water with a shine-through effect near the coastlines where photorealistic underwater ground is visible through the water surface? I have seen this in a few commercial addons and I found the effect amazing.How can I disable the ground flattening for the default airports? I found this extremely annoying when using custom elevation meshes. I hate taking off with my motor glider from a rectangular mini-canyon or -- even worse -- from an artificial plateau ;)Some Microsoft-defined vector rivers seem to cut an "elevation stencil" into my high resolution terrain meshes. The terrain just drops steeply down (which looks unnatural) to the river's elevation level. Is it possible to place a blanket exclude for this unnaturally looking behavior somehow?Christian

Share this post


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

thing I can do is keep on kicking this thing until experts reply...

Share this post


Link to post
Share on other sites

Hello Christian,You have created a lot of excitement with your program. Congratulations!1. "retain Microsoft's vector water polys" - I suppose that what you mean is that you want the custom ground to have the water parts be FS water and not just a hard surface.Custom textures will always override the default ground, and cover it.To make part of the custom ground into water requires a water mask, or alpha channel. This can be a simple bitmap, equivalent to the custom ground, where pure black (RGB=0,0,0) is painted on the parts that should be water, and pure white (RGB=255,255,255) is painted on the land parts.The alpha channel can be part of the TIF file, or it can be a separate image, in which case this is indicated in the Source section of the inf file.2. "photorealistic underwater ground is visible" - confusing language, but perhaps you want a gradual transition from the custom texture to the default ground.If so, then this requires a blend mask. This should be a grayscale image with a gradient from white (opaque) to black (transparent). This also should be indicated in the inf file.Here are some examples, a part of the island of St. Barth

Share this post


Link to post
Share on other sites

Hi ChristianLuis gave some very good answers already, here are mine:>How would I retain Microsoft's vector water polys when I define my own photoscenery areas? Is it all about the priorities or layers in the scenery.cfg file? Yes, to keep vector data you give it a higher priority. However, that's not what you want to do as Luis explained.> Or is the only way to do this by defining my own polygons as part of the TileProxy World folder? No. The way to do it is to define an alpha channel as Luis described. This is the ONLY sensible way of doing this. The problem of course is that you need to run a water (RGB color) recognizion algorith and create you own alpha channels on the fly. This will explode loading times even further to the point where live streaming may not be feasable.> Is it possible to copy (or softlink) the Microsoft vectors into the TileProxy folder so I can avoid creating my own?No, but the answers before should have tackled that question.> How can I create water with a shine-through effect near the coastlines where photorealistic underwater ground is visible through the water surface? I have seen this in a few commercial addons and I found the effect amazing.Yes, done with semi-transparent alpha channels as Luis described.> How can I disable the ground flattening for the default airports? I found this extremely annoying when using custom elevation meshes. I hate taking off with my motor glider from a rectangular mini-canyon or -- even worse -- from an artificial plateau ;)By excluding them. However the more prober answer is - you don't and live with the fake plateaus. Removing the plateaus wil cause 2 things: your runway objects will float in the air and your AI aircraft will be screwed. Don't do it...>Some Microsoft-defined vector rivers seem to cut an "elevation stencil" into my high resolution terrain meshes. The terrain just drops steeply down (which looks unnatural) to the river's elevation level. Is it possible to place a blanket exclude for this unnaturally looking behavior somehow?Yes and now. There is hack to modify your terrain.cfg but that in turn will screw up bigger water areas. The only real way to do this is to redefine the rivers from scratch.

Share this post


Link to post
Share on other sites

Thanks for the answers so far. I believe the DXT1 compressed BMP tiles only support a single bit alpha channel, ruling out blend masks completely. But for land/water separation it would suffice.Now.. how to recognize water automatically. That's a question of image processing and science. I could simply create my own vector database of coast lines with an offline image processing approach, so I don't have to do it online ;)Christian

Share this post


Link to post
Share on other sites

color is pretty uniform too... Couldn't there be a way to scan for that? I mean, how many times do you see blue on the ground?

Share this post


Link to post
Share on other sites

One more question:Is there a way to tap into Flight Simulator X's library of BGL files? In particular I need- population density for a given location- FSX default land class on that tile- possibly the elevation mesh on a tileWhy do I need it?I want to synthesize light maps for night flying. I need to know where populated city areas are and I want to place lights at or near structures that look like roads and buildings.But therefore I would like to tap into the FSX databases as far as possible, because there is no good reason to ship a separate database with TileProxy.I know I can look into the FSX BGL files with TMFViewer, but how would I make use of that data within my own software?

Share this post


Link to post
Share on other sites

These are excellent questions, Christian. You are a very ambitious man!Perhaps for these very technical questions concerning the content of default files you could join us for discussions on the scenery sdk newsgroup? It might be a more appropriate place to talk about this. And we would all love to see you there.Best regards.Luis

Share this post


Link to post
Share on other sites

Unfortunately, water isn't always blue - often there are waves that make the water look almost white. Load the default flight in Friday Harbour from Google Maps as an example.A fully automated land/water recognition may be very difficult to achieve. At the minimum the algorithm needs different parameters for different coastal regions.

Share this post


Link to post
Share on other sites

Is that a Microsoft newsgroup? Or do you mean the subforum on fsdeveloper.com?

Share this post


Link to post
Share on other sites

Hi ChristianI know some of the BGL format, pre FSX, not sure if FSX changed a few things - this is very possible. The problem is that the main data is compressed. Jim Keir is the only guy I know who was dedicated enough to solve the compression issue. He keeps that info private due to copy protection issues (ie once the format is public other people can rip commercial meshes etc).You may want to have a chat with Jim, but you'll probably have to make that part of the code closed (ie non GPL). Another option may be SimConnect although I think this part of the data isn't exposed in SimConnect (which is a big shame). The problem with accessing the bgls directly is that you need to run the Quad detection in the background (ie which quad tile your aircraft is in), which adds to the overhead.Cheers,Christian

Share this post


Link to post
Share on other sites

Hello Christian,The elevation data can be found at the same link as the water bodies information, as mentioned above. It is all derived from the NASA SRTM data.Land class is probably the same as the Digital Chart of the World, and derivatives.So, there is no need to take apart the default files.Best regards.Luis

Share this post


Link to post
Share on other sites

>A fully automated land/water recognition may be very difficult>to achieve. At the minimum the algorithm needs different>parameters for different coastal regions.Not really if you use Google maps:- get a satellite image for the area you need (terrain);- now switch to a map mode for the same area. Now everything is color-coded, and it is very easy to recognize the water, roads, parks etc.That is what my vector recognizer does. Still far from perfect, but I'm working on it. By combining those two sources you could get very realistic patterns.

Share this post


Link to post
Share on other sites

Ouch! That's twice the amount of downloads just to recognize land/water. Also the URL format is somewhat different between map and satellite views. And it would only work where Google actually has maps. I bet that's not available for many far out regions of the world.

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