problom with masking
hi all i am trying thecode from lesson 20
and trying to mask but it dont success and it just show nothing or if i delete the :
glEnable(GL_BLEND); // Enable Blending
glDisable(GL_DEPTH_TEST);
i just see a black picture's background
and here is my full code of it :
glEnable(GL_BLEND); // Enable Blending
glDisable(GL_DEPTH_TEST);
glBlendFunc(GL_DST_COLOR,GL_ZERO);
glBindTexture(GL_TEXTURE_2D, texture[4]);
glBegin(GL_QUADS);
glTexCoord2f(0.0,1.0); glVertex3f(-1.0,1.0,0.0);
glTexCoord2f(1.0,1.0);glVertex3f(1.0,1.0,0.0);
glTexCoord2f(1.0,0.0);glVertex3f(1.0,0.0,0.0);
glTexCoord2f(0.0,0.0);glVertex3f(-1.0,0.0,0.0);
glEnd();
glBlendFunc(GL_ONE, GL_ONE);
glBindTexture(GL_TEXTURE_2D, texture[2]);
glBegin(GL_QUADS);
glColor4f(1.0f,1.0f,1.0f,0.5f);
glTexCoord2f(0.0,1.0); glVertex3f(-1.0,1.0,0.0);
glTexCoord2f(1.0,1.0);glVertex3f(1.0,1.0,0.0);
glTexCoord2f(1.0,0.0);glVertex3f(1.0,0.0,0.0);
glTexCoord2f(0.0,0.0);glVertex3f(-1.0,0.0,0.0);
glEnd();
glEnable(GL_DEPTH_TEST); // Enable Depth Testing
glDisable(GL_BLEND);
______________
does anyone know what is this happening?
if yes plz help me...
thx
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement