[osg-users] Huge perfomance issues

Werner Modenbach Werner.Modenbach at modenbach-ac.de
Fri May 31 08:12:23 PDT 2019


Hi Achilleas,

your explanations look to me like "I want to repaint my living room. So I destroy my house and ..."
My suggestion:
For each kind of geometry create it as geode and add it to a switch node. So you can switch them on and off as needed.
For alterations keep pointers to the geodes and alter the geometries. I.e. assign new coordinate arrays etc. .
Also there is no need to do it within a frame.

Regards

- Werner -


Am 30.05.2019 um 12:53 schrieb Achilleas Margaritis:
> Hi,
>
> I am developing a data visualization application with Qt + OSG, but I have huge performance problems.
>
> These problems are not due to OSG itself but rather due to how I use OSG (I just started using OSG/OpenGL for the first time).
>
> The application accepts a lot of data as messages over the network, and draws polygons and lines according to the received data.
>
> In order to make drawing easy, I have developed a class which has many drawing functions: DrawPolygon, DrawPolygonLine, DrawLine, DrawRectangle. DrawCircle, DrawCube, etc.
>
> In every of these functions, I do the following:
>
> 1) create a Geode.
> 2) create a Geometry and attach it to the Geode created above.
> 3) create a material with the appropriate colors for the drawing, attached to the Geode created above.
> 4) create a state set for the drawing properties, attached to the Geode created above.
>
> At each frame, I delete all the objects created, and then use the API I described above (i.e. DrawPolygon, DrawPolygonLine etc) to recreate the drawings with the newly received data.
>
> The frame rate is abysmal though. After the creation of a few tens of polygons and lines (around 100), the frame rate drops extremely low and the UI becomes totally unresponsive.
>
> The code I have created is largely copied from the OSG examples I have found online, mostly from the osggeometry.cpp example.
>
> My question is what am I doing wrong?
>
> Is the multiple statesets created the problem? Each Drawing function creates a new stateset, a new vertex array, a new primitives array, a new geode etc.
>
> Thank you!
>
> Cheers,
> Achilleas
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=76154#76154
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


More information about the osg-users mailing list