[osg-users] [Performance] Update dynamic vertices in drawable by external incoming data

OpenSceneGraph Users osg-users at lists.openscenegraph.org
Wed Feb 19 05:34:05 PST 2020

HI Yuan,

There a number of ways to go about this type of task, which route to take 
will depend on your needs/hardware available.

In principle pass 400-800 points each frame is not a large and should work 
easily at 60fps without any issues.  One most efficient way to do this is 
to create an array which is large enough for the maximum number of points 
you'll need and allocate this at the start, then just fill in the parts of 
the array that you need, and set the DrawArrays to just reference the 
portion you need.  For instance you could allocate an osg::Vec3Array of 
1000 vertices at setup, then never resize it.  Each time you update the 
data you'll need to call array->dirty() to force the VBO to be updated.

Also when doing bechmarking mark sure you are using a release build of the 
OSG and your application as this can make a huge difference.


You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osg-users+unsubscribe at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osg-users/2fbde036-08a2-4866-b352-9666eff515f6%40googlegroups.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20200219/a056a8fa/attachment.html>

More information about the osg-users mailing list