Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#Actualmhagain

Posted 21 January 2013 - 04:03 PM

Just re-examining your vertex shader, here's the problem with it:

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.

Like I said, check your glGetShaderInfoLog and glGetProgramInfoLog outputs and they should point you to further issues (you've another in your vertex shader), as well as to your fragment shader problems.


#1mhagain

Posted 21 January 2013 - 04:02 PM

Just re-examining your vertex shader, here's the problem with it:

 

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.

 

Like I said, check your glGetShaderInfoLog and glGetProgramInfoLog outputs and they should point you to further issues (you've another in your vertex shader), as well as to your fragment shader problems.


PARTNERS