This is not my actual shaders,but a simple example demonstrating the problem(or should I say driver bug?)
The objects should all be colored red,right?Wrong!The colors are completely incorrect,and they even change when I rotate or move the camera.Now,if I comment out the line that accesses the lightsource position,all is fine.Bottom line,if lightsource parameters are present in the code,the varying varables mapping is somehow affected,and the results are incorrect.I downloaded the latest NVidia drivers(61.77),but it didn’t help.So,what’s the deal here?
Sounds like a bug to me. Tried even newer drivers?
I just saw that there’s a 65.90 listed on NVIDIA’s download site if you select Quadro as graphics board.
Googling found even newer ones on Guru3D http://downloads.guru3d.com
I just installed 66.00 from Guru3D,and I still get the same problem.I have completely stopped writing my engine code for about a week,because of this stupid bug.
I can confirm this bug under Linux drivers as well (GeForce FX5600 with 61.11).
I think the compiler for GLSL is still in a beta state, sometimes it talks about warnings which are never shown and I remember having similar problems while coding (code that will never get used influencing the output).
@yooyo: Getting the assembler output from cgc would be nice, do you happen to know how to enable this for the Linux driver?
maybe i am wrong, but i think that “col” variable declared in vertex prog is not linked to “col” declared in fragment program. so, in the frag prog variable “col” is undefined. maybe you should try using “gl_Color” instead, both is vert and frag progs?