   transparent textures?
  I have got textures on my program but I can't figure out how to make the white bits of the textures transparent?Here is some of my code just encase you need it!GLuint LoadTexture(char *filename) { GLuint texID; AUX_RGBImageRec *image = auxDIBImageLoad(filename); glGenTextures(1, &texID); glBindTexture(GL_TEXTURE_2D, texID); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); gluBuild2DMipmaps(GL_TEXTURE_2D, 3, image->sizeX, image->sizeY, GL_RGB, GL_UNSIGNED_BYTE, image->data); return texID; } static void instructionsBackground(){glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, waterId); glBegin(GL_QUADS); glColor3f(1,1,1); glTexCoord2f(10.0f, 10.0f); glVertex2d(winL,winT);glTexCoord2f(10.0f, 0.0f); glVertex2d(winL,winB);glTexCoord2f(0.0f, 0.0f); glVertex2d(winR,winB);glTexCoord2f(0.0f, 10.0f); glVertex2d(winR,winT);glEnd(); }
  I'm not sure if/how one sets a color to equal transparency. What you can do is add an alpha layer to your textures and then load them as RGBA. Then sort them back to front and render them with alpha blending enabled.   ;  Here is the code... Make sure your texture is setup to rgba glEnable(GL_BLEND);glEnable(GL_ALPHA_TEST);glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);//draw stuffglDisable(GL_ALPHA);    glDisable(GL_BLEND);HTH   ;  How Do I set the texture as RGBA?   ;Quote:Original post by CodeBoxHow Do I set the texture as RGBA?Load a texture format like .tga or someother picture format that supports Alpha channel. Then load it into OpenGL with GL_RGBA types. Have the RGB portion of the texture greyscale and the alpha is a black/white representation of that which will determine what is transparent and what is not. Now after looking at your code, I see you are using the Aux loader. I don't think that works with anything other than .bmp? I am not sure, but if doesn't support .tga goto Nehe and look at the tutorial on loading .tgas or use a library like DevIL...   ;Quote:Original post by MARS_999Now after looking at your code, I see you are using the Aux loader. I don't think that works with anything other than .bmp? correct.Quote:I am not sure, but if doesn't support .tga goto Nehe and look at the tutorial on loading .tgas or use a library like DevIL...Or the newly release GTL [grin]   ;  or maybe this might do the trickhttp://www.codesampler.com/oglsrc/oglsrc_4.htm#ogl_color_key   