Hi.
I'm using SoftShadowMap scene and I want to assign custom shader to one of the nodes, but it doesn't work.
I do it like that:
osg::ref_ptr<osg::Shader> frag = new osg::Shader(osg::Shader::FRAGMENT, code);
osg::StateSet *ss = box->getOrCreateStateSet();
osg::ShaderAttribute *sa = new osg::ShaderAttribute;
sa->setType(osg::StateAttribute::FRAGMENTPROGRAM);
ss->setAttribute(sa);
sa->addShader(frag.get());
As seen from the code, I tried to enable shader composition, but that didn't help me.
Am I doing it wrong?