Splatgrove
- ..
- .metadata57 B
- README.md1.5 KB
- bindings.yaml828 B
- shader.wgsl34.7 KB
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
| Slot | Access | Contents |
|---|---|---|
records | read_write | The shared sdfSplats pool, 6 u32 words per splat. |
garden | read | GardenUniforms — time, sun, sky, wind, eye, fog, player positions. |
shapes | read | Shape per garden shape, eight vec4s each. |
params.first | uniform | The garden's first record in the pool. |