Z-plane drawing order

Started by elias4444, January 13, 2005, 16:58:13

Previous topic - Next topic

elias4444

I'm guessing there's a simple solution to this one, but I can't find it:

It took me a while to figure out that if I drew something with a higher z-plane coordinate before something that goes behind it, the first object's transparency wouldn't reflect the texture of the object behind it.  This makes sense, as you can't alphablend something that isn't there yet.

However, in 3D environments, it's hard to know what exactly is going to be closer to the camera and in front of something else at any given time. How do you handle this? Do you have to resort all of your objects every frame (wow, talk about a performance hit!), or is there a simple OpenGL function that does this for you (as I believe there is in DirectX).
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com

princec

Yes, you need to resort your objects every frame. It's nowhere near as slow as you think.

Cas :)