# Resin Pour — `resin-pour@1.0.0`

A thread of clear resin pours into a wooden mould of three tinted layers with gems, pearls and rising bubbles, rings of ripples spreading from where it lands. Loops perfectly.

A pour of clear epoxy resin into a wooden mould, over a table of embedded treasures. A glossy thread of resin falls from above, rings of ripples spread across the surface where it lands, and below the surface three layers of tinted resin lie one over another with slowly undulating boundaries, gems, pearls and rings suspended between them and bubbles rising lazily through the layers. Choose the tints (ocean, sunset, forest or amethyst), how many gems are embedded, the strength of the ripples, the wood of the mould (oak, walnut or ebony), the seed, the backdrop colour and whether the camera sways.

- Kind: object; status: published; digest sha256:10172b68f8b0d045cb525b90ea2f77ef6d9a144d39534a4e268e384f4cb1ce15
- Role: Object (3D, three.js): a glossy, craft-and-satisfying resin-art showpiece for DIY, decor and product content.
- Implementation: three; entry `src/resin-pour.js`
- Files: https://aipixelwizard.com/registry/resin-pour/1.0.0/<path> (`LICENSE`, `asset.json`, `demo.js`, `index.html`, `src/resin-pour.js`)
- Manifest JSON: https://aipixelwizard.com/api/v1/visuals/resin-pour/versions/1.0.0
- Runnable demo: https://aipixelwizard.com/registry/resin-pour/1.0.0/index.html (open over http; it imports sibling packages by relative path)
- Dependencies (exact): `three@0.185.1` (source) — Renderer, geometry and shader materials.; `chrome-material@1.1.0` (demo) — Studio environment light, backdrop and contact shadow.; `apw-runtime@1.0.0` (demo) — Demo harness.

## Exports
- `createResinPour({ tints?, gems?, ripples?, wood?, seed? }) => { group, setProgress(progress), dispose() }` — The mould, three resin layers, embedded gems, bubbles, stream and ripples, about 9 across, the floor of the mould on y = 0; needs an environment map.
- `TINTS: { ocean, sunset, forest, amethyst }` — Tints of the three layers, bottom to top.

## Parameters
- `tints` (select one of ocean | sunset | forest | amethyst, default "ocean") — Tints
- `gems` (integer 0–60, default 24) — Gems
- `ripples` (number 0–2, default 1) — Ripples
- `wood` (select one of walnut | oak | ebony, default "walnut") — Mould
- `seed` (integer 1–999, default 16) — Seed
- `background` (color, default "#1a1e28") — Backdrop
- `orbit` (boolean, default true) — Camera sway

## Composition
- Inputs: Time within the loop; the tints, gems, ripples, wood, seed, backdrop and camera sway.
- Outputs: A full frame rendered in 3D with a studio environment.
- Coordinates: The mould is 8 × 8 inside with its floor at y = 0; the layers' tops are at 0.55, 1.0 and 1.5; the stream falls from y = 8 at the centre; the camera looks down at about 36°.
- Lighting: A warm key light with a shadow map and the studio environment on the glossy resin.
- Timing: setProgress(progress) rewrites the layer surfaces and places rings and bubbles; frames render in any order.
- Works with: chrome-material, orbit-camera, kinetic-title, number-reveal
- About 4 200 vertices rewritten per layer each frame; the layers are translucent without true refraction.

## Output and loop
- 1080×1080, 30 fps, 14 s, procedural
- Seamless loop: yes — The ripples travel four wavelengths' worth of phase per loop, the layer boundaries undulate in sines of whole cycles, the stream's stripes move whole periods and each bubble makes whole trips, so the last frame meets the first.
- Verified 2026-10-06 in Chrome 154.0.8037.97 headless on Linux 7.0.0-38-generic (x64), Node 22.14.0 (WebGL 2 via SwiftShader (software)); deterministic: yes; loop check: Frame 0 vs end state (progress 1): mean |Δ| 0.0000, max |Δ| 0 of 255.

## Use it
New project: Create a WebGLRenderer with a studio environment and a shadow-casting light, add createResinPour().group and call pour.setProgress(progress) each frame.

Existing project: Copy src/resin-pour.js; add the group to your scene with an environment map.

Reuse ideas:
- Craft brand: Ocean, walnut.
- Warm decor: Sunset, oak.
- Dreamy: Amethyst, calm.

## Limitations
- The resin is translucent tinted slabs without true refraction, so the embedded objects are not bent.
- The stream is a fixed-shape thread with moving stripes, not a simulated fluid.

## License
MIT. Copyright (c) 2026 AI Pixel Wizard. Released under the MIT License. See LICENSE in this folder.

Provenance: Adapted from the owner's threejs-sketches/objects-scenes/resin-pour (MIT) and rebuilt for AI Pixel Wizard in October 2026 as an original studio object: three translucent tinted layers with whole-cycle undulation, a ring-rippled top, embedded gems, rising bubbles and a striped pouring stream on an exact loop.

