[osg-users] Best ways to render "FE" models with millions of tris and quads

Robert Osfield robert.osfield at gmail.com
Tue Nov 17 09:18:26 PST 2009


Hi Andrew,

On Tue, Nov 17, 2009 at 3:44 PM, Andrew Cunningham <osg at a-cunningham.com> wrote:
> Hi Robert et al,
>
> As usual, some great and helpful replies!
>
> - The geometry consists of probably 20 or so geonodes, so is probably reasonably well subdivided , but not too much...
>
> - What the bleep is a VBO and how do I use it. Seriously,  I am an OpenGL 1.2 guy so do not have lot of experience with more advanced OGL APIs. Is this something you can just turn on in OSG? Better RTFM!

Read up on the net for info on VBO's (VertexBufferObjects), it's
basically the modern replacement for display lists.

To use:

   geometry->setUseVertexBufferObjects(true);


> - I need to pick the elements. That is be able to click on an individual "Tri" or "Quad" and get back to the model data. This works just fine right now using primitiveindex  returned from the picking and a lookup table, but as I said any optimization or flattening hidden to me makes that impossible.
>
> - When you say just using a single block of  DrawElementUint(GL_TRIANGLES), that is basically what I am doing as much as possible. When picking I can go back to the original "model" object by knowing what "Triangle" I picked - but optimization will still blow that link away.

What do you mean when you say "optimization".  If you build your
geometry up in an efficient manner to start with it'll already be
pretty optimal, and while tristrips will be more slightly more
efficient than using individual triangles, as long as you index
primitives i.e. DrawElementsUInt(GL_TRIANGLES) then you should get
pretty good performance, and be able to take advantage of the vertex
cache on the GPU as long as you keep cluster of triangles so that
there common indices are clusted near by in the DrawElementUInt array.

Robert.


More information about the osg-users mailing list