Files
Sanctification/spikes/card-harness/CURRENT-DEFAULTS.md
2026-09-12 08:33:44 -07:00

325 lines
19 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Sanctification Card Lab - Current Defaults
## Approved Runtime Look
- Revision: `runtime-look-v4-2026-09-07`
- Approved: September 7, 2026
- Scope: card geometry, front-face materials, substrate distinction, foil, holographic response, and current finish-mask policy
- Follow-up approval: rigid pack prototype and artifact-free individual card inspection; retained as the foundation for the foil iteration below
- Linen follow-up: `linen-relief-v1-2026-09-10`, visually approved September 10, 2026
- Metal and wood follow-up: `metal-wood-relief-v1-2026-09-10`, visually approved September 10, 2026
- Not yet approved: the new foil treatment/choreography, lighting presets, mobile performance, or wear
These values represent the current visual baseline. Changes should be deliberate and compared against this revision rather than treated as incidental shader cleanup.
The approved September 10 depth follow-ups supersede the v4 linen, metal, and wood
surface responses below: raised-looking weave, recessed metal etching, and raised
wood grain with shader parallax, including Printed ink at oblique angles.
Paper, Plastic, card geometry, backs, and renderer settings retain the v4 baseline.
This visual approval is not
a mobile performance sign-off or approval of the remaining pack choreography.
## Geometry
The card is generated procedurally at runtime. Blender and GLB files are not required.
| Property | Physical value | Runtime value |
|---|---:|---:|
| Width | 63 mm | 2.8571 scene units |
| Height | 88.2 mm | 4 scene units |
| Thickness | 0.4 mm | 0.01814 scene units |
| Corner radius | 2.8 mm | 0.12698 scene units |
| Corner segments | - | 16 |
Front and back use normalized UV coordinates with no runtime mirroring. The front, back, and edge are separate material surfaces.
The edge extrusion renders only side-wall triangles; its generated end caps are
excluded from the draw range. Front and back sit exactly at half the physical
thickness, with no almost-coplanar cap underlay or artificial depth offset.
### Reveal-Safe Card Back
The universal card back is intentionally independent from the selected front finish, substrate, finish strength, surface detail, and condition. This prevents the hidden card identity or variant from being inferred during a pack reveal.
| Property | Fixed value |
|---|---:|
| Roughness | 0.42 |
| Metalness | 0 |
| Clear coat | 0.20 |
| Clear-coat roughness | 0.24 |
| Normal map | None |
The physical edge remains substrate-aware for close inspection. Pack-opening choreography should keep the thin edge from becoming a deliberate pre-reveal inspection surface.
## Renderer
| Setting | Default |
|---|---|
| Output color space | sRGB |
| Tone mapping | ACES Filmic |
| Exposure | 1.0 |
| Pixel ratio | `min(devicePixelRatio, 2)` |
| Scene background | `#0b0e14` |
| Environment | Generated 128 px studio cube texture |
## Camera and Reset Pose
| Setting | Default |
|---|---:|
| Perspective field of view | 34 degrees |
| Near / far planes | 0.1 / 100 |
| Camera position | `(0, 0, 8.2)` |
| Orbit target | `(0, 0, 0)` |
| Orbit distance | 5-12 |
| Card rotation | `(-0.06, 0.12, 0)` radians |
Available inspection poses:
| Pose | Card rotation |
|---|---|
| Front | `(-0.06, 0.12, 0)` |
| Grazing | `(-0.14, 52 degrees, 0)` |
| Edge | `(-0.05, 90 degrees, 0)` |
| Back | `(-0.06, 180 degrees + 0.12 radians, 0)` |
| Free | Current manually controlled rotation |
Reset restores the Front pose, David, Holographic finish, Paper substrate, default surface values, default camera, and default light.
## Light
| Setting | Default |
|---|---|
| Type | Point light |
| Color | `#fff0d0` |
| Position | `(2.2, 2.5, 4.4)` |
| Shader intensity | 3.0 |
| Three.js light intensity | 34 |
| Distance / decay | 20 / 1.7 |
| Environment intensity | 0.7 |
Lighting presets are available for repeatable evaluation but are not yet visually approved:
| Preset | Type | Color | Position | Intensity | Environment | Exposure |
|---|---|---|---|---:|---:|---:|
| Studio | Point | `#fff0d0` | `(2.2, 2.5, 4.4)` | 3.0 | 0.70 | 1.00 |
| Warm gallery | Spot | `#ffd29a` | `(-2.8, 3.1, 4.8)` | 4.0 | 0.52 | 1.04 |
| Cool window | Directional | `#bddcff` | `(-3.4, 4.2, 5.2)` | 2.7 | 0.78 | 1.00 |
| Dramatic spot | Spot | `#ffe1ad` | `(3.6, 1.9, 3.6)` | 4.8 | 0.28 | 0.92 |
| Flat review | Directional | `#ffffff` | `(0.6, 0.8, 5.5)` | 2.25 | 1.00 | 1.00 |
Changing a light type, color, position, intensity, environment contribution, or exposure marks the lighting configuration as Custom.
## User-Facing Surface Controls
| Control | Default | Available range |
|---|---:|---:|
| Finish | Holographic | Printed ink / Foil / Holographic / Gold leaf / Frosted glass |
| Material | Paper | Paper / Linen / Metal / Wood / Leather |
| Finish strength | 0.60 | 0-1 |
| Roughness | 0.23 | 0.05-0.8 |
| Surface detail | 0.14 | 0-0.45 |
| Environment intensity | 0.70 | 0-1.5 |
| Condition | 1.0 (mint) | 0-1 |
| Imperfection seed | 81251 | 1-99999 |
Finish and material are independent concepts, but combinations should exist only when they have an intentional visual interpretation.
Leather, Gold leaf, and Frosted glass are experimental
September 11 additions awaiting visual review. They do not change the existing
default selection or approved recipes. Leather applies generic substrate
relief and edge treatments with grain suppressed over mask-protected ink; the two
new coatings follow each card's finish mask. Vellum and Pearlescent were removed
after visual review; Leather's initial aggressive grain was replaced with shallow,
softly filtered grain pending further approval.
Frosted glass is an opaque etched coating, not a transparent card material. See the
[experimental treatment descriptions](README.md#experimental-materials-and-finishes).
## Substrate Recipes
### Paper
- Roughness floor: `0.56`
- Fiber frequency: `230 x 322`
- Relief amplitude: `0.0014 * detail`
- Broad reflection strength: `0.045`
- Edge: `#9c8c69`, roughness `0.62`, metalness `0.02`, clear coat `0.02`
### Linen
- Roughness floor: `0.70`
- Interlaced thread frequency: `52 x 73`
- Raised weave height span: `0.010 * min(detail, 1.5)` scene units
- Analytic thread slopes keep normal response readable at oblique angles
- Two procedural weave evaluations add bounded view-dependent parallax; artwork,
finish-mask, and wear UVs stay anchored
- Grazing denominator floor: `0.30`; detail is capped at `1.5` for linen relief
- Subpixel threads fade using screen-space derivatives
- Base reflection strength: `0.025`; broad thread-ridge highlight strength:
`0.025 + 0.055 * grazing`, modulated by resolved ridge height and surface detail
- Edge: `#a89772`, roughness `0.78`, metalness `0`, clear coat `0`
This is shader relief, not displaced geometry: the card silhouette and physical
thickness are unchanged. The Surface detail control scales the effect, including
turning it off at zero. Printed ink retains the thread lighting without requiring
a foil finish; foil and holographic coating formulas are unchanged.
### Plastic
- Roughness ceiling: `0.25`
- Dielectric Fresnel base: `0.04`
- Reflected fraction cap: `0.32`
- Direct highlight cap: `0.50`
- Edge: `#d4cab0`, roughness `0.24`, metalness `0`, clear coat `0.72`
### Metal
- Visually approved September 10, 2026
- Roughness ceiling: `0.20`
- Artwork-driven etch: darker values are recessed more deeply
- Etch relief amplitude: `-0.010 * depth * min(detail, 1.5)` (previously `-0.0065`)
- Bounded predictor/corrector parallax shifts artwork and finish mask together;
grazing denominator floor `0.35`, fading within `0.025` UV of the card edges
- Directional recess shadow strength: `0.22`, scaled by detail and local ridge depth
- Cavity shading: `0.12` on the metal underprint and `0.06` on the combined printed result
- Metal underprint blend: `0.42`
- Edge: `#a8adb7`, roughness `0.20`, metalness `0.86`, clear coat `0.18`
Metal + Foil is a special intentional combination:
- Preserves printed artwork colors
- Reduces etch depth beneath the foil mask by at most 25%
- Adds only `0.0005 * mask * detail` of raised relief
- Uses restrained champagne tint `#ffd694`
- Plating weight is capped at `0.34`
- Must not turn the illustration into opaque gold
Parallax and directional recess shading add depth cues beyond the stronger relief.
The existing underprint tint and foil/plating recipes are retained; the finish
mask follows the shifted artwork. Card thickness and geometry are unchanged.
### Wood
- Visually approved September 10, 2026
- Roughness floor: `0.48`
- Warped longitudinal grain frequency: `170`
- Relief amplitude: `0.012 * min(detail, 1.5)` (previously `0.007 * detail`)
- Two procedural grain evaluations provide bounded parallax; grazing denominator
floor `0.35`. Artwork stays anchored; tint and relief use the same shifted grain.
- Warm tint blend: `0.25`
- Reflection strength: `0.09`
- Edge: `#6b3f21`, roughness `0.56`, metalness `0`, clear coat `0.08`
## Finish Recipes
### Printed Ink
- Returns the substrate response without an additional coating.
- Substrate relief and reflection must remain visible.
### Foil
- Uses the finish mask as selective coverage.
- Effective finish strength: `finishStrength * 0.8`
- Maximum coating weight: `0.48`
- Coating response cap: `0.78`
- Reflection is warm and screened with the original artwork rather than replacing it.
- Reduced sheen applies only to Foil, not Holographic.
### Holographic
- Effective finish strength: `finishStrength`
- Maximum coating weight: `0.92`
- Coating response cap: `1.8`
- Spectral reflection blend: `0.72`
- Artwork-to-spectral coating blend: `0.48`
- The approved spectrum uses UV, view direction, and light direction so color shifts while the card moves.
- Do not weaken the holographic color response to solve mask problems; correct the mask instead.
## Finish Masks
### David
- Saturation threshold: `smoothstep(0.18, 0.62)`
- Value threshold: `smoothstep(0.015, 0.16)`
- Retains soft title-panel protection.
### Timothy
- Saturation threshold: `smoothstep(0.08, 0.58)`
- Value threshold: `smoothstep(0.015, 0.16)`
All finish masks should:
- Protect critical text unless a treatment is intentionally designed for it.
- Follow compositional regions such as stained-glass panes, ornament, borders, garments, and environmental color.
- Be reviewed while the card rotates under multiple lighting angles.
## Wear and Imperfections
Wear/condition and imperfections are deferred product features. These settings document existing experimental harness behavior, not M1 requirements.
Condition uses `1.0` for mint and `0.0` for the most worn supported appearance. The approved v4 material baseline remains unchanged at the mint default.
- Edge wear uses seeded irregular width and substrate-appropriate exposed colors.
- Three deterministic fine scratches and two deterministic scuff regions are generated from the imperfection seed.
- Scratches and scuffs perturb the surface normal slightly and reduce finish coverage where the coating is damaged.
- Paper and linen expose pale fibers, plastic becomes cloudy, metal exposes brighter raw metal, and wood exposes a lighter brown layer.
- Wear remains bounded so the card artwork stays readable even at condition `0.0`.
## Local Asset Evaluation
Lab mode can replace the active artwork or finish mask with a local image through the browser file picker. Local files remain in browser memory, are not copied into the project, and are discarded when the page reloads or the selected fixture is restored. Reset restores the David reference artwork and mask.
## Experiment Snapshots
Lab mode can save named experiments in browser storage, export or import a versioned JSON snapshot, and capture the current canvas as PNG. Snapshot schema version 2 records:
- Runtime-look revision and save time
- Reference fixture and custom asset filenames
- Finish, substrate, and surface controls
- Condition and imperfection seed
- Lighting preset, environment, type, color, position, intensity, and exposure
- Card rotation, camera position, and orbit target
Local image contents are intentionally not embedded in snapshots. When a snapshot records custom artwork or a custom mask, those files must be loaded again after restoring the configuration.
Schema version 1 snapshots remain loadable and restore as mint condition with seed `81251`.
## Source of Truth
- Geometry: `src/cardGeometry.ts`
- Runtime shader: `src/cardMaterial.ts`
- Scene and control defaults: `src/main.ts`
- Generated asset contract: `public/reference/manifest.json`
- Art policy: `../art-direction.md`
## Tear-Open Foil Pack (Next Review Iteration)
Pack is a third mode beside Inspect and Lab. It does not revise
`runtime-look-v4-2026-09-07`, saved experiments, or the reference asset contract.
- Controller: `src/packOpening.ts`; foil meshes: `src/foilWrapper.ts`; integration and lazy local-asset loading: `src/main.ts`.
- States: `sealed → opening → stackReady → lifting → lifted → revealing → inspecting → advancing → stackReady / complete`.
- Order: David / Printed ink / Linen; Timothy / Foil / Paper; David / Holographic / Metal. Surface defaults remain strength `0.60`, roughness `0.23`, detail `0.14`, mint condition and seed `81251`. Pack inherits the current lighting.
- Wrapper: two `64 × 80` subdivided pouch surfaces joined at their side/bottom boundaries and one `64 × 10` top ribbon, sharing horizontal samples along the attached seam. Total 21,760 triangles. Dimensions: width `3.36`, bottom `-2.24`, tear seam `1.97`, top `2.28`; center depth `-0.09`, inflated half-depth `0.37`. Surface folds are shallow deterministic UV-based displacements; contact dent is bounded to `0.045` units. Side and bottom crimps remain separated surfaces, with no overlapping cap/label meshes or transparent fades.
- Foil material: deep teal printed canvas, warm gold seam and restrained typography; standard material roughness `0.43`, metalness `0.68`, double-sided. The existing scene lighting/environment lights the foil. This is a wrapper-specific recipe, not a card-material revision.
- Opening lasts `3200 ms` from sealed (remaining duration scales with retained progress); lift `620 ms`, reveal `820 ms`, advance `650 ms`. Elapsed-time smoothstep interpolation and quaternion rotation remain unchanged for card transitions.
- Opening's eased progress intervals: tear `0–0.38`; strip detachment/curl-away `0.38–0.52`; mouth spread `0.50–0.62`; card extraction `0.62–0.826`; empty pouch exit `0.83–0.87`; stack settling `0.87–1`. Each successive card starts/ends extraction `0.018` progress later, staying at its established depth and scale. Extraction rises `4.4` units, clearing the entire pouch before its lateral exit. The wrapper never drops through the floor or crosses the inspecting card.
- Mouth lips spread in depth to a `0.64` half-opening envelope; the front lip bows down `0.28` units and the rear up `0.08`, exposing the opening without added rim layers. The released ribbon curls up/back around the moving tear front, then moves right and away before extraction begins.
- Seam input: a projected mouse/touch hit area at least `44 px` high; a rightward drag across `75%` of projected pack width (at least `80 px`) traverses a full tear. Progress is monotonic and survives partial release, pointer cancellation/lost capture and mode switches. A completed pull releases into the remaining choreography; otherwise **Finish opening** or another seam drag resumes. **Tear open** is the button/keyboard equivalent. The progress indicator exposes the tear percentage.
- Reduced motion: `70 ms` per transition, with identical resting states and event order.
- Input ownership: the Pack controller alone writes Pack transforms. Manual input pauses scripted motion without snapping; Continue resumes the elapsed transition. The seam gesture can take over a still-tearing animation at its current progress. A second touch cancels seam ownership in favor of pinch; wheel zoom releases captured gestures. Rotation is allowed only after revealing; zoom is available throughout. Press/release contact deformation is damped, except under reduced motion where it is immediate.
- Skip finishes one transition or one next resting-state step. Restart clears progress and event guards. Mode changes pause Pack while retaining the separate Inspect/Lab scene and assets.
- Hidden fronts are disabled, all backs share the universal fixed material, and hidden edges use the same mint paper recipe. Real substrate edges become visible only after the reveal finishes.
- Lift ownership: the existing stack card is the animated object, with the same root and mesh UUIDs throughout. There is no separate active-card renderer or stack placeholder. All unrevealed fronts remain disabled throughout the lift.
- Stack depth spacing: `0.055` scene units between roots at `0.88` scale, leaving approximately `0.039036` between neighboring surfaces. The current card lifts away while reserve cards ease to a visible lower-right position, preserving their depth spacing and face-down orientation.
- Inspection clearance: the full card corner-sweep radius is derived from the shared scene dimensions (approximately `2.458`). Lift finishes at local `z = max(3, radius + 0.5)` before reveal or manual rotation. With current dimensions, even the conservative full-rotation envelope stays over `0.61` units ahead of the reserve stack and over `0.60` above the floor. The opened wrapper is hidden and sits outside this envelope.
- Reserve cards remain visible through reveal, inspection, and exit. They are offset by `(1.05, -0.4, 0)` from their normal stack poses while inspecting, then recenter during advancing. The active card exits laterally on the same safe inspection plane, never diving back through the reserve stack.
- Pack uses a separate responsive 34-degree camera, fitted to the wrapper and compact bottom controls; pinch/wheel zoom spans `0.62–1.45` of its fitted distance. Opening-only framing retreats up to `8` units and raises its center `1.6` units during extraction, returning fully before stackReady. A `2.15`-unit camera retreat eases with the lift and reverses on exit to preserve the established card framing at the deeper inspection plane. One camera-update helper combines retreat, responsive fit, vertical framing, and user zoom; paused motion preserves them all. Inspect/Lab camera defaults are unchanged. Aggressive user zoom may crop the scene, as in the existing inspection flow.
No pack progress persistence, random rewards, backend, sound, haptics, particles,
cloth, or general timeline/editor are included. Deformation is an authored, reversible
evaluation of progress, not physical tearing or arbitrary cloth manipulation. The
tear itself cannot be reversed by dragging left; only Restart reseals the pack.
Wrapper art and the new foil choreography remain review-only. Desktop browser and
emulated mobile checks are not physical-device performance or touch-feel sign-off.