Hi everyone,
I’m facing an issue when trying to rotate a direction in the vertex shader using a constant matrix. I’m defining the matrix like this:
uniform mat3 rotationMatrix;
However, when I use mat3
, the result seems incorrect, and when I switch to mat4
, the shader hangs. Here’s what I’m currently doing in the fragment shader:
vec3 normA = normalize(vNormA);
vec3 rotatedNormA = rotationMatrix * normA;
In my JavaScript code, rotationMatrix
is initialized as an identity matrix, so it shouldn’t affect the direction, but something still seems off.
Has anyone encountered similar issues or has any ideas on how to approach this?
Btw I defined the matrix as this:
let rotAMatrix = BABYLON.Matrix.Identity();
currShader.setMatrix("rotationMatrix", rotAMatrix);
Thanks in advance!