Virtual Planet Builder: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(Created page with "VirtualPlanetBuilder (VPB) is an OSG tool that generates native OSG data to represent terrain, usually by draping a GEO-TIFF over an elevation model. == Building VirtualPlane...")
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Scenery Core Development}}
VirtualPlanetBuilder (VPB) is an OSG tool that generates native OSG data to represent terrain, usually by draping a GEO-TIFF over an elevation model.
VirtualPlanetBuilder (VPB) is an OSG tool that generates native OSG data to represent terrain, usually by draping a GEO-TIFF over an elevation model.


Line 7: Line 9:
If you've got an existing FlightGear build, there are some additional dependencies:
If you've got an existing FlightGear build, there are some additional dependencies:
* OSG
* OSG
* GDAL  (https://gdal.org/)
** Including NVTT.  ('sudo apt-get install libnvtt-dev' - oddly VPB builds without it but then checks for the shared library at runtime...)
* GDAL  (https://gdal.org/),  Note that this needs to 2.4.X
** ... which requires PROJ 6 or above (https://proj.org/)
** ... which requires PROJ 6 or above (https://proj.org/)
*** ... which requires the sqlite3.11 or above development package (on linux - 'sudo apt-get install libsqlite3-dev')
*** ... which requires the sqlite3.11 or above development package (on linux - 'sudo apt-get install libsqlite3-dev')


Note that GDAL and PROJ do not use cmake, so you need to run "./configure" in the source directory before make
Note that GDAL and PROJ do not use cmake, so it builds in the source directory as follows:
./configure -prefix=/path/to/install
make


VPB is built using cmake e.g.
VPB is built using cmake e.g.


cmake -DOSG_DIR=/path/to/OSG/install /path/to/VPB/src
cmake -DOSG_DIR=/path/to/OSG/install /path/to/VPB/src
make


== Getting Landcover Data ==
== Getting Landcover Data ==
Line 23: Line 29:
Choose RASTER data, which will download a geo-referenced TIF image.
Choose RASTER data, which will download a geo-referenced TIF image.


== Getting DEM data.
== Getting DEM data. ==
 
For SRTM, try here:  http://srtm.csi.cgiar.org/
 
Again, Raster data is fine.
 
== Running VPB ==
 
Here are the options I've used to generate some scenery of the UK:
 
./bin/osgdem --TERRAIN \
--compressor-nvtt \
--compression-quality-highest \
--geocentric \
-t /home/stuart/FlightGear/VPB/data/CORINE/u2018_clc2018_v2020_20u1_raster100m/DATA/U2018_CLC2018_V2020_20u1.tif \
-d /home/stuart/FlightGear/VPB/data/SRTM90/srtm_34_02.tif \
-d /home/stuart/FlightGear/VPB/data/SRTM90/srtm_35_01.tif \
-d /home/stuart/FlightGear/VPB/data/SRTM90/srtm_35_02.tif \
-d /home/stuart/FlightGear/VPB/data/SRTM90/srtm_36_01.tif \
-d /home/stuart/FlightGear/VPB/data/SRTM90/srtm_36_02.tif \
-b -4 50 -3 51 \
--PagedLOD \
-l 8 \
-o WS_W4N50.osgb
 
* --TERRAIN to use osgTerrain::Terrain database
*  --compressor-nvtt --compression-quality-highest to generate native mipmaps
* --geocentric because that's what FG uses
* -t the texture to drape (in this case CORINE)
* -d the DEM to use (in this case pieces of SRTM90)
* -b is the extents in decimal degrees: LON1 LAT1 LON2 LAT2
* --PagedLOD to generate PagedLOD nodes
* -l 8 the number of LOD levels to generate
* -o is the output file, in this case native OSG binary format.
 
[[Category:Scenery software]]

Revision as of 19:00, 13 November 2020


VirtualPlanetBuilder (VPB) is an OSG tool that generates native OSG data to represent terrain, usually by draping a GEO-TIFF over an elevation model.

Building VirtualPlanetBuilder

The VPB project and code can be found here: https://github.com/openscenegraph/VirtualPlanetBuilder

If you've got an existing FlightGear build, there are some additional dependencies:

  • OSG
    • Including NVTT. ('sudo apt-get install libnvtt-dev' - oddly VPB builds without it but then checks for the shared library at runtime...)
  • GDAL (https://gdal.org/), Note that this needs to 2.4.X
    • ... which requires PROJ 6 or above (https://proj.org/)
      • ... which requires the sqlite3.11 or above development package (on linux - 'sudo apt-get install libsqlite3-dev')

Note that GDAL and PROJ do not use cmake, so it builds in the source directory as follows:

./configure -prefix=/path/to/install
make

VPB is built using cmake e.g.

cmake -DOSG_DIR=/path/to/OSG/install /path/to/VPB/src
make

Getting Landcover Data

For CORINE data covering Europe, try here: https://land.copernicus.eu/pan-european/corine-land-cover/clc2018

Choose RASTER data, which will download a geo-referenced TIF image.

Getting DEM data.

For SRTM, try here: http://srtm.csi.cgiar.org/

Again, Raster data is fine.

Running VPB

Here are the options I've used to generate some scenery of the UK:

./bin/osgdem --TERRAIN \
--compressor-nvtt \
--compression-quality-highest \
--geocentric \
-t /home/stuart/FlightGear/VPB/data/CORINE/u2018_clc2018_v2020_20u1_raster100m/DATA/U2018_CLC2018_V2020_20u1.tif \
-d /home/stuart/FlightGear/VPB/data/SRTM90/srtm_34_02.tif \
-d /home/stuart/FlightGear/VPB/data/SRTM90/srtm_35_01.tif \
-d /home/stuart/FlightGear/VPB/data/SRTM90/srtm_35_02.tif \
-d /home/stuart/FlightGear/VPB/data/SRTM90/srtm_36_01.tif \
-d /home/stuart/FlightGear/VPB/data/SRTM90/srtm_36_02.tif \
-b -4 50 -3 51 \
--PagedLOD \
-l 8 \
-o WS_W4N50.osgb
  • --TERRAIN to use osgTerrain::Terrain database
  • --compressor-nvtt --compression-quality-highest to generate native mipmaps
  • --geocentric because that's what FG uses
  • -t the texture to drape (in this case CORINE)
  • -d the DEM to use (in this case pieces of SRTM90)
  • -b is the extents in decimal degrees: LON1 LAT1 LON2 LAT2
  • --PagedLOD to generate PagedLOD nodes
  • -l 8 the number of LOD levels to generate
  • -o is the output file, in this case native OSG binary format.