Hi,

I use a "hand-made" geometry class, derived from "osg::Geometry" (osg 3.0.1, 
Win 7 64bits)

My geometry is filled with vertices and indices, and configured as follow :


Code:
p_myGeometry->setUseDisplayList(false);
p_myGeometry->setUseVertexBufferObjects(true);
p_myGeometry->setDataVariance(osg::Object::STATIC);
p_myGeometry->setVertexArray(p_myVertices);
p_myGeometry->addPrimitiveSet(p_myPrimitiveEBO);
p_myGeometry->setComputeBoundingBoxCallback(new SeaBoundingBoxCallBack());




There are 3 methods re-implemented :


Code:
void MyGeometry::compileGLObjects(osg::RenderInfo& renderInfo) const
{
        // Do special stuff allocation on Cuda / OpenCl... and bind to openGL 
objects

        osg::Geometry::compileGLObjects(renderInfo);
}
//
void MyGeometry::drawImplementation(osg::RenderInfo& renderInfo) const
{
        // Retrieve data from Cuda / OpenCL special stuff allocated in 
"compileGLObjects"

        osg::Geometry::drawImplementation(renderInfo);
}
//
voidMyGeometry::releaseGLObjects(osg::State* pState) const
{
        // Do special stuff release

        osg::Geometry::releaseGLObjects(pState);
}




Everything works fine if I create the Scene Graph, then setup a viewer and 
display the scene graph.

But if I create a scene graph without this "MyGeometry" object, setup the 
viewer, display the scene graph, and THEN insert a new "MyGeometry", neither 
"compileGLObjects" or "releaseGLObjects" are called...

Is there any reason ?

I saw in "compileGLObjects" documentation :


> Note:
> Operation is ignored if _useDisplayList is false or VertexBufferObjects are 
> not used.
> 


but I use :


Code:
p_myGeometry->setUseVertexBufferObjects(true);
p_myGeometry->setVertexArray(p_myVertices);




Thank you!

Cheers,
Aurelien

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=45453#45453





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

Reply via email to