Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Best way to sort of transparent particles into GPU without CPU using GS pass?

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2017
    Posts
    20

    Question Best way to sort of transparent particles into GPU without CPU using GS pass?

    Hi!

    Actually, I have a particle system that handles transform feedback to compute entire simulation into GPU,
    but now I trying to sort semi-transparent particles.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    3,006
    Quote Originally Posted by martel View Post
    Actually, I have a particle system that handles transform feedback to compute entire simulation into GPU,
    but now I trying to sort semi-transparent particles.
    The best way is to avoid the need to sort them. Additive blending (for particles which emit light but which don't affect light passing through) and multiplicative blending (for particles which affect light passing through but don't emit or reflect light) don't require sorting.

    If the particles have to be sorted (because they both affect light passing through and emit or reflect light), you have two main options. One is a topological sort, which only orders particles with respect to other particles which overlap. The other is a total sort, which sorts every particle according to its distance. A topological sort requires less effort overall, but its structure isn't particularly convenient for vector (GPU-style) parallelism. For a total sort, the most GPU-friendly algorithms are bitonic sort and even-odd merge sort. Both are O(n*log(n)^2), although bitonic sort seems to be more cache-friendly.

  3. #3
    Junior Member Newbie
    Join Date
    Dec 2017
    Posts
    20
    Thx! , I have chosen not to carry out sorting, I have given up and I have disabled the depth writing, this make the things more simples ...
    Last edited by martel; 12-04-2018 at 01:07 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •