Martin Beckett wrote:
Jason Daly wrote:
If you're familiar with OpenGL, osg::DrawArrays is equivalent to glDrawArrays(), osg::DrawElements is equivalent to glDrawElements(). The first uses the vertex arrays directly, the second uses an index array to select vertices from the vertex arrays.

Thank you.
I had it in my mind that glDrawElements() was very slow compared to ranges, and 
it was recommended that a large geode was broken down into a number of 
osg::DrawArrays

DrawElements is fine. What you don't want to do is use indexed vertex attributes (for example, osg::Geometry::setVertexIndices() ). That will force OSG to use glBegin/glEnd, which is never a good idea these days.

The advice about breaking up large geodes is still applicable. If you're talking about hundreds of thousands of vertices, it's probably best to represent those as multiple geodes (and group them spatially, if possible).


What about using 'out of order' osg::DrawElements to group points by location rather than in the vertex order, for easy point picking - is that a good idea?

I don't think that will matter too much as far as performance is concerned, so it's probably a good idea if it makes your app more usable.


Yes (but still better than using glBegin/glEnd ;-)

Indeed  :-)


I will just be editing the points interactively so compared to the speed of the 
intersector this shouldn't be a problem.

I'd still disable them. If you're using VBOs and DrawElements effectively, they probably won't help that much, and you'll have to recompile the display list each time you make a change, which might cause frame rate hiccups.

--"J"

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to