I'm rendering the entire scene with ambient and diffuse light. My problem lies with the fact that the diffuse component of the lighting is not automatically using the alpha value specified with my calls to glColor4f().
I can work around it by changing the alpha value of the diffuse component of the material at each vertex as i do the rendering.
// Before i Turned The Lights On
glBindTexture(); // Pick Texture
foreach vertex
{
glColor4f(1.0f, 1.0f, 1.0f, l_alpha); // Set Alpha
glVertex3fv(l_vertex); // Draw Vertex
// .. repeat
}
// After The Lights Were Turned On
glBindTexture() // pick texture
GLfloat l_diffuse[4] = {1.0f, 1.0f, 1.0f, 0.0f}; // array for diffuse color
foreach vertex
{
l_diffuse[3] = l_alpha; // Change Value In Diffuse Color Array
glColor4fv(l_diffuse); // Set Alpha
glMaterialfv(GL_FRONT,GL_DIFFUSE,l_diffuse); // Change Materials Diffuse
glVertex3fv(l_vertex); // Draw Vertex
// .. repeat
}
I'm actually doing all my vertex rendering with vertex arrays and this material changing turned my texture blending code into an ugly mess. Is there any way to get around changing the materials diffuse component at each vertex while still getting the same affect?












