sdfSplats.package
- ..
- .metadata243 B
- README.md893 B
- module.wgsl6.4 KB
README.md
sdf_surface
The shape-independent half of an SDF Gaussian-splat painter, in WGSL. Given
a seed point near a shape, splat_project lands it on the shape's current
zero level set with damped Newton steps (so a shape animates just by
changing its SDF parameters and the strokes ride the surface);
stroke_orientation lays a flat brush stroke in the tangent plane;
soft_shadow, sdf_ao and splat_shade (wrapped sun, sky/ground ambient,
rim light, glow, aerial fog, under a SplatLight) shade it as paint. It
includes sdf_toolkit and splat_record, so one include brings everything.
Contract: the including compute shader declares struct Shape, struct Ctx
and fn shape_sdf(p: vec3<f32>, sh: Shape, c: Ctx) -> vec4<f32> (x distance,
y part id, z/w part coordinates). sdf_shapes.computeShader in this package
and Splatgrove's sdf_splat_gen are complete painters built on it.