• Create Account

### #Actualmhagain

Posted 21 January 2013 - 04:03 PM

normal0 = world * vec4(normal,0.0f);

normal0 is defined as a vec3, yet the output of a mat4 * vec4 calculation will be a vec4, so you've got a vector type truncation. Your shader compile should at least have given you warnings about that, so I'd suspect that you're not checking the result of your compilation fully (or at all) using glGetShaderInfoLog and glGetProgramInfoLog.

Regarding truncations, the GLSL spec says:

there must be enough components provided in the arguments to provide an initializer for every component in the constructed value. It is an error to provide extra arguments beyond this last used argument

And

Accessing components beyond those declared for the vector type is an error

So in this case the NV compiler is strictly adhering to spec, whereas the AMD compiler is being lax and allowing things it shouldn't.

### #1mhagain

Posted 21 January 2013 - 04:02 PM

normal0 = world * vec4(normal,0.0f);

normal0 is defined as a vec3, yet the output of a mat4 * vec4 calculation will be a vec4, so you've got a vector type truncation.  Your shader compile should at least have given you warnings about that, so I'd suspect that you're not checking the result of your compilation fully (or at all) using glGetShaderInfoLog and glGetProgramInfoLog.

Regarding truncations, the GLSL spec says:

there must be enough components provided in the arguments to provide an initializer for every componentin the constructed value. It is an error to provide extra arguments beyond this last used argument

And

Accessing components beyond those declared for the vector type is an error

So in this case the NV compiler is strictly adhering to spec, whereas AMD is being lax and allowing things it shouldn't.