Jump to content
  • Advertisement
Sign in to follow this  
Lode

OpenGL The ZBuffer and translucency

This topic is 4685 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have the ZBuffer enabled and am drawing translucent quads in OpenGL. Say there are two translucent quads, quad 1 marked with | and the other with :, positioned as follows:
    1          2
    |          :  
    |          :
A   |          :   B
    |          :
    |          :
    |          :
When I'm standing in position A, I see quad 1, and through it also quad 2 because quad 2 was drawn first. If I'm standing in position B, I see only quad 2 and through it, I don't see quat 1. Can OpenGL be set to automaticly make it so that I'll always see both quads? In other words, make it handle translucency correctly in all occasions. If OpenGL can't handle this automaticly, how to do it?

Share this post


Link to post
Share on other sites
Advertisement
Short answer: no.

You must sort your translucent objects back-to-front.

Long answer: maybe some day.

There is currently a lot of research being done to create order-independent translucency.

Share this post


Link to post
Share on other sites
It also depends on the type of transparency. Additive blending and alpha testing are both order-independant.

Enigma

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!