[osg-users] [osgCompute] osgCompute - binding ColorArray failed
jens.svt at googlemail.com
Mon Nov 30 13:52:23 PST 2009
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.
Read this topic online here:
More information about the osg-users