So I’ve been banging my head against the wall with this for a while, maybe somebody else can enlighten me.
I have a matrix being set in a shader using Shader.SetGlobalMatrix that’s working with everything except translation. It’s as if it’s a 3x3 matrix instead of a 4x4 matrix. There’s no difference between this:
Matrix4x4 transformMatrix = target.projectionMatrix;
Shader.SetGlobalMatrix("_LightTransform", transformMatrix);
and this:
Matrix4x4 transformMatrix = target.projectionMatrix * Matrix4x4.TRS(10000 * Vector3.one, Quaternion.identity, Vector3.one);
Shader.SetGlobalMatrix("_LightTransform", transformMatrix);
Relevant shader code:
o.uv.zw = (mul(_LightTransform * _Object2World, v.vertex).xy + float2(1, 1)) * 0.5;
Any help would be appreciated!