XNA Transparency depending on drawing order?

Posted by DarthRoman on Game Development See other posts from Game Development or by DarthRoman
Published on 2013-03-19T16:22:34Z Indexed on 2013/11/05 10:15 UTC
Read the original article Hit count: 323

Filed under:
|
|

I am drawing two 3D objects, both of them can fade from opaque to transparent independently, and they can intersect between them (so you cannot say when one of them is before the other one). Look at the image for a better understanding (one of the object is a terrain and the other one an area):

Correct draw

Now, if I apply transparency to both of them, and draw the terrain before the area, the terrain is not transparent respecting to the area, but the area is:

Incorrect transparency

And finally, if I draw the area before the terrain, then the area is not transparent respecting of the terrain:

Incorrect transparency 2

QUESTION: How can I make all the objects transparent to the rest of objects without depending on the drawing order?

© Game Development or respective owner

Related posts about xna-4.0

Related posts about transparency