In OpenGL Shading Language, you cannot write to a varying variable in the fragment shader. You may write to a varying variable in the vertex shader, and it will be interpolated and the interpolated value passed to the fragment shader.
It is also in the OpenGL Shading Language specification that you must use a decimal when assigning a value to a float. For example, “1” is an integer, while “1.0” is a float. If cross platform shaders is your goal, ATI’s compiler is much more strict and will give you a more portable shader. From what I see, you don’t have a Radeon problem, but a GeForce problem as it is accepting ill-formed out of spec code.
If you wish to continue with an nVIDIA card and compiler, you may want to double check your code with GLSL Validate , this is a simple parser that verifies shader code is to spec and therefore more likely to be able to be compiled on different video cards.
You can also use nvemulate to enable strict shader portability warning. This way, I found some non-portable statements in my shaders. You can also let the driver save the shader info logs, the combined shader source and the generated low level ARB_vp/vp shader into textfiles.
GLSL Validate checks your shader syntax, it is not a debugger. It takes very little time to use, as it is quite simple. Even if you use nvemulate with the strict flag, it still is a good idea to run the shader through GLSL Validate as the warning messages are often lacking information.
I’ve got a new problem with Radeons. The code works properly now, but the performance is terrible. On my Geforce 6600 I get like 150fps. On a Radeon x800 I get like 20. Clearly there is an issue. I’m not even sure where to start looking for that problem.