With my font rendering, I use a shader [icode]vec4 tint[/icode] to set the color of the text. I transferred this code from an implementation from about a month ago, but the exact same code isn’t working. Any help would be appreciated.
[icode]Uploading the data to the shader[/icode]
// get the location. called in initialization
tintLocation = GL20.glGetUniformLocation(programId, "in_Tint");
// upload the data each draw call to the shader
GL20.glUseProgram(programId);
GL20.glUniform4f(tintLocation, r, g, b, a);
GL20.glUseProgram(0);
GL20.glUseProgram(programId);
[icode]Vertex Shader[/icode]
#version 150 core
uniform mat4 projectionMatrix;
uniform mat4 viewMatrix;
uniform mat4 modelMatrix;
uniform vec4 in_Tint;
in vec4 in_Position;
in vec4 in_Color;
in vec2 in_TextureCoord;
out vec4 pass_Color;
out vec2 pass_TextureCoord;
out vec4 tint;
void main(void) {
gl_Position = in_Position;
// Override gl_Position with our new calculated position
gl_Position = projectionMatrix * viewMatrix * modelMatrix * in_Position;
pass_Color = in_Color;
pass_TextureCoord = in_TextureCoord;
tint = in_Tint; // tint the buffer
}
[icode]Fragment Shader[/icode]
#version 150 core
uniform sampler2D Texture0;
in vec4 pass_Color;
in vec2 pass_TextureCoord;
in vec4 tint;
out vec4 out_Color;
void main(void) {
out_Color = pass_Color;
// Override out_Color with our texture pixel
out_Color = texture(Texture0, pass_TextureCoord) * tint;
}