Archived

This topic is now archived and is closed to further replies.

barryward12345

TP at Dawn

Recommended Posts

I have always thought that TP looked "worst" in flat urban area. The buildings don't look real good of course- whereas I believe that TP is at its best in mountaneous areas. And I usually fly with TP during daylight hours.But I have discovered that TP at Dawn is quite good in urban areas - it gives quite a good feel and any unclearness of the urban textures is less noticeable. Unfortunately, there are no lights apart from those used in speciifc sceneries ( ie no autogen lighting) - I just pretend that it is dawn and the street lighting has just gone out :-) Try it - you might like it(Near Long Beach, CA - using Service 3, 1 M res) http://forums.avsim.net/user_files/191855.jpg

Share this post


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

I am trying to wrap my mind around the issue of night lighting. There are basically two problems:a) detecting where civilization isand :( placing lights at credible locationsI could be using some kind of public records about population density, but this information is coarse, too coarse maybe.Alternatively the PC could go hunting for patterns in the textures. Say... straight lines (roads), lots of lines crossing at right angles, rectangular buildings etc. When I find many such patterns, there's likely much civilization around, so much light sources should be placed there.However this approach may fall victim to false detection of agricultural areas with rectangular layout of crops. You don't want see fields glowing in the dark, unless there was some major nuclear accident nearby.To scan for all these shapes a LOT of CPU resources are required. Now luckily I am just about to learn how to program the GPU (the graphics chip) with CUDA, so maybe I can divert some of the GPU's processing power into doing work for Tileproxy. Night lighting, color correction (postprocessing) and texture compression are candidates to be handled on the GPU. Unfortunately ATI users would be out of the loop here, as ATI (now AMD) are not compatible with nVidia's CUDA.

Share this post


Link to post
Share on other sites

Hi Christian I know what you just said was in English - because I recognise the words - but that was about it!! :-) Anyway, thank you for what you have provided so far - and I hope you are learning and having fun :-) Barry

Share this post


Link to post
Share on other sites

In short I was saying something like: let there be light, I just need to figure out how.

Share this post


Link to post
Share on other sites

Wouldn't it be easier to use the services' road map layer for pattern finding? That would give much better contrast and better defined lines. At least one service even has color coding for things like city areas, special buildings, and the like. Another option might be Open Street Map, which is vector based and has a host of meta data, too. Their quality varies widely, though, all the way from extremly accurate to only highways, if at all. Now that I think of it, hasn't it been you who mentioned the latter some time ago?

Share this post


Link to post
Share on other sites

Okay, so I am working on figuring out how to make the computer "see" civilization... Now let's assume civilization means that people build stuff with straight edges... roads, square buildings, runways, etc...So the question is: how can I make a computer "see" lines? Let's assume we can convert the satellite image to a contour image (this is called edge detection). So each line in the contour image may represent the outline of a building (e.g. a factory building) or the shoulder of roads (e.g. in a typical US city the roads form a nice grid).There is a mathematical process called a Hough transform that allows the computer to "see" lines. Well, usually it takes a lot of computation to achieve that but a graphics chip is fast enough to compute it in the blink of an eye. Here's an example:http://forums.avsim.net/user_files/191990.jpgOn the left side there's the contour image of a polygon that I painted in MS Paint. And on the right side there's the image after a Hough transform. You can see some four (or five) bright nodes that roughly correspond to the four lines in the image. From those nodes you can conclude where the position and angle of the lines are. The line distance from center point is along the vertical dimension, its angle is on the horizontal dimension.So by counting the number of lines in the contour image of a satellite photo I could estimate the amount of "civilization". And from the position of the lines I could estimate roughly where to place the night lights. The more "Civilization" is found, the more lights I would place. After saving this as a "light map" in BMP format, your city would be lit up like a christmas tree. Voila, instant poor man's night lighting. ;)Nature and wilderness would appear mostly unlit because you hardly find many straight lines there.Okay... a prototype might be a few weeks out, and you would need a modern nVidia graphics chip to use the accelerated version that I started to program (using CUDA). Look forward to Chicago at night. Maybe it will appear similar to the real thing as found here:http://www.flickr.com/photos/myelectricshe...703624/sizes/l/Thanks for motivating me to look into this. This may end up being just as good as the water masks.Christian

Share this post


Link to post
Share on other sites

Fetching the map view (as opposed to aerial view) would double the amount of downloads.I'd rather put 100 times the computational effort in. On a modern GPU chip this is almost for free ;)

Share this post


Link to post
Share on other sites

Hi Christian, a question which probably arise from my ignorance:FSX knows where to put lights, so is there any possibility to use FSX "light positioning system" and put FSX lights over TP? (or some other "trick" to use FSX lights).CiaoGiovanni

Share this post


Link to post
Share on other sites

Actually, FSX doesn't know where to put lights. What you see at night is, basically, nothing more than simple texture bitmaps containing light points overlaid on top of the (darkened) daytime textures. Now the problem is, once you start replacing the default daytime textures with your own (which TileProxy does), FSX expects you to also supply custom night textures, simply because the two have to match in order not to look odd.

Share this post


Link to post
Share on other sites

mmmmmmmm...... I understand now.And.... what about testing the presence of "light pixels" in the original FSX standard night texture??? instead of trying to identify "populated areas" in the Service x textures? Could it be easier (and fastest)???CiaoGiovanni

Share this post


Link to post
Share on other sites

The problem is that the default textures have nothing to do with reality. They are just generic representations of a given landclass. If you tried to combine custom photo textures with default night lighting, the two would not match, and it would look very odd. You'd have bands of street lights not matching the photo streets, you'd have light points in the middle of parks, you'd have regular grids of street lights where there are no regular street grids, or vice versa, and so on. It might actually look OK in the middle of the night, when the photo textures are almost black, but how about twilight?However, if you have something like Ultimate Terrain, which has most every street at the correct place, the street vector data might provide useful information as to where to put lights. I have no idea if the corresponding BGL sub-format is well known, though.Judith

Share this post


Link to post
Share on other sites