[osg-users] [vpb] Multiple terrain layers and relative altitude heightmap

195 views
Skip to first unread message

Aurelien Albert

unread,
Mar 14, 2012, 11:46:47 AM3/14/12
to osg-...@lists.openscenegraph.org
Hi,

I'm starting a new project that will use VPB databases, but I have some questions about data manipulation :

(all data are re-projected to the same coordinate system before any processing)

1. I need to manage multiple "terrain layers". A layer is made of elevation data and texture data. So I think to build a terrain database for each "terrain layer" and then add all these database in the same scene graph. This allow the user to rebuild / show / hide only selected "terrain layers"

Is there any technical / performance problems to use multiple terrain database nodes in the same scene graph ? I know there will be some rendering artifacts because a (X;Y) point can have different altitudes (one from each "terrain layer") but this is not my question, I wondering about TileID management for example.

2. Some "terrain layers" have elevation data relative to another one. Is there anyway to manage that using osgTerrain ? I think I can "add" the 2 elevation data using GDAL before database creation, but I would prefer to do that at runtime.

3. Is there any "invalid elevation value" management to "cut holes" in source elevation data and then build a database with holes inside ? (not simple shape holes as square)

4. Is there any way to build a "texture only database" (no elevation data) and then add / remove it (as a colorlayer on pre-loaded terrain database) at runtime ?


Thank you!

Cheers,
Aurelien

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=46268#46268

_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC

unread,
Mar 14, 2012, 12:05:52 PM3/14/12
to osg-...@lists.openscenegraph.org
Aurelien,

I don't have specific answers to your questions but have you considered
using osgEarth instead of VPB?

Given what you're trying to accomplish, osgEarth may be a better fit...

-Shayne

Chris Hanson

unread,
Mar 14, 2012, 12:15:30 PM3/14/12
to osg-...@lists.openscenegraph.org
On Wed, Mar 14, 2012 at 9:46 AM, Aurelien Albert <aurelie...@alyotech.fr> wrote:
1. I need to manage multiple "terrain layers". A layer is made of elevation data and texture data. So I think to build a terrain database for each "terrain layer" and then add all these database in the same scene graph. This allow the user to rebuild / show / hide only selected "terrain layers"
Is there any technical / performance problems to use multiple terrain database nodes in the same scene graph ? I know there will be some rendering artifacts because a (X;Y) point can have different altitudes (one from each "terrain layer") but this is not my question, I wondering about TileID management for example.

  I've done it before without problems.
 
2. Some "terrain layers" have elevation data relative to another one. Is there anyway to manage that using osgTerrain ? I think I can "add" the 2 elevation data using GDAL before database creation, but I would prefer to do that at runtime.

  Not really. You should consider looking into osgEarth. It might have a way to do this since it builds the terrain on the fly.
 
3. Is there any "invalid elevation value" management to "cut holes" in source elevation data and then build a database with holes inside ? (not simple shape holes as square)

  I don't remember how VPB handles this anymore. I know I've done it though.
 
4. Is there any way to build a "texture only database" (no elevation data) and then add / remove it (as a colorlayer on pre-loaded terrain database) at runtime ?

  This is something osgEarth is MUCH better suited to doing.
 


Thank you!

Cheers,
Aurelien

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=46268#46268





_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



--
Chris 'Xenon' Hanson, omo sanza lettere. Xe...@AlphaPixel.com http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android

Aurelien Albert

unread,
Mar 14, 2012, 2:36:35 PM3/14/12
to osg-...@lists.openscenegraph.org
Thanks for your quick answers !

I'm considering using VPB instead of osgEarth for performance issue : we need to provide a smooth user experience at 30-60 fps on midrange hardware.

And since a lot of data are static, I think VPB should give us better performance, but maybe am I wrong ?

------------------
Read this topic online here:

http://forum.openscenegraph.org/viewtopic.php?p=46282#46282

Chris Hanson

unread,
Mar 14, 2012, 2:49:31 PM3/14/12
to osg-...@lists.openscenegraph.org
I'm considering using VPB instead of osgEarth for performance issue : we need to provide a smooth user experience at 30-60 fps on midrange hardware.
And since a lot of data are static, I think VPB should give us better performance, but maybe am I wrong ?

  Have you TRIED osgEarth?

  You can use VPB-built static terrin baselayers in osgEarth, and use osgEarth's dynamic terrain layers only where needed. You can also use osgEarth to apply dynamic imagery sources onto static VPB terrain layers.
 

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=46282#46282





_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Aurelien Albert

unread,
Mar 15, 2012, 4:39:56 AM3/15/12
to osg-...@lists.openscenegraph.org

> Have you TRIED osgEarth?


Yes, in the past I've been working about 8 month on a osgEarth based project.

We used a 2 GB dataset, and performance was really bad until the cache is filled.

The new project I'm starting will use dataset about to 5-20 GB, in local storage (with some single files up to 4 GB).

So I'm a little afraid about performance using osgEarth, and the resulting cache size.

Also, a have a restriction : the dataset coordinate system is selected by the end-user, and not necessary a geoid. If I remember well, osgEarth can work only with a geoid.

------------------
Read this topic online here:

http://forum.openscenegraph.org/viewtopic.php?p=46291#46291

Aurelien Albert

unread,
Mar 15, 2012, 6:37:38 AM3/15/12
to osg-...@lists.openscenegraph.org

> You can use VPB-built static terrin baselayers in osgEarth, and use osgEarth's dynamic terrain layers only where needed. You can also use osgEarth to apply dynamic imagery sources onto static VPB terrain layers.


Hum, I've missed that in my previous project... you are probably right, it might be the best idea.

I'll check coordinates system mangement in osgEarth to see if it fits our requirements.

------------------
Read this topic online here:

http://forum.openscenegraph.org/viewtopic.php?p=46295#46295

Eric Zaremba

unread,
Mar 15, 2012, 12:01:24 PM3/15/12
to osg-...@lists.openscenegraph.org
Hi,

At the question

Aurelien wrote:
> 3. Is there any "invalid elevation value" management to "cut holes" in source elevation data and then build a database with holes inside ? (not simple shape holes as square)


You say

Chris Hanson wrote:
> I don't remember how VPB handles this anymore. I know I've done it though.


The need of drill hole in my terrains is the thing which prevent me to use osgEarth or VPB until now. If you can remember how to do it, it will be a great improvement in my projects.

Thank you!

Cheers,
Eric

------------------
Read this topic online here:

http://forum.openscenegraph.org/viewtopic.php?p=46309#46309

Chris Hanson

unread,
Mar 15, 2012, 12:47:54 PM3/15/12
to osg-...@lists.openscenegraph.org
Chris Hanson wrote:
> I don't remember how VPB handles this anymore. I know I've done it though.


  I recall what I did -- I actually used a crazy rendering trick to avoid the need for holes in the terrain.

  I believe you could mark the hole areas in your drape image with a special color and then have a custom shader that discarded fragments when that color was detected. If that won't work, there's probably other ideas I could consult with you on. 
 

Robert Osfield

unread,
Mar 15, 2012, 12:43:57 PM3/15/12
to osg-...@lists.openscenegraph.org
Hi Aurelien,

On 14 March 2012 15:46, Aurelien Albert <aurelie...@alyotech.fr> wrote:
> 3. Is there any "invalid elevation value" management to "cut holes" in source elevation data and then build a database with holes inside ? (not simple shape holes as square)

There is the osgTerrain::ValidValueOperator base that can be used to
set valid values for data by assigning an instance of one of it's
subclass to the osgTerrain::layer, the osgTerrain::NoDataValue is the
subclass that probably does what you need.

VirtualPlanetBuilder reads the no data values from GDAL and uses this
internally, but I've just done a quick code review and can't spot an
entry in VPB for setting the osgTerrain::NoDataValue.

As for multiple terrain layers, VirtualPlanetBuilder and osgTerrain
were written with assumption that their would only be one elevation
layer per tile. One could possible play with using a SwitchLayer in
osgTerrain and add support for this in VirtualPlanetBuilder to achieve
the ability to have multiple elevation layers, however, this obviously
requires to modifications to VirtaulPlanetBuilder and osgTerrain.

Robert.

Jason Beverage

unread,
Mar 15, 2012, 1:03:37 PM3/15/12
to osg-...@lists.openscenegraph.org
Hi Eric,

osgEarth can do everything you've mentioned you need to do.  You can add/remove layers at runtime, cut holes in the terrain using the masking feature and run at 60 fps.  When you say that performance was bad until you've filled the cache in osgEarth, you're making a good point.  Everything that VPB does in it's preprocessing step osgEarth is doing at runtime and caching as it goes along.  So a fully cached osgEarth is very similar to a VPB built database.

That being said, you'll get MUCH better performance (in both osgEarth at runtime and VPB at build time) if you take some relatively simple steps to make sure you're GIS is optimized, see  http://osgearth.org/wiki/DataPreparation 
Basically you need to take the time to reproject your data up front and ensure that it's in a fast format that can support fast tiled reads (like a tiled geotiff with overviews or an ECW or JPEG2000).

I'm looking at a 1.2 GB ECW file in osgEarth right now with no cache at all and it's crazy fast.

Thanks,

Jason

Eric Zaremba

unread,
Mar 19, 2012, 11:26:51 AM3/19/12
to osg-...@lists.openscenegraph.org
Ok, thank you, I will take a look at all of that.

Eric

------------------
Read this topic online here:

http://forum.openscenegraph.org/viewtopic.php?p=46412#46412

Reply all
Reply to author
Forward
0 new messages