Skip to main content
gamedev.net
🔒 Locked

Alpha sorting

Started by spiggo89 Jul 5, 2008 at 11:10 PM 1 replies 1.1k views
Original Post
spiggo89
spiggo89
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]
Buckeye
Buckeye
Quote:
I am now having problems with it

Not much to go on. Can you describe the problem and what you mean by "alpha-sorting"?
Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly. You don't forget how to play when you grow old; you grow old when you forget how to play.
LeGreg
LeGreg
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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.