[2021.38110] Windows: GLSL MAT - Cannot use uniforms in shader when instancing

Thanks for all the work that’s been put into the latest experimental build! So excited for vulkan, must have been a massive undertaking.

I’m trying to do some simple Geometry COMP instancing with a GLSL MAT as the material. It works fine until I add a uniform in the GLSL MAT’s pixel shader - then I get the red & blue checker “shader error” texture on the geo in the Geometry COMP even though the GLSL MAT says it compiled fine.

If I turn of “Instancing” on the Geometry COMP or if I comment out the uniform in the GLSL MAT’s pixel shader it works again.

Attached is a quick example.glslMAT_uniform_bug.toe (4.0 KB)

Hey @b34npour

Thanks for the report.

It seems like there is an issue with custom uniforms when instancing, where you need to declare them both in the Vertex and Pixel shaders.

So, just copy-paste from pixel to vertex the line uniform vec4 exampleUniform;

I am logging an issue for a developer to look into it or for the Info DAT to add that bit.


Hi Michel, thanks for the note! That worked once I declared them in both, appreciate it!