Hi, I was trying to use gl_SecondaryColor to pass in a vertex position offset. However, I noticed strange behavior. Does anyone know if gl_SecondaryColor gets clamped to some value? I am now trying to pass in my own attribute, but my program is crashing. Below is a snippet of what I'm doing. Any help would be greatly appreciated.
//Called once at initialization. Geometry->setVertexAttribBinding(6, osg::Geometry::BIND_PER_VERTEX); Geometry->setVertexAttribArray(6, new osg::Vec4Array); Geometry->addPrimitiveSet(new osg::DrawArrays(GL_QUADS, 0, 0)); //Called for each quad at initialization. osg::ref_ptr<osg::Vec4Array> centerPoint = dynamic_cast<osg::Vec4Array*>(Geometry->getVertexAttribArray(6)); centerPoint->push_back(center); centerPoint->push_back(center); centerPoint->push_back(center); centerPoint->push_back(center); //Called after vertex shader is attached to the program. program->addBindAttribLocation("centerPoint", 6); The same organization works with vertices, normals, and texture coordinates. Thanks, Mike
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org