15
edits
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 == | |||
[[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 | 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 == | ||
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. | |||
==== Texture generation ==== | |||
There are two ways to obtain these textures: | |||
* | * The easy way | ||
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: | |||
magnet:?xt=urn:btih:ffd18abf3bd98ee761babc09d7c901ea1ce0c78f&dn=EarthView%20-%20Complete | |||
and may also be available for download at this url: | |||
[https://curl.irmp.ucl.ac.be/~chris/upload/fg/earthview/ /earthview/] | |||
* The interesting way | |||
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: | |||
384 | |||
and | [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]. | |||
== Implementation == | == Implementation == |
edits