PDA

View Full Version : suppressing alpha value - need to draw 2 times?



therealremi
03-29-2009, 09:06 AM
Hi,
I want to render a textured mesh but I do not want to put the alpha from the texture into framebuffer - instead I want to have alpha value 1.0 for the whole mesh no matter what is the actual alpha value in the texture.
The only solution that I know of is to:
glColorMask(1,1,1,0)
draw the mesh
disable texturing
glColorMask(0,0,0,1)
glColor4f(0,0,0,1)
draw the mesh again
But this involves drawing the mesh twice. Perhaps is there a way to do it better?

ephtracy
03-29-2009, 10:13 AM
IMO, if you set your texture internal format to GL_RGB ( just without the alpha channel ) when you load your image into buffer, the alpha value of the pixels rendered from your mesh will constantly be 1.0 by default.