View Full Version : order-independent transparency
09-23-2003, 04:16 PM
A thumb rule to get transparency is 'draw the transparent object last', However, if it is not possible to draw it last, is there any way to achieve transparency? (using blending functions ofcourse.)
09-24-2003, 01:51 PM
You can use, in limited ways, destination alpha, and blend everything into the buffer based on the opacity of what's already there. Draw transparent items without Z writes. The problem is that you can't get the Z buffer right that way, and you may end up blending things that are actually hither from the transparent things.
A better approach is "depth peeling" using the stencil buffer and some number of passes depending on what depth complexity you want. You end up drawing (parts of) the scene many times this way, but it's robust, and order independent.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.