Archived

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

geez

How to blend a masked image??

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