[osg-users] [osgCompute] osgCompute - binding ColorArray failed

Jens Orthmann jens.svt at googlemail.com
Mon Nov 30 13:52:23 PST 2009


Hi arielh,

For this purpose you cannot make use of osgCuda::Arrays because buffers of this type are read-only. In order to add a color entry for each vertex you have to expand your osgCuda::Geometry object by an additional color array of type osg::Vec4Array=> myGeometry->setColorArray( new osg::Vec4Array ). The vertex buffer object of this geometry is then extended by the respective color data. During your computation you need to know this offset to address the color data (In your case this should be something like "sizeof(Vec4f) * numVertices").   


I hope this information will help you. 

Cheers,
Jens

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







More information about the osg-users mailing list