Board index FlightGear Development Scenery

How do I customize the terrain in Flightgear?

Questions and discussion about enhancing and populating the FlightGear world.

Re: How do I customize the terrain in Flightgear?

Postby ludomotico » Mon May 04, 2020 1:53 pm

Current scenery already uses CORINE for Europe. If your local area is in Europe, current scenery is probably the best you can get (except for port areas)

Which part are you interested to enhance? Without building any custom terrain, you can:

- Use real buildings. Check this project: viewtopic.php?f=5&t=35581
- Use alternative textures. Check this thread: viewtopic.php?f=5&t=37111
User avatar
ludomotico
 
Posts: 1269
Joined: Tue Apr 24, 2012 2:01 pm
Version: nightly
OS: Windows 10

Re: How do I customize the terrain in Flightgear?

Postby Hooray » Fri May 22, 2020 7:43 pm

ludomotico wrote in Mon May 04, 2020 1:16 pm:You may try to compile a version of FlightGear with OSGEarth support: http://wiki.flightgear.org/Building_Fli ... ntegration. OSGearth used Google Maps out of the box and you don't have to build any additional terrain. This is an old version of Flightgear, and you won't be able to use many of the current aircraft.


There haven't been too many changes in sg/fg, so it should be pretty straightforward to rebase those original patches.

That being said, thanks to the new Compositor framework, it's going to become pretty straightforward to create a viewer that renders an arbitrary sub-scene graph.

This would be the prerequisite for things like rendering 3D models, or the canvas view element (tail cams, synthetic views, FLIR, night vision etc)

http://wiki.flightgear.org/Howto:Extend ... _3D_models
Image

Canvas View Camera Element
Image

And once the Canvas/View integration is restored, this will also mean that Jeff's osgEarth integration could be revisited because the technical requirements would be identical, whereas the integration would be in line with other planned work, e.g. CompositeViewer support: http://wiki.flightgear.org/CompositeViewer_Support

This isn't to say that photo scenery itself is going to be any better than it used to be, it's just to say that integrating alternate scenery/terrain approaches is going to be much more straightforward thanks to the compositor/canvas approach.
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: How do I customize the terrain in Flightgear?

Postby simone04 » Fri May 29, 2020 7:20 pm

Ok, just a little update: Now that I have more free time I can spend it into this.
Could you tell me more about this "compositor/canvas" approach? How does this work? Sorry if I am totally ignorant about this, but I just want to understand how it works.
Also how do I setup the compositor file? I just need some clarification, and also I need to understand if I can apply this method to achieve my goals..
it would be great if I could use that high definition texture with some method that allows that.
simone04
 
Posts: 65
Joined: Tue May 28, 2019 6:58 pm
Location: Italy
Callsign: MR-BEAN
Version: 2020.1.1
OS: Ubuntu 18.04.4 LTS

Re: How do I customize the terrain in Flightgear?

Postby simone04 » Sat May 30, 2020 11:05 am

ludomotico wrote in Mon May 04, 2020 11:40 am:- CORINE is synthetic terrain and, as such, it is not "real". Check: http://wiki.flightgear.org/Howto:Regional_texturing to learn about how to enhance the details of the current terrain. Good news are you don't need building a new terrain to greatly enhance your region!

now that I have more free time I delved into some links you sent me, and I think that I finally found the right page on how to do it.... sorry if initially I didn't fully understand what you were trying to tell me.. I'll post an update when I have some results.
simone04
 
Posts: 65
Joined: Tue May 28, 2019 6:58 pm
Location: Italy
Callsign: MR-BEAN
Version: 2020.1.1
OS: Ubuntu 18.04.4 LTS

Re: How do I customize the terrain in Flightgear?

Postby vnts » Sun May 31, 2020 4:32 pm

simone04 wrote in Sun May 03, 2020 8:02 pm:I want to replace the default terrain with a more detailed terrain (like a 1m/pixel map), from google maps for example(or other free services like https://earthexplorer.usgs.gov/ ).

Not sure what photo sources you are using for textures now, but just wanted to note sources have to be GPLv2 compatible for derived textures to be added to FGData. CC0 & CC-BY-SA 4.0 are compatible. Google earth isn't compatible. USGS/Landsat data seems [1] [2] to be - if it's high res enough.
..the right page on how to do it

Incidentally I started work a while back on a page that gives quick links/pointers for the frequently asked question of seeing some aspect people want to improve/change and wondering where those scenery visuals come from and points of access to change them: http://wiki.flightgear.org/Howto:Improv ... f_interest

It's WiP, haven't linked it to other wiki pages yet. I have limited time with FG myself, so I'm taking the opportunity of learning FG a bit as I write, being more familiar with the GPU side to date.

Re: photoscenery. To add to what was said, another problem with photoscenery in a flightsim like FG is that weather physics still needs land-classification info to be loaded and given to the weather system. Not sure if the OSG earth version does that. For example, how fast the surface warms up & cools down can take or add energy to the atmosphere fluid depending on heat capacities and vegetation coverage, how wet/dry the surface is makes it act as a source or sink of moisture (latent heat release from condensation makes moisture like unburnt jet fuel in the atmosphere), smaller scale measures of roughness can also be useful, and even knowing what objects to randomly place can change thermal formation. That's in addition to contact properties for landing/take-off. Technically the ground effect changes depending on things that alter surface roughness, as well as hardness factors like vegetation cover/sand/water (although it's a bit hard to get individual tree cluster visuals and ground effect to line up).

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

Re: How do I customize the terrain in Flightgear?

Postby simone04 » Sun May 31, 2020 4:50 pm

I don't know how I would get high resolution imagery in Europe, as USGS has high resolution for the US, but for the rest of the world there are only some global satellites that aren't that good in resolution..
And yes I got the USGS global satellite imagery for my zone and I got also the imagery from google earth, and I know that google earth imagery isn't GPLv2 compatible...
But if anyone knows where I could find some imagery in a decent resolution, it would be helpful :)
Last edited by simone04 on Sun May 31, 2020 4:58 pm, edited 1 time in total.
simone04
 
Posts: 65
Joined: Tue May 28, 2019 6:58 pm
Location: Italy
Callsign: MR-BEAN
Version: 2020.1.1
OS: Ubuntu 18.04.4 LTS

Re: How do I customize the terrain in Flightgear?

Postby Hooray » Sun May 31, 2020 5:03 pm

If you are not going to release/distribute anything, the GPL is not a problem - for instance, osgEarth simply downloads the corresponding imagery "on the fly" (in the background), so any imagery isn't included with fgfs, but simply downloaded on demand.

Similarly, the patches we have, primarily modify FlightGear to use existing images - in other words, you could even use self-generated imagery, and I believe Curt has repeatedly posted screen shots where he used some of his UAV work to create images and drape them dynamically over the terrain as needed.

This sort of thing is pretty straightforward to do in OSG land, and we even have patches to make this possible dynamically. It would only take very little code to add a new canvas placement so that arbitrary textures could be used - you could even "mix" different textures at run-time. And while the problems that were previously mentioned are indeed real, it is possible to procedurally augment/edit such images - for instance, to remove shadows or cloud layers (or actual aircraft), this is where an ANN may help.

For the osgEarth integration (updated 5 months ago, targeting 2019.1), see:

https://gitlab.com/poweroftwo
http://simperative.com/portfolio.html

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: How do I customize the terrain in Flightgear?

Postby simone04 » Sun May 31, 2020 5:31 pm

Absolutely. I am not going to distribute or releasing anything. In fact I was aware that Google Earth Imagery was not GPLv2 compatible, but as I wasn't going to publish anything I thought that it wasn't a problem.
Also I got in my final texture some aircraft that needed to be removed, so I'm going to modify it.
simone04
 
Posts: 65
Joined: Tue May 28, 2019 6:58 pm
Location: Italy
Callsign: MR-BEAN
Version: 2020.1.1
OS: Ubuntu 18.04.4 LTS

Re: How do I customize the terrain in Flightgear?

Postby legoboyvdlp » Sun May 31, 2020 7:30 pm

vnts wrote in Sun May 31, 2020 4:32 pm:Re: photoscenery. To add to what was said, another problem with photoscenery in a flightsim like FG is that weather physics still needs land-classification info to be loaded and given to the weather system. Not sure if the OSG earth version does that. For example, how fast the surface warms up & cools down can take or add energy to the atmosphere fluid depending on heat capacities and vegetation coverage, how wet/dry the surface is makes it act as a source or sink of moisture (latent heat release from condensation makes moisture like unburnt jet fuel in the atmosphere), smaller scale measures of roughness can also be useful, and even knowing what objects to randomly place can change thermal formation. That's in addition to contact properties for landing/take-off. Technically the ground effect changes depending on things that alter surface roughness, as well as hardness factors like vegetation cover/sand/water (although it's a bit hard to get individual tree cluster visuals and ground effect to line up).


Unfortunately it doesn't; there is no landclass interactions whatsoever, in fact, going by what I read elsewhere, at least.
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: How do I customize the terrain in Flightgear?

Postby Hooray » Sun May 31, 2020 7:36 pm

The scripted weather system used at some point (pre-dating the hard-coded terrain presampler) an API called "geodinfo": http://wiki.flightgear.org/Nasal_library#geodinfo.28.29

The second return value is a hash with information about the assigned material, as per materials.xml / README.materials

Thorsten is very aware of landcover classes / materials, as he's using the same data for regional texturing.

You can easily see for yourself, that the corresponding data is indeed used by going to $FG_ROOT/Nasal/local_weather and running $ grep -nr geodinfo


https://sourceforge.net/p/flightgear/fg ... t.nas#1839
Code: Select all
# get terrain elevation and landcover   

                var elevation = -1.0; var p_cover = 0.2;# defaults if there is no info
                var info = geodinfo(lat, lon);
                if (info != nil)
                        {
                        elevation = info[0] * local_weather.m_to_ft;
                        if (info[1] != nil)
                                {
                                var landcover = info[1].names[0];
                                if (contains(local_weather.landcover_map,landcover)) {p_cover = local_weather.landcover_map[landcover];}
                                else {p_cover = 0.2;}
                                }
                        }



http://wiki.flightgear.org/Advanced_weather
Last edited by Hooray on Sun May 31, 2020 7:38 pm, edited 1 time in total.
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: How do I customize the terrain in Flightgear?

Postby legoboyvdlp » Sun May 31, 2020 7:37 pm

Which is true, and it's very good, but we're talking about osgearth.... not regional texturing :)
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: How do I customize the terrain in Flightgear?

Postby Hooray » Sun May 31, 2020 7:43 pm

osgearth contains patches to make standard APIs work - so, if landcover data like materials.xml is missing, it would be plausible to simply use data fro materials.xml in osgearth mode.

https://gitlab.com/poweroftwo/flightgea ... d.cxx#L963
https://gitlab.com/poweroftwo/flightgea ... y.cxx#L391
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: How do I customize the terrain in Flightgear?

Postby simone04 » Fri Jun 05, 2020 2:55 pm

mmh.. I am getting some problems here..
I have followed those guides:
http://wiki.flightgear.org/Howto:Regional_texturing
http://wiki.flightgear.org/Procedural_Texturing
I have wrote this little piece of code and saved it as lica.xml
Code: Select all
<PropertyList> 

<name>LICA</name>
<area>
<lon1>16.4948</lon1>
<lon2>15.8728</lon2>
<lat1>38.9899</lat1>
<lat2>38.2738</lat2>
</area>
<material>
<name>IrrCropPastureCover</name>

<texture-set>
<texture>Terrain/FINAL_1m.png</texture>
</texture-set>
<xsize>64</xsize>
<ysize>64</ysize>
<solid>1</solid>
</material>
</PropertyList>

To make things clearer:
- 1m_FINAL.png is a random texture (64x64) that already exist in FG (flightgear/Scenery/Models/Airport/eddf_blast_deflector_bottom.png)
-I am not sure how lon1,2 and lat1,2 works... Also because I am having some doubts, like the two coordinates are there because they need to create a rectangle shape? How precise do the coordinates needs to be(for example 4 numbers after the decimal point) etc..?

Also I have some trouble getting the right landcover classes... As I read here:
http://wiki.flightgear.org/Howto:Editing_tile_textures_and_materials
You can determine the material definition used within a triangle in-sim by using the ufo and Ctrl+Alt clicking on the ground. This will list the landclass used from the materials.xml file.

I am a little puzzled about this, because when I click Ctrl+Alt+LeftClick I get more than one landclass name. Here is some example:
Code: Select all
[ALRT]:nasal      lat:38.9397 lon:16.2839 alt:80m class(es): IrrCropPastureCover IrrCrop Orchard Olives Vineyard Rice MixedCropPastureCover MixedCrop Crop ComplexCrop

how do I determine the right landclass name? As you can see here I have more than one landclass...
(the result of all this is nothing. in fact when I run FG I don't see the texture)

I also wrote this to Materials.xml file:
Code: Select all
<region include="Materials/regions/lica.xml"/>
simone04
 
Posts: 65
Joined: Tue May 28, 2019 6:58 pm
Location: Italy
Callsign: MR-BEAN
Version: 2020.1.1
OS: Ubuntu 18.04.4 LTS

Re: How do I customize the terrain in Flightgear?

Postby ludomotico » Fri Jun 05, 2020 5:28 pm

simone04 wrote in Fri Jun 05, 2020 2:55 pm:-I am not sure how lon1,2 and lat1,2 works... Also because I am having some doubts, like the two coordinates are there because they need to create a rectangle shape? How precise do the coordinates needs to be(for example 4 numbers after the decimal point) etc..?


Yes, shapes are rectangles. Precision (i.e.: numbers after the decimal point) is not that important: only the tile center is checked against the rectangles.

Also, notice you have lat1 and lat2 switched arround: lat1/lon1 must be the lowest number, lat2/lon2 the highest. This is why your rectangle doesn't seem to work.


I am a little puzzled about this, because when I click Ctrl+Alt+LeftClick I get more than one landclass name. Here is some example:
Code: Select all
[ALRT]:nasal      lat:38.9397 lon:16.2839 alt:80m class(es): IrrCropPastureCover IrrCrop Orchard Olives Vineyard Rice MixedCropPastureCover MixedCrop Crop ComplexCrop



Right. The Ctrl+Alt+LeftClick method outputs materials, and a material may apply to several landclasses. In your example, all these landclasses are assigned to the same material, defined like this:

Code: Select all
<material>
<name>IrrCropPastureCover </name>
<name>IrrCrop</name>
<name>Orchard</name>
...
</material>


how do I determine the right landclass name? As you can see here I have more than one landclass...


The high level API only manages materials, not landclasses. I'm not aware of any method to learn the exact landclass for an area in FlightGear, apart from mapping 1:1 landclass to materials in your regional texture (not recommended)

Since you hardly want to change a very specific spot in your area but all IrrCrop areas at once, your best bet is using a very obvious texture and fly around to check what have you changed.

I also wrote this to Materials.xml file:


Be aware the LAST files in materials.xml have preference: if you define a material in your region, and there is already another region defining the material for this landclass later in materials.xml, it will take precedence.
User avatar
ludomotico
 
Posts: 1269
Joined: Tue Apr 24, 2012 2:01 pm
Version: nightly
OS: Windows 10

Re: How do I customize the terrain in Flightgear?

Postby simone04 » Fri Jun 05, 2020 6:14 pm

hmmm so I need to do something like this? :
Code: Select all
<lat2>38.991380</lat2>
<lon2>16.136188</lon2>
<lat1>38.846353</lat1>
<lon1>16.377910</lon1>
simone04
 
Posts: 65
Joined: Tue May 28, 2019 6:58 pm
Location: Italy
Callsign: MR-BEAN
Version: 2020.1.1
OS: Ubuntu 18.04.4 LTS

PreviousNext

Return to Scenery

Who is online

Users browsing this forum: No registered users and 11 guests