News for hackers. Stuff that matters.
Re:Sorting with GPUs: A Survey by ben-schaaf on Monday September 11, 2017 @04:31AM (#15216945)
Rendering transparent models in real-time (ie. for games) requires a sorting step when they overlap. I can imagine a scene containing a couple hundred thousand transparent models that need sorting.
Re:Sorting with GPUs: A Survey by exDM69 on Monday September 11, 2017 @07:35AM (#15217705)
That's obviously a good use case and doesn't even need to have that large of number of elements because the data could get consumed by the GPU, so no back-and-forth transfer necessary.

This paper was focused on comparison based sorting. Depth sorting can be done with GPU radix sort (which is super fast), because with minor modifications, floating point and integer comparison are equal for finite, not-NaN values (and games don't care about that).

Re:Sorting with GPUs: A Survey by stcredzero on Monday September 11, 2017 @12:12PM (#15219585)
Rendering transparent models in real-time (ie. for games) requires a sorting step when they overlap.

My game heavily uses a "find nearest n" operation on an R-Tree, then sorts by distance for AI operations.

Re:Sorting with GPUs: A Survey by skocznymroczny on Monday September 11, 2017 @08:31AM (#15218014)
Are there any game engines that actually do the sorting? I thought they just render them in random order and hope for the best.
Re:Sorting with GPUs: A Survey by tomjakubowski on Monday September 11, 2017 @04:38AM (#15216970)
I was very surprised that depth sorting for real time rendering was not listed among the potential applications in the abstract.
Re:Sorting with GPUs: A Survey by pjc50 on Monday September 11, 2017 @06:21AM (#15217385)
Isn't that usually done with the depth buffer?
Re:Sorting with GPUs: A Survey by panic on Monday September 11, 2017 @09:35AM (#15218363)
Depth buffers only work well for opaque objects, which cover each other completely. With partial coverage or blending, multiple objects could end up contributing to a pixel in an order-dependent way (e.g., if you're viewing an anti-aliased leaf edge under the surface of water through a window). The depth buffer, which only stores a single depth, doesn't solve this problem directly -- you can use it to render each transparent layer one-by-one ("depth peeling"), but this can be slow.
Re:Sorting with GPUs: A Survey by heavenlyblue on Monday September 11, 2017 @06:33AM (#15217439)
Depth buffer has an issue of scales: one thing is 1 meter away and another one is 1 million meters away with another several thousand billion meters away. That makes it practically unusable for global positioning (especially for things that are both far away, but another one is just a little bit further).

On the other hand sorting doesn't need to have a global axis - in the perfect case it just needs to compare two elements against each other.

Re:Sorting with GPUs: A Survey by exDM69 on Monday September 11, 2017 @07:31AM (#15217679)
For non-transparent models, to a degree it gets done by the depth buffer. For transparent models, depth buffer is not helpful.

But even when using the depth buffer, drawing in front-to-back order will drastically improve performance as fragment shaders don't have to run for occluded fragments that get depth culled.