Blending produces nothing but clear color (even at alpha 1.0)

This topic is 3562 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

screenProject(1);//Setup matrix
glClearColor(0,0,0,0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glEnable(GL_BLEND);
glDisable(GL_DEPTH_TEST);
glColor4f(1.0f,1.0f,1.0f,1.0f);
printScreen(texture1,0);//Billboard
glColor4f(1.0f,1.0f,1.0f,0.01f);
printScreen(texture2,-1);
glDisable(GL_BLEND);
glEnable(GL_DEPTH_TEST);

screenProject just sets the projection matrix to glOrtho, and printScreen just draws a large quad with the first argument as it's texture and the second argument as it's z coordinates. I should probably point out that objects with lower Z values are closer to the screen (ie, I didn't change from the norm). The problem is I can't get GL_BLEND to work in any way shape or form. No matter what arguments I pass to glBlendFunc() (typically GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA as the spec suggests), all that is drawn is the clear color. I've tried everything, but if I enable GL_BLEND, it wont draw anything. I realize my alpha is low on the second one - but it wont even draw the first!

• 33
• 12
• 10
• 9
• 9
• Forum Statistics

• Total Topics
631353
• Total Posts
2999488
×