Ok I found the solution.
Buried deep within shaderGenerator.cxx, I found where the generated shader gets the tex scale matrix.
It uses “texmat_x” where x is the index of the texture.
This is contained within synthesize_shader on line 846.
panda3d.org/reference/1.8.1/ … php#l00846
This value is verified and used in the shader on line 937.
panda3d.org/reference/1.8.1/ … php#l00937
So to use it in the shader use:
in uniform float4x4 texmat_0,