Png texture with alpha uses renderer bg instead of material behind it

Hi!
The problem is almost fully described in the title: when I use textures with transparency, edges of them render like there’s no other mesh behind them, even if there is. Here are some examples, I marked in yellow problematic places:
http://ipic.su/img/img3/fs/art1.1330265314.png
http://ipic.su/img/img3/fs/art2.1330265475.png

Author: Fantashit

2 thoughts on “Png texture with alpha uses renderer bg instead of material behind it

  1. I know this is an old thread but I just wanted to add a comment for anyone else coming to this.
    I spent the whole day trying to solve a problem with semi-transparent objects that (due to requirements of my application) can be added to the scene in arbitrary orders and overlap and viewed from different angles. My problem was the transparent portions of my textures were preventing more distant objects from showing through as those more distant objects were yet to be rendered – i.e. I was picking up background (or other objects) in the depth buffer. Thanks to this thread and to the suggestion from @Malgalad I think it is now working properly. The solution for me was to modify my fragmentShader by adding a line to test the final (computed) gl_FragColor and discard the fragment if its alpha is less than threshold (0.5).

Comments are closed.