Color and Texture Blending in Shader

I have a set of shaders for textures, and to handle the camera position and view. I would like to blend the color specified below with the texture color.


listIndex = GL11.glGenLists(1);
GL11.glNewList(listIndex, GL11.GL_COMPILE);
GL11.glBegin(renderType());
for (int i = 0; i < size(); i++)
{
	Vector3 v = get(i);
	Vector2 t = getTex(i);
	Color c = getColor(i);
			
	GL11.glColor3f(c.fr(), c.fg(), c.fb());
	GL11.glTexCoord2f(t.x, t.y);
	GL11.glVertex3f(v.x, v.y, v.z);
}
GL11.glEnd();
GL11.glEndList();

Using the above code, the texture displays properly, but the color is ignored.

Old Texture Vertex Shader


uniform mat4 projection;
uniform mat4 view;

void main()
{
	gl_TexCoord[0] = gl_MultiTexCoord0;
	gl_Position = projection * view * gl_Vertex;
}

Old Texture Frag Shader


uniform sampler2D texture1;

void main()
{
	gl_FragColor = texture2D(texture1, gl_TexCoord[0].st);
}

What I have tried:

Vertex Shader:


uniform mat4 projection;
uniform mat4 view;
varying vec4 vColor;

void main()
{
	vColor = gl_Color;
	gl_TexCoord[0] = gl_MultiTexCoord0;
	gl_Position = projection * view * gl_Vertex;
}

Fragment


uniform sampler2D texture1;
varying vec4 vColor;

void main()
{
	gl_FragColor = texture2D(texture1, gl_TexCoord[0].st) * vColor;
}

The color of the texture remains the same as before.

Are you sure that your shaders compile succesfully? Try


gl_FragColor = texture2D(texture1, gl_TexCoord[0].st) * vec4(1.0, 0.0, 0.0, 1.0);

If everything doesn’t turn red, that might mean your shader is not even being used…

Thanks, everything did turn red. I re-checked the colors that were being passed in and realized I forgot to cast the RGB values as integers. My color class has constructors for both floats and integers and because the calculations I did to get the color, it used the float one. The color values were always 1.