I'm working on a 3D game, and I'm running across a transparency issue that I don't understand.
I followed this tutorial and my textures work like a champ:
http://ninjacave.com/slickutil1The second that I try to load the textures on my 3D Quad, the alpha channel turns black and I can't see the textures beneath it. But, I can see the lines of the bounding box I drew around the model through the texture.
I've attached two images of what I'm talking about. They are the exact same image file. They also both register has true in a Texture.hasAlpha() test.
Here is the Initializing OpenGL Code
glEnable(GL_TEXTURE_2D);
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_DEPTH_TEST);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(fieldOfView, 960f / 640f, 0.001f, 200);
glMatrixMode(GL_MODELVIEW);
getTextures();
And here is the code where the texture is bound to the quad object:
Color.white.bind();
texture.bind();
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glBegin(GL_QUADS);
glTexCoord2d(0,0);
glVertex3d(loc.getX(), loc.getY() + sizeY, loc.getZ() + sizeZ);
glTexCoord2d(12f/32f,0);
glVertex3d(loc.getX() + sizeX, loc.getY() + sizeY, loc.getZ() + sizeZ);
glTexCoord2d(12f/32f,18f/32f);
glVertex3d(loc.getX() + sizeX, loc.getY(), loc.getZ());
glTexCoord2d(0,18f/32f);
glVertex3d(loc.getX(), loc.getY(), loc.getZ());
glEnd();
Am I missing something here?