Jump to content
  • Advertisement


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

How to blend a masked image??

This topic is 5167 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, ive used lesson 20 to mask my image and its working perfectly fine. Now i would like to make this image transparent, and i dont know how. I tried with the alpha but dont seem to work. This is the code im using to do my masking: glEnable(GL_BLEND); glDisable(GL_DEPTH_TEST); for( int i=0; i<=31; i++ ){ glBlendFunc(GL_DST_COLOR,GL_ZERO); glBindTexture(GL_TEXTURE_2D, texture[mask.tex]); glBegin(GL_QUADS); glTexCoord2f(0.0f, 0.0f);glVertex3f( mask[i].x, mask[i].y-2, 0.0f); glTexCoord2f(1.0f, 0.0f);glVertex3f( mask[i].x+2, mask[i].y-2, 0.0f); glTexCoord2f(1.0f, 1.0f);glVertex3f( mask[i].x+2, mask[i].y, 0.0f); glTexCoord2f(0.0f, 1.0f);glVertex3f( mask[i].x, mask[i].y, 0.0f); glEnd(); glBlendFunc(GL_ONE, GL_ONE); glBindTexture(GL_TEXTURE_2D, texture[jetons[i].tex]); glBegin(GL_QUADS); glTexCoord2f(0.0f, 0.0f);glVertex3f( jetons[i].x, jetons[i].y-2, 0.0f); glTexCoord2f(1.0f, 0.0f);glVertex3f( jetons[i].x+2, jetons[i].y-2, 0.0f); glTexCoord2f(1.0f, 1.0f);glVertex3f( jetons[i].x+2, jetons[i].y, 0.0f); glTexCoord2f(0.0f, 1.0f);glVertex3f( jetons[i].x, jetons[i].y, 0.0f); glEnd(); } glEnable(GL_DEPTH_TEST); glDisable(GL_BLEND); ty [edited by - geez on March 29, 2004 2:56:21 PM] [edited by - geez on March 29, 2004 5:50:12 PM]

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!