OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Chunked lod


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
sergio2k18
Newbie


Joined: 01 May 2018
Posts: 12

PostPosted: Sat Jun 23, 2018 3:08 pm    Post subject:
Chunked lod
Reply with quote

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
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11973

PostPosted: Mon Jun 25, 2018 8:24 am    Post subject:
Chunked lod
Reply with quote

Hi Tyler,

Modern graphics cards love coarse grained chunks of static geometry,
they can churn through at millions of vertices a second without
breaking sweat.

Once you start make the scene graph more fine grained or making more
of the geometry dynamic so that it has to be updated per frame then
the more your application will be CPU limited and won't be able to
make the most of incredible throughput capability of the graphics
hardware.

Twenty+ years ago the speed different between GPU and CPU's was much
lower so it was more beneficial to avoid sending geometry to the GPU
by using techniques like ChunkedLOD, these days the speed ratio is
quite different, the GPU have got faster much more rapidly than CPUs,
so techniques that were really useful previously now aren't optimal.

With modern hardware if you did want to do some form of continuous LOD
then you would be best to look at pushing more work at the GPU and
keeping as much load off the CPU as you can.

Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
sergio2k18
Newbie


Joined: 01 May 2018
Posts: 12

PostPosted: Mon Jun 25, 2018 10:30 am    Post subject:
Reply with quote

Hi,

Tank you for your answer, Robert.
The fps speed up when i cut from scene all 3d bounding boxes ( a mesh
version of AABB). There is a perceptible improvement.
Anyway, some day ago i started with a small program how to use draw instancing in Openscenegraph.
Just now i'm evalutating to write a 2nd version of my lod system in order to use Geometry Instancing. In this way i release CPU to execute a draw call for each node when on frame it needs to draw.



Thank you!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum



Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP