• Advertisement
Sign in to follow this  

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

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

If you intended to correct an error in the post then please contact us.

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!

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement