Distance Field editor & voxelizer

Hi, I wanna make a volume based sandbox game and I’m working on a model editor thing that uses SDFs, combines them into a 3D volume based on different types of operations, and then creates a triangle model out of it
right now the model is just voxels (with only the visible faces being generated) but I’d like to move to dual contouring & smooth normals once I figure that out

I’m however at a point where either the mesh generation compute shader or bringing the data back to the cpu drops the framerate from 112fps to 30 when going from a 32x32x32 to a 64x64x64 volume.
I’ve put some profiler samples and the issue comes largely from that, and not any code I run afterward to convert the triangle array to mesh data (this also has an impact but not nearly as important in comparison).

Here’s the current version of the compute shader : hatebin
any idea how to improve performance?

1 Like