Hi Peter, try
stateSet -> addUniform( new osg::Uniform( "stTexture" , 0 ) ) ; instead; Regards, -Fred ----- "Peter Wrobrl" <[email protected]> a écrit : > Hi, > > yes, it should use texture 0, but how do I specify this ? The 1 in > this code line : > stateSet -> addUniform( new osg::Uniform( osg::Uniform::SAMPLER_2D , > "stTexture" , 1 ) ) ; > > does not choos a texture, but sets the number of elemets in the > uniform ( one sampler2D ). > > The texture unit association happens ( to my understanding ) with this > : > stateSet -> setTextureAttributeAndModes( 1 , projectionTexture , > osg::StateAttribute::ON ) ; > > But I can't do this for texture 0 ( stTexture ) as it is defined > inside the .osg file. > > So basically the question is, how to assotiate a sampler2D uniform > with a certain texture Unit ( from an .osg file ) ? > > > > Thank you! > > Cheers, > Peter > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=32941#32941 > > > > > > _______________________________________________ > 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

