Hi Peter,

On 21/10/10 12:05 , Peter Wrobrl wrote:
> So first I generate a StateSet for my Group Node and just add a sampler 2D 
> Uniform, so
> that the original fileTexture ( should be ) is available in my Shader :
> stateSet -> addUniform( new osg::Uniform( osg::Uniform::SAMPLER_2D , 
> "stTexture" , 1 ) ) ;
> 
> Then I add the projectionTexture to my StateSet into Texture Unit 1 and add 
> the corresponding Uniform :
>       stateSet -> setTextureAttributeAndModes( 1 , projTexture , 
> osg::StateAttribute::ON ) ;
>       stateSet -> addUniform( new osg::Uniform( osg::Uniform::SAMPLER_2D , 
> "projectionTexture" , 1 ) ) ;

I'm not sure if I completely follow you, but shouldn't 'stTexture' be set to 0, 
to use the
texture from the .osg file?

With the above code both 'stTexture' and 'projectionTexture' use the same 
texture,
although with different texture coordinates.

HTH,
/ulrich
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to