How to blend a masked image??
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.x, mask.y-2, 0.0f);
glTexCoord2f(1.0f, 0.0f);glVertex3f( mask.x+2, mask.y-2, 0.0f);
glTexCoord2f(1.0f, 1.0f);glVertex3f( mask.x+2, mask.y, 0.0f);
glTexCoord2f(0.0f, 1.0f);glVertex3f( mask.x, mask.y, 0.0f);
glEnd();
glBlendFunc(GL_ONE, GL_ONE);
glBindTexture(GL_TEXTURE_2D, texture[jetons.tex]);
glBegin(GL_QUADS);
glTexCoord2f(0.0f, 0.0f);glVertex3f( jetons.x, jetons.y-2, 0.0f);
glTexCoord2f(1.0f, 0.0f);glVertex3f( jetons.x+2, jetons.y-2, 0.0f);
glTexCoord2f(1.0f, 1.0f);glVertex3f( jetons.x+2, jetons.y, 0.0f);
glTexCoord2f(0.0f, 1.0f);glVertex3f( jetons.x, jetons.y, 0.0f);
glEnd();
}
glEnable(GL_DEPTH_TEST);
glDisable(GL_BLEND); </i>
ty
<SPAN CLASS=editedby>[edited by - geez on March 29, 2004 2:56:21 PM]</SPAN>
<SPAN CLASS=editedby>[edited by - geez on March 29, 2004 5:50:12 PM]</SPAN>
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement