Hi Sebastian,

I set the vertex attribute array this way: 

Code:

geometry->setVertexAttribArray(s_attributeIndex, m_vertexAttributes.get());
geometry->setVertexAttribBinding(s_attributeIndex, 
osg::Geometry::BIND_PER_VERTEX);
geometry->setVertexAttribNormalize(s_attributeIndex, GL_FALSE);




and then set up VBO

Code:

geometry->setUseVertexBufferObjects(true);




binding attribute

Code:
program->addBindAttribLocation("vxOSG_HeightFieldParams", 
VxOSG::VxHeightFieldDisplayNode::s_attributeIndex);



and in the update 

Code:

// set dirty on arrays for VBO update
vertices->dirty();
normals->dirty();
geometry->dirtyBound();



 
also I update custom attributes like this

Code:
(*m_vertexAttributes)[index][inEntryID] = inEntryValue;


s_attributeIndex = 15
maybe I am missing something?

I've tried to use tex coord array 2 and it seems to be working. But I would 
like to understand why custom vertex attribute is not working with vbo. 

I have a feeling that I need to set custom attribute array to dirty somehow.

Thank you! 
Janna

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





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

Reply via email to