Transparent textures

I did misread it but I think that’s because I’m pretty sure what you are suggesting is not possible.



I’m not sure how you would selectively render to the z-buffer on a pixel by pixel basis. It would be cool, though.

Setting alpha-fall-off to 0.5 remedies the problem. Big thanks!



However, I don’t quite understand why the problem occurs (why borders and only the borders are with wrong color) and why setting alpha threshold helps. The texture has only fully transparent pixels and fully opaque pixels. See: http://users.utu.fi/sampie/jme/firtexture-zoom.png

@sampie said:
Setting alpha-fall-off to 0.5 remedies the problem. Big thanks!

However, I don't quite understand why the problem occurs (why borders and only the borders are with wrong color) and why setting alpha threshold helps. The texture has only fully transparent pixels and fully opaque pixels. See: http://users.utu.fi/sampie/jme/firtexture-zoom.png


But the texture gets filtered for drawing prettier shrunk down and enlarged versions. (You could also turn the min and mag filters off as another option and just let things look ugly from far away).

The issue comes when these partial pixels are rendered... the mix with the background at the time and then fill the z-buffer with that distance. When something else tries to render behind them it won't get rendered because the z-buffer already has a nearer value. Setting the alpha test and fall off the way you did means that the pixels with alpha less than 50% get discarded and not even rendered to the z-buffer. In your case, above 50% must be dark enough that you don't notice the bleed through of the background... though it is still there.

Also, if you normally have no alpha in the texture then filtering will make nice relatively even steps of alpha and 0.5 is probably a good value in that case.

Thanks for giving a clear and detailed explanation!



This filtering, which creates alpha, is something I have noticed that Gimp does as well when scaling a picture.