Introducing an initial osgEarth integration featuring a runtime selectable option for the terrain scene in FlightGear. Once enabled, osgEarth renders the terrain scene by building the textured geometry at runtime from raw source imagery and elevation data. Load times for an unvisited location are surprisingly fast given a respectable Internet download rate. For locations previously visited, an optimized file cache data is saved for rapid loading.
Input data can come from a variety of sources including web mapping services or local source data (e.g. geotiff) stored on disk. Once rendering is enabled, the entire FlightGear terrain scene graph is replaced along as well as the scene elevation queries. However, the native terrain implementation remains fully intact and can be restored by disabling osgEarth from its configuration dialog.
The benefits gained from this initial osgEarth integration include geo-specific imagery rendered in real-time from a variety of sources that are available worldwide; tiled terrain on demand; and high altitude views from anywhere above the earth. However, this implementation with FlightGear includes some notable limitations listed in the compromises section.
sample images:
https://plus.google.com/112064247634340 ... yc1ViabWGw
sample video:
https://plus.google.com/112064247634340 ... pn9rTithWd
Features
• osgEarth Configuration Dialog
- Menu: Environment->OsgEarth
Enable / disable use of OsgEarth rendering at runtime. Simply disable OsgEarth to return to native implementation.
Built-in street map layer with opacity slider that can be adjusted at runtime
Customize brightness / contrast / gamma at runtime
• Fly to any airport in the world instantly. Database is paged from network or disk and built on the fly
• osgEarth currently supports these drivers:
Tile Source Drivers
- AGGLite Rasterizer
ArcGIS Server
Debug Display
GDAL (Geospatial Data Abstraction Library)
Noise
OSG (OpenSceneGraph Loader)
TileCache
WorldWind TileService
TMS (Tile Map Service)
VPB (VirtualPlanerBuilder)
WCS (OGC Web Coverage Service)
WMS (OGC Web Map Service)
XYZ
import shapefiles (via osgEarth) to create extrude buildings etc.
- modify or add new earth sources (on-line imagery via WMS; shapefiles, custom geotiff’s etc.)
fgdata\Scenery\Terrain\OsgEarth\EarthFiles
adding new sources
fgdata\Scenery\Terrain\OsgEarth\OsgEarthSources.xml
- Has potential to reduce installation footprint
Important Note: Users are bound by the particular licenses of the source data services.
- File caching
Imagery, elevation, heightfields, and optimized KML ive’s are cached to disk for rapid load and reduced network access.
Supports loading from file cache only when web services are not available
Important disk space consumption warning:
Because disk caching is enabled by default, when running, files will continuously be cached for imagery and other source data. At this time, this implementation does not monitor disk space usage and will not automatically clear space. The file cache directory can be found under the fgdata folder and is named OsgEarthCache. Simply delete the entire folder to clear the entire cache.
- Due to noise commonly found in coarse elevation sources, aircraft landing areas need to be flattened.
Heightfield files (geotiff format) are automatically produced by FlightGear for airport locations that are near the ownship position and placed into a new osgEarth layer.
extents are based on coordinates found in apt.dat.
heightfield generation algorithm makes a best attempt to retain the slope of the region and usually makes the airfield usably level. Undesirable artifacts are generated for some airports (e.g. incomplete polygon tessellation around high slopes areas), particularly smaller ones that have only a single runway.
Important Performance Note: At runtime, as new airport heightfields are generated, the terrain scene will temporarily reset as the new layer is added. The addition of a new layer to osgEarth results in a moment where the terrain scene is “blanked” and then restored. After an airport has been revisited, the blanking effect is no longer present.
- Geographically located features such as building and structures will be automatically positioned and clamped to the terrain surface.
Sample KML files are available from the Sketchup 3DWarehouse. http://sketchup.google.com/3dwarehouse
It is advisable to be selective when choosing models to download from the 3D warehouse as quality varies. Also note that the 3D warehouse contains redundant models of the same feature.
Place uncompressed KML folders in fgdata\Scenery\Terrain\OsgEarth\KMLFiles.
Loading of models from KMZ archives is not currently supported. The KMZ must be uncompressed in place, in order for FlightGear to digest.
Important Performance Note: loading of KML models is currently a technical demonstration and is not a functional replacement of the current FlightGear implementation. The addition of a high number of KML models to the input folder will substantially slow down the initial runtime loading. Unnecessarily complex models will also slow runtime rendering performance.
The KML referenced Collada (DAE) files are optimized (i.e. LOD node added, textures compressed and embedded etc.) into fast loadable OSG “ive” files stored in the disk cache folder.
Compromises – known limitations of initial implementation
• Only a single material / landclass – (runway) is used in this implementation.
• Typical ground texture resolution is lacking compared to the native FlightGear geo typical runways and taxiways.
- Micro-texture (a.k.a. detail texture) could be utilized to improve effective ground texture resolution.
- FlightGear render non-textured models poorly
Currently all KML found in the path are loaded regardless of their distance from the ownship’s position. To improve load performance, some type of spatially organized framework along with use of the OSG paging mechanism such as proxy nodes should be implemented.
During initial load of a textured model, some runtime visual artifacts are produced due to OpenGL graphics conflicts. Quitting FlightGear and rerunning restores the correct state.
• 3D clouds – The Up vector gets out of kilter over long distances
• Need to load height fields that are nearby and page out others.
• No airport lighting in this implementation.
Growth Items
• extract buildings from FG datasets and clamp to surface
• extract airport lighting from FG datasets and clamp to surface
• utilize the osgEarth shader composition framework in order to support Rembrandt and atmospheric modeling in a more mature fashion.
• produce a coarse worldwide material map from shapefiles useful to determine surface material
• many others…
Source Code Changes
• This initial integration of osgEarth into FlightGear requires changes that are stored in the three primary git repositories (FlightGear, SimGear and FgData). Changes have also been made to the Windows FlightGear loader fgRun.
• git clone -v -b 2.12-OsgEarthIntegration git@gitorious.org:fg/simgear-osgearth.git simgear
• git clone -v -b 2.12-OsgEarthIntegration git@gitorious.org:fg/flightgear-osgearth.git flightgear
• git clone -v -b 2.12-OsgEarthIntegration git@gitorious.org:fg/fgdata-osgearth.git fgdata
• git clone -v -b 2.12-OsgEarthIntegration git@gitorious.org:fg/fgrun-osgearth.git fgrun
Additional Dependencies
• In order to incorporate osgEarth functionality, the osgEarth libraries are new additional dependencies to build the FlightGear osgEarth integrated application.
• git clone -v -b osgearth-2.5-RC3 https://github.com/gwaldron/osgearth.git osgearth
I have a Windows 64 bit patch i plan to make available shortly.
jeff Biggs