A lens is a face lens: it draws over a tracked face. Screen effects have their own manifest, effect-manifest-v1.md, with its own enums; nothing here applies to them. (Before the split, this manifest also had a kind 2 for screen effects, with durationMs and screen layer types 6–8; they left it inside format-v1.0.0, before anything shipped.)
effect-manifest-v1.md
kind
durationMs
format-v1.0.0
type
anchor
mode
sheet.endBehavior
visible
show
play sprite
source
count
animation
property
easing
endBehavior
Lifecycle names: lens.started. Face-signal names: mouth.open, brows.raised, blink, head.tilt, smile (with optional threshold 0–1; threshold is allowed only on face-signal events). Host names: any ^[a-z][a-z0-9_.-]{0,63}$ — the platform defines the mechanism, the customer the vocabulary.
lens.started
mouth.open
brows.raised
blink
head.tilt
smile
threshold
^[a-z][a-z0-9_.-]{0,63}$
A colour-look asset is a 512 × 512 PNG holding a 64³ LUT as an 8 × 8 grid of 64 × 64 tiles (red across each tile, green down each tile, blue across tiles left→right, top→bottom). Offsets and particle speeds are in face widths.
Full face (anchor 10). The centre of the whole face, brows to chin: face-frame position (0, +0.15) from the eye midpoint, in face widths (rendering-v1 2.2). With scale 1 a sticker is exactly one face width wide (height from its image's aspect), so a mask drawn at the face's proportions covers the face; it turns with head roll like any other anchor. It is valid on every field that takes an anchor — transform.anchor (types 2 and 4 on a face) and face particles' anchor (type 5, which then spawn at the face centre). It is engine level 1 (ENGINE_LEVEL_BY_ANCHOR): it is part of format-v1.0.0 (added before any lens was published or any SDK shipped), so the SDKs' 1.0.0 render it and a lens using it keeps minEngineVersion 1. Example: fixtures/lens/valid/face-mask.json.
scale
transform.anchor
ENGINE_LEVEL_BY_ANCHOR
minEngineVersion
fixtures/lens/valid/face-mask.json
A sprite sheet (sheet, type 4) requires endBehavior: it applies when loop is false (1 hold last frame, 2 hide); when loop is true it is still required but has no effect. Face particles (type 5) require offset — the spawn offset from the anchor point, same shape, range and meaning as transform.offset. See rendering-v1.md for the normative rendering rules (playback, spawn position, draw order, timing, and everything else a renderer needs pinned).
sheet
loop
1
2
offset
transform.offset
rendering-v1.md
An optional top-level animations list holds keyframe clips; a lens without it is unchanged. A clip animates one layer over its own time, on lens time; the rendering rules are rendering-v1.md §11, which uses the easing formulas and the clip clock of effect-rendering-v1.md E10.1–E10.3.
animations
effect-rendering-v1.md
{ "id": "hat-pop", "layer": "hat", "durationMs": 1000, "loop": false, "autoplay": true, "startMs": 200, "endBehavior": 1, "tracks": [ { "property": 3, "keys": [{ "atMs": 0, "value": 0.3, "easing": 7 }, { "atMs": 1000, "value": 0.6, "easing": 1 }] } ] }
id
layer
autoplay
startMs
tracks
keys
atMs
{ "type": 6, "animation": "<clip id>" }
Properties each layer may animate, and each property's key range (ids 1–5 mean what they mean for screen effects, in the layer's own units):
transform.offset.x
placement.transform.offset.x
offset.x
transform.offset.y
placement.transform.offset.y
offset.y
transform.scale
placement.transform.scale
transform.rotationDeg
placement.transform.rotationDeg
opacity
intensity
placement.transform.anchor
transform.followRoll
placement.transform.followRoll
Tables in code: lensAnimatableProperties(layer), LENS_ANIMATION_VALUE_RANGE, MAX_ANIMATIONS (16), MAX_TRACKS_PER_ANIMATION (6), MAX_KEYS_PER_TRACK (32); the easings are AnimationEasing, shared with screen effects. Every animation feature above except properties 8 and 9 is engine level 1. Example: fixtures/lens/valid/animated.json animates every engine-1 property on every layer kind that may, with every engine-1 easing, and starts two clips from a mouth.open trigger.
lensAnimatableProperties(layer)
LENS_ANIMATION_VALUE_RANGE
MAX_ANIMATIONS
MAX_TRACKS_PER_ANIMATION
MAX_KEYS_PER_TRACK
AnimationEasing
fixtures/lens/valid/animated.json
format-v1.1.0
Added after iOS SDK 0.2.0 shipped. All optional; a lens that uses any of them needs minEngineVersion 2, so an engine-1 SDK refuses it as "engine too old" (see Versioning). Rendering: rendering-v1.md 11.8–11.12.
{ "id": "hat-spin", "layer": "hat", "lane": 2, "durationMs": 2000, "loop": true, "autoplay": true, "endBehavior": 1, "tracks": [{ "property": 4, "keys": [ { "atMs": 0, "value": -10, "easing": 8, "curve": { "x1": 0.68, "y1": -0.6, "x2": 0.32, "y2": 1.6 } }, { "atMs": 2000, "value": 10, "easing": 1 } ] }] }, { "id": "frame-mouth", "layer": "frame", "durationMs": 1000, "loop": false, "autoplay": true, "endBehavior": 1, "drive": { "signal": "mouth.open" }, "tracks": [{ "property": 5, "keys": [{ "atMs": 0, "value": 0, "easing": 2 }, { "atMs": 1000, "value": 1, "easing": 1 }] }] }
followRoll
8
curve: { x1, y1, x2, y2 }
x1
x2
y1
y2
curve
lane
drive: { "signal": "<face signal>" }
format-v1.2.0
combine
ClipCombine
constants.ts
Tables in code: ENGINE_LEVEL_BY_ANIMATION_PROPERTY, ENGINE_LEVEL_BY_EASING, ENGINE_LEVEL_BY_FIELD (lane, drive, curve at 2, combine at 3 — any presence counts, even "lane": 1), LENS_CUSTOM_CURVE_EASING (8), MAX_ANIMATION_LANES (4). Examples: fixtures/lens/valid/animated-v2.json uses each engine-2 field; animated-v3.json adds combine.
ENGINE_LEVEL_BY_ANIMATION_PROPERTY
ENGINE_LEVEL_BY_EASING
ENGINE_LEVEL_BY_FIELD
drive
"lane": 1
LENS_CUSTOM_CURVE_EASING
MAX_ANIMATION_LANES
fixtures/lens/valid/animated-v2.json
animated-v3.json
format-v1.5.0
A face lens can place 3D models — GLB files (glTF 2.0 binary) in the Mirage GLB v1 profile, the same profile and caps as screen effects (effect-manifest-v1.md) — on the head. Everything 3D on a lens is engine level 5 (screen-effect 3D is engine 4): an engine-4 SDK reports such a lens as too new. Rendering: rendering-v1.md §12. Until the format-v1.5.0 tag, the values marked [P] there are provisional.
{ "id": "crown", "type": 6, "visible": true, "asset": "crown_3fa9c21b.glb", "transform3d": { "anchor": 1, "offset": { "x": 0, "y": 0.18, "z": -0.1 }, "rotationDeg": { "x": -10, "y": 0, "z": 0 }, "scale": 1.15, "followHead": true }, "opacity": 1, "modelClip": { "index": 0, "loop": true, "autoplay": false } }
Model (type 6) — asset (a .glb name); transform3d: anchor 1–10 (a point on the canonical head, rendering-v1 12.4), offset {x, y, z} each in [−2, 2] face widths (x right, y up, z towards the viewer), rotationDeg {x, y, z} each in [−180, 180], scale in (0, 4] face widths per model unit, and followHead (true: the model turns with the head; false: it keeps the camera's orientation and only moves with the anchor); opacity; an optional modelClip { index 0–3, loop, autoplay } naming one of the GLB's own clips. It may animate properties 1–5, 8 (anchor) and 10–12.
asset
.glb
transform3d
rotationDeg
followHead
modelClip
index
Model copies (type 7) — asset, scale in (0, 2] × the frame's short side per model unit, copies { count 1–40, spawn { x 0–1, y −1–0 (above the top edge), spreadX, spreadY }, gravity 0–20 frame heights per s², bounce 0–1, spinDegPerS 0–1440, lifetimeMs 100–10,000 } and burstOnShow. The copies fall over the camera image in frame space (the floor is the frame's bottom edge), not on the face. There is no tilt (a screen-effect option). Show (1) or emit (4, count ≤ 40) starts a burst. It animates nothing.
copies
spawn
spreadX
spreadY
gravity
bounce
spinDegPerS
lifetimeMs
burstOnShow
tilt
scene3d (optional) — lighting 1–4 (the screen effect's presets), exposure 0.4–1.8 and occluder (true: the standard head occluder hides what is behind the head, rendering-v1 12.5). Absent = Studio at 1.0 with the occluder on. roomLight (optional, engine 7, see "Room light" below).
scene3d
lighting
exposure
occluder
roomLight
Track properties — 10 offset z (−2…2 face widths), 11 rotation about x, 12 rotation about y (−720…720 degrees); 4 is the rotation about z. Action 7 (play model clip) (re)starts a model's modelClip and implies show; it targets a model that has one.
GLB assets — named <name>_<first 8 hex of sha256>.glb; the entry adds model { triangles, textures, clips }. 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 occluder does not count). The 2 MiB package cap counts GLBs like PNGs. Layer types 1–5 take PNG names only; types 6 and 7 take GLB names only (a schema rule).
<name>_<first 8 hex of sha256>.glb
model
triangles
textures
clips
Tables in code: ENGINE_LEVEL_BY_LAYER_TYPE (6, 7 → 5), ENGINE_LEVEL_BY_ANIMATION_PROPERTY (10–12 → 5), ENGINE_LEVEL_BY_FIELD (scene3d, a .glb asset, model stats → 5), ACTION_TARGET_TYPES (4 → 5, 7; 7 → 6), CANONICAL_ANCHORS_3D, HEAD_OCCLUDER_RADII, HEAD_OCCLUDER_CENTRE. Example: fixtures/lens/valid/model-3d.json — a crown that bobs and sways (properties 10 and 12) and plays its own clip on an open mouth, glasses on the face, and hearts that rain on the host event purchase.completed.
ENGINE_LEVEL_BY_LAYER_TYPE
ACTION_TARGET_TYPES
CANONICAL_ANCHORS_3D
HEAD_OCCLUDER_RADII
HEAD_OCCLUDER_CENTRE
fixtures/lens/valid/model-3d.json
purchase.completed
format-v1.7.0
A face lens can paint the tracked face: a PNG painted on the face map (MediaPipe's canonical face UVs, CANONICAL_FACE_MESH_UV) is drawn on the face's mesh, so it follows a smile, an open mouth and a blink. Rendering: rendering-v1.md §13. Engine level 6: an engine-5 SDK reports such a lens as too new.
CANONICAL_FACE_MESH_UV
{ "id": "paint", "type": 8, "visible": true, "asset": "tiger_5e6f7a8b.png", "opacity": 0.85, "blend": 2, "holes": { "eyes": true, "mouth": true } }
Face paint (type 8) — asset (a PNG on the face map, at most 1024 × 1024 like every image); opacity 0–1, which it may animate (property 5); blend 1 normal, 2 multiply (darkens and keeps the skin's texture), 3 screen (lightens); holes { eyes, mouth }: true leaves that opening unpainted. A lens has at most one, and it comes before every 3D layer (type 6 or 7), so models are drawn over the paint. Show and hide target it like any layer.
blend
holes
eyes
mouth
Tables in code: ENGINE_LEVEL_BY_LAYER_TYPE (8 → 6), FaceMeshBlend, MAX_FACE_MESH_LAYERS, CANONICAL_FACE_MESH_UV, FACE_MESH_EYE_HOLES, FACE_MESH_MOUTH_HOLES. Example: fixtures/lens/valid/face-paint.json — a multiplied tiger paint under a crown that fades in and hides on a smile.
FaceMeshBlend
MAX_FACE_MESH_LAYERS
FACE_MESH_EYE_HOLES
FACE_MESH_MOUTH_HOLES
fixtures/lens/valid/face-paint.json
format-v1.8.0
A face lens's 3D objects can take the room's light: the host samples the camera's colour on the face and the renderer estimates the light's direction, colour and strength from it. Rendering: rendering-v1.md §14.
scene3d.roomLight (optional) — 1 = match the room's light, 2 = keep the chosen lighting preset. Absent = 1 on engine 7 and later; engines before 7 always draw the preset. Only the field's presence raises the engine level: a lens that wants the default leaves it out.
scene3d.roomLight
"scene3d": { "lighting": 2, "exposure": 1.1, "occluder": true, "roomLight": 2 }
Tables in code: RoomLight, ENGINE_LEVEL_BY_FIELD (scene3d.roomLight → 7), and the estimate's shared numbers LIGHT_SAMPLE_LANDMARKS, LIGHT_SKIN_CHROMA, LIGHT_REFERENCE_AMBIENT, LIGHT_REFERENCE_KEY, LIGHT_SMOOTHING_MS, LIGHT_MIN_FACING, LIGHT_MIN_SAMPLES. Examples: fixtures/lens/valid/room-light.json (the crown with the room light off); invalid room-light-engine-too-low, room-light-out-of-range. The estimator's pinned cases are in fixtures/light/.
RoomLight
LIGHT_SAMPLE_LANDMARKS
LIGHT_SKIN_CHROMA
LIGHT_REFERENCE_AMBIENT
LIGHT_REFERENCE_KEY
LIGHT_SMOOTHING_MS
LIGHT_MIN_FACING
LIGHT_MIN_SAMPLES
fixtures/lens/valid/room-light.json
room-light-engine-too-low
room-light-out-of-range
fixtures/light/
packages/format/schema/lens.v1.schema.json
packages/format/fixtures/lens/valid/
fixtures/lens/invalid/
{ "description": "...", "base": "face-crown", "patch": [{ "op": "replace", "path": "/triggers/0/event/name", "value": "lens.exploded" }], "expectedIssues": [{ "path": "/triggers/0/event/name", "code": "trigger.unknown_event" }] }
base
fixtures/lens/valid/
.json
patch
add
remove
replace
-
expectedIssues
checkRules
path
code
rejectedBySchema: true
schema.*
A JSON Schema check is necessary but not sufficient. Semantic rules run only on a schema-valid manifest — a schema failure is reported as schema issues alone, and the rules below never run against it. For schema failures, conformance means "rejected"; only the path + code of a semantic issue are normative.
layer.duplicate_id
/layers/i/id
asset.missing
/layers/i/asset
assets
asset.unused
/assets/<name>
package.too_large
/assets
assets[*].bytes
>
LENS_PACKAGE_BYTE_CAP
particles.too_many
/layers
maxParticles
trigger.unknown_event
/triggers/i/event/name
effect.started
effect.ended
trigger.threshold_not_applicable
/triggers/i/threshold
trigger.unknown_layer
/triggers/i/actions/j/layer
trigger.action_mismatch
/triggers/i/actions/j
ACTION_TARGET_TYPES[action.type]
trigger.unknown_animation
/triggers/i/actions/j/animation
animation.duplicate_id
/animations/i/id
animation.unknown_layer
/animations/i/layer
animation.property_not_animatable
/animations/i/tracks/j/property
lensAnimatableProperties
placement.mode
animation.duplicate_property
animation.keys_out_of_order
/animations/i/tracks/j/keys/k/atMs
animation.key_outside_clip
animation.value_out_of_range
/animations/i/tracks/j/keys/k/value
animation.autoplay_conflict
/animations/i/autoplay
animation.curve_missing
/animations/i/tracks/j/keys/k/easing
animation.curve_not_applicable
/animations/i/tracks/j/keys/k/curve
animation.anchor_not_whole
animation.unknown_signal
/animations/i/drive/signal
drive.signal
trigger.no_model_clip
trigger-no-model-clip
trigger.emit_over_copies_cap
/triggers/i/actions/j/count
model.stats_missing
model.stats_not_applicable
/assets/<name>/model
model.too_big
/assets/<name>/bytes
model.triangles_over_cap
/assets/<name>/model/triangles
model.textures_over_cap
/assets/<name>/model/textures
model.clips_over_cap
/assets/<name>/model/clips
model.clip_out_of_range
/layers/i/modelClip/index
scene.triangles_over_cap
faceMesh.too_many
/layers/i
face-mesh-two-layers
faceMesh.after_3d
face-mesh-after-model
engine.too_low
/minEngineVersion
ENGINE_LEVEL_BY_EVENT_SOURCE
engine-too-low-for-animation
engine-too-low-for-lane
animation-combine-engine-too-low
model-engine-too-low
scene3d-engine-too-low
glb-asset-engine-too-low
face-mesh-engine-too-low
Notes for implementers:
MAX_TEXTURE_DIMENSION
sheet.frameWidth
sheet.frameHeight
asset.sheet_too_small
frameCount
floor(width / frameWidth) × floor(height / frameHeight)
lenses
docs/api/lenses.md
formatVersion changes only on a breaking change to this document. Adding a layer type, an anchor or an event is not breaking: it raises that feature's engine level, and older engines refuse lenses whose minEngineVersion they do not meet. A renderer must therefore compare minEngineVersion with its own engine version before it validates the manifest strictly: an engine-1 renderer that parsed a lens using a later anchor first would report "invalid anchor" instead of "engine too old".
formatVersion
Tags. The SDKs pin this package by git tag. Until an SDK shipped, every v1 change was part of format-v1.0.0 and the tag moved with it. iOS SDK 0.2.0 shipped on format-v1.0.0 (engine 1), so that tag is now fixed for good: each later additive change gets a new tag (format-v1.1.0, …) and raises the engine level of what it adds.
format-v1.4.0
format-v1.3.0 (2026-11-02) adds no engine level: it recalibrates rendering-v1 6.1's brows.raised and smile from a measured real face. Every lens renders on every engine as before; an SDK pinned to an earlier tag reads those two signals with the first constants.
format-v1.3.0
Face-lens 3D (pose, canonical anchors, occluder) is not in format-v1.4.0: its pose constants are measured on real devices first. It will come as engine 5, format-v1.5.0, so an engine-4 SDK — which renders 3D screen effects — reports a 3D face lens as too new instead of drawing it partly.