Original Post
Hi there, I'm having troubles with my shader. I took the code from the Point light per pixel lighting tutorial (lighthouse3d : http://www.lighthouse3d.com/opengl/glsl/index.php?pointlight), and I added a few simple things. I added 1 uniform and 2 varyings in each program. -> Here no problem yet. Then I added a simple line of code (float v = 0.5 * (1.0 + dot(normalize(vViewVec), vNormal));), these are the 2 varyings and v is not used in the program after this line. -> And here the problems begin : - on my nvidia 7800GT card (with lastest drivers 93.71, anyway I don't think it would change anything) : it doesn't compile : error C5041: cannot locate suitable resource to bind parameter "dist" - if I change the order of the varyings declaration, the "dist" is another variable name ! - on my ati 9600 pro card : it does compile but it does change the color of everything ! That's really weird since the 'v' variable is not used at all ... Here are screenshots without and with the problematic code line : http://reverse-thegame.com/system/files/images/shader-ok.png http://reverse-thegame.com/system/files/images/shader-bug.png And finaly here is the code : - vertex program : http://rafb.net/p/IJk7qX84.html - fragment program : http://rafb.net/p/rD8if871.html If you want to test you just need to create the corresponding resources for the uniforms : a vec4 named view_position and a 2D texture named Tex. I'm really stuck with this. Do you think I have too many varyings ? I don't think so. But anyway on 2 different cards it's causing problems :/ Thank you for your help !