Accessing geometry instance transforms in GLSL

According to the wiki, I should be able to tap the different instance transforms with a set of different functions in the vertex shader.

I have added the correct extension ( #extension GL_EXT_gpu_shader4 : enable ) at the top of the shader, but i get an error when trying to use getInstanceScale() when using it as such:

vec3 scale = getInstanceScale();

The error is: call to undefined function"getInstanceScale"

Is there another extension that needs to get activated or something?

Thanks for reporting this. This is actually a false positive error. What’s happening is when the shader is getting compiled for the MAT itself there isn’t any instancing so it’s missing some of the functions.
When the MAT is applied onto a Geometry and rendered into a Render TOP, the instance functions will become available so things should compile/work correctly.
I’ll fix the error, but I think you can just ignore it and assume things will compile correctly when the shader is applied to geometry in the Render TOP.
Let me know if I’m wrong

Also just FYI, these functions will only return useful data when you do NOT have rotation applied on the instancing page. When rotations are used all of these channels are turned into single transform matrix instead of getting sent into the shader as individual channels when I can return easily.
I’ll also update the wiki with this

Gotcha, I was about to report that it didn’t work, but I am indeed using rotation. Instead of just not reporting useful data it seems to stop anything from rendering. It does work once I use the getInstanceMat() function.

My bad though, as it does state on the wiki that using rotation nullifies the scale function!

What is the arrangement of the transform matrix? Is it like this?:

X   Y   Z   ?

T
S
R
?

Thanks Malcolm!