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?


  • Tim

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.

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.


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.

Thanks again.