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.xyz, worldToObj.xyz, worldToObj.xyz); vec3 sunDirObj = sunDirWorld.xyz * w2oMat;
I rewrote it in that way:
mat3 w2oMat; w2oMat = worldToObj.xyz; w2oMat = worldToObj.xyz; w2oMat = worldToObj.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 ?