I am atm creating a camera with the help of GLM. Everything went well until the point I had to specify a matrix4x4 uniform in my shader.
I use layout specifiers to specify my uniforms. The big problem with this is, that it gives me an error: error C3008: unknown layout specifier ‘binding = 1’.
Does anyone know how I can fix this probem?
(Sorry I do not know how to create codeblocks, if someone can explain this too I would be really gratefull)
My vertex shader:
#version 450
layout(location=0) in vec3 position;
layout(location=1) in vec4 colour;
layout(location=2) in vec2 uv;
out vec4 fragColour;
out vec2 fragUV;
layout(binding = 1)uniform mat4 orthoMat;
void main()
{
fragColour = colour;
gl_Position = vec4(orthoMat * vec4(position, 1.0));
fragUV = vec2(uv.x, 1.0 - uv.y);
}
My fragment shader:
#version 450
in vec4 fragColour;
in vec2 fragUV;
out vec4 colour;
layout(binding = 0) uniform sampler2D diffuse;
void main()
{
vec4 textureColour = texture(diffuse, fragUV);
colour = textureColour * fragColour;
}