Log inGet started
Package

sdf_splat_gen.computeShader

Newest version

README.md

sdf_splat_gen

Splatgrove's garden painter, and the full worked example of a custom painter for the sdfSplats package: the floating island, flowers, mushrooms, trees, rocks, the morph totem and the sky jellies as animated signed-distance shapes, painted with Gaussian splats every frame.

One thread per splat. Each splat belongs to one shape (found by binary search over shapes, sorted by their first splat). The thread seeds the splat on its shape's current parts, projects it onto the shape's zero level set (splat_project), orients it as a flat brush stroke in the tangent plane, shades it as paint (wrapped sun, sky/ground ambient, SDF occlusion and soft shadow or the island's blob shadows, rim light, aerial fog) and writes the packed 24-byte splat record at params.first + i in the shared pool. Only the garden-specific parts live here — shape SDFs, per-kind seeding, wind and player lean, per-part paint; the rest comes from #include "sdfSplats.sdf_surface".

Shapes animate by changing their SDF parameters (bloom, breath, sway, lean, morph); the splats ride the moving surface because they are re-projected from fixed seeds each frame.

Bindings

SlotAccessContents
recordsread_writeThe shared sdfSplats pool, 6 u32 words per splat.
gardenreadGardenUniforms — time, sun, sky, wind, eye, fog, player positions.
shapesreadShape per garden shape, eight vec4s each.
params.firstuniformThe garden's first record in the pool.