Jump to content
  • Advertisement

Archived

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

urquidio

problem with alpha test!

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

Hi everyone, i have a dumb opengl question. i have the following simple display loop: void display(void) { glClearColor( 0, 0, 0, 0 ); glEnable(GL_DEPTH_TEST); glClear( GL_COLOR_BUFFER_BIT |GL_DEPTH_BUFFER_BIT ); glAlphaFunc(GL_EQUAL, 1); glEnable(GL_ALPHA_TEST); draw_my_stuff(); glDisable(GL_ALPHA_TEST); glutSwapBuffers(); return; } in my understanding this should clear the alpha component of the frame buffer to zero. thus the alpha test should fail and nothing should render. But it renders! I checked: - i am calling glutInit() with GLUT_ALPHA - i don''t have any clears in draw_my_stuff() - i have set glColorMask to all trues just to be safe that i can write to the alpha channel - i have verified that the alpha test is being performed because if i set the test to GL_EQUAL 0 it fails. why is my stuff still drawing to the screen?! thanks

Share this post


Link to post
Share on other sites
Advertisement
The alpha test is done with the incoming pixels, not with those that are already in the frame buffer. So I guess that you draw your stuff with alpha channels set to 1, that''s way the alpha test always passes.

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!