When I use this shader, I see no errors, but neither any color is drawn.
vert:
#version 330 core
layout (location = 0) in vec3 aPos;
out vec4 vertexColor;
void main()
{
gl_Position = vec4(aPos, 1.0);
vertexColor = vec4(0.5, 0.0, 0.0, 1.0);
}
frag:
#version 330 core
out vec4 FragColor;
in vec4 vertexColor;
void main()
{
FragColor = vertexColor;
}
PShader s_msdf;
void settings() {
size(600, 600, P2D);
}
void setup() {
s_msdf = loadShader("msdf.frag", "msdf.vert");
}
void draw() {
shader(s_msdf);
fill(0);
rect(0, 0, 500, 500);
resetShader();
}
How can this be fixed? Normally I write my shaders more in the ‘old’ style. But it’s so outdated.