Hi, I created this simple vertex shader:
uniform vec3 xyz = vec3(0.0, 0.0, 0.0);
void main() {
vec3 normal, lightDir;
vec4 diffuse;
float NdotL;
normal = normalize(gl_NormalMatrix * gl_Normal * xyz);
lightDir = normalize(vec3(gl_LightSource[0].position));
NdotL = max(dot(normal, lightDir), 0.0);
diffuse = gl_FrontMaterial.diffuse * gl_LightSource[0].diffuse;
gl_FrontColor = NdotL * diffuse;
gl_Position = ftransform();
}
The only problem is that when I try compiling the shader object, it complains, giving a log message:
[quote]ERROR: 0:1: ‘uniform’ : cannot initialize this type of qualifier
[/quote]
However, in the glsl spec, they have examples where uniforms are initialized. Am I doing something wrong or could this be a bug in the drivers? My card is a Nvidia 8600MT in a macbook pro. I will check it on a desktop soon, just to test that theory.
Thanks