Log inGet started
World

Splatgrove

Branchmain
Branchesmain
Commitff76c26a07

README.md

sdfSplat (asset type)

A procedural Gaussian splat object you place in scenes like a model. Part of the sdfSplats package.

Make one

asset.create("sdfSplat", "lantern")          -- lantern.sdfSplat/ with a starter splat.yaml

Then edit lantern.sdfSplat/splat.yaml:

parts:
  - shape: cylinder          # sphere box torus capsule cylinder cone octahedron blob
    position: [0, 0.3, 0]    # metres, relative to the object's origin
    rotation: [0, 0, 0]      # degrees (x pitch, y yaw, z roll)
    size: [0.3, 0.6, 0.3]    # metres, a number or [x, y, z]
    splats: 5000
    color: "#3a2e22"         # bottom colour
    tipColor: "#5a4632"      # colour toward local +Y
    roundness: 0.3           # box / cylinder / cone / octahedron edges
  - shape: sphere
    morphTo: octahedron      # optional second primitive
    morph: 0.3               # 0..1 blend toward it
    position: [0, 0.75, 0]
    size: 0.25
    splats: 3000
    color: "#ff9a2e"
    glow: 1.2
    wobble: 0.3
    animate:
      spin: 40               # degrees per second about the part's Y
      bob: [0.05, 0.5]       # metres, cycles per second
      morph: 0.2             # ping-pong morph cycles per second
      pulse: 0.4             # glow pulse depth 0..1

Other part fields: wobbleSpeed, thickness (torus / capsule tube), opacity, strokeSize.

Place one

Drag it from the asset browser into a scene, or:

local e = asset.resolve("lantern", "sdfSplat"):instantiate(nil, { position = { 2, 0, -3 } })

That spawns an entity with a SplatAsset component (source = the asset, detail = splat budget multiplier, animated). Move, turn and scale the entity and the splats follow. Copies stay linked: edit splat.yaml and every placed copy changes.

How it draws

Each part is a signed-distance primitive repainted with brush-stroke Gaussian splats every frame by the package's sdf_shapes painter, sorted with every other splat source per view. Add the package's PixelPalette component for a pixel-art look.