yuzi

GLSL mat4 constructor problem

Discussion created by yuzi on Sep 9, 2010
Latest reply on Sep 10, 2010 by frali
GLSL mat4 constructor problem

My GLSL application runs well with nVidia and Intel GPU. But I encountered a problem with Radeon HD5400 and latest drivers on Windows XP SP3.

 

In a vertex shader, this code does not work correctly.

-----------------------------------------------

void main() 

{

float caz = 1;



 

float saz = 0;

mat4 Rz = mat4(caz, saz, 0, 0, -saz, caz, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);

 

-----------------------------------------------

 

Instead, this code works correctly.

-----------------------------------------------

void main() 

{

float caz = 1;

 

 

float saz = 0;

mat4 Rz = mat4(vec4(caz, saz, 0, 0), vec4(-saz, caz, 0, 0), vec4(0, 0, 1, 0), vec4(0, 0, 0, 1));

 

-----------------------------------------------

It seems to me that following code behaves almost identically to the first code.

(Note that 3rd row of 4th column is one)

-----------------------------------------------

void main() 

{

float caz = 1;

 

 

float saz = 0;

mat4 Rz = mat4(vec4(caz, saz, 0, 0), vec4(-saz, caz, 0, 0), vec4(0, 0, 1, 0), vec4(0, 0, 1, 1));

 

-----------------------------------------------

I hope this problem will be corrected shortly.
Regards.




 

 

 

Outcomes