fortikur
04-20-2005, 08:58 AM
I have a 3D scene and a textured quad in the foreground. The quad is rendered without depth testing. The quad is transparent, where the alpha value is 0.
Just imagine yourself looking through the window. You can see the borders of the window. The glas of the window is black (rgb: 0,0,0 = alpha:0), so you can see through it. My problem is, that on the border of the window, where the image (quad) meets the 3D world (contour of the border) there is a black line, as the scene would be antialiased. But it isn't.
I tried with blending and alpha testing, but none of them gave me a correct result.
i used:
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
an later
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER,0);
I read in the forums a solution to make the borders black, so they become invisible, but this is not that case. The black border appears where the texture meets the black (transparent) part of the texture.
What should I do to correct this?
Thx in advance for any help
Just imagine yourself looking through the window. You can see the borders of the window. The glas of the window is black (rgb: 0,0,0 = alpha:0), so you can see through it. My problem is, that on the border of the window, where the image (quad) meets the 3D world (contour of the border) there is a black line, as the scene would be antialiased. But it isn't.
I tried with blending and alpha testing, but none of them gave me a correct result.
i used:
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
an later
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER,0);
I read in the forums a solution to make the borders black, so they become invisible, but this is not that case. The black border appears where the texture meets the black (transparent) part of the texture.
What should I do to correct this?
Thx in advance for any help