Hi.
I have a version 3.0 vertex shader for (what I call) Static Imposters that essentially decides which image in a texture atlas should be used and sends that info to the pixel shader.
I am confident that the shader is written correctly but it always displays the wrong image! If I run the shader through a debugger, the numbers are all correct, but the wrong image displays. I have isolated this to a single variable, whose value is assigned from the program with Effect.Parameters["ImagesPerView"].SetValue(ImagesPerView);
Running the shader through the Pix debugger, the value of ImagesPerView is always set correctly to 12, but the program displays the image as if the value of ImagesPerView is set to 11. If I hardcode the value of ImagesPerView in the vertex shader to 12, overriding the program assignment, the program displays the correct image! WHY am I getting different results even though the value of ImagesPerView is always 12?
The program is assigning the value of 12 to ImagesPerView on every draw call. I don't think this is due to any sort of implicit conversions as I have checked the code thoroughly, and even did an (int)ImagesPerView conversion on every operation to make sure. All of the other variable assignments in the shader appear to be correct and functioning correctly. Stared at it until I was crosseyed.....What The Heck am I doing wrong?
Any ideas welcome.
THANKS