Hi
I’m drawing bitmaps with transparent background.When the objects don’t overlap each other then all is good, but when they overlap then there is some disturbance. I’m using
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
Is it right? My alpha value is from PNG alpha chanel.
Thanks.
Are you drawing the alpha objects back-to-front?
Generally speaking, if you want good multi-layer compositing (e.g. for alpha texture impostors), you’re going to want to use pre-multiplied alpha. It’s associative. That is (ONE, ONE_MINUS_SRC_ALPHA) blend function, with a texture that has already had the alpha pre-multiplied:
http://home.comcast.net/~tom_forsyth/blog.wiki.html#[[Premultiplied%20alpha]]
Thanks, solved
I also forgot to add glDepthMask(GL_FALSE);