[osg-users] [osgCompute] Binding ColorArray

Ariel Hutterer ahuttere at gmail.com
Sun Nov 29 06:25:55 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???


Cheers,
Ariel

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







More information about the osg-users mailing list