Earthview: Difference between revisions

Jump to navigation Jump to search
2,675 bytes added ,  12 June 2020
Update customization section
m (Update requirements section)
(Update customization section)
Line 1: Line 1:
{{See also|Flying on other planets}}
{{See also|Flying on other planets}}


The default FlightGear terrain rendering strategy is designed for visuals from aircraft cruise altitude. While it is [http://www.flightgear.org/tours/pushing-the-boundaries-the-x-15-story/ possible] to use it for altitudes up to some 100 km, the performance impact becomes increasingly prohibitive and the visuals are not overly compelling. In particular for orbiting spacecraft such as [[Vostok-1]] or the [[Space Shuttle]] neither rendering nor loading the standard terrain mesh is fast enough.
The default FlightGear terrain rendering strategy is designed for visuals from aircraft cruise altitude. While it is [http://www.flightgear.org/tours/pushing-the-boundaries-the-x-15-story/ possible] to use it for altitudes up to some 100 km, the performance impact becomes increasingly prohibitive and the visuals are not overly compelling. In particular for orbiting spacecraft such as [[Vostok-1]] or the [[Space Shuttle]] or even the [[UFO]], neither rendering nor loading the standard terrain mesh is fast enough.


Earthview is an alternative orbital rendering engine for FlightGear designed to get credible visuals in these situations. It is based on projecting a simple textured sphere representing Earth into the scene using ray optics. The quality of the terrain visuals then largely depend on the texture size used. Since there is then only a single object in the field of view, performance is generally very good provided that there is enough texture memory available.
Earthview is an alternative orbital rendering engine for FlightGear designed to get credible visuals in these situations. It is based on projecting a simple textured sphere representing Earth into the scene using ray optics. The quality of the terrain visuals then largely depend on the texture size used. Since there is then only a single object in the field of view, performance is generally very good provided that there is enough texture memory available.


{{Spaceflight}}
{{Spaceflight}}
=== Overview ===
== Overview ==
[[File:menubar2.jpg|517px]]
[[File:menubar2.jpg|517px]]


Line 51: Line 51:
Since there is no detailed terrain mesh involved and there is essentially just a single textured sphere in the field of view, performance is generally excellent even on low end graphics cards.
Since there is no detailed terrain mesh involved and there is essentially just a single textured sphere in the field of view, performance is generally excellent even on low end graphics cards.


The main requirement (especially if custom hires textures are used) is available memory and GPU texture memory. All textures are split into eight tiles, four for the northern hemisphere, and four for the southern hemisphere and each tile is loaded, or unloaded, according to visibility. As such, GPU memory is efficiently used and limited graphic card memory should not be an issue for the default texture size. However, the loading of a texture tile induces some bottleneck and FG may hang for a couple of seconds, or more (depending on tile resolution), while the texture appears.  
The main requirement (especially if custom hires textures are used) is available memory and GPU texture memory. All textures are split into eight tiles, four for the northern hemisphere (N1 to N4), and four for the southern hemisphere (S1 to S4) and each tile is loaded, or unloaded, according to visibility. As such, GPU memory is efficiently used and limited graphic card memory should not be an issue for the default texture size. However, the loading of a texture tile induces some bottleneck and FG may hang for a couple of seconds, or more (depending on tile resolution), while the texture appears.  


Where this is feasible and supported by the GPU drivers, pre-compressed and mipmapped dds textures offer the fastest loading times. As such textures can not be used with many OpenSource graphics drivers, the default textures are not in dds format, but these can be generated along the lines discussed in the "Customization" section. For high-end graphic cards, it is possible to actually force the loading of all texture tiles at once when Earthview starts. This is triggered with the command line option:
Where this is feasible and supported by the GPU drivers, pre-compressed and mipmapped dds textures offer the fastest loading times. As such textures can not be used with many OpenSource graphics drivers, the default textures are not in dds format, but these can be generated along the lines discussed in the "Customization" section. For high-end graphic cards, it is possible to actually force the loading of all texture tiles at once when Earthview starts. This is triggered with the command line option:
Line 57: Line 57:
   --prop:/earthview/show-force-all=true
   --prop:/earthview/show-force-all=true


With the maximum resolution textures (16384x16384 pixels for a world tile and 8192x8192 pixels for the a cloud and a normalmap tile), expect a minute or more for the loading, around 6GB of GPU memory and 16GB of RAM to be filled. If you can afford it, there will be no other loading bottleneck afterwards. These numbers can accordingly be lowered using lower resolution tiles.
With the maximum resolution textures (16384x16384 pixels for a world tile and 8192x8192 pixels for a cloud and a normalmap tile), expect a minute or more for the loading, around 6GB of GPU memory and 16GB of RAM to be filled. If you can afford it, there will be no other loading bottleneck afterwards. These numbers can accordingly be lowered using lower resolution tiles.


Finally, while it is possible to use Earthview in rendering schemes other then ALS, this is neither supported nor endorsed. While they work perfectly well for the normal operations envelope of a flightsim, at high altitude the default renderer as well as [[Project Rembrandt]] do not render a realistic horizon line, plausible atmosphere visuals or the hard shadows of outer space and Earthview can not compensate for these issues.
Finally, while it is possible to use Earthview in rendering schemes other then ALS, this is neither supported nor endorsed. While they work perfectly well for the normal operations envelope of a flightsim, at high altitude the default renderer as well as [[Project Rembrandt]] do not render a realistic horizon line, plausible atmosphere visuals or the hard shadows of outer space and Earthview can not compensate for these issues.
Line 63: Line 63:
== Customization ==
== Customization ==


Getting your own hires version of textures requires a few simple steps:
To get full advantage of Earthview, and your graphic card, you may install and use your own high resolution tiles as well as normal maps having a alpha channel to trigger parallax mapping.


{{Note|1=You can skip the next 2 steps ("obtain a texture set" and "convert the texture set") and download the ready-to-use files via torrent with this magnet link:
==== Texture generation ====
magnet:?xt=urn:btih:ffd18abf3bd98ee761babc09d7c901ea1ce0c78f&dn=EarthView%20-%20Complete


Or you could get yourself this Bash-script to let it do the generation for you: https://github.com/chris-blues/Nasa2FGearthview}}
There are two ways to obtain these textures:


* obtain a texture set
* The easy way
Go to [http://visibleearth.nasa.gov/ Visible Earth], look into the Blue Marble section and download a texture set of your choice (there's different seasons available for instance).


NASA typically delivers the hires textures with naming conventions N1 - N4 (northern hemisphere) and S1 - S4 (southern hemisphere) and Earthview follows that convention.
When our resources allow for it, some users generate these textures and make them available for download. They may be obtained via torrent with this magnet link:


* convert the texture set
    magnet:?xt=urn:btih:ffd18abf3bd98ee761babc09d7c901ea1ce0c78f&dn=EarthView%20-%20Complete


Graphics cards prefer powers of two in texture sizes, so you probably want to resize the sheets to either 8192x8192 or 16384x16384. At the same time, you might want to save them in pre-compressed and mip-mapped dds format (this may require a gimp plugin) for better loading times. Do this on a machine with plenty of memory, as the graphics program may need a lot in intermediate stages.
and may also be available for download at this url:


* assign the texture sheets
    [https://curl.irmp.ucl.ac.be/~chris/upload/fg/earthview/ /earthview/]


Look into $FGData/Models/Astro  - this is where Earthview resides. The current texture sheets are pale_blue_aug_??.png and clouds_??.png where ?? stands for the NASA position reference.
* The interesting way


The simple way is to assign your texture to earth_unitscale_rawuv.ac (then they can be used 'as is'). It's easiest to open the file with the text editor, look for the lines like
Most likely the easy way is no longer available, or you are curious. Chris_Blues made a wonderful Bash-script that will download the NASA images and do the texture generation for you, in the correct way. It is available on github, together with the instructions on how to use it:
<b>texture "pale_blue_aug_N1.png"</b>
384
and replace them with your own N1 texture. Then open earth.xml and point to your just edited 3d model via <path>earth_unitscale_rawuv.ac</path>. Do the same for cloudsphere.xml (it's entirely possible to do all this in a 3d modeling application like blender, but chances are it will get rather slow and unwieldy for such huge texture sheets).
    [https://github.com/chris-blues/Nasa2FGearthview Nasa2FGearthview]
 
This program can generate world, clouds and normalmaps with height data included in various resolutions ranging from 1024x1024 to 16384x16384 pixels.
 
* Remarks
 
Notice that all the input images are provided by NASA and any usage of the textures should be made in accordance with their distribution policy. They are directly accessible for download at [http://visibleearth.nasa.gov/ Visible Earth], look into the Blue Marble section and search for a texture set of your choice.
 
NASA provides different seasons available for the Earth images, even one per month. [https://github.com/chris-blues/Nasa2FGearthview Nasa2FGearthview] allows you to chose the month for which you want to generate your set of tiles.
 
Graphics cards prefer powers of two in texture sizes, so [https://github.com/chris-blues/Nasa2FGearthview Nasa2FGearthview] resizes the tiles to 1024x1024, 2048x2048, 4096x4096, 8192x8192 or 16384x16384 pixels. Be aware of the original image resolution, there is no much gain into using a super-sampled tile. For instance, the current cloud maps provided by NASA have a resolution of typically 10000 pixels. Using 8192x8192 sampling is the best option, the gain of super-sampling it at 16384x16384 is very small.
 
 
==== Installing and using customized textures ====
 
The texture tiles loaded by Earthview reside in
 
  $FGData/Models/Astro/Textures
 
where $FGData depends on the installation path of flightgear-fgdata. If you only want to use "png" texture tiles, simply replace all the '''world_*.png''', '''clouds_*.png''' and '''normalmap_earth_*.png''' files by your own.
 
If you want to use "dds" mipmapped images, then you have to edit a few "ac" files to tell Earthview to use them. These configuration files reside in
 
  $FGData/Models/Astro
 
and are
 
  earth_*.ac
 
On Unix systems, the program '''sed''' is your friend (but make a backup before).
 
* Remarks
It is possible to assign any image you fancy to be used as a tile by Earthview. For this, you can edit the file '''earth_unitscale_rawuv.ac''' to load your images, and edit '''earth.xml''' such that it points to your just edited 3d model via <path>earth_unitscale_rawuv.ac</path>. You can do the same for '''cloudsphere.xml'''. However, assigning textures in this manner, as they are to the "rawuv" sphere, creates visible seams where the texture sheets end. This is particularly visible if parallax mapping is rendered as the computation requires shifting the textures over the sphere.
 
The solution is to add margins that encompass a bit of the neighbouring tiles. This is what [https://github.com/chris-blues/Nasa2FGearthview Nasa2FGearthview] is doing (as well as the texture set provided). These bordered tiles don't use '''earth_unitscale_rawuv.ac''' but instead '''earth_unitscale_hires.ac''', which is the default (see [https://forum.flightgear.org/viewtopic.php?f=6&t=15754&start=135#p207629 this forum post] for the original discussion). In other words, if you use [https://github.com/chris-blues/Nasa2FGearthview Nasa2FGearthview] to generate your own textures, you do not need to change '''earth.xml''' nor '''earth_unitscale_rawuv.ac''', but you should still edit '''earth_unitscale_hires.ac''' if you want to use dds tiles.
 
==== Open tips ====
 
* Since there is no limit to customization, and if you can afford 50GB of disk space, you can create a whole set of directories containing Earth textures for each month of the year, as for instance:
 
  EarthView.World.January-2020.06/
  EarthView.World.February-2020.06/
  ...
 
On linux, a simple "cron" job can automatically link the content of one of these directories to '''$FGData/Models/Astro/Textures/''', like this one:
 
  #!/bin/bash
  TEXTUREDIR="/usr/share/games/flightgear-extra/Models/Textures"
  TIMESTAMP="2020.06"
  MONTH=$(date +%B)
  WORLDRES="16384"
  echo "Going to: $TEXTUREDIR"
  cd $TEXTUREDIR
  echo "Linking world textures of: $MONTH"
  ln -s -f ../EarthView.World.${MONTH}-${TIMESTAMP}/${WORLDRES}/world_*.dds .
  ln -s -f ../EarthView.World.${MONTH}-${TIMESTAMP}/${WORLDRES}/world_*.png .
  echo "done"
 
And you'll be flying Earth with textures matching the current month!
 
* You may also fancy textures from other celestial bodies, as for instance the Moon. Textures generator available here [https://github.com/eatdust/LROC2FGearthview LROC2FGearthview] and shaders there [https://github.com/eatdust/moonshaders moonshaders].


Assigning textures as they are to the rawuv sphere creates visible seams where the texture sheets end. The solution is to add margins (like done for the texture set provided). If you edit your textures to add such margins, you don't need to use <b>earth_unitscale_rawuv.ac</b> and can assign your textures to <b>earth_unitscale_hires.ac</b> (see [https://forum.flightgear.org/viewtopic.php?f=6&t=15754&start=135#p207629 this forum post] for the details of creating such textures)


For comparison, a 16384x16384 texture sheet in pre-compressed and mip-mapped dds format should come to 341 MB. Unless you have a substantial amount of memory, consider using less than full resolution, since you always need 4 of these textures loaded into graphics memory, and 8 if you also switch on clouds.


== Implementation ==
== Implementation ==
15

edits

Navigation menu