[osg-users] osgCompute - binding ColorArray failed

Ariel Hutterer ahuttere at gmail.com
Mon Nov 30 01:44:37 PST 2009


Hi:
I try to expand the ptclParticleDemo.I want to add a color array and change
the color in cuda program.
I try to "bind" the colorArray but i not sure hown to:

osg::Vec4Array *colors = new osg::Vec4Array(numParticles);
ptclGeom->setColorArray(colors);
ptclGeom->setColorBinding(osg::Geometry::BIND_PER_VERTEX);

osg::ref_ptr<osgCuda::Array> colorArray = new osgCuda::Array;
colorArray->setArray(colors);
colorArray->setName("colors");
srcArray->setElementSize(sizeof(osg::Vec4f));
srcArray->setDimension(0,numParticles);
srcArray->addHandle("PTCL_COLOR_BUFFER");
computation->addResource( *srcArray);

But not work properly.
Some One can help me???
Thanks
Ariel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20091130/5db165ac/attachment.htm>


More information about the osg-users mailing list