Hi!
I don’t know if this belongs here or in the GLSL category, but here goes:
This is the shader program I’m using:
#version 330 core
uniform mat4 modelViewProjection;
layout(location = 0) in vec3 modelSpaceVertexPosition;
layout(location = 1) in vec4 vertexColor;
layout(location = 2) in vec2 vertexTextureCoordinates;
out vec4 color;
out vec2 textureCoordinates;
void main() {
gl_Position = modelViewProjection * vec4(modelSpaceVertexPosition, 1);
color = vertexColor;
textureCoordinates = vertexTextureCoordinates;
}
#version 330 core
uniform sampler2D diffuseTexture;
in vec4 color;
in vec2 textureCoordinates;
out vec4 fragmentColor;
void main() {
fragmentColor = texture2D(diffuseTexture, textureCoordinates) * color;
}
I’m trying to edit the librocket sample to use this shader:
Everything is working fine except for vertexColor/color which is always (1,1,1,1).
I’m running out of ideas. What am I doing wrong?