HI Paul, I don't know enough about what you are doing to guess what is amiss with the Uniform set up. The only thing I can suggest is if you are overriding other Uniforms then append a osg::StateAttribute::OVERRIDE parameter to the addUniform to allow it override the settings below it in the scene graph.
As for texture units used, this will vary between the various ShadowTechnique. There are settings in headers of the techniques, or placed centrally in the ShadowSettings object to allow you set the base texture unit. Also have a look at the implementations. Robert. On 18 December 2013 00:35, Paul Cooper <[email protected]> wrote: > > I'm currently working on using custom shaders for osgShadow. Just would > like to know how to set uniforms i.e if I need to do something like this: > > osg::ref_ptr<osg::StateSet> stateset = shadowed->getOrCreateStateSet(); > stateset->setTextureAttributeAndModes(4, textureNormal); > stateset->addUniform(new osg::Uniform("NormalMap", 4)); > > > I've tried setting that on the shadowed node and passing in a uniform to > the shadowMap with _uniformList.push_back(new osg::Uniform("NormalTexture", > 4)); > but no luck... > > Also which texture units are reserved in osgShadow for shadowing? > > Regards > Paul > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > >
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

