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

Thrall, Bryan bryan.thrall at flightsafety.com
Wed Nov 18 15:47:06 PST 2009


Andrew Cunningham wrote on Wednesday, November 18, 2009 4:51 PM:

> OK, I think I have resolved the mystery. The VBO was being stalled by
a
> setNormalBinding(osg::Geometry::BIND_PER_PRIMITIVE); 
> 
> If I remove that, and compare FPS,  then the VBO performance is
slightly
> better than the displaylist version 
> 
> Why do I use setNormalBinding(osg::Geometry::BIND_PER_PRIMITIVE);
Because by
> definition, finite element geometry is a discretized geometry, so you
want
> each element to have one normal. You don't want to smooth the surface.

> 
>  If anyone has a way to do that without using BIND_PER_PRIMITIVE ..
let me
> know! 

BIND_PER_PRIMITIVE forces OSG into slow paths, so I don't think it was
using the VBO in that case (even if it did still allocate them). To take
advantage of VBOs, you need one of the other bindings. Using per-vertex
indexed arrays also force you into slow paths; see
osg::Geometry::arFastPathsUsed().

So, the obvious way is to duplicate the per-primitive normals over all
the vertices in that primitive, but that will increase your memory usage
significantly. There was a thread on this recently; you could search the
archives, I think they talked about ways of compressing normals into
vertex attributes to minimize the extra memory overhead.

HTH,
-- 
Bryan Thrall
FlightSafety International
bryan.thrall at flightsafety.com


More information about the osg-users mailing list