Re: [osg-users] Multitexture Issue in GLSL Fragment Shader

2010-10-21 Thread Peter Wrobrl
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

Re: [osg-users] Multitexture Issue in GLSL Fragment Shader

2010-10-21 Thread Frederic Bouvier
Hi Peter, try stateSet - addUniform( new osg::Uniform( stTexture , 0 ) ) ; instead; Regards, -Fred - Peter Wrobrl particlepe...@gmx.de 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(

Re: [osg-users] Multitexture Issue in GLSL Fragment Shader

2010-10-21 Thread Peter Wrobrl
Figured it out finally. Need to use : stateSet - addUniform( new osg::Uniform( stTexture , 0 ) ) ; stateSet - setTextureAttributeAndModes( 1 , projTexture , osg::StateAttribute::ON ) ; stateSet - addUniform( new osg::Uniform( projectionTexture , 1 ) ) ; Instead of : stateSet - addUniform( new

Re: [osg-users] Multitexture Issue in GLSL Fragment Shader

2010-10-21 Thread Peter Wrobrl
Hi, that was classic, thx Fredric :-) Thank you! Cheers, searching for the Pivot of my Soul, PP !!! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=32945#32945 ___ osg-users mailing list

[osg-users] Multitexture Issue in GLSL Fragment Shader

2010-10-20 Thread Peter Wrobrl
Hi, Am following osgstereomatch example, but can't find my mistake. Trying to use two Textures in a Fragment Shader, with one set of geometry texCoordArray and one with Screen Projected Coordinates. I include an .osg file in my programm which has properly textured geometry. The .osg file has

Re: [osg-users] Multitexture Issue in GLSL Fragment Shader

2010-10-20 Thread Ulrich Hertlein
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