Hey, as the Title says i’m using Textures in 3D and some of them have Transparent pixels.
Here my init Code:
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GLU.gluPerspective(60, Display.getWidth()/Display.getHeight(), 0.001f, 64);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glLoadIdentity();
// Depth Test
GL11.glDepthFunc(GL11.GL_LEQUAL);
GL11.glEnable(GL11.GL_DEPTH_TEST);
// Texture
GL11.glEnable(GL11.GL_TEXTURE_2D);
// Transparent Faces
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
// Transparent Textures
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glAlphaFunc(GL11.GL_GREATER, 0);
// Enable Cull Face
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glCullFace(GL11.GL_BACK);
GL11.glClearColor(0.2f, 0.5f, 0.8f, 1.0f);
However, I got like a Cube and want to put a name above it, Using an Image which contains all Letters. The text itself works fine, The Cube itself works fine too but The Text has the problem that the transparent faces aren’t really transparent, they just get coloured as my Clear Color ( In this case 0.2, 0.5, 0.8 ) Which isn’t really what i wanted as you might guess. So when there’s like a world behind that name there isn’t just the Text, it’s the text with a border in the clearcolor as if the texture wasn’t transparent and contained the Color which it doesn’t. however in 2D it’s working fine where i got exactly the same init code for the Textures.