Hello all,

I'm currently seeing a really weird problem with a shader on a Radeon
HD 4350 card (both with drivers dating from July and with the most recent drivers dating 9/9/2009). The shader is rather convoluted, but the problem seems centered around code similar to this:

  float light = 1.0
  if (shadows_enabled)
    light = shadow2DProj(shadowTexture, gl_TexCoord[1]).r;

shadows_enabled is a uniform bool, and shadowTexture is a
sampler2DShadow. Now, I know for a fact that at the root of my graph,
shadow_enabled is set to false, and it is not changed anywhere in the
graph. And I can also verify that the if is never entered by rendering everything white and changing it to black in the if. Nothing is rendered black. So the if is never entered.

Nevertheless, here's the problem: if I keep the shadow2DProj line, objects seem to get textured with the wrong texture and be semi-transparent. It's really weird. I get no compile errors for the shader. If I comment out the shadow2DProj line and replace it by a dummy line like "light = 0.0;", then all is well and the rendering is what I'd expect.

I would expect results like that if the shadow2DProj line was being
executed with a bad texture (perhaps because the shadow map texture was
undefined) but the line isn't being executed...

The other weird thing is that removing the other texture lookup I have in the shader ("vec4 textureColor = texture2D(...);") but keeping the shadow2DProj line also works. So it seems that removing one or the other of these texture lookups works, but keeping them both (even if both are not executed) gives visual artifacts.

Why would commenting a line that doesn't even get executed change the
output of a shader? Is there a limit of number of texture lookups per shader, or something like that, on these cards?

We actually don't have any other ATI cards in the office (this machine was built as a test to see if it would be viable) so I can't test on other cards to see if it's just the 4350 that has a problem with this shader.

Can anyone suggest what might be wrong? I'm really clutching at straws
here trying to figure out what the problem is, and I don't have a clue.

Thanks in advance,

J-S
--
______________________________________________________
Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/


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

Reply via email to