Sign in to follow this  
spiggo89

Alpha sorting

Recommended Posts

Recently I wanted to put some foliage in my game, so I got one of those models that is simply a bunch of quads dispersed around a point at random angles/sizes and a plant texture. However I am now having problems with it. From a little research it seems the problem is to do with alpha sorting, I did find a small demo on codesampler.com which used a trick of rendering from back to front to ensure the alpha would work. Now im not entirely sure, but this seems like alot of work if i have large numbers of plants in the one area. What i am wondering is if there are any alternative ways to approach this problem, and if not, are there any in depth articles/tutorials on it? Edit: Just found the search function... http://www.gamedev.net/community/forums/topic.asp?topic_id=157544 answers my question pretty well. [Edited by - spiggo89 on July 6, 2008 12:13:31 AM]

Share this post


Link to post
Share on other sites
Quote:
Original post by spiggo89
What i am wondering is if there are any alternative ways to approach this problem, and if not, are there any in depth articles/tutorials on it?


Order independent transparency is an old topic that keep coming up and up.

In short, there is no panacea, only solutions that might or might not work in your case.

Sorting before rendering is most of the time sufficient to get rid of artifacts but not necessarily complete (triangle A before B before C before A comes to mind). And sorting every frame can be expensive.

Sometimes artifacts will be sufficiently small to unnoticeable even if you don't have a totally correct order (still need a rough order) but disabled z-writing for semi-transparent polygons (you still have the depth test for transparent/opaque intersection).

Other solutions listed here :

order independent transparency

A popular one these days is screen door transparency with the alpha to coverage feature.

LeGreg

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this