HI Gianni,
On 23 July 2014 16:25, Gianni Ambrosio <[email protected]> wrote: > Hi Robert, > just because I had in mind a thread in this forum where it seems, on the > contrary, that was NOT recommended for GL efficiency. What isn't recommend is using the deprecated osg::Geometry::setVertex/Color/Normal/etc./Indices(..) functionality, sharing vertices via vertex indices isn't supported by OpenGL and has to be simulated by caching vertex data on the CPU and then send this as a buffer. In OSG-3.2 these methods are deprecated and will be removed completely from OSG-3.4 onwards. > Do you mean something like the code inside "createBackground()" of > osggeometry.cpp example? > > polyGeom->setVertexArray(new osg::Vec3Array(numCoords,myCoords)); > ... > polyGeom->addPrimitiveSet(new > osg::DrawElementsUShort(osg::PrimitiveSet::TRIANGLE_STRIP,numIndices,myIndices)); > Using DrawElementsUShort is the correct way to provide indices and is fully supported by OpenGL and is the recommend way to provide primitive data where vertices can be shared. Robert.
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

