[osg-users] I created 10000 cylinder, osg run very slow

Sebastian Messerschmidt sebastian.messerschmidt at gmx.de
Wed Jul 22 04:59:26 PDT 2015


Hi Nick,

The implementation is almost to complicated. Using instancing with 
osg::Image and a texture almost beats all other implementations I've 
tested so far in terms of complexity and performance.
Maybe we should some more examples for this to osg.
Cheers
Sebastian

> Hi Luo,
>
> have a look at this paper - it is OSG related with GL calls (In the 
> latest OSG release there are OSG wrappers for most of them). It will 
> help you with large number of instancing and controlling each instance 
> separately
>
> http://3dcgtutorials.blogspot.com/2013/09/instancing-with-openscenegraph-part-ii.html
>
> Hope it helps
> Nick
>
> On Wed, Jul 22, 2015 at 9:25 AM, Sebastian Messerschmidt 
> <sebastian.messerschmidt at gmx.de 
> <mailto:sebastian.messerschmidt at gmx.de>> wrote:
>
>     Hi,
>
>         Hi,
>
>         I need to use cylinder to simulate the “ladder”.  So there are
>         many cylinder to create. I new a osg::Geode , and then use it
>         to new 10000 osg::MatrixTransform, all these
>         osg::MatrixTransform were added to one group.
>
>         But the program runs very very slow.
>
>     Are you testing in debug mode?
>
>         In fact I create the same scene using opengl, the program runs
>         quickly.
>
>     Are you using the osg::Shapedrawable for the cylinder shape? Try
>     to replace it with a simple triangle for testing to see if the
>     geometry or the transforms are your bottleneck.
>
>     I'd use hw-instancing for this amount of copies of a simple
>     geometry or bake the transformations into big geometries
>     representing hundreds of cylinders each.
>
>     Also if the 10000 elements are spatially separable and thus not
>     all of them in the view at the same time you should use some
>     grouping to balance your scenegraph. Simply putting 10000
>     transforms into one group most likely will kill performance, as
>     all children will have to be traversed each frame.
>
>
>
>         How can I upgrade my program?
>         thanks.
>
>     Can you provide a more detailed description or an example? Your
>     question is too open to get you specific answers.
>
>
>         Thank you!
>
>         Cheers,
>         LUO
>
>         ------------------
>         Read this topic online here:
>         http://forum.openscenegraph.org/viewtopic.php?p=64386#64386
>
>
>
>
>         Attachments:
>         http://forum.openscenegraph.org//files/mfc_osg_124.cpp
>
>
>         _______________________________________________
>         osg-users mailing list
>         osg-users at lists.openscenegraph.org
>         <mailto:osg-users at lists.openscenegraph.org>
>         http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
>     _______________________________________________
>     osg-users mailing list
>     osg-users at lists.openscenegraph.org
>     <mailto:osg-users at lists.openscenegraph.org>
>     http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
>
>
> -- 
> trajce nikolov nick
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20150722/29e314a3/attachment-0003.htm>


More information about the osg-users mailing list