Board index FlightGear Development Scenery

Photoscenery?

Questions and discussion about enhancing and populating the FlightGear world.

Loading DDS files according to the LOD

Postby abassign » Fri Apr 02, 2021 8:34 pm

I started doing a massive upload of DDS files using the procedure described here:

https://github.com/nathanielwarner/flig ... otoscenery

The DDS files are quite large (I use the --cols 2 option), but certainly of good quality.
The problem is that during the flight the files are loaded and the memory consumption becomes very high, until saturation is reached with the consequent termination of the FGFS program.
I think it would be useful to load the DDS files divided by LOD so that in the preparation process you can use the larger files only in proximity (proximity defined as a combination of distance and viewing angle) and use smaller files (2/3 levels of reduction) for longer distances. This could also work by rescaling, via a batch, the files.
Does this question of mine make sense?
Developer of the program https://wiki.flightgear.org/Julia_photoscenery_generator
FDM developer of the G91R1B aircraft https://wiki.flightgear.org/FIAT_G91R1B
JSBSim collaborator
abassign
 
Posts: 947
Joined: Mon Feb 27, 2012 6:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2020.4
OS: Ubuntu 20.10

Re: Loading DDS files according to the LOD

Postby oracle » Fri Apr 02, 2021 11:12 pm

abassign wrote in Fri Apr 02, 2021 8:34 pm:I started doing a massive upload of DDS files using the procedure described here:
...
Does this question of mine make sense?

It makes sense and I don't see any other way: use hi-res images in proximity and lower-res in the distance. Possibly use several levels of detail depending on distance.
Maybe image files have to be broken down into smaller tiles and use some smart logic to load and unload them.

Now, what do you mean you're doing a mass upload? Where and under what permissions? I don't understand the permissions of images obtained from ESRI.

Alternatively, I tried to download Sentinel-2 images - these are free to use, rework and distribute but detail is not that good. I further learned that some reasonably good looking sat images are derived from Sentinel data by combining several photos of the same area and applying clever pixel algorithms. So maybe the images I'm able to download (which are big TIFF files) are worthless for FG. And the method to download is very time-consuming: you have to create an account, select an area, submit an order, wait for your order to be processed and download when it's ready. You're not guaranteed your selected area is not covered by clouds... So this source can by no means be used runtime directly.
oracle
 
Posts: 39
Joined: Mon Mar 22, 2021 2:08 pm

Re: Loading DDS files according to the LOD

Postby abassign » Sat Apr 03, 2021 8:45 am

oracle wrote in Fri Apr 02, 2021 11:12 pm:Now, what do you mean you're doing a mass upload? Where and under what permissions? I don't understand the permissions of images obtained from ESRI.


Massive downloading of photorealistic images for personal use is allowed for some servers, so I don't see any particular problems.
The post-processing of the images required to produce better system performance is a private matter that cannot be prevented. The problem I pose is purely technical and in any case in use in simulation programs (and not only).
We have a photoscenary folder (I use this name) that I manage as an additional scenario, inside that folder we have the Orthophotos folder (mine currently has 604 files for a total of 12 GB), now if you could split the Orthophotos folder into different folders resolution we would have the ability to upload photos according to the distance between the plane and the area covered by the photo. We could define categories starting from 1 (the one that the user defines as the maximum resolution) and subsequent categories 2,3 etc which divide, for example, the linear dimension by two. At this point there is the problem of reloading the tiles once the conditions allow it with the attention not to generate situations of instability in the marginal areas. I think it is necessary to discuss with who developed the Orthophotos technique.
Developer of the program https://wiki.flightgear.org/Julia_photoscenery_generator
FDM developer of the G91R1B aircraft https://wiki.flightgear.org/FIAT_G91R1B
JSBSim collaborator
abassign
 
Posts: 947
Joined: Mon Feb 27, 2012 6:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2020.4
OS: Ubuntu 20.10

Re: Photoscenery?

Postby Hooray » Sat Apr 03, 2021 10:42 am

abassign wrote in Fri Apr 02, 2021 8:34 pm:I think it would be useful to load the DDS files divided by LOD so that in the preparation process you can use the larger files only in proximity (proximity defined as a combination of distance and viewing angle) and use smaller files (2/3 levels of reduction) for longer distances. This could also work by rescaling, via a batch, the files.
Does this question of mine make sense?


OSG-wise you'd want to ensure that such photo scenery images are loaded via one of OSG's LOD helpers: either PagedLOD or ProxyNode (which is NOT paging out stuff after loading):

https://weber.itn.liu.se/~karlu20/tmp/O ... yNode.html
https://www.oreilly.com/library/view/op ... 05s13.html


And in fact, there's a special LOD node for terrain overlays, a so called OverlayNode: https://weber.itn.liu.se/~karlu20/tmp/O ... yNode.html
OverlayNode is for creating texture overlays on scenes, with the overlay texture being generated by pre rendering an Overlay Subgraph to a texture, then projecting this resulting texture on the scene.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Photoscenery?

Postby oracle » Sat Apr 03, 2021 1:20 pm

abassign wrote in Sat Apr 03, 2021 8:45 am:
oracle wrote in Fri Apr 02, 2021 11:12 pm:Now, what do you mean you're doing a mass upload? Where and under what permissions? I don't understand the permissions of images obtained from ESRI.


Massive downloading of photorealistic images for personal use is allowed for some servers, so I don't see any particular problems.

Well, you wrote you were uploading, so I was wondering what and where.

My idea is to try to obtain some free images, pre-process them and upload them on my server for the community to use.
Having everyone interested in photoscenery do the download and pre-processing individually sounds like a waste. It is more scalable to have people build upon each other's work rather than starting from the beginning. If we have the same imagery to start with, our results will be more comparable and product will also be faster to develop and easier to maintain.

But if someone is already uploading somewhere, I'm totally wasting my time trying to do the same.
oracle
 
Posts: 39
Joined: Mon Mar 22, 2021 2:08 pm

Re: Photoscenery?

Postby abassign » Sun Apr 04, 2021 10:35 am

Hooray wrote in Sat Apr 03, 2021 10:42 am:OSG-wise you'd want to ensure that such photo scenery images are loaded via one of OSG's LOD helpers: either PagedLOD or ProxyNode (which is NOT paging out stuff after loading):
https://weber.itn.liu.se/~karlu20/tmp/O ... yNode.html
https://www.oreilly.com/library/view/op ... 05s13.html


What you wrote is very interesting, but at this point how can you activate the possibility of choosing different images according to the LOD?
Developer of the program https://wiki.flightgear.org/Julia_photoscenery_generator
FDM developer of the G91R1B aircraft https://wiki.flightgear.org/FIAT_G91R1B
JSBSim collaborator
abassign
 
Posts: 947
Joined: Mon Feb 27, 2012 6:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2020.4
OS: Ubuntu 20.10

Re: Photoscenery?

Postby Hooray » Sun Apr 04, 2021 1:01 pm

For some technical background, see: https://wiki.flightgear.org/PagedLOD

If you have improvements/suggestions in mind, it's best to discuss those on the devel mailing list and/or file a feature request here: https://sourceforge.net/p/flightgear/codetickets/

I haven't looked at the patches in months, but Nathaniel used to be pretty responsive and also participated in related discussions on the forum/devel list, so if in doubt, send him a heads-up and ask for his opinion.

I do seem to recall that there were some mipmapping and DDS related talks on the devel list, too.
Also, the new WS 3.0 scheme is likely to put an increased focus on multi-texturing the terrain mesh at runtime (texture baking), so any overlayNode/LOD scheme would seem applicable there, too - Stuart or Scott would seem to be the right people to reach out to to learn more.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Photoscenery?

Postby oracle » Sun Apr 04, 2021 1:49 pm

For anyone interested, this is the best possible resolution available for free open imagery (any further zoom just makes it pixelated):

Image

You may be able to find certain areas in better detail but for open source large scale coverage Sentinel appears to be the best choice.
The example above is Vienna Schwechat airport in 10 m/px.

The Sentinel Hub offers several download formats and options. Unfortunately I don't know if any of them can be converted to DDS.

The showcase for photoscenery here is most probably created using better source images. Sentinel imagery won't give such good results.

Image
oracle
 
Posts: 39
Joined: Mon Mar 22, 2021 2:08 pm

Re: Photoscenery?

Postby awen » Mon Apr 05, 2021 9:32 am

oracle wrote in Sun Apr 04, 2021 1:49 pm:For anyone interested, this is the best possible resolution available for free open imagery (any further zoom just makes it pixelated):

Image

You may be able to find certain areas in better detail but for open source large scale coverage Sentinel appears to be the best choice.


To be fair, I am satisfied with this LOD for the entire world if the photos are available via server download. I think having the opportunity to use self-prepared, more detailed photos as an addon-on would be great.
awen
 
Posts: 93
Joined: Mon Oct 19, 2020 1:39 am
Location: China
Version: 2020.4.0
OS: Windows 11

Re: Photoscenery?

Postby vnts » Mon Apr 05, 2021 11:50 am

oracle wrote in Sun Apr 04, 2021 1:49 pm:The showcase for photoscenery here is most probably created using better source images. Sentinel imagery won't give such good results.

The issue with sentinel (and other satellite) imagery is that the sensors are very much intended for scientific measurement and not enjoyment with the human eye - as well as the low resolution. The released images are very much approximated and processed to look generally pleasing to the human eye, but won't really look much like an aerial photo on the same day.
oracle wrote in Sat Apr 03, 2021 9:03 pm:In addition to my not-so-good image collection, there is also this article: Visually appealing mosaics for Austria, Germany, and Slovenia now available through WMS. Images have the same resolution but appear much cleaner and with more natural colours because of better pixel compositing algorithm (or so would the Germans have us believe).

Your image above is from this specially processed set, right? The colours will likely be replaced/enhanced further to be pleasing to the eye, as the exact natural colours are undeterminable.

Google earth and instantstreetview aerial views use lots of sources, and aerial sources at closer ranges - see link. Unfortunately google will not have the full rights to aerial images though (unless they took some themselves), so they can't distribute those under GPL license in future even if they wanted to (which could be used to create a competing-map service) - or even give FG tiny bits of them to use as textures if FG asks (which won't affect them commercially).
oracle wrote in Sun Apr 04, 2021 1:49 pm:https://raw.githubusercontent.com/nathanielwarner/flightgear-photoscenery/master/screenshots/ksba-photo-comparison-compositor.jpg

The traditional vs photoscenery example is at a location where FG scenery isn't developed yet - possibly the USA.
The way FG looks depends on the terrain elevation/landclass data, regional definitions that enable engine features, and regional textures. The USA has very old regional definitions, and mostly generic regional textures - in addition to old elevation/landclass data.
See the before/after improvement shots that applied/finished Gilberto's improvements: viewtopic.php?f=5&t=37161&start=30#p374352
(The photoscenery results aren't that good in absolute terms - there are better photosceneries in some of the SOTM, but high quality sources are hard to find for a lot of areas. )
oracle wrote in Sun Apr 04, 2021 1:49 pm:For anyone interested, this is the best possible resolution available for free open imagery (any further zoom just makes it pixelated): Image

For me LOWW looks like this with the current state of regional definitions there in 2020.3.8 or next:
Image
This is mainly generic Europe agriculture that haven't been localised for this area specifically - and there are lots of landclasses that currently use the same regional definition which could be split up. There are already some agriculture textures in FG which are similar to the farming pattern in the photo: https://imgur.com/l2p9RkC . So it's possible, with similar or a lot less effort, to get FG to have the exact same look as a high quality /aerial/ photo of an area - but without being sometimes blurry or having trees and agriculture that don't line up.

Kind regards,
vs
vnts
 
Posts: 409
Joined: Thu Apr 02, 2015 1:29 am

Re: Photoscenery?

Postby oracle » Mon Apr 05, 2021 12:11 pm

Thanks for the feedback.
I think even if I don't manage the image conversion to DDS, someone else will.
The good thing is that open free global sat imagery is available. Whether FG user experience with it could be pleasant enough is currently beyond me.

You may notice that the above example of Vienna Airport has one more problem besides the low resolution: it seems over-exposed.
The white areas representing some of the airport buildings and apron are actually not that bright. Real surfaces are gradients of gray, some not even so light gray.
Same for the north bank of the Danube river - it's brighter than it should be.
Why does this happen?

Turns out, the satellite cameras are not just taking RGB (red-green-blue) photos. Instead they pick up several bands - RGB specifically collected as Sentinel B2, B3 and B4, among other bands.
In order to get an image that we perceive as a photo, the 3 bands are merged. Here's for example one of the bands (blue):
Image

The other bands (red and green) look similar. So the sensors seem to capture light gray surfaces as very bright and after merging we end up with these white areas.
Funny side effect is visible on the nearby highway: vehicles appear as elongated rainbow blobs. See how the merging algorithm created separate red, green and blue pixels. You can even tell the direction the vehicles are moving by the color shift: the front is blue, the middle is green and the tail is red:
Image

It would be interesting if this over-saturation can be corrected or at least decreased a little. But that's a mighty project. Because here's the next caveat:
The cloudless global imagery we enjoy from some providers is created by selecting and combining multiple images of the same place. There are algorithms able to detect clouds and create a composite cloudless image out of several partially cloudy ones. The over-saturated outcome results of compositing of several over-saturated source images.

This whole story of how sat imagery is created is a little off topic but I thought it was interesting to share.
oracle
 
Posts: 39
Joined: Mon Mar 22, 2021 2:08 pm

Re: Photoscenery?

Postby vnts » Mon Apr 05, 2021 1:40 pm

oracle wrote in Mon Apr 05, 2021 12:11 pm:The other bands (red and green) look similar. So the sensors seem to capture light gray surfaces as very bright and after merging we end up with these white areas.

Dynamic range is another issue. Even RGB channels are limited to 256 levels. The eye adjusts to the light in the scene dynamically, so can perceive a huge range of intensities. The reflectance (albedo) of artificial surfaces here at this sun angle is too great for the sensor / data format / HDR adjustment. Even with normal cameras/photos intended for the eye there's often a huge amount of processing and colour adjustment that is done.
oracle wrote in Mon Apr 05, 2021 12:11 pm:Funny side effect is visible on the nearby highway: vehicles appear as elongated rainbow blobs. See how the merging algorithm created separate red, green and blue pixels. You can even tell the direction the vehicles are moving by the color shift: the front is blue, the middle is green and the tail is red

This could possibly be because of the algorithm that combines different photos and sources tried combining photos that were taken a short time apart by the satellite :mrgreen: .
oracle wrote in Mon Apr 05, 2021 12:11 pm:It would be interesting if this over-saturation can be corrected or at least decreased a little. But that's a mighty project.

It could be decreased, but that would mostly result in a darker grey I think - because the channel values for the entire airport is squeezed into one or a few levels on all 3 channels, there's not much information that could be recovered. Doing that would need some sort of (custom?) image processing filter run over the photoscenery. It doesn't matter for artificial surfaces, as these would be covered by airports and OSM2City placed on top of terrain.

Kind regards,
vs
vnts
 
Posts: 409
Joined: Thu Apr 02, 2015 1:29 am

Re: Photoscenery?

Postby jakkos98 » Sat Jun 05, 2021 6:12 pm

Hello,

Orthophoto WMS service from geoportal.gov.pl (Polish geographic data service), has changed addres, so following lines in creator.py must be change
Code: Select all
'geoportal': 'https://mapy.geoportal.gov.pl/wss/service/img/guest/ORTO/MapServer/WMSServer?REQUEST=GetMap&VERSION=1.3.0&TRANSPARENT=TRUE&LAYERS=RASTER&STYLES=&CRS=CRS:84&EXCEPTIONS=xml&BBOX={tbounds[0]},{tbounds[1]},{tbounds[2]},{tbounds[3]}&WIDTH={tsize[0]}&HEIGHT={tsize[1]}&FORMAT=image/png',


New working geoportal.gov.pl WMS service addres for creator.py:
Code: Select all
#geoportal.gov.pl only Poland (licence: https://www.geoportal.gov.pl/data/free-data)
    'GeoportalPL': 'https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMS/StandardResolution/WMSServer?REQUEST=GetMap&VERSION=1.3.0&TRANSPARENT=TRUE&LAYERS=RASTER&STYLES=&CRS=CRS:84&EXCEPTIONS=xml&BBOX={tbounds[0]},{tbounds[1]},{tbounds[2]},{tbounds[3]}&WIDTH={tsize[0]}&HEIGHT={tsize[1]}&FORMAT=image/png',
   



Links to geoportal.gov.pl
* main site https://www.geoportal.gov.pl/o-geoportalu/aktualnosci
* list of free data https://www.geoportal.gov.pl/data/free-data

Best regards.
Pozdrawiam

Jakub
Best regards
Pozdrawiam

Jakub Kosakowski
jakkos98
 
Posts: 29
Joined: Tue Jul 11, 2017 4:03 pm
Location: Nowy Sacz, Poland
Callsign: SP-KOS
Version: 2020.4.0
OS: Windows 11 Home 22H2

Re: Photoscenery?

Postby Johan G » Tue Jul 06, 2021 9:37 pm

Some posts were split off to the new topic Tree generating Photoshop filter.
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Some YouTube videos
Johan G
Moderator
 
Posts: 6629
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

Re: Photoscenery?

Postby rooman » Mon Jul 19, 2021 8:24 am

Photo scenery of Switzerland is available for non commercial use at several resolutions;
https://www.swisstopo.admin.ch/en/geodata/maps/smv.html
can we use it in FG?
rooman
 
Posts: 171
Joined: Sun Apr 12, 2015 7:26 pm
Location: Lausanne, Switzerland
Callsign: HB-ROO
Version: Next + LTS
OS: Ubuntu latest stable

PreviousNext

Return to Scenery

Who is online

Users browsing this forum: No registered users and 7 guests