Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·part ofpackage sdfSplats.package·originates fromworld c100ce72-e…

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…

byzero-proxy @ DESKTOP-DB3UJOJ·posted 2d ago
What it does

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/v2

module 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 })

argtypedescription
namestringUnique source name, e.g. "myGame.forest".
specSourceSpec`{ 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.

argtypedescription
namestringThe 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.

argtypedescription
namestringSource name.

examples

SdfSplats.countOf("sdfSplats.shapes")

sources( ) →

Names and record counts of every registered source.

examples

SdfSplats.sources()

lin(c: number) → number

argtypedescription
cnumber

hex(h: string) →

sRGB hex colour to linear `{ r, g, b }` — the space painters shade in.

argtypedescription
hstring`"#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 }`.

argtypedescription
canyThe 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.

argtypedescription
eye{ number }Camera position `{ x, y, z }`.

examples

buf:write(SdfSplats.packLight({ 0, 2, 10 }))
⌬ Types
Frame = {SourceSpec = {
⌬ Metadata
descriptionAPI 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.

8+items
·
renderfeature · born here
❒asset
# splatPool The render feature that draws the sdfSplats pool. Each frame it lays out every registered source in one shared buffer of packed splat records, runs each source's generator once, then per render target (viewport, every offscreen capture, every render-to-texture camera) rebuilds the cull uniforms from that target's camera (`splat_view_prep`) and runs the builtin `splat_cull`, the shared `gpuSort` radix passes and a `channel = "gaussian"` splat draw composited over the lit scene. It compiles its per-view programs up front and draws only once they are ready. Started and stopped by `sdfSplats.module` as sources come and go; you do not create it yourself.
▲ 0↑ born
❒
package · born here
❒asset
# sdfSplats — procedural, animated and rigged Gaussian splats Gaussian splats you generate instead of capture. Signed-distance (SDF) shapes are painted with brush-stroke Gaussian splats on the GPU every frame, so a shape animates just by changing its numbers (bloom, morph, sway, wobble) and the strokes ride the moving surface. Everything is drawn through the engine's own Gaussian splat machinery — the builtin splat cull, gpuSort radix depth sort and `channel = "gaussian"` splat draw — for every view: the viewport, offscreen captures and render-to-texture cameras. A pixel-art palette pass completes the painterly look. **Splat rigging.** Splat bodies can be rigged and animated like any character: a rig is a set of bones, each painted as a tapered limb, all smooth-unioned into one skin that bends at the joints. - **SplatSkeleton** — put it on any animated, skinned character (an avatar, a player's body) and its skeleton's live pose — animation clips, locomotion, IK, ragdoll — drives a splat body. A walking avatar walks as a painting. - **SplatRig + SplatLimb** — build your own creature from bone entities (a bone per joint, parented into a skeleton); animate the bones from a script, with **JointSwing**, or any animation that moves entities. - **rigs.put(key, rig)** — feed limb poses from code every frame. ```luau -- a splat avatar: the player's own animated body, painted playerBody.component.add("SplatSkeleton", { splats = 36000 }) -- a custom creature: root + bone entities local root = entity.spawn("critter") root.component.add("SplatRig", { splats = 20000, blend = 0.09 }) local hip = entity.spawn("hip", { parent = root }) hip.localPosition = { 0.3, 0, 0.15 } hip.component.add("SplatLimb", { axis = "-y", length = 0.4, radius = 0.08, endRadius = 0.06 }) hip.component.add("JointSwing", { axis = "z", amplitude = 28, speed = 1.2 }) ``` **Splat objects as assets — `sdfSplat`.** A splat object is an asset like a model: a `<name>.sdfSplat/` folder whose `splat.yaml` lists its parts (SDF primitives with placement, colours, glow, wobble, morph and simple animation). It has a rendered preview in the asset browser and you **drag it into a scene**; that places an entity with a `SplatAsset` component that paints it, live-linked to the asset (edit `splat.yaml` and every placed copy changes). Five examples ship in `examples/`: glowOrb, crystalCluster, graveStone, morphTotem, ghostWisp. ```luau asset.create("sdfSplat", "lantern") -- then edit lantern.sdfSplat/splat.yaml asset.resolve("glowOrb", "sdfSplat"):instantiate(nil, { position = { 0, 0, 4 } }) ``` The `sdfSplat` type's own README has the full `splat.yaml` reference. Three ways in for shapes, from no code to your own shader: 1. **SdfSplatShape component — no code.** Put it on any entity: sphere, box, torus, capsule, cylinder, cone, octahedron or blob, with a colour gradient, glow, wobble, and `morph` toward a second primitive. The entity's transform places it. ```luau local e = entity.spawn("orb") e.localPosition = { 0, 1.5, 0 } e.component.add("SdfSplatShape", { shape = "torus", morphTo = "octahedron", splats = 16000 }) e.component.get("SdfSplatShape").morph = 0.5 -- animate it from any script ``` 2. **Your own SDF painter — a compute shader.** Write `shape_sdf`, how your shapes seed their splats and how they are painted; include `sdf_surface` for the rest (Newton projection onto the surface, stroke orientation, soft shadow, AO, paint shading, the packed splat record); register it as a source. Splatgrove's garden painter (`splatgrove/sdf_splat_gen` in the Splatgrove world) is a complete example: a floating island, wind-bent flowers that open as players approach, breathing mushrooms, swaying trees, a morphing totem and drifting sky jellies: 544,000 splats regenerated every frame in about 16 ms on an RTX 5090. 3. **Any GPU splat generator.** Particles, simulations, point clouds: any compute shader that writes the 24-byte record (`splat_record`) can be a source and is depth-sorted together with every other source. ```luau local SdfSplats = require("sdfSplats.sdfSplats") local PAINTER = asset.resolve("myPainter", "computeShader") SdfSplats.register("myGame.forest", { count = 200000, generate = function(frame) -- once per frame PAINTER:dispatch({ buffers = { frame.records, myUniforms, myShapes }, workgroups = { math.ceil(frame.count / 64) }, params = { first = frame.first }, -- write at first + i }) end, }) ``` For the pixel-art look add a `PixelPalette` component (or call `require("sdfSplats.palettes").apply({ palette = "Moss & Moon" })`). ## What is in the package | Asset | Role | |---|---| | `SplatSkeleton.component` | Rigging: any animated skinned character → a splat body following its skeleton. | | `SplatRig.component`, `SplatLimb.component` | Rigging: a custom splat creature from bone entities. | | `JointSwing.component` | Animates a bone entity (legs, tails, wings) by swinging it. | | `rigs.module`, `sdf_rig.computeShader` | The rigging API and painter (smooth-unioned tapered limbs). | | `SdfSplatShape.component` | Entity → animated SDF primitive painted in splats. | | `shapes.module` | Gathers every shape into one source; `put` shapes without entities. | | `sdf_shapes.computeShader` | The primitive painter (8 primitives, morph, wobble, gradient, glow). | | `sdfSplats.module` | The API: register/unregister sources, pool settings, lighting, status. | | `splatPool.renderFeature` | One shared pool for all sources: per-view cull, radix sort, splat draw. | | `splat_view_prep.computeShader` | Per-view cull uniforms from `@frame.camera`. | | `sdf_surface.shaderModule` | WGSL painter core: projection, stroke frame, shadow, AO, shading. | | `sdf_toolkit.shaderModule` | WGSL SDF primitives, smooth booleans, noise, rotations, seeding. | | `splat_record.shaderModule` | WGSL: write the packed 24-byte splat record. | | `pixelPalette.shader` | Pixel-art palette post pass (OKLab, ordered dither, outline). | | `palettes.module` | Palettes and `apply` / `register` / `remove` for the pass. | | `PixelPalette.component` | The palette pass as a component. | | `documentation/sdf-gaussian-splats.guide` | How it works and how to build on it. | | `sdf-gaussian-splats.agentSkill` | The procedure for an agent making splat content. | Depends only on `@builtin` (gaussianSplats cull, gpuSort, splat composite). The guide: `guides { path = "sdf-gaussian-splats" }`.
▲ 0↑ born
backing path · sdfSplats.package/sdfSplats.module

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported on this asset or on the parts this page shows. Parts it leaves out are not counted here.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ 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".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.