PDA

View Full Version : Bug in mat3 constructor / ATI Catalyst 7.2 ?



Ysaneya
02-22-2007, 01:53 PM
I just installed the latest ATI drivers ( Catalyst 7.2 ) today and was surprised to notice that my GLSL shader stopped to work.

I tracked the problem to the following piece of code which transforms a light direction from world space to object space:


mat3 w2oMat = mat3(worldToObj[0].xyz, worldToObj[1].xyz, worldToObj[2].xyz);
vec3 sunDirObj = sunDirWorld.xyz * w2oMat;I rewrote it in that way:


mat3 w2oMat;
w2oMat[0] = worldToObj[0].xyz;
w2oMat[1] = worldToObj[1].xyz;
w2oMat[2] = worldToObj[2].xyz;
vec3 sunDirObj = sunDirWorld.xyz * w2oMat;"worldToObj" is defined as a mat4 uniform, and "sunDirWorld" as a vec4 uniform.

Did anybody notice a similar problem ? Or was my code incorrect or non-spec conformant in the first place ?

Y.