Hi Robert, as I understand it, this feature enables one to put unconnected strips in a single primitive, while degenerated triangles may add a line between the end of a strip and the next.
Regards, -Fred ----- Mail original ----- De: "Robert Osfield" <[email protected]> À: "OpenSceneGraph Users" <[email protected]> Envoyé: Mardi 3 Avril 2012 15:34:02 Objet: Re: [osg-users] Primitive Restart Hi Felix, Is there any reason why you can't just connect the tri strips together using a repeated indices to create a degenerate triangle that connects two strips together. This way you can put multiple tri strips into a single DrawElementUShort and avoid the heavy cost of lots of separate OpenGL calls. Using this approach just requires some post processing of the osg::Geometry rather than changes to the core OSG. The combining of tri strips this way will also perform better and use less memory. Robert. On 2 April 2012 00:25, Felix Nawothnig <[email protected]> wrote: > Hey. > > Now comes a non-trivial one... :-) > > A while ago I added support for primitive restart to our internal > build to stitch triangle strips - this greatly improved performance > and VRAM usage for our very heavy CAD data. As primitive restart was > included in GL core a while a ago I suppose this feature has a chance > to be included in OSG. > > I havn't prepared a patch yet (mostly because I don't want to waste > the time in case this isn't going to be integrated anyway), so I'll > just outline what I did: > > - osg::DrawElements and friends got two new attributes, > PrimitiveRestart (bool) and PrimitiveRestartIndex (unsigned integer) > - osg::State was extended to allow setting the respective GL attributes > - The osg::PrimitiveFunctor and osg::PrimitiveIndexFunctor interfaces > were extended by a primitiveRestart() and setPrimitiveRestart(bool, > unsigned int) method > - osg::TriangleIndexFunctor was extended to implement the new functionality > > ... and all other PrimitiveFunctor / PrimitiveIndexFunctor > implementations everywhere were extended to support primitive restart. > > (I also have a visitor stitching strips which are contained in > seperate primitive sets but I did that outside of OSG ... if PS > support is included I suspect it might be useful to have a visitor to > do this in osgUtil somewhere too) > > So... should I prepare a patch? > > Cheers, > > Felix > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

