I’m trying to draw this circle:
on top of an opengl scene. The file (icon2.png) is 256x256 rgba. I’m having trouble to get it to draw correctly. I’ve tried all sorts of combinations of glBlendFunc() and glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, …) but can’t get it to work correctly. Most often the circle is too dark (almost black) or the area outside the circle (the entire square) is shown.
Could someone tell me what the right combination of settings to use? I’ve tried settings from the NeHe tutorial to start with. I’m drawing this in orthogonal mode.
use default glBlendFunc ( which is conveniently GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
use default texture mode modulation
-> should work.
Here’s what I’ve tried now. The circle is still too dark. The glColor3f() call causes the circle to to be colored strangely.
glEnable( GL_TEXTURE_2D );
glEnable( GL_BLEND );
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_BLEND);
The result rendering is here:
remove this line : glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_BLEND);
can you post your whole code related to texturing ?