Thank you Robert, you were right, I used the wrong gl_TexCoord[..] in
the shader! An additional question, I tried to set the gl_TexCoord[ ]
with an given uniform int, namely the texture unit, so that you should
not do it by hand in the shader. It looks like this gl_TexCoord[texID],
but if I do this I get an error when compiling the shader: array must be
redeclared with a size before being indexed with a variable. So my
question, why can't I do this?
Robert Osfield schrieb:
Hi Marcus,
The OSG just passes things through to OpenGL, so OpenGL docs on
texture units will help you.
In the case of ShadowMap it could simply be that the shader isn't
picking up on the new texture unit.
Robert.
On 6/28/07, Marcus Fritzen <[EMAIL PROTECTED]> wrote:
Hello,
yeah, because I am still quiet a newbie, I have a question about texture
units. How is this handled in osg? I know that I can set it over
getOrCreateStateSet()->setTextureAttributeAndModes( texture unit, ... ),
but what is it doing? I searched a little bit in the stateset class, but
I couldn't found an answer. If I set the texture unit e.g. to 2, what
means this? Means it that my texture is corresponding to the ID = 2 and
can I set it to 2 if I have no texture at ID = 1? Another question, what
is the corresponding to glGenTextures(...)?
I ask this because I played a little bit with the osgShadowMap. The
problem is, when I create a shadowMap and set its texture unit to 2, the
shadows were gone and I don't know why. If I set it to 0, it uses no
base texture, this sounds logical to me.
I know, that are many questions, but perhaps someone kann push me in the
right direction ;)
Marcus
--
----------------------------------------------------------------
Marcus Fritzen E-mail: [EMAIL PROTECTED]
University Koblenz
Triererstr. 105, 56072 Koblenz,
HIWI FB4 Herr Jackel
----------------------------------------------------------------
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
--
----------------------------------------------------------------
Marcus Fritzen E-mail: [EMAIL PROTECTED]
University Koblenz Mobil: +491786867360
Triererstr. 105, 56072 Koblenz,
HIWI FB4 Herr Jackel
----------------------------------------------------------------
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/