osg fbx模型中任何一个节点染色(着色)
void setNodeStateset(osg::Node *nodeParam) { osg::ref_ptr<osg::StateSet> stateset1 = nodeParam->getOrCreateStateSet(); osg::ref_ptr<osg::Program> program1 = new osg::Program; program1->addShader(new osg::Shader(osg::Shader::VERTEX, vertShader)); program1->addShader(new osg::Shader(osg::Shader::FRAGMENT, fragShader)); stateset1->setAttributeAndModes(program1, osg::StateAttribute::ON); }
QQ 3087438119