[osg-users] Chunked lod

Tyler Durden mynewphoneaaaa at gmail.com
Sat Jun 23 08:08:26 PDT 2018


Hi,

I have implemented a working chunked lod system for terrain.
It uses vertex morphing to execute smooth transition between quadtree's levels like CDLOD.
It is parametrizable ( i can choose the depth or number of levels, the size of quadtree node and so on).


Chunked lod is a quadtree based system to render nodes.
All nodes of the underlying quadtree have its own geometry (it is constant for all nodes; for example 33x33 or 17x17 and so on).
Node splitting is performed when collision test between a sphere (wich radius depends on node's level) and a AABB happens.

Obviously the larger the node size the faster collision tests on CPU because there is a on average lower number of nodes to do, but more geometry.
As opposed as above, the smaller the node size, there is fewer geometry but higher collision tests when the camera get closer on the ground.


When a collision test return success the operation are:
1) remove from rendering parent node
2) add to rendering 4 child nodes

If the camera has a certain speed and when it get closer on terrain (increasing number of collision tests, because there is more nodes) i notice a slower frame rate.
Let me explain how i enable / disable rendering nodes of quadtrees.
I have two classes, QuadTree and QuadTreeNode. Both, QuadTree class and QuadTreeNode calss have a  osg::ref_ptr<osg::Group>.
When the QuadTree class make decision to split a node, it detach osg::Group associated with parent node (a QuadTreeNode instance) by calling osg::Group::removeChild and attach
osg::Group associated with 4 children nodes (4 instances of QuadTreeNode) by calling osg::Group::addChild (4 times).
Is this a correct approach? Is there a faster method? Any trick? Any suggestion to speed up frame rate?








Thank you!

Cheers,
Tyler

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







More information about the osg-users mailing list