World Sculptor


Unity-based 3D sculptor using compute shaders and SDFs

2024

During a Tools module of my study, I worked on making a 3D sculptor using Unity and Compute Shaders. It uses a 3D texture, to store the sdf of the object, and uses a compute shader to generate a mesh. The object is divided into chunks, so mesh generation doesn't have to regenerate the entire mesh each edit. Using compute shaders, the sdf gets incrementally updated, during undo and regular operations. It stores the operations in a LIFO collection, so it can easily undo them. An operation records the float values that were created, and the location, so that it can at a later time re-assign those values. Re-assigning the values to the 3D texture is done in a compute shader, and recording the editted values, is done in the update compute shader, using an append buffer. The update compute shader applies the sdf of the edit, to the 3D texture, it gets passed the parameters of the edit, such as the location, radius, and strength, then the compute shader calculates the correct values.

During the creation of the object, you can select parameters such as the size and the resolution. Auto-save stores up to N amount of revisions, so you can roll-back to an older version, and back, without any data loss. Optionally auto-save can also be disabled if preferred.

Features

Save/Load

Generational Auto-Save

Tool Resize

Obj Export

New Creation

Subtract/Add Sculpt

Undo