sdfSplats
The public API of the sdfSplats package: a shared GPU pool of Gaussian splats that any number of procedural generators write into every frame. Register a source — a record count and a `generate(frame)` function that dispatches your compute painter over `frame.count` threads writi…
sdfSplats
The public API of the sdfSplats package: a shared GPU pool of Gaussian splats
that any number of procedural generators write into every frame. Register a
source — a record count and a generate(frame) function that dispatches your
compute painter over frame.count threads writing at frame.first + i — and
it is drawn, culled and depth-sorted together with every other source, for
every camera and capture, through the builtin Gaussian splat machinery.
SdfSplatShape components are one source; Splatgrove's garden is another.
Also holds the pool's sort settings (near, far, buckets), the lighting
the package's painters shade with (optionally following the scene's sun),
status for diagnosis, and colour helpers (hex, linear, packLight).
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2module sdfSplats Procedural Gaussian splats: one shared GPU splat pool that any number of generators ("sources") write into every frame, drawn for every view (viewport, offscreen captures, render-to-texture cameras) through the builtin splat cull, gpuSort radix passes and `channel = "gaussian"` splat draw (the `splatPool` render feature). A source is a compute shader you dispatch from `generate`; it writes packed 24-byte splat records (see `splat_record.shaderModule`). `SdfSplatShape` components are one source; Splatgrove's garden is another. Registering the first source starts the `splatPool` render feature; unregistering the last stops it.
ensureRunning( ) → void
stopIfIdle( ) → void
register(name: string, spec: SourceSpec) → void
Add a splat source, or update one already registered under `name`. The pool is re-laid out (and reallocated) only when the set of sources or a source's `count` changes, so calling this every frame with the same count is cheap — which is how components keep a source alive across hot reloads. PAINTER:dispatch({ buffers = { f.records, uniforms }, workgroups = { math.ceil(f.count / 64) }, params = { first = f.first } }) end })
| arg | type | description |
|---|---|---|
| name | string | Unique source name, e.g. "myGame.forest". |
| spec | SourceSpec | `{ count = <records>, generate = function(frame) ... end }`. |
examples
SdfSplats.register("demo.blob", { count = 20000, generate = function(f)unregister(name: string) → void
Remove a source; its records leave the pool on the next frame. The render feature stops when no source is left.
| arg | type | description |
|---|---|---|
| name | string | The name it was registered under. |
examples
SdfSplats.unregister("demo.blob")layout( ) →
The pool layout the render feature draws: every source with the range of records it owns, in registration order.
examples
SdfSplats.layout().total
countOf(name: string) → number
How many records a source is registered with, or nil when it is not registered — the cheap check a caller makes before re-registering.
| arg | type | description |
|---|---|---|
| name | string | Source name. |
examples
SdfSplats.countOf("sdfSplats.shapes")sources( ) →
Names and record counts of every registered source.
examples
SdfSplats.sources()
lin(c: number) → number
| arg | type | description |
|---|---|---|
| c | number |
hex(h: string) →
sRGB hex colour to linear `{ r, g, b }` — the space painters shade in.
| arg | type | description |
|---|---|---|
| h | string | `"#rrggbb"`. |
examples
SdfSplats.hex("#ff8800")linear(c: any) →
sRGB colour (a `Field.color` value, `{ r, g, b }` or `{ r = .., g = .., b = .. }`, components 0..1) to linear `{ r, g, b }`.
| arg | type | description |
|---|---|---|
| c | any | The colour. |
examples
SdfSplats.linear({ r = 1, g = 0.5, b = 0.2 })readSceneSun( ) → void
Follow the scene's first directional light (direction toward the sun, colour and intensity) into `lighting`, at most once a frame.
examples
SdfSplats.readSceneSun()
packLight(eye: { number }) →
Pack `lighting` as the six vec4s of `SplatLight` (sdf_surface), for the given camera position.
| arg | type | description |
|---|---|---|
| eye | { number } | Camera position `{ x, y, z }`. |
examples
buf:write(SdfSplats.packLight({ 0, 2, 10 }))Frame = {SourceSpec = {API for procedural Gaussian splats: register compute-shader splat sources into one shared pool drawn per view through the builtin splat sort.Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Showing up to 3 levels deep. Open a part to see what it holds further down.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.