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); }