Ah well, i’ve got many problems with pixel shaders on my Radeon 8500. I’ve read the spec many, many times and i believed i mastered it, but my application doesn’t work. I did many tests, and found a simple (at least, i thought it was simple) shader, that doesn’t output the expected result. I have the latest beta drivers (but i get the same problem with the official drivers).
Here’s basically the problem.
I have a sky cube map bound in texture 0. The texture coordinates are a reflection vector into that cube map. This works fine (eg. i see the sky reflected onto my surface) when i’m not using a pixel shader.
Now i use that simple shader:
glPassTexCoordATI(GL_REG_1_ATI, GL_TEXTURE0_ARB, GL_SWIZZLE_STR_ATI)
glColorFragmentOp1ATI(GL_MOV_ATI, GL_REG_1_ATI, GL_NONE, GL_NONE, GL_CON_0_ATI, GL_NONE, GL_NONE)
glSampleMapATI(GL_REG_0_ATI, GL_REG_1_ATI, GL_SWIZZLE_STR_ATI)
I have the vector (0.5, 0.5, 0.5, 0) inside the constant 0.
I’m expecting that shader to replace the reflection vector by the constant vector, hence to have my surface of a uniform color (since the sampled texels will all have the same coordinates into the cube map). What really happens is like if the MOV instruction was completely ignored. I see normal reflections everywhere. But the pixel shader is well executed, since if i do other stupid operations, the surface appearance changes…
This simple shader is not doing anything interesting in itself, but i’d like to know why it doesn’t output the results i was expecting… what am i doing wrong ? Is there something i didn’t understand ?
Y.
[This message has been edited by Ysaneya (edited 06-16-2002).]