# Scene manifest v1 Product direction: [Project brief](PROJECT-BRIEF.md). Browser input support is below; the implemented hosted batch contract is in [service.md](../skills/bnkr-nft-launch/references/service.md) and `service/schema.js`. The illustrative layer manifest later in this document remains a proposal. ## Executable browser renderer `docs/scene-renderer.js` exports `parseScene(svgText, kind)` and `SceneRenderer`. The demo imports the actual source artwork instead of maintaining separate subject drawing functions. Every nonempty fill and stroke becomes a material surface. Distance masks provide edge shading; all surfaces share the light position, style, time and variation seed. Water receives moving surface detail and reflected foreground silhouettes. Background sky uses procedural cloud density rather than vector cloud silhouettes. Supported source elements: `svg`, `g`, `path`, `rect`, `circle`, `ellipse`, `line`, `polyline`, and `polygon`. Use a numeric viewBox (or width/height), solid colors, basic strokes and transforms. Optional `data-material` and `data-name` attributes assign a material and layer name. Otherwise, the UI exposes the imported layers for assignment. Built-in examples provide assignments by source shape order. Materials: sky, water, wood, fabric, fur, metal, light, ceramic, glass, rope, cloud, backdrop. The scene material control overrides every surface; Natural mix uses the individual assignments. Geometry is preserved across seed variations. Seeds alter procedural textures and small color variations, not subject identity or trait composition. SVG imports reject scripts, external resources and unsupported elements/attributes. Gradients, stylesheets, masks, filters, text and embedded images are not supported. The SVG importer accepts up to 64 shapes and 500 KB. `docs/raster-adapter.js` exports `parseRaster(dataURL, {colors, hints})`. PNG/JPEG/WebP sources use up to 8 MB and 16 megapixels, aspect-fit into a 512-square material mask while retaining RGB detail and alpha. MIT image-q Wu quantization builds 2-32 palette regions (default 16). Fully transparent inputs fail. Default materials use color/position heuristics, not semantic object recognition. Optional hints supply `material`, `name`, RGB hex `color` and/or normalized `[x,y,width,height]` bounds in the fitted square. Review equal-colored objects carefully: a palette mask can contain unrelated objects. No source is replaced with a demo or fallback still. The browser exports a contact sheet of 6, 12 or 24 seeded frames and a JSON recipe containing the source, settings and per-surface materials. The hosted service separately exports per-token PNGs, metadata and animated HTML viewers. Encoded animation is not implemented. Identical seeds and times reproduce the same frame on the same renderer; exact GPU output can vary across devices. ## Collection Manifest Direction A scene is a list of layers plus their material/role/motion and a global style and camera. ```json { "version": 1, "seed": "collection-01", "viewport": {"width": 1024, "height": 1024}, "subject": {"kind": "creature", "asset": "ipfs://..."}, "environment": {"kind": "studio", "layers": ["backdrop", "floor", "light"]}, "layers": [ {"id": "backdrop", "role": "background", "material": "ground", "z": 0}, {"id": "body", "role": "subject", "material": "fur", "z": 10, "motion": "breathing"} ], "style": "glossy-collectible", "lighting": {"keyDirection": 45, "intensity": 0.8}, "motion": {"enabled": true, "speed": 1} } ``` ## Validation Enforce unique IDs, stable z-order, recognized material and style registry identifiers, finite lighting parameters, valid media URLs and layer geometry bounds. Validate contradictory trait exclusions and animation/export support before launch. No wallet/contract details belong in scene manifests. ## Proposed collection renderer API (not implemented) `renderScene(ctx, scene, t)` orchestrates environment, material processing, subject assets, style pass and effects. `t` is explicit to support deterministic frame export.