svg-optical-mesh
Make or change Mesh Gradient (mesh/): a pure 4-tile 8+4 asymmetric WebGL2 GLSL 300 es optical mesh Bento Grid with OKLab color science, unified Fontshare Cabinet Grotesk + IBM Plex Mono typography, au
SKILL.mdskills/svg-optical-mesh/SKILL.md
GitHubOptical mesh
A pure 4-tile 8 + 4 asymmetric Bento Grid of physical light over colour fields — proving why next-generation
mesh gradients belong to optics, advection, and glass rather than static CSS radial blurs or noisy banners.
Read mesh/notes.md first for the module map and shared layout contracts.
The bar (anti-slop laws)
- Zero banner, zero hero, zero header — four silent optical worlds fitting one desktop viewport. Start
directly at the top on gallery stone (
#F2F1ECDay /#04060BNight): left 8 columns hold01 Frosted Halo(span 4) +02 Thin-Film Crystal(span 4) above wide03 Atmospheric Plumes(span 8); right 4 columns span both rows as a full-height#070A10Turrell obsidian vertical totem (04 Backlit Vessels). Placedelineate / Mesh Gradientand global controls (Paletteswatch ·Drift/Still·Night/Day·Source·Skill) on one frameless bare-ground colophon line beneath the grid — never inside a coloured gradient card. - Radical chrome restraint — zero developer jargon. Never dump
GLSL 300 ES,IOR,OPD, watermarks, or control instructions onto the art. Every tile carries only its quiet01–04tabular index, title, and inline specimen strip (04keeps its top-right completely empty aboveReeded's flutes). - One disciplined studio grotesque (
Cabinet Grotesk@1+IBM Plex Mono).- Never mix three competing display voices. Load
https://api.fontshare.com/v2/css?f%5B%5D=cabinet-grotesk@1&display=swappaired withIBM Plex Mono(400;500). - Set tile titles (
13.5 px,wght 540), all 3 Plume poster headlines (wght 560paper vs450obsidian halation compensation), and all 6 Lantern vessel labels (wght 560 → 250optical DOF oncontain: layout stylespans, quantized to integer steps) inCabinet Grotesk. - Set tabular
01–04indices, Plume micro-specs, and specimen strips inIBM Plex Mono. Use real1 px.plume-rulehairline bars instead of ASCII underscores and keep Plume's 2-column Swiss poster grid uncollapsed above145 pxsheet width.
- Never mix three competing display voices. Load
- Unified porcelain/obsidian ground (
uGround) and zero PowerPoint gloss dots.- Both
01 Veiland02 Prismfloat directly on#FCFCFBpure porcelain (Day) or#070913deep obsidian (Night) — NEVER paint a separate bright blue/teal sky-box behind 3D crystals, and NEVER place circular white Blinn-Phong gloss orbs on curved glass surfaces. Let specular brilliance come strictly from grazing thin-film Fresnel caustics.
- Both
- Nonlinear spring scroll, staggered morphing & autonomous vertical Lantern glide.
- Feed passive scroll deltas via power-law impulse (
|dy|^1.3) into an underdampedscrollSurgeSpring(ω = 14, ζ = 0.34) driving Veil defrost tilt + strong-flick morph, Prism angular crystal orbit, Plume thermal updraft surge, and subtle Lantern shimmer. - Stagger autonomous spring morphs (
Veil ~4.2 s,Prism ~5.1 soffset2.3 s). - On
Lantern, hold razor-sharp center lock for2.6 sinDriftmode before launching an elastic spring step vertically (scroll.target += 1with velocity impulse for Y-axis anamorphic streaks); pause immediately on hover/drag/click and resume3.8 safter leave without trapping mobilepan-yscroll.
- Feed passive scroll deltas via power-law impulse (
- Four optical plates:
- 01 — Veil (
shaders/veil.ts): Four rounded 2D SDFs (squircle,circle,reuleaux,pentagon) with decoupledsigmaOuter/sigmaInneranalyticalerfconvolution, lower-right inner contrast pool behind the1.2 pxspecular crescent, upper-right acrylic frost stipple, and decoupled radial zero-cutoff fade melting imperceptibly into porcelain or obsidian. - 02 — Prism (
shaders/prism.ts, shapes0..3): Precision-cut raymarched solids (spool,domewith dished equator planes for zero aliasing,diamond,tetra) floating directly on pureuGroundwith bounding-sphere early-out (r = 0.94, 48 steps with sub-pixel cone-coverage silhouette AA), single 14-step exit trace + 2-step exactd = 0surface snap (0% bevel staircase ripples), analytical R/G/B Cauchy dispersion (1.48/1.52/1.57), Airy thin-film Fresnel caustics (630/532/460 nm), zero circular Phong spots, and zero grey TIR. - 03 — Plume (
shaders/plume.ts): 4-tap curl-warped analytical asymmetric silk-curtain caustics evolving across a 3-chord harmonic cycle on 3 Swiss posters (washwith Night top-lefttypeCalmguard,bloomrising32–38%beneath62%clean paper,emissionobsidian aurora curtains blooming to#FFFDF8). Compact card mode (compact > 0.5) renders one full-bleed silk sheet. - 04 — Lantern (
shaders/lantern.ts): Six glowing superellipses (n = 4.6,Tangent,Aperture,Cipher,Foci,Warp,Reeded) with thick corner Fresnel rims, velvet cavities, jeweler-fine procedural motifs, and two-passRGBA8FBO + 17-tap hash-jittered dual-axis anamorphic blur (Y-axis whenisVerticalLantern(w, h), X-axis when wide).
- 01 — Veil (
- Strict GPU & scroll efficiency, adaptive 24 / 60 fps pacing, silent off-screen.
- On
mesh/, each of the 4 tiles compiles only its own shader vianew MeshRenderer(canvas, { plates }), uses per-tile optimal backing DPR (plume: 1.0,lantern: 1.35,veil: 1.5,prism: 1.65), paces calm ambient drift at 24 fps (41 ms) while ramping cleanly to 60 fps (15.5 ms) during interaction, morphs, or glides, and sleeps completely off-screen viaIntersectionObserver+document.hidden(0off-screen draws). - On
delineate's landing card (card.ts), all 4 live plates share ONEMeshRendererWebGL2 context viagl.scissor+gl.viewportwithResizeObserver-cached rects (zerogetBoundingClientRectin RAF).
- On
The task
- Tuning an optical plate: edit
mesh/shaders/<plate>.tsand verify with?plate=<plate>&stillacross?light=day,?light=night,?palette=0|1|2, and?shape=0..5. - Adding or refining a curated palette: edit
mesh/palette.tsusing OKLab-verified Day/Night 5-stop tuples; inspect every tile in both lights for zero clipped noise or muddy mid-tones. - Adjusting bento grid layout, vertical Lantern auto-scroll, or variable typography: edit
mesh/physics.ts,mesh/show.ts,mesh/main.ts,mesh/stage.css, andmesh/style.css. - Updating the landing-page card: edit
mesh/card.tsandmesh/card.css, keeping all 4 live plates in one shared WebGL2 canvas, zero-race:root--paper/--inkground math, anddata-themesync.
Done means
npm run check and npm run site pass with zero TypeScript or console errors, and in real GPU Chrome on
npm run mesh (http://localhost:5400/):
- Confirm
Cabinet GroteskandIBM Plex Monoreportstatus === "loaded"(zero 3-font clash). - Inspect the pure 4-tile
8 + 4Bento Grid across Desktop (1440 × 900, Day & Night), Tablet (820 × 1180), and Mobile (390 × 844), confirming:- Zero
#horizonbanner, zero coloured box behind controls, and all 4 live optical tiles + frameless colophon fit cleanly in one1440 × 900desktop viewport. 01 Frosted Haloand02 Thin-Film Crystalshare pure#FCFCFBporcelain /#070913obsidian ground with zero painted sky-box behind crystals, zero circular Phong orb dots, and zero equator aliasing ondome.03 Atmospheric Plumespreserves crisp 2-column Swiss poster grids withCabinet Grotesk,1 px.plume-rulehairlines, and readable Night Sheet 01 ink contrast.04 Backlit Vesselsspans full height on the right in#070A10obsidian with a clean empty top-right corner, auto-scrolls vertically every2.6 swith Y-axis anamorphic trails, pauses on hover, and snapsCabinet Grotesklabels sharp (wght 560,filter: none) at center lock.- Off-screen tiles burn
0gl.drawArrayscalls;.mesh-showonsite/dist/index.htmlandsite/dist/mesh/card.jpgrender cleanly.
- Zero