# Rendering issue: depth buffering + blending: how do they work together?

This image describes the problem I'm having:

What you are seeing consists of two images:

• Image A(with the alien-concept art thingy), depth value .98, the white parts on the image is where the alpha value is 0.0f

• Image B(with the play game button thingy), depth value .99, one solid image without any transparency value.

Now, when I first set this up, I expected Image A to let the colours of Image B through where Image A is fully transparent. But it doesn't

Question 1 : Why doesn't it?

Question 2 : What can I do to fix it? Are there multiple ways to fix it?

Question 3 : Is this problem different for partial transparency? If so, how do I make it work with partial transparency as well?

Thanks.

• Have you enabled blending and set up the proper blend function? In openGL this would be glEnable(GL_BLEND) and glBlendFunc() – notlesh Feb 23 '12 at 17:16
• @stephelton yes. I think this has something to do with order-independent blending, but I'm not sure. It would be nice to hear from someone with more experience what the problem exactly is, and methods I can use to fix it – xcrypt Feb 23 '12 at 17:23