View Full Version : Z-Sorting
07-02-2006, 02:40 PM
Hi, I have never had the issue with rendering transparent surfaces, but now I do, and I would like to ask how did any of you tackle this issue?
07-02-2006, 03:07 PM
Sorting each triangle is often too expensive and not needed, you may go for a coarser sort grain.
- sorting only per object, draw backfaces first then front faces, or skip backfaces.
- for additive particles effects, no need to sort
- for substractive black particles (smoke) no need to sort
- dust/dirt/clouds particles need proper sorting. You may want to avoid quicksort as there is quite high frame-to-frame coherence.
07-02-2006, 11:58 PM
You could just do fast "bucket sort".
Divide the z-depth to several slices and put each triangle(by it center) in the correct bucket.
512 slices would be enough for most geometries.
It will be fast.
07-03-2006, 01:27 PM
Thanks guys. I think I like the "bucket sort" idea, it seems easy, and doesn't seem to have huge overhead (superficial thinking right now).
I will go implement it now.
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.