A screen effect plays in an overlay the host app places above its own screens — no camera,
no face. It is a product of its own: this manifest is independent of the face lens manifest
(manifest-v1.md), with its own enums, schema, fixtures and rendering rules
(effect-rendering-v1.md). Both manifests ship in the git tag
format-v1.0.0.
#Shape
json
{
"formatVersion": 1,
"effectId": "<uuid>",
"version": 1,
"minEngineVersion": 1,
"durationMs": 2500,
"layers": [],
"triggers": [],
"animations": [],
"assets": {}
}
durationMs — required, integer 100–10 000: the effect always ends here.
layers — 1–8, drawn in array order (first = back). triggers — at most 32.
animations — optional, at most 16 keyframe clips (see Animations); absent = none.
assets — <name>_<first 8 hex of sha256>.png → { sha256, bytes }. Every object is strict:
an unknown key is rejected.
#Enums
| Enum |
Values |
layer type |
1 particles · 2 full-screen sprite · 3 motion · 4 image · 5 sprite · 6 colour wash (engine 3, format-v1.2.0) · 7 model · 8 model copies (engine 4) |
gradient.direction (type 6) |
1 top to bottom · 2 left to right |
fit (type 2) |
1 contain · 2 cover |
sheet.endBehavior (types 2, 5) |
1 hold last frame · 2 hide (the layer's visible becomes false; a later show/play sprite shows it again from frame 0) |
motion (type 3) |
1 shake · 2 flash · 3 pulse |
event source |
1 lifecycle · 2 host |
action type |
1 show · 2 hide · 3 play sprite (→ 2, 5) · 4 emit particles (→ 1, 8; needs count) · 5 run motion (→ 3) · 6 play animation (names a clip: { "type": 6, "animation": "<clip id>" }) · 7 play model clip (→ 7; (re)starts its modelClip, implies show; engine 4) |
animation property |
1 x · 2 y · 3 scale · 4 rotation (a model: about z) · 5 opacity · 6 zoom · 7 z · 8 rotation about x · 9 rotation about y (7–9: models only, engine 4) |
scene3d.lighting |
1 Studio · 2 Warm · 3 Cool · 4 Night (engine 4; values in effect-rendering-v1 E12.6) |
animation easing |
1 linear · 2 ease in · 3 ease out · 4 ease in-out · 5 hold · 6 back · 7 bounce · 8 custom curve (engine 3) |
animation endBehavior |
1 hold last values · 2 return to base |
animation combine |
1 replace (absent) · 2 add · 3 multiply (engine 3) |
Lifecycle names: effect.started, effect.ended. Host names: any ^[a-z][a-z0-9_.-]{0,63}$ —
the platform defines the mechanism, the customer the vocabulary. Triggers have no threshold.
#Layers
Every layer has id (^[a-z][a-z0-9_-]{0,31}$, unique) and visible.
| Type |
Fields |
| 1 particles |
asset; origin {x, y} (fractions of the overlay, 0–1); emitter { ratePerSecond 0–300, lifetimeMs 100–10 000, speed 0–2, directionDeg −180–180, spreadDeg 0–360, sizeScale 0.01–1, gravity −2–2 }; burstCount 0–300; maxParticles 1–300 |
| 2 full-screen sprite |
asset; sheet { frameWidth, frameHeight 1–1024, frameCount 1–256, fps 1–60, loop, endBehavior }; fit; startMs 0–10 000 |
| 3 motion |
motion; intensity 0–1; startMs 0–10 000; durationMs 50–10 000; frequencyHz 0.5–30 |
| 4 image |
asset; position {x, y} (the image's centre, fractions of the overlay); scale (> 0, ≤ 2: width as a multiple of the overlay's short side); rotationDeg −180–180; opacity 0–1 |
| 5 sprite |
asset; sheet; position; scale; rotationDeg; opacity; startMs 0–10 000 |
| 6 colour wash |
color (lowercase #rrggbb, sRGB); gradient optional { color, direction } (from color to gradient.color); opacity 0–1. No asset. Engine 3. |
A colour wash tints the whole overlay at its array position (over the layers before it); it never
reads or regrades the host app's own pixels — an overlay cannot — and no motion moves it
(effect-rendering-v1.md §E11).
Lengths (particle speed, gravity, sizeScale, image and sprite scale) are multiples of
S = min(overlay width, overlay height).
#Animations
A clip animates one layer over its own time; the rendering rules are
effect-rendering-v1.md §E10.
json
{
"id": "bounce-in", "layer": "badge",
"durationMs": 800, "loop": false, "autoplay": true, "startMs": 0, "endBehavior": 1,
"tracks": [
{ "property": 3, "keys": [{ "atMs": 0, "value": 0.1, "easing": 6 }, { "atMs": 800, "value": 0.5, "easing": 1 }] }
]
}
id — same pattern as a layer id, unique among clips. layer — the layer it animates.
durationMs 50–10 000; loop; autoplay (the clip starts itself at startMs); startMs
optional, 0–10 000 (absent = 0); endBehavior required (no effect when loop is true).
tracks — 0–6, at most one per property. keys — 1–32 per track, atMs 0–durationMs,
strictly increasing; a key's easing shapes the segment to the next key (the last key's easing
is unused but required).
- Values are absolute: a playing clip's track replaces the property's resting value. One clip
plays per layer at a time; action 6 (re)starts a clip and implies show of its layer.
Properties each layer type may animate, and each property's key range:
| Property |
Image 4, sprite 5 |
Particles 1 |
Full-screen sprite 2 |
Colour wash 6 |
Key range |
| 1 x |
position.x |
origin.x |
— |
— |
0–1 |
| 2 y |
position.y |
origin.y |
— |
— |
0–1 |
| 3 scale |
scale |
— |
— |
— |
> 0, ≤ 2 |
| 4 rotation |
rotationDeg |
— |
— |
— |
−720…720 |
| 5 opacity |
opacity |
— |
opacity (resting value 1) |
opacity |
0–1 |
| 6 zoom |
— |
— |
zoom (resting value 1) |
— |
0.1–4 |
Motion layers (3) animate nothing. Tables in code: EFFECT_ANIMATABLE_PROPERTIES,
EFFECT_ANIMATION_VALUE_RANGE, MAX_ANIMATIONS (16), MAX_TRACKS_PER_ANIMATION (6),
MAX_KEYS_PER_TRACK (32). The features above are engine level 1.
Engine 3 additions (format-v1.2.0) — the face lens's lanes and custom curves, and combine
modes on both manifests (effect-rendering-v1.md E10.7, E10.8):
- Lanes — a clip's optional
lane 1–4 (absent = 1). Starting a clip replaces only the clip
playing on the same layer and lane; one autoplay clip per layer and lane.
- Combine — a clip's optional
combine: 1 replace (absent; the higher lane wins), 2 add, 3
multiply — with the lanes below, else the layer's resting value.
- Custom curve — easing
8 with the key's curve: { x1, y1, x2, y2 } (CSS cubic-bézier;
x1, x2 in [0, 1], y1, y2 in [−1, 2]); required with easing 8 and refused with any other.
- No
drive: a screen effect has no face.
Tables in code: EFFECT_ENGINE_LEVEL_BY_FIELD (lane, curve, combine — any presence counts),
EFFECT_ENGINE_LEVEL_BY_EASING (8 → 3), ClipCombine. Example: fixtures/effect/valid/animated-v3.json.
#3D (engine 4)
A screen effect can place 3D models — GLB files (glTF 2.0 binary) in the Mirage GLB v1 profile —
in the overlay. Everything 3D is engine level 4: an engine-3 SDK reports such an effect as too new.
Model (type 7) — asset (a .glb name), position {x, y} in overlay fractions on the z = 0
plane, z in [−2, 2] multiples of S towards the viewer, rotationDeg {x, y, z} each in
[−180, 180], scale in (0, 2] × S per model unit, opacity, and an optional modelClip
{ index 0–3, loop, autoplay } naming one of the GLB's own clips. It may animate properties
1–5 and 7–9.
Model copies (type 8) — asset, scale, copies { count 1–40, spawn { x 0–1, y −1–0
(above the top edge), spreadX, spreadY }, gravity 0–20 overlay heights per s², bounce
0–1, spinDegPerS 0–1440, lifetimeMs 100–10,000 }, tilt (gravity follows the device) and
burstOnShow. Show (1) or emit (4, count ≤ 40) starts a burst. It animates nothing.
scene3d (optional) — lighting 1–4 and exposure 0.4–1.8. Absent = Studio at 1.0. It has
no occluder: a screen effect has no face.
GLB assets — named <name>_<first 8 hex of sha256>.glb; the entry adds model
{ triangles, textures, clips }, computed by the API at upload. Caps: 20,000 triangles,
4 textures, 4 clips and 1 MiB per GLB; 100,000 triangles drawn per frame (every model plus every
copies layer's count × triangles). The package cap (3 MiB) counts GLBs like PNGs. Layer types
1, 2, 4 and 5 still take PNG names only; types 7 and 8 take GLB names only (a schema rule).
The GLB itself must fit the Mirage GLB v1 profile: checkGlb(bytes) in src/glb.ts checks it and
returns the model stats (or the first refusal, in plain words). The API refuses uploads with it
and the editor shows the same words before uploading (docs/api/models.md).
Tables in code: EFFECT_ENGINE_LEVEL_BY_LAYER_TYPE (7, 8 → 4),
EFFECT_ENGINE_LEVEL_BY_ANIMATION_PROPERTY (7–9 → 4), EFFECT_ENGINE_LEVEL_BY_FIELD (scene3d,
a .glb asset, model stats → 4), the caps MAX_MODEL_* and MAX_DRAWN_TRIANGLES. Example:
fixtures/effect/valid/model-3d.json — a trophy that spins (property 9) and plays its own clip,
and 24 coins that rain with tilt on the host event purchase.completed.
#Files
- JSON Schema (generated):
packages/format/schema/effect.v1.schema.json
- Fixtures:
packages/format/fixtures/effect/valid/ (must pass) and
packages/format/fixtures/effect/invalid/ — the same invalid-fixture format as the lens
manifest (description, base = a file in fixtures/effect/valid/ without .json, an RFC 6902
patch of add/remove/replace, then exactly one of expectedIssues or
rejectedBySchema: true).
- Valid fixtures cover every layer type:
confetti.json (screen particles 1, motion 3),
background-sprite.json (full-screen sprite 2) and trophy.json (placed sprite 5, placed image 4);
animated.json uses every animation property and easing, an autoplay, a looping and an
action-started clip, and action 6; colour-wash.json (engine 3) has a gradient wash faded by an
opacity clip and a plain wash shown by a host event; animated-v3.json (engine 3) has three lanes
— a curve-eased slide, an added bob and a multiplied wobble started by a host event.
#Validation = schema + rules
Semantic rules run only on a schema-valid manifest. Only the path + code of a semantic issue
are normative; a schema failure only has to be rejected.
| Code |
Path |
Condition |
layer.duplicate_id |
/layers/i/id |
A layer id repeats an earlier one |
asset.missing |
/layers/i/asset |
A layer's asset is not a key of assets |
asset.unused |
/assets/<name> |
An assets key no layer uses |
package.too_large |
/assets |
Σ assets[*].bytes > 3 MiB (3 145 728) |
particles.too_many |
/layers |
Σ maxParticles over type 1 layers > 300 |
timing.exceeds_duration |
/layers/i/durationMs |
Type 3: startMs + durationMs > durationMs of the effect (ending exactly at the end is allowed) |
timing.exceeds_duration |
/layers/i/startMs |
Types 2 and 5: startMs ≥ durationMs of the effect |
trigger.unknown_event |
/triggers/i/event/name |
Source 1 with a name other than effect.started / effect.ended |
trigger.unknown_layer |
/triggers/i/actions/j/layer |
The action's layer matches no layer id (suppresses action_mismatch for that action; action 6 has no layer) |
trigger.unknown_animation |
/triggers/i/actions/j/animation |
Action 6 names no clip |
animation.duplicate_id |
/animations/i/id |
A clip id repeats an earlier one |
animation.unknown_layer |
/animations/i/layer |
No layer has that id |
animation.property_not_animatable |
/animations/i/tracks/j/property |
The layer's type may not animate the property (not reported when the layer is unknown) |
animation.duplicate_property |
/animations/i/tracks/j/property |
A property repeats within one clip |
animation.keys_out_of_order |
/animations/i/tracks/j/keys/k/atMs |
atMs ≤ the previous key's |
animation.key_outside_clip |
/animations/i/tracks/j/keys/k/atMs |
atMs > the clip's durationMs |
animation.value_out_of_range |
/animations/i/tracks/j/keys/k/value |
The value is outside the property's key range |
animation.autoplay_conflict |
/animations/i/autoplay |
A second autoplay clip on the same layer and lane (absent lane = 1) |
animation.curve_missing |
/animations/i/tracks/j/keys/k/easing |
easing is 8 and the key has no curve (engine 3) |
animation.curve_not_applicable |
/animations/i/tracks/j/keys/k/curve |
The key has a curve and its easing is not 8 (engine 3) |
timing.exceeds_duration |
/animations/i/startMs |
An autoplay clip whose startMs (absent = 0) ≥ durationMs of the effect |
trigger.action_mismatch |
/triggers/i/actions/j |
The target layer's type is not one the action allows (see the action enum) |
trigger.no_model_clip |
/triggers/i/actions/j |
Action 7 on a model with no modelClip (engine 4) |
trigger.emit_over_copies_cap |
/triggers/i/actions/j/count |
Action 4 on a copies layer with count > 40 |
model.stats_missing |
/assets/<name> |
A .glb asset has no model (engine 4) |
model.stats_not_applicable |
/assets/<name>/model |
A PNG asset has model |
model.too_big |
/assets/<name>/bytes |
A GLB is over 1 MiB (1 048 576) |
model.triangles_over_cap |
/assets/<name>/model/triangles |
Over 20,000 |
model.textures_over_cap |
/assets/<name>/model/textures |
Over 4 |
model.clips_over_cap |
/assets/<name>/model/clips |
Over 4 |
model.clip_out_of_range |
/layers/i/modelClip/index |
The GLB has no clip with that index |
scene.triangles_over_cap |
/layers |
Over 100,000 triangles drawn per frame |
engine.too_low |
/minEngineVersion |
minEngineVersion < the highest engine level of any layer type, event source, key easing or engine-3 clip field used: a colour wash (6), a lane, a curve, easing 8 or a combine needs 3 (colour-wash-engine-too-low.json, animation-lanes-engine-too-low.json); a model or copies layer (7, 8), track property 7–9, scene3d, a .glb asset or model stats needs 4 (model-engine-too-low.json, scene3d-engine-too-low.json, model-track-engine-too-low.json). |
Decode-time check, run by the API at validate and publish: asset.sheet_too_small — for a type 2
or type 5 layer, frameCount must not exceed floor(width / frameWidth) × floor(height / frameHeight) of the asset's actual pixel size.
#Versioning
formatVersion changes only on a breaking change to this document. Adding a layer type or an
event source is not breaking: it raises that feature's engine level
(EFFECT_ENGINE_LEVEL_BY_LAYER_TYPE, EFFECT_ENGINE_LEVEL_BY_EVENT_SOURCE in constants.ts),
and a renderer compares minEngineVersion with its own engine version before it validates
strictly. Until the first effect is published and the SDKs' 1.0.0 ship, every v1 change is part
of the tag format-v1.0.0 (the tag is moved and the SDKs re-pin it).
One engine number covers both manifests: an SDK states one engine version. Engine 2 came with
format-v1.1.0 (face-lens features only), so the colour wash (layer type 6, format-v1.2.0) is
engine 3: an engine-2 SDK reports such an effect as too new and never draws it partly.
Engine 4 (3D, format-v1.4.0, tagged 2026-11-10 for screen effects alone; face-lens 3D follows
as engine 5, format-v1.5.0): model and copies
layers, GLB assets with their stats, action 7, track properties 7–9 and scene3d. An engine-3 SDK
reports such an effect as too new and never draws it partly. Property 7 used to be an unknown
property in the fixture animation-unknown-property.json; that fixture now uses 10.