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 simone04 » Fri Jun 05, 2020 5:44 pm

OK, I made some progress.. Switching Latitude and NOT longitude worked. Thanks
But Something seems off.
Because it doesn't start at the right coordinates...
I don't know how to fix it.. Also I got the coordinates from google maps
simone04
 
Posts: 65
Joined: Tue May 28, 2019 5: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 wkitty42 » Fri Jun 05, 2020 7:11 pm

make sure you are north or south as needed... positive numbers are north (of equator) and east (of UTC)... negative for south and west...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 6491
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: How do I customize the terrain in Flightgear?

Postby simone04 » Fri Jun 05, 2020 9:53 pm

Yes I know.. I am sure that they are positive because they are North and East, not South and West.
Anyway I had some experimenting. I noticed some strange behavior....
This is my code(actually not all the code, only the coordinates change):
Code: Select all
<lat1>38.991380</lat1>
<lon1>16.134700</lon1>
<lat2>38.846353</lat2>
<lon2>16.377910</lon2>

So the problem here is <lon1>
As I am changing lon1 the tile keeps its location. I tried many times and this is the only result.
https://mega.nz/file/fDpVmYDT#7Qp_l1qLFuky3I5fv0yg1KbPUNWwdcIGEQ55ZIDIPuQ
As you can see no matter how I change the <lon1> value, it doesn't move horizontally..
but
The only longitude that worked was this:
Code: Select all
<lat1>38.991380</lat1>
<lon1>16.125000</lon1>
<lat2>38.846353</lat2>
<lon2>16.377910</lon2>

As you can see only when it is with .125000 or less works. But there is a problem:
https://mega.nz/file/jLhAXArC#kWGiyoxczLcjcK3ZPcwqrKg3CpkQJFhUQS9lv-m2Vh4
The problem is actually that is in the middle of the sea instead of the terrain..
(sorry but I could only use MEGA for sharing the images..)
simone04
 
Posts: 65
Joined: Tue May 28, 2019 5: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 » Sat Jun 06, 2020 12:27 pm

Yes, the unit for the material system is the tile. The world in FlightGear is divided in tiles, like a chess board. You cannot modify the dimensions of a tile. You can only change all materials of a tile at once. You cannot have two kind of irrigated fields in the same tile.

This is why I said the precision of the rectangle does not matter: when a new tile is loaded, FlightGear decides which materials it must apply to the whole tile by checking in which custom area the center of the tile is included in.

The dimensions of a tile depend on its latitude. Check: http://wiki.flightgear.org/Tile_Index_Scheme
User avatar
ludomotico
 
Posts: 1102
Joined: Tue Apr 24, 2012 1:01 pm
Version: git
OS: Debian GNU/Linux

Re: How do I customize the terrain in Flightgear?

Postby simone04 » Sat Jun 06, 2020 1:58 pm

Oh, I see..
So the coordinates refer only to the tile?
Also, how do I determine the coordinate of each tile?
Well I could use UFO to determine the coordinate, but I was wondering if there was another method..
simone04
 
Posts: 65
Joined: Tue May 28, 2019 5: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 » Sat Jun 06, 2020 11:10 pm

The system is designed for areas of the size of continents, islands, countries... you can of course change the materials of a single tile, but it is probably not the most efficient way.

Why do you need to refer to the specific tiles? Unless you are doing something very special, define your materials for your province/country. The borders are not going to be exactly the coordinates you define, but the coordinates of the tiles you are covering. Since you'd probably want to change hundreds of tiles at once, this is not really a limitation.

This maps shows the currently defined regions:

Image

As you can see, current custom areas typically cover thousands of squared kilometers, and hundreds of tiles.
User avatar
ludomotico
 
Posts: 1102
Joined: Tue Apr 24, 2012 1:01 pm
Version: git
OS: Debian GNU/Linux

Re: How do I customize the terrain in Flightgear?

Postby simone04 » Tue Jun 09, 2020 10:02 am

Here is an update:
I tried 1m/px map but my computer can't handle it.
So I tried 4m/px, and this time from here(I also think that it is GPLv2 compatible, but I'm not sure):
https://scihub.copernicus.eu/dhus/
It kinda worked, the image was loaded, but it was all messed up.
I cut the image with the respective coordinates:
Code: Select all
<lat1>39.0000</lat1>
<lon1>16.0000</lon1>
<lat2>38.8750</lat2>
<lon2>16.5000</lon2>

here is a screenshot:
https://mega.nz/file/nHgFkSSQ#rq2tX0ICvIPkjj32rXXoOgRb36ngYbzs0ZJUwj01T2k
The original image was way longer than this, this image is like repeating itself (but that is because of the size), but it is like at a certain point it starts over ..
I don't know if you understand what I'm saying, because it's a bit difficult to explain..
but anyway this is the original image:
https://mega.nz/file/6TQCTYQL#v9CjhpHSOJAXFJSMrcP6pQY9AnQAwzDfo8cNSoqkjGE
simone04
 
Posts: 65
Joined: Tue May 28, 2019 5: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 D-ECHO » Tue Jun 09, 2020 10:06 am

Are you aware that this low resolution will probably give you an incredibly bad experience at anything below maybe FL100-150 ?

Anyways, to avoid the image repeating itself, you need to adjust the resolution paramter in the respective material, iirc. It'd help to see what material definition you used to obtain this image (copy/paste it here)
User avatar
D-ECHO
 
Posts: 2079
Joined: Sat May 09, 2015 12:31 pm

Re: How do I customize the terrain in Flightgear?

Postby simone04 » Tue Jun 09, 2020 10:13 am

D-ECHO wrote in Tue Jun 09, 2020 10:06 am:Are you aware that this low resolution will probably give you an incredibly bad experience at anything below maybe FL100-150 ?

Yes I am aware, I'm just testing now with this low resolution.. Later I'll get a 2m/px if my computer can handle it :mrgreen:


D-ECHO wrote in Tue Jun 09, 2020 10:06 am:Anyways, to avoid the image repeating itself, you need to adjust the resolution paramter in the respective material, iirc. It'd help to see what material definition you used to obtain this image (copy/paste it here)

Are you talking about <xsize> and <ysize> ? Does it relate with the resolution in m/px ?
simone04
 
Posts: 65
Joined: Tue May 28, 2019 5: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 D-ECHO » Tue Jun 09, 2020 10:22 am

If I remember correctly, yes xsize and ysize are what you'd want to tune. I don't know exactly which values you'd need but you can experiment a bit.
User avatar
D-ECHO
 
Posts: 2079
Joined: Sat May 09, 2015 12:31 pm

Re: How do I customize the terrain in Flightgear?

Postby ludomotico » Tue Jun 09, 2020 10:22 am

oh, I see. You are trying to use orthophotos and the method "texture materials", as described here: http://wiki.flightgear.org/Photoscenery I didn't understand you were trying to do this.

Check the file FGDATA/docs/README.materials: you'll find some properties you might be interested in:

- xsize/ysize, to define the size of the texture image in meters. I guess, in your case, it must be the dimensions of the tile. The dimensions of the tile depends on its latitude.
- wrapu/wrapv , to declare if the material should wrap or not.

In any case, the shape must be UV-mapped exactly to match the texture, and this is NOT the default behavior in terragear, as the wiki says.
User avatar
ludomotico
 
Posts: 1102
Joined: Tue Apr 24, 2012 1:01 pm
Version: git
OS: Debian GNU/Linux

Re: How do I customize the terrain in Flightgear?

Postby simone04 » Tue Jun 09, 2020 10:31 am

ludomotico wrote in Tue Jun 09, 2020 10:22 am:- xsize/ysize, to define the size of the texture image in meters. I guess, in your case, it must be the dimensions of the tile. The dimensions of the tile depends on its latitude.

I already used xsize and ysize in my xml file.. And I think it's related to the resolution of the image in m/px, so if the resolution of the image is 1m/px then xsize and ysize match with the dimension of the tile.


ludomotico wrote in Tue Jun 09, 2020 10:22 am:Check the file FGDATA/docs/README.materials: you'll find some properties you might be interested in

Oh I didn't read that. I'll check it..


Anyway thanks for your answers.. :D
simone04
 
Posts: 65
Joined: Tue May 28, 2019 5: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 » Tue Jun 09, 2020 10:37 am

xsize/ysize is the dimensions of the image, in meters: if you want your image to extend for 14000x140000 meters, these are the numbers you set in xsize/ysize, regardless of the number of pixels of the image. Now, it is up to your image to have a resolution high enough to look nice while covering 14000x14000 meters.
User avatar
ludomotico
 
Posts: 1102
Joined: Tue Apr 24, 2012 1:01 pm
Version: git
OS: Debian GNU/Linux

Re: How do I customize the terrain in Flightgear?

Postby simone04 » Tue Jun 09, 2020 1:45 pm

Mmmh this is my code:
Code: Select all
<PropertyList> 
<name>LICA Airport</name>
<area>
<lat1>39.0000</lat1>
<lon1>16.0000</lon1>
<lat2>38.8750</lat2>
<lon2>16.5000</lon2>
</area>
<material>
<name>IrrCropPastureCover</name>
<name>IrrCrop</name>
<name>Orchard</name>
<name>Olives</name>
<name>Vineyard</name>
<name>Rice</name>
<name>MixedCropPastureCover</name>
<name>MixedCrop</name>
<name>Crop</name>
<name>ComplexCrop</name>
<name>EvergreenBroadCover</name>
<name>EvergreenForest</name>
<name>RainForest</name>
<name>MixedForestCover</name>
<name>MixedForest</name>
<name>DeciduousBroadCover</name>
<name>DeciduousForest</name>
<name>DeciduousNeedleCover</name>
<name>DryCropPastureCover</name>
<name>DryCrop</name>
<name>NaturalCrop</name>
<texture-set>
<texture>Terrain/4mpx_CALABRIASAT.png</texture>
</texture-set>
<xsize>4095</xsize>
<ysize>1390</ysize>
<wrapu>false</wrapu>
<wrapv>false</wrapv>
</material>
</PropertyList>

https://mega.nz/file/CXZhiY7Q#ITXSrXL-RteygdHP3GyMF1heXTlyAeSHcxH9WLxQYzE
The image in this screenshot is "stretched" for the whole territory .. The strange thing, however, is that it repeats itself, but not because the image is small (besides that), the problem is that it repeats itself in the middle of the image , it is not even displayed completely..
simone04
 
Posts: 65
Joined: Tue May 28, 2019 5: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 » Tue Jun 09, 2020 3:19 pm

I am aware of the "shadow problem" while using the Photoscenery method. I have no problem with this.

Shadows is one of the issues, as you pointed out. Also, textures at night, Autumn, storms or any other lighting effect different to the one present when the photo was taken.


Procedurally identifying/modifying and removing shadows has become a rather common requirement over the years (beginning ~2010), so that there's a ton of technical papers to be found online - someone with a corresponding background in effects/shaders (and the maths behind it) could probably implement a simple proof-of-concept to see if one of these approaches is feasible or not.

Alas, the main people with that sort of background are not at all interested in photo scenery :lol:


Shadow Removal for Aerial Imagery by Information Theoretic IntrinsicImage Analysis
Abstract
We present a novel technique for shadow removal basedon an information theoretic approach to intrinsic imageanalysis.Our key observation is that any illuminationchange in the scene tends to increase the entropy of ob-served texture intensities. Similarly, the presence of tex-ture in the scene increases the entropy of the illumina-tion function. Consequently, we formulate the separationof an image into texture and illumination components asminimization of entropies of each component. We employa non-parametric kernel-based quadratic entropy formula-tion, and present an efficient multi-scale iterative optimiza-tion algorithm for minimization of the resulting energy func-tional. Our technique may be employed either fully auto-matically, using a proposed learning based method for au-tomatic initialization, or alternatively with small amount ofuser interaction. As we demonstrate, our method is particu-larly suitable for aerial images, which consist of either dis-tinctive texture patterns, e.g. building facades, or soft shad-ows with large diffuse regions, e.g. cloud shadows.
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: 11836
Joined: Tue Mar 25, 2008 8:40 am

PreviousNext

Return to Scenery

Who is online

Users browsing this forum: No registered users and 1 guest