Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

GregC

Blending

This topic is 6117 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

OK in NeHe''s 8th tut(the one about about blending). It says this line glColor4f(1.0f,1.0f,1.0f,0.5f); sets the brightness full and 50% alpha. I understand that. But it also says that the alpha value is the last value and that 0.0f is completely transparant and 1.0f is completely opaque. When I change this value to 1.0f the cube I get is not completely opaque. What''s happening?

Share this post


Link to post
Share on other sites
Advertisement
I dont know must about OpenGL but have you tried omitting the 4th argument or setting it to null? Also are you setting a flag somewhere when you are rendering to make the primitive transparent?

~Vendayan

Share this post


Link to post
Share on other sites
Change this line:


glBlendFunc(GL_SRC_ALPHA,GL_ONE);


to this:


glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);


I hope that helps!

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!