TDInstanceMat returns identity matrix if there's nothing in the instancing rotate fields

Hi,

For a custom shader I need to use the TDInstanceMat() function. When not putting anything into one of the rotation fields on the instance page (but still having stuff in translate or scale fields) the function returns the identity matrix. I can get the correct matrix by setting one of the rotate fields (even a rotation value of zero returns a correct matrix). This seems like an odd behavior.

I’ve made a quick example of the issue here :
TDInstanceMat_issue.tox (2.7 KB)

Thanks in advance

-Alex

Edit :

Build is 2021.14360
On windows

This seems like a GLSL compiler bug. If you apply the TDInstanceMat directly such as

mat4 m = TDInstanceMat();
vec4 worldSpacePos = m * vec4(P, 1.0);
instanceMat = m;

Then I get the correct value. Also if I output the [3] column of the matrix out via a vec4 out/in variable, I get the correct values in the pixel shader.

Ok awesome,

Thanks for the quick answer