f3d icon indicating copy to clipboard operation
f3d copied to clipboard

CPU sorting pipeline

Open avaer opened this issue 1 month ago • 6 comments

This PR implements a cpu-based sorting pipeline. Fixes https://github.com/f3d-app/f3d/issues/1803.

I don't intend this to be merged, but hopefully it is useful code to someone if they need this feature.

avaer avatar Nov 05 '25 21:11 avaer

I don't intend this to be merged

Why not though ? :)

mwestphal avatar Nov 05 '25 21:11 mwestphal

@mwestphal This was written as a hack, I just needed to get correct splatting results on MacOS CLI.

Tbh I have no clue about the f3d codebase, or how this PR interacts with the rest of the app surface. I'm just a graphics person fixing my own use case.

Replacing the compute shader with an implementation that reads from GL and runs sort on CPU is going to be slow regardless, maybe not up to par for this project. Plus this is using STL with alloc on every sort/frame, not what I would do in a RT rendering pipeline. Do we want to multithread or desynchronize the render? I don't know.

And I don't really have the bandwidth to do this PR correctly to the standards I would expect for my own projects :P.

This is such a tight change though, I think anyone who knows the codebase should be able to put this code in the right place and test to make sure it works.

avaer avatar Nov 05 '25 22:11 avaer

@avaer understood, thanks for sharing!

By the way we have a discord and a tight community of devs and users, you are welcome to join! https://discord.f3d.app

@Meakk what do you think of this impl? Wanna finish it?

mwestphal avatar Nov 06 '25 05:11 mwestphal

Thanks @avaer I will take a look.
I'm also currently implementing stochastic transparency that works pretty well for gaussian splatting and is compatible with macOS since sorting isn't required anymore.
See #2250 in case you want to track the feature.

Meakk avatar Nov 06 '25 16:11 Meakk

@Meakk should we keep this one open or not ?

mwestphal avatar Nov 29 '25 14:11 mwestphal

Yes, it's better in order to not lose it.

Meakk avatar Dec 01 '25 16:12 Meakk