[osg-users] Switching lods with PagedLOD

363 views
Skip to first unread message

Adrian Lindberg

unread,
Feb 26, 2010, 11:16:13 AM2/26/10
to osg-...@lists.openscenegraph.org
Hi,

I'm making progress with the my paged lodding. But I've run into another wall. When I set up the pagedLOD node I provide the files along with their paths. The lodding works but the problems occur when it switches one lod level for another, namely the time it takes for the new lod to load through the pager.

My application will constantly lod stuff (using Quadtrees) and it takes some time to load and prepare the data so when the old lod gets out of range I get a gaping hole in my geometry. What I want is for the PagedLOD to know the hierarchy and therefore not unload the old lod before the new lods have been paged in. I get the feeling that this type of functionality should be available somewhere and overlapping ranges won't do since I'm not able to guarantee anything that way.

Do I need to write my on page nodes or does osg provide this functionality out-of-the-box?

Again, any help is much appriciated,
Adrian

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

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

Chris 'Xenon' Hanson

unread,
Feb 26, 2010, 11:23:17 AM2/26/10
to osg-...@lists.openscenegraph.org
On 2/26/2010 9:16 AM, Adrian Lindberg wrote:
> I'm making progress with the my paged lodding. But I've run into another wall. When I set up the pagedLOD node I provide the files along with their paths. The lodding works but the problems occur when it switches one lod level for another, namely the time it takes for the new lod to load through the pager.
> My application will constantly lod stuff (using Quadtrees) and it takes some time to load and prepare the data so when the old lod gets out of range I get a gaping hole in my geometry. What I want is for the PagedLOD to know the hierarchy and therefore not unload the old lod before the new lods have been paged in. I get the feeling that this type of functionality should be available somewhere and overlapping ranges won't do since I'm not able to guarantee anything that way.
> Do I need to write my on page nodes or does osg provide this functionality out-of-the-box?

I think you'll have to explain more about how you're doing it. PagedLOD, especially the
way VirtualPlanetBuilder does it for terrain tiles, does exactly what you want.

Are you doing terrain? If so, is there a good reason you're not using VPB?

--
Chris 'Xenon' Hanson, omo sanza lettere Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
"There is no Truth. There is only Perception. To Perceive is to Exist." - Xen

Adrian Lindberg

unread,
Feb 26, 2010, 11:41:32 AM2/26/10
to osg-...@lists.openscenegraph.org

Chris 'Xenon' Hanson wrote:
>
> I think you'll have to explain more about how you're doing it. PagedLOD, especially the
> way VirtualPlanetBuilder does it for terrain tiles, does exactly what you want.
>
> Are you doing terrain? If so, is there a good reason you're not using VPB?
>

I am doing terrain-ish stuff, so no there is no valid reason for not using VPB. It's just that I checked out the project briefly and saw no stable release download and hence did not use the project. Perhaps this is what I want to do.

Question is though, does the VPB need metadata/geometry in a specific manner (formats) or am I free to write custom plugins (which I need) to supply this kind of information?

I start of with a root node, which loads a meta file. The meta file creates a pagedLOD node and supplies it with one geometry and one or more additional meta files, children to the current LOD level. Currently I supply children in a Quadtree manner but this is not to be assumed.

What I do need some kind of kd-tree hierarchy however so the PagedLOD knows that it isn't allowed to unload tile X until children X1 X2 and X3 have been paged.

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

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

Robert Osfield

unread,
Feb 26, 2010, 12:07:54 PM2/26/10
to osg-...@lists.openscenegraph.org
Hi Adrian,

PagedLOD is designed to allow you to specify the first children as ones that are inline - and already attached as children that are saved as part of the PagedLOD's tile - these are the low res fallback children, then subsequent children have the external file reference which server as high res versions. 

Typically one would set up the scene graph so that the first child of the PagedLOD is the low res version of a tile and is stored inline - with the filename for the child set to "" to signify that it's inline, then the second child is an external file reference for a high rest tile.  This external high rest tile is then composed of a group of four children, with each child 1/4 of the tile area, and each child being a PagedLOD with the same pattern of inline and external children.   This builds a quad tree that scales perfectly and always has an inline child to fallback even when the required LOD level isn't yet loaded.

The DatabasePager which is build into osgViewer automatically loads the external children on demand, you won't need to worry about it. 

Another trick in the trade is to use the filename as an encoding of the tile LOD, and X,Y location and then have a pseudo plugin generate the geometry and textures procedurally, this way you can easily implement multi-threaded procedural techniques.

Robert.

Jason Beverage

unread,
Feb 26, 2010, 12:12:26 PM2/26/10
to OpenSceneGraph Users
Hi Adrian,

You can also check out osgEarth (http://www.osgearth.org) for an
example of how to use a pseudo plugin to generate the terrain tiles
procedurally as Robert mentioned. It also lets you create your
plugins for providing imagery, elevation and feature data.

Thanks,

Jason

Chris 'Xenon' Hanson

unread,
Feb 26, 2010, 12:22:03 PM2/26/10
to osg-...@lists.openscenegraph.org
On 2/26/2010 9:41 AM, Adrian Lindberg wrote:
> I am doing terrain-ish stuff, so no there is no valid reason for not using VPB. It's just that I checked out the project briefly and saw no stable release download and hence did not use the project. Perhaps this is what I want to do.

Which exact version of OSG are you using? A stable release or the developer 2.9.7? What
platform?

I've started offering SVN-head downloads of OSG, VPB and osgEarth for Windows 32 on a
subscription basis for some of my clients, if you're interested in that.


VPB is THE recommended way to do pre-built terrain in OSG. It's very well refined and
stable and performs very well.

> Question is though, does the VPB need metadata/geometry in a specific manner (formats) or am I free to write custom plugins (which I need) to supply this kind of information?

VPB relies on GDAL to load the data. GDAL can real almost any recognized GIS data
format, and VPB allows you to supply metadata at build time for formats (like JPEG) that
might lake geospatial metadata.

If you can't convert your data to a recognized format, you could probably cobble
together a piece of code for GDAL to read your format directly.

Is your terrain and terrain texture data static (unchanging at runtime) or dynamically
changing?

> I start of with a root node, which loads a meta file. The meta file creates a pagedLOD node and supplies it with one geometry and one or more additional meta files, children to the current LOD level. Currently I supply children in a Quadtree manner but this is not to be assumed.
> What I do need some kind of kd-tree hierarchy however so the PagedLOD knows that it isn't allowed to unload tile X until children X1 X2 and X3 have been paged.

VPB pretty much does all of this automatically.

I'd be happy to advise you further privately if you want.

--
Chris 'Xenon' Hanson, omo sanza lettere Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
"There is no Truth. There is only Perception. To Perceive is to Exist." - Xen

Adrian Lindberg

unread,
Mar 1, 2010, 7:17:42 AM3/1/10
to osg-...@lists.openscenegraph.org
Wow, you guys are great. Didn't expect this much help so soon.


robertosfield wrote:
> Typically one would set up the scene graph so that the first child of the PagedLOD is the low res version of a tile and is stored inline - with the filename for the child set to "" to signify that it's inline, then the second child is an external file reference for a high rest tile. This external high rest tile is then composed of a group of four children, with each child 1/4 of the tile area, and each child being a PagedLOD with the same pattern of inline and external children. This builds a quad tree that scales perfectly and always has an inline child to fallback even when the required LOD level isn't yet loaded.

Cool, this was not obvious for me looking at the code. One question though. Supplying the empty filename "" is this a special case handled by PagedLOD (so that it will keep it even if it is out of range and no other tile is loaded)? If so I'll look for it (I'll look anyway but it might save me some time if I know it's there at least).

Unfortunately procedural stuff isn't interesting at the time. I'm looking at static data.


Chris 'Xenon' Hanson wrote:
> Which exact version of OSG are you using? A stable release or the developer 2.9.7? What
> platform?
>
> I've started offering SVN-head downloads of OSG, VPB and osgEarth for Windows 32 on a
> subscription basis for some of my clients, if you're interested in that.

I'm running the developer 2.9.7 (OMG! OpenGL ES) so far and will only use any later stable build. I'm interested in such a subscription as I will move to the Win32 platform shortly (right now I'm on OSX but only because I love the platform and Xcode and not because it's a target platform).


Chris 'Xenon' Hanson wrote:
> VPB relies on GDAL to load the data. GDAL can real almost any recognized GIS data
> format, and VPB allows you to supply metadata at build time for formats (like JPEG) that
> might lake geospatial metadata.

There is a possibility I might not be interested in using GDAL for bloating reasons. Eventually I'm going to want to scale back on any unnecessary functionality. I don't know if this is going to be a problem. Also converting to existing GIS data is not the way to go for the data. Most of the data is going to be static.


Chirs 'Xenon' Hanson wrote:
> I'd be happy to advise you further privately if you want

I'd like that very much actually. Do you use the forum or the mailing list? (PM email since I believe my email isn't shown in the mailinglist).

Cheers,
Adrian

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

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

Chris 'Xenon' Hanson

unread,
Mar 1, 2010, 12:22:36 PM3/1/10
to osg-...@lists.openscenegraph.org
On 3/1/2010 5:17 AM, Adrian Lindberg wrote:
> robertosfield wrote:
>> Typically one would set up the scene graph so that the first child of the PagedLOD is the low res version of a tile and is stored inline - with the filename for the child set to "" to signify that it's inline, then the second child is an external file reference for a high rest tile. This external high rest tile is then composed of a group of four children, with each child 1/4 of the tile area, and each child being a PagedLOD with the same pattern of inline and external children. This builds a quad tree that scales perfectly and always has an inline child to fallback even when the required LOD level isn't yet loaded.
> Cool, this was not obvious for me looking at the code. One question though. Supplying the empty filename "" is this a special case handled by PagedLOD (so that it will keep it even if it is out of range and no other tile is loaded)? If so I'll look for it (I'll look anyway but it might save me some time if I know it's there at least).

I don't think LOD 0 is ever unloaded.

Also, PagedLOD _never_ unloads lower LODs, even if higher LODs are in use. It preserves
these so that it can rapidly downshift to a lower LOD if performance constraints demand it.

> I'm running the developer 2.9.7 (OMG! OpenGL ES) so far and will only use any later stable build. I'm interested in such a subscription as I will move to the Win32 platform shortly (right now I'm on OSX but only because I love the platform and Xcode and not because it's a target platform).

Ok, well, contact me if you want to get signed up for it when you start to play with
Windows. 2.9.7 is a good choice, as there are lots of improvements since 2.8.2.

> There is a possibility I might not be interested in using GDAL for bloating reasons. Eventually I'm going to want to scale back on any unnecessary functionality. I don't know if this is going to be a problem. Also converting to existing GIS data is not the way to go for the data. Most of the data is going to be static.

Well, VPB is dependent on GDAL for sure, it'd be hard to remove that. You could try to
do what VPB (or osgEarth) does yourself, but you're neglecting a lot of historical
knowledge built-in there.

> I'd like that very much actually. Do you use the forum or the mailing list? (PM email since I believe my email isn't shown in the mailinglist).

xe...@alphapixel.com

--
Chris 'Xenon' Hanson, omo sanza lettere Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
"There is no Truth. There is only Perception. To Perceive is to Exist." - Xen

Reply all
Reply to author
Forward
0 new messages