Sign in to follow this  
Zouflain

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this