Hello Simon,

Calling the "setVertexArray" every frame, however, brings the frame rate down 
dramatically, which isn't very acceptable.
Is there a way to change vertices' positions in real time more effectively?

This is an FAQ. Searching the list archives would have turned up many threads where this same question was asked.

The OSG by default assumes that your vertex array is static, and generates display lists for your Drawables. If you update vertex data each frame, without disabling display lists on that Drawable, then OSG still thinks that your geometry is static and regenerates the display list every time you modify the vertex data. This is what is slowing you down.

Effectively, OSG is generating display lists which are being used for only one frame and then discarded. Display lists are efficient only when they can be used for many frames, to offset the time required to generate them.

Just call geometry->setUseDisplayList(false) when you create the geometry and you should be fine. Optionally you can enable Vertex Buffer Objects using geometry->setUseVertexBufferObjects(true). Search the list or OpenGL documentation to know when this is appropriate.

Hope this helps,

J-S
--
______________________________________________________
Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to