On this page

Recipes

How ShaderWeave represents a design as canonical JSON.

A recipe is the single source of truth for a render. Canonicalize it, hash it, cache it, share it.

Shape

{
  "generator": "shader-gradient",
  "params": {
    "colors": ["#FF5C38", "#0C0C0E"],
    "noiseScale": 2.4
  },
  "seed": 42,
  "engineVersion": "0.2.0"
}
FieldNotes
generatorRegistry slug
paramsValidated against that generator’s Zod / JSON Schema
seed0…2³²−1; 0 means “derive from params hash”

| engineVersion | Pins reproducibility across upgrades |

Size and format are separate render settings. The renderer cache includes both, along with the engine and renderer versions. Existing recipe hashes and links are preserved.

Canonicalization

Params are deep-sorted and normalized before hashing. Two recipes that differ only by object key order hash identically.

The hash powers:

  • Disk / memory cache keys
  • Embed URLs (GET /v1/render/:hash?r=…)
  • Client-side recipe sharing in the editor

Partial params

API clients may send a partial params object. Missing keys are filled from generator defaults, then validated.

{
  "params": { "colors": ["#0C0C0E", "#FF5C38"] },
  "seed": 7
}

Formats

FormatUse
png / webpStills (default png)
gif / mp4Loops (animated generators only)
svgVector-native generators
cssCSS approximations where supported

See Generate for request/response details.