Bug in shader compilation for OpenGL?

This might be another MojoShader thing but it seems weird: When I go to compile a shader, in my vertex shader input, I can include this variable in the struct:

float3 Normal : NORMAL;

However, when I try to include this variable in the vertex shader output struct with the : NORMAL tag like I did in the input, the shader will not run (“Compilation Error” during runtime).

If I tag it as a TEXCOORD instead, then it works:

float3 Normal : TEXCOORD9;

For example, seems to work fine on the vertex shader output. I have the same issue with : TANGENT0 as well. I’m not sure if it’s just own noobiness not knowing how this works, but it seems strange to me.

This is OpenGL vs_3_0 and ps_3_0.

Just use texcoord for custom channels, openGL doesn’t know these semantics anyway and it is transpiled as offset in layout.

1 Like