by adom
The Adom logomark is a hydrogen 2p orbital: psi = (2p_x + 2p_y)/sqrt(2). A live Babylon.js lab that proves it (all 16 real spherical harmonics, the alignment cheat, and the directed loop), plus loader.html: the same animation as one dependency-free WebGL file for webview load screens.
← Commit history
Publish 1.1.0
10 files changed
+2051−373
README.md+47−26@@ -19,8 +19,11 @@ This page is the working proof. harmonics through l = 3 as live gain sliders over an evolving superposition), Logo cheat (align the orbital against the real logo vectors and measure the fit), Scratch (the earlier cut kept for experiments), and Final (the directed cut: teal- intro, play, dinner call, cheat, sit, back out, a fresh roll every pass). Scroll below the lab for the loader docs.+ intro, play, dinner call, morph, sit, back out, a fresh roll every pass). Scroll below the lab for the loader docs. - **loader.html**: the animation as ONE dependency-free file for webview load screens.+ Take 2: the lobes morph into the logo's leaves, nothing is cut or faded.+- **loader-take1.html**: the earlier take, kept: the orbital cut to the mark per pixel,+ the excess melting away, and the flat mark handed over inside the sit. - **orbital-lab.html**: the full standalone app (CDN Babylon). - **assets/**: the logomark vectors and the 128-sample measured edge profile. - **tools/**: the generators. `build-readme.py` produces readme.html for the wiki@@ -31,7 +34,7 @@ This page is the working proof. ## Use it as a webview loader `loader.html` is raw WebGL: no Babylon, no CDN, no fonts, no fetch. One file, about-24 KB on disk and under 10 KB gzipped, zero external requests, one draw call over+45 KB on disk and 18 KB gzipped, zero external requests, one draw call over 12,800 vertex-shader-displaced triangles, roughly 0.06 ms of JS per frame. The GLSL is extracted verbatim from the Babylon lab at build time, so the two render identically; the wheel is tuned against the lab's MEASURED response: the same@@ -49,20 +52,20 @@ state is rolled at every epoch. | param | default | meaning | |---|---|---|-| pt | 4.5 | playground seconds of free evolution between epochs |-| dt | 3 | seconds to steer onto the mark, and back out |-| ct | 0.3 | seconds before the epoch the outline cheat fades in |-| st | 0 | seconds the mark is held dead still |-| logo | 100 | peak opacity of the flat teal mark, in percent |-| llead | 1 | seconds the logo fade starts before the sit and ends after it |-| tlead | 1.5 | seconds before the epoch the dark lobe fades to teal |-| ov | 1 | 0 makes the cheat its own act after the steer |+| pt | 5 | playground seconds of free evolution between epochs |+| dt | 1.5 | seconds to steer onto the mark (the dive), and back out |+| ct | 0.6 | seconds the morph takes: the lobes become the leaves before the epoch and lobes again after it; keep it in the late part of dt |+| st | 1 | seconds the mark is held dead still (the crisp vector mark shows here) |+| logo | 100 | how flat the 3D gets for the logo moment, in percent; at 100 the crisp vector mark takes over during the sit |+| llead | 0.9 | seconds before the sit the 3D starts flattening to teal, and after it the shading comes back |+| tlead | 0.4 | seconds before the epoch the dark lobe turns teal |+| ov | 1 | 0 makes the morph its own act after the steer | | intro | 1 | 0 skips the teal logo intro | | mode | performance | lightweight bundles fps 30, dpr 1, seg 48, no AA; performance (alias sexy) is full quality; explicit params override | | seg | 80 | sphere tessellation 24 to 128 | | aa | 1 | 0 disables antialiasing | | dpr | 2 | devicePixelRatio cap, 1 to 3 |-| fps | off | cap the render rate for spinner duty (floor 20); rAF yields between frames and stops when hidden |+| fps | 60 (30 lightweight) | cap the render rate (floor 20); fps=0 uncaps; rAF yields between frames and stops when hidden | | bg | 0d1117 | hex background, or transparent to composite over the container's background (GL alpha); also settable live by postMessage | | hint | 0 | 1 shows the small click-to-zoom pill in armed contexts; off by default for purity; also flippable live by postMessage | | margin | 0 | percent of the container left empty around the mark (80 = small and centered, 20 = nearly fills); zoom-out caps at 40% past the margined framing |@@ -79,10 +82,11 @@ loader is that lab distilled to one dependency-free file. |---|---|---|---| | Babylon.js + app | ~1.4 MB engine + page | CDN + page | after download and parse | | three.js + app | ~170 KB engine + page | CDN + page | after download and parse |-| loader.html | 9,912 bytes, everything included | zero | tens of milliseconds |+| loader.html | 18,314 bytes, everything included | zero | tens of milliseconds | -Measured on this build: 24,379 bytes on disk, 9,912 gzipped, including shaders,-the 286-point logomark vectors, the 128-sample edge profile, and the timeline.+Measured on this build: 44,918 bytes on disk, 18,314 gzipped, including shaders,+the 286-point logomark vectors, the measured edge profiles, the 128-angle leaf+table the morph lands on, and the timeline. Runtime: 0.057 ms of JS per frame (about 1.4% of a 240 Hz budget), one draw call over 12,800 triangles / 6,561 vertices, all displacement in the vertex shader, and requestAnimationFrame pauses it when hidden so a backgrounded webview costs@@ -134,22 +138,39 @@ continuous mid-animation resizes; re-backing is coalesced into the render loop repaint clean every frame with no blank flashes. Run `resize-proof.html` from the repo to torture-test it in your own container. -## The three tuned cuts+## How the logo moment works (take 2) -The settings the loop was tuned to, saved live while dialing it in. All three ship in-the Final tab's snapshot pulldown, and each maps to loader URL params.+A pure 2p lobe is a ball touching the origin. Its cross-section disk is mapped onto+the logo's leaf, radially from a center on the leaf's axis: the ball's center lands+on it, the rim on the leaf's outline, the node on the leaf's corner. Heights are+kept, so the ball becomes a leaf-shaped solid whose outline IS the vector mark.++- Over **ct** the live orbital blends into that solid while perspective flattens+ away, so at the epoch the 3D silhouette is the flat outline exactly.+- The shading keeps the orbital's own normals, so the map never creases the light.+- Over **llead** the shading flattens to the brand teal, and the crisp vector mark+ replaces the 3D whole, on one frame, only during the sit, where the two are identical.+- Every vertex within one mesh step of the node collapses to the corner, so no+ triangle can bridge the two leaves mid-morph.++Nothing is cut, and nothing crossfades.++## The tuned cuts++All ship in the Final tab's snapshot pulldown, and each maps to loader URL params. | cut | numbers | why it feels the way it does | |---|---|---|-| john fav (the page preview) | pt 5, dt 0.7, ct 0.2, st 1, logo 100%, llead 0.6, tlead 0.2 | The keeper: a 0.7s dive into a real 1s sit, teal unifying only 0.2s before arrival so the colour snap lands WITH the logo. Loader: `?pt=5&dt=0.7&ct=0.2&st=1&llead=0.6&tlead=0.2` |-| john 1 (default) | pt 4.5, dt 3, ct 0.3, st 0, logo 100%, llead 1, tlead 1.5 | The stately cut: a long 3s dive so you watch the physics converge, the cheat held to the last 0.3s so you never catch it working, no sit, the logo moment living entirely on its 1s lead. Loader: no params. |-| snap 2 | pt 5, dt 1, ct 0.2, st 0, logo 100%, llead 0.3, tlead 1.5 | The middle cut: a 1s dive, a tight 0.3s logo flash. Punchy, still readable. Loader: `?pt=5&dt=1&ct=0.2&llead=0.3` |-| snap 3 | pt 5, dt 0.7, ct 0.2, st 0, logo 80%, llead 0.5, tlead 1.5 | The heartbeat cut: a 0.7s dive, logo capped at 80% so the 3D shows through the flash. A pulse, not a poster. Loader: `?pt=5&dt=0.7&ct=0.2&logo=80&llead=0.5` |--Knob meanings: pt free play between epochs; dt the dive onto the mark; ct how late the-outline cheat is held back (smaller = sculpting nearly invisible); st dead-still hold;-logo the flat mark's peak opacity; llead starts the logo fade that many seconds before-the epoch and ends it that many after; tlead turns the dark lobe teal that early.+| take 2 D (default, the page preview) | pt 5, dt 1.5, ct 0.6, st 1, logo 100%, llead 0.9, tlead 0.4 | A 1.5s dive with the morph in its last 0.6s, so the orbital has settled to two round lobes before they flow into the leaves, then a 1s sit on the crisp mark. Loader: no params. |+| john fav | pt 5, dt 0.7, ct 0.2, st 1, logo 100%, llead 0.6, tlead 0.2 | The previous default: a fast 0.7s dive into a 1s sit; with take 2 the 0.2s morph reads as a snap. Loader: `?pt=5&dt=0.7&ct=0.2&st=1&llead=0.6&tlead=0.2` |+| john 1 | pt 4.5, dt 3, ct 0.3, st 0, logo 100%, llead 1, tlead 1.5 | The stately cut: a long 3s dive, no sit. Loader: `?pt=4.5&dt=3&ct=0.3&st=0&llead=1&tlead=1.5` |++Knob meanings: pt free play between epochs; dt the dive onto the mark; ct the morph;+st dead-still hold; logo how flat the 3D gets; llead how early it starts flattening;+tlead how early the dark lobe turns teal.++`loader-take1.html` is a built snapshot of the earlier take (ct is the cut, logo the+flat overlay); `tools/build-loader.py` regenerates `loader.html` (take 2) only. ## Rebuilding
SKILL.md+19−13@@ -3,8 +3,8 @@ name: orbital-lab description: >- The physics behind the Adom logomark (it is a hydrogen 2p orbital, psi = (2p_x + 2p_y)/sqrt(2)) and, for developers, the Adom loading animation:- loader.html, a single dependency-free raw-WebGL file (24,379 bytes, 9,912- gzipped, zero requests, 0.057 ms JS per frame, one draw call) that plays the+ loader.html, a single dependency-free raw-WebGL file (44,918 bytes, 18,314+ gzipped, zero requests, one draw call) that plays the brand animation as a webview load screen. Use when someone asks why the Adom logo is an orbital, wants the orbital demo shown, needs the Adom loading animation or load screen for a webview, or asks how big or heavy the loader@@ -30,11 +30,13 @@ and serve it beside your app: </iframe> <!-- when your app is ready, fade the iframe out and remove it --> -URL params (defaults are the tuned john 1 cut): pt (4.5) free-play seconds-between epochs; dt (3) the dive onto the mark; ct (0.3) how late the outline-cheat fades in; st (0) dead-still hold; logo (100) flat-mark peak opacity in-percent; llead (1) logo fade lead seconds; tlead (1.5) teal-unification lead;-ov (1) 0 makes the cheat its own act; intro (1) 0 skips the teal intro;+URL params (defaults are the tuned take 2 D cut, where the lobes MORPH into the+logo's leaves and nothing is cut or faded): pt (5) free-play seconds between+epochs; dt (1.5) the dive onto the mark; ct (0.6) the morph, in the late part of+the dive; st (1) dead-still hold, where the crisp vector mark takes over; logo+(100) how flat the 3D gets, in percent; llead (0.9) flattening lead seconds;+tlead (0.4) teal-unification lead; ov (1) 0 makes the morph its own act; intro+(1) 0 skips the teal intro; interact (0) 1 arms click-to-zoom, for previews and demos only, never for real load screens, which must stay input-transparent; margin (0) percent of the container left empty around the mark, 80 sits it small in the middle, 20@@ -77,9 +79,12 @@ wiki page's live viewer demonstrates this with container-background swatches. Measured, not estimated, on the shipped build: -- One file: 24,379 bytes on disk, 9,912 bytes gzipped, and that INCLUDES the- shaders, the 286-point logomark vectors, the 128-sample measured edge- profile, and the whole timeline.+- One file: 44,918 bytes on disk, 18,314 bytes gzipped, and that INCLUDES the+ shaders, the 286-point logomark vectors, the measured edge profiles, the+ 128-angle leaf table the morph lands on, and the whole timeline.+- `loader-take1.html` is the earlier take, kept as a built snapshot: the+ orbital cut to the mark per pixel with the excess melting away and the flat+ mark handed over inside the sit (ct is the cut, logo the flat overlay). - Zero external requests: no CDN, no fonts, no fetch. The file is its entire dependency closure. First frame in tens of milliseconds. - 0.057 ms of JavaScript per frame (16 coefficient cosines plus uniform@@ -145,9 +150,10 @@ readbacks for the fit measurement); the loader is that lab distilled. - Inert by default: a load screen never eats input. `?interact=1` arms click-to-capture (teal ring + glow); click-away or blur releases.-- `?logo=N` sets the logo fill's peak fade-in opacity in percent (default- 100). 50 ghosts it, 10 whispers it, 0 disables the fill while the surface- still sculpts into the mark shape. Live: postMessage `{adomLoader:{logo:N}}`.+- `?logo=N` sets how flat the 3D gets for the logo moment, in percent (default+ 100: the flat brand teal, and the crisp vector mark takes over during the+ sit). Lower keeps some 3D shading; 0 keeps it all while the surface still+ morphs into the mark shape. Live: postMessage `{adomLoader:{logo:N}}`. - `?speed=N` runs the ANIMATION clocks at N percent (10 = a tenth speed). Camera springs and interaction stay real time. Live: postMessage `{adomLoader:{speed:N}}`.
loader-take1.htmladded+683@@ -0,0 +1,683 @@+<!DOCTYPE html>+<html lang="en">+<head>+<meta charset="UTF-8">+<meta name="viewport" content="width=device-width, initial-scale=1">+<title>Adom loader</title>+<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='5' fill='%2300b8b0'/%3E%3C/svg%3E">+<style>+ html,body{margin:0;height:100%;overflow:hidden;background:#0d1117}+ canvas{position:absolute;inset:0;width:100%;height:100%;display:block}+</style>+</head>+<body>+<canvas id="gl"></canvas>+<canvas id="ov"></canvas>+<script>+/* The Adom logomark is a hydrogen 2p orbital: psi = (2p_x + 2p_y)/sqrt(2).+ This file is the wiki page adom/orbital-lab distilled to a loader. */+'use strict';+var Q=new URLSearchParams(location.search);+function P(k,d){+ var o=window.__ADOM_LOADER_PARAMS||{};+ if(k in o) return o[k];+ var v=parseFloat(Q.get(k));return isFinite(v)?v:d;+}+var PT=P('pt',4.5), DT=P('dt',3), CT=P('ct',0.3), ST=P('st',0);+var LOGO_PK=Math.max(0,Math.min(1,P('logo',100)/100));+var LLEAD=Math.abs(P('llead',1)), TLEAD=Math.abs(P('tlead',1.5));+var EMERGE=String(P('emerge',0))==='1';+/* speed: percent playback rate for the ANIMATION clocks (timeline, evolution,+ birth). 100 is real time; 10 is a tenth speed. Camera springs and user+ interaction stay real-time so the feel never goes gluey. */+var SPEED=Math.max(0.05,Math.min(3,Math.abs(P('speed',100))/100));+/* orbit: automatic camera yaw during PLAY, in degrees per second (0 = off,+ try 12). The angle glides to the nearest whole turn as sculpting begins,+ so every epoch still lands square-on for the logo overlay, and play+ resumes from the equivalent orientation with no unwinding sweep. */+var ORBIT=(P('orbit',0)||0)*Math.PI/180;+var OV=Q.get('ov')!=='0', DO_INTRO=Q.get('intro')!=='0'&&!EMERGE;+/* margin: percent of the container left EMPTY around the mark. 0 is the+ classic framing; 80 sits the anim small in the middle of a big window.+ Implemented as camera distance, so perspective, the overlay match and the+ epoch glide all stay exact at any margin. */+/* margin accepts NEGATIVE values for full bleed: -N moves the camera N%+ closer, so -50 doubles the mark and it runs off every edge. Clamped at+ -70 so the surface never crosses the near plane. */+var MARGIN=Math.max(-70,Math.min(90,P('margin',0)));+function homeFor(m){ return m<0 ? R*(1+m/100) : R/(1-m/100); }+/* MODES bundle the quality knobs so nobody has to reason about them:+ mode=lightweight fps 30, dpr 1, seg 48, no antialias: spinner fleets,+ dialogs, battery. Looks fine at small sizes.+ mode=performance (the default, alias mode=sexy) uncapped, dpr up to 2,+ seg 80, antialias: hero surfaces, big canvases.+ Explicit params always override the mode. rAF still yields between frames+ and stops when hidden in every mode. seg and aa are boot-time; fps can be+ changed live by postMessage in armed contexts. */+var MODE=String((window.__ADOM_LOADER_PARAMS&&window.__ADOM_LOADER_PARAMS.mode)||Q.get('mode')||'').toLowerCase();+if(MODE==='sexy')MODE='performance';+var LIGHT=(MODE==='lightweight'||MODE==='light');+/* SAFEGUARD (2026-08-04, upstreamed from Hydrogen Desktop): default to a BOUNDED 60fps even+ in performance mode instead of uncapped. An uncapped WebGL surface on a slower/integrated+ GPU pegs the GPU and starves the embedding app's UI thread (frozen nav) and delivers frame+ BURSTS that read as "crazy speed". A hero that genuinely wants uncapped opts out: ?fps=0. */+var FPSCAP=Math.max(0,P('fps',LIGHT?30:60)); if(FPSCAP>0&&FPSCAP<20)FPSCAP=20;+var DPRCAP=Math.max(1,Math.min(3,P('dpr',LIGHT?1:2)));+var SEGQ=Math.round(Math.max(24,Math.min(128,P('seg',LIGHT?48:80))));+var AAON=P('aa',LIGHT?0:1)>=1;+var lastDraw=0;+/* Background contract: bg=HEX paints a solid, bg=transparent leaves the GL+ clear at alpha 0 so the CONTAINER's background shows straight through, and+ the mark composites onto whatever surface it sits on (a toolbar, a hero,+ anything). Changeable live by postMessage in armed contexts. */+var BG=[0.051,0.067,0.090], TRANSP=false;+function applyBg(raw){+ raw=String(raw||'').toLowerCase().replace('#','');+ TRANSP=(raw==='transparent');+ var ok=/^[0-9a-f]{6}$/.test(raw);+ BG=ok?[parseInt(raw.slice(0,2),16)/255,parseInt(raw.slice(2,4),16)/255,parseInt(raw.slice(4,6),16)/255]+ :[0.051,0.067,0.090];+ var css=TRANSP?'transparent':(ok?('#'+raw):'#0d1117');+ document.documentElement.style.background=css;+ document.body.style.background=css;+}+applyBg((window.__ADOM_LOADER_PARAMS&&window.__ADOM_LOADER_PARAMS.bg)||Q.get('bg'));++var VS=`precision highp float;+attribute vec3 position;+uniform mat4 uMVP;+uniform float c[16];+uniform float uScale;+varying float vPsi;+varying vec3 vN;++float psiOf(vec3 d){+ float x=d.x, y=d.y, z=d.z;+ float s = 0.0;+ s += c[0] * 0.2820948;+ s += c[1] * 0.4886025 * y;+ s += c[2] * 0.4886025 * z;+ s += c[3] * 0.4886025 * x;+ s += c[4] * 1.0925484 * x * y;+ s += c[5] * 1.0925484 * y * z;+ s += c[6] * 0.3153916 * (3.0*z*z - 1.0);+ s += c[7] * 1.0925484 * x * z;+ s += c[8] * 0.5462742 * (x*x - y*y);+ s += c[9] * 0.5900436 * y * (3.0*x*x - y*y);+ s += c[10] * 2.8906114 * x * y * z;+ s += c[11] * 0.4570458 * y * (5.0*z*z - 1.0);+ s += c[12] * 0.3731763 * z * (5.0*z*z - 3.0);+ s += c[13] * 0.4570458 * x * (5.0*z*z - 1.0);+ s += c[14] * 1.4453057 * z * (x*x - y*y);+ s += c[15] * 0.5900436 * x * (x*x - 3.0*y*y);+ return s;+}++uniform float uFlat, uRot, uPlump, uGap, uEdge, uCorner;+uniform float uLogoR[128]; // the mark's measured edge, 0..90 degrees+varying vec2 vQ; // in-plane shape position, before the gap: the pixel cut reads it+varying float vFace; // > 0 where the outward normal faces the camera+varying float vZ; // shape-space depth, for the trim's perspective++/* The morph target for ANY direction.++ Honest note on what works and what does not.++ Sliding only the RADIUS toward the mark's edge leaves out-of-quadrant+ vertices with a target of zero, so they pile at the node: that was the bead+ and the creases.++ Moving the DIRECTION too seemed like the fix, but both variants failed for+ the same underlying reason: this sphere's parameterisation covers the full+ 180-degree lobe, and the mark's leaf is 90 degrees. Clamping stacks half the+ vertices on the boundary planes (shredding). Remapping 2:1 spreads them, but+ then every vertex including those at the node gets pushed out to the leaf+ edge, so the nodal pinch vanishes and the two lobes fuse into a tube.++ What actually measures best is the simplest thing: keep the physics surface+ exactly as the wavefunction gives it, and cut it to the mark's quadrants.+ That scored 95.9% IoU at 0.8% spill and renders clean, because it never+ moves a vertex anywhere the surface was not already. It IS a clip, and that+ is the honest description of the licence in the mark. */+vec3 shapedPos(vec3 dir, float ovK){+ float pp = psiOf(dir);+ vec3 physics = dir * abs(pp);+ if (uFlat <= 0.0001) return physics;++ float PI4 = 0.7853981634;+ float axis = radians(uRot);+ float s = (pp >= 0.0) ? 1.0 : -1.0;+ float lobe = (pp >= 0.0) ? axis : axis + 3.14159265;++ /* The quadrant cut itself is done PER PIXEL in the fragment shader (vQ+ below). Doing it here, by projecting every out-of-quadrant vertex onto+ the cut planes, built a paper-thin sheet of squashed triangles along each+ plane: edge-on it rendered as a hairline at the seam, and while the cut+ ramped in it fanned out into jagged fins. Discarding fragments instead+ gives a mathematically straight edge exactly on the plane, with no+ geometry left behind to catch the light.++ What stays here is only the CORNER rounding, and only its soft excess+ over a hard cut: min(d,0) rounded is 0.5*(d - sqrt(d*d + rc*rc)), and+ subtracting min(d,0) leaves the gentle inward ease near the plane while+ the hard part is left to the pixel cut. */+ vec2 q = physics.xy;+ float rc = uCorner;+ if (rc > 1e-5) {+ vec2 e1 = vec2(cos(axis - PI4), sin(axis - PI4));+ vec2 e2 = vec2(cos(axis + PI4), sin(axis + PI4));+ float d1 = dot(q, e1) * s;+ q -= e1 * ((0.5 * (d1 - sqrt(d1*d1 + rc*rc)) - min(d1, 0.0)) * s);+ float d2 = dot(q, e2) * s;+ q -= e2 * ((0.5 * (d2 - sqrt(d2*d2 + rc*rc)) - min(d2, 0.0)) * s);+ }++ vec3 clipped = vec3(mix(physics.xy, q, uFlat), physics.z);++ /* OUTER BOUNDARY correction.+ The cut fixes the inner corner but leaves the outer edge as the plain+ circle the physics gives: it overshoots the mark in some directions and+ falls short in others. So for each direction, compare the orbital's own+ in-plane radius against the mark's measured edge at that same angle and+ scale by the ratio. Points outside the mark are pulled in, points inside+ are pushed out, and the silhouette lands exactly on the vectors.++ Directions past the quadrant (about to be cut away) take the ratio AT the+ quadrant edge rather than none at all. Switching the correction off right+ at the edge kinked every triangle that straddled it, which showed as a+ notch where the flat edge meets the outer curve.++ This scales the in-plane component only, so the solid stays coherent+ out of plane rather than collapsing. */+ if (uEdge > 0.0001) {+ vec2 cq = clipped.xy;+ float cl = length(cq);+ if (cl > 1e-5) {+ float cang = atan(cq.y, cq.x);+ float cda = atan(sin(cang - lobe), cos(cang - lobe));+ {+ float u = (clamp(cda, -PI4, PI4) + PI4) / (2.0 * PI4) * 127.0;+ float fi = floor(min(u, 126.0));+ float f = u - fi;+ int i = int(fi);+ int j = int(fi + 1.0);+ float rEdge = mix(uLogoR[i], uLogoR[j], f);++ // the orbital's own equatorial radius in this (quadrant-clamped) direction+ float ea = lobe + clamp(cda, -PI4, PI4);+ float rPsi = abs(psiOf(vec3(cos(ea), sin(ea), 0.0)));+ /* Aim 6% PAST the mark and let the fragment shader trim the outline+ exactly. Where the vector's curve leaves the flat edge it is+ tangent to it, a detail far finer than the sphere's vertex+ spacing, so aiming at it directly left a chord there: a sharp+ corner. ovK is 0 for the lighting, so the overshoot only moves+ the silhouette the trim cuts, never the shading. */+ float ov = mix(1.0, 1.06, ovK);+ if (rPsi > 1e-5) {+ float k = min(rEdge / rPsi * ov, 3.0);+ clipped.xy = cq * mix(1.0, k, uEdge);+ }+ }+ }+ }+ return clipped;+}++void main(void){+ vec3 d = normalize(position);+ float p = psiOf(d);+ vPsi = p;++ vec3 shaped = shapedPos(d, 1.0);+ vQ = shaped.xy;+ vZ = shaped.z;+ vec3 pos = shaped * uScale;+ pos.xy += normalize(vec2(cos(radians(uRot)), sin(radians(uRot))))+ * ((p >= 0.0) ? 1.0 : -1.0) * uGap * uScale * uFlat;++ /* Normals are differenced from the SHAPED radius, not the raw wavefunction.+ Using the raw psi here left the lighting describing a surface that no+ longer existed once the cheat moved it, which showed up as a dark crater+ across the transformed lobe. */+ vec3 t1 = normalize(abs(d.z) < 0.9 ? cross(d, vec3(0.,0.,1.)) : cross(d, vec3(1.,0.,0.)));+ vec3 t2 = cross(d, t1);+ float hh = 0.03;+ vec3 a = normalize(d + t1*hh), b = normalize(d + t2*hh);+ vec3 p0 = shapedPos(d, 0.0) * uScale;+ vec3 pa = shapedPos(a, 0.0) * uScale;+ vec3 pb = shapedPos(b, 0.0) * uScale;+ vec3 nn = cross(pa - p0, pb - p0);+ vN = normalize(dot(nn, d) < 0.0 ? -nn : nn);++ /* Facing, measured rather than read from gl_FrontFacing: the winding is+ opposite between Babylon and the raw WebGL loader. Stepping along the+ outward normal moves toward the camera exactly when the surface faces+ it, so the clip-space depth drops. */+ gl_Position = uMVP * vec4(pos, 1.0);+ vec4 cn = uMVP * vec4(pos + vN * 0.05, 1.0);+ vFace = gl_Position.z / gl_Position.w - cn.z / cn.w;+}`;+var FS=`precision highp float;+varying float vPsi;+varying vec3 vN;+varying vec2 vQ;+varying float vFace;+varying float vZ;+uniform vec3 cPos, cNeg;+uniform float uFlat, uRot, uShade, uPass, uEdge, uCamD, uPx;+uniform vec4 uProf[12]; // the mark's outline: 48 radii, sampled densely at both flat edges++/* The outline radius at x across the leaf (0 and 1 are the flat edges).+ Sampled at smoothstep-spaced angles: near a flat edge the radius grows+ like the square root of the angle, which smoothstep's spacing makes+ linear, so plain interpolation stays within about a pixel. Picked out by+ comparison, because GLSL ES 1.00 fragment shaders may not index uniform+ arrays dynamically. */+float outlineAt(float x){+ float sx = clamp(0.5 - sin(asin(clamp(1.0 - 2.0*x, -1.0, 1.0)) / 3.0), 0.0, 1.0);+ float u = sx * 47.0;+ float fi = floor(min(u, 46.0));+ float a = 0.0, b = 0.0;+ for (int k = 0; k < 12; k++) {+ float q0 = float(k * 4);+ vec4 id = vec4(q0, q0 + 1.0, q0 + 2.0, q0 + 3.0);+ a += dot(uProf[k], vec4(equal(id, vec4(fi))));+ b += dot(uProf[k], vec4(equal(id, vec4(fi + 1.0))));+ }+ return mix(a, b, u - fi);+}++void main(void){+ /* The quadrant cut, per pixel, always at the mark's own 45 degree planes.+ Pass 0 (opaque) keeps each lobe's quadrant. Pass 1 is the OVERFLOW, the+ part of the round lobe outside the quadrant, drawn translucent at+ 1 - uFlat, so as the cheat ramps the excess melts away and leaves the+ leaf. Nothing moves and nothing is squashed: a rotating cut read as+ scissors closing, and squashing vertices onto the planes (the first+ version) left paper-thin sheets that showed as a hairline at the seam. */+ float fade = 1.0;+ if (uFlat > 0.0001) {+ float ql = length(vQ);+ bool inside = true;+ float cov = 1.0;+ if (ql > 1e-6) {+ float ax = radians(uRot) + (vPsi >= 0.0 ? 0.0 : 3.14159265);+ vec2 ad = vec2(cos(ax), sin(ax));+ vec2 qn = vQ / ql;+ inside = dot(qn, ad) >= 0.7071067 - 1e-4;+ /* The outer trim: the exact vector outline, eased in with the edge+ correction (1.3x, beyond any physics radius, down to 1x) so it+ never pops. Measured where this pixel's ray meets the mark's plane+ (z = 0), so the cut lands on SCREEN: a front-facing point sits+ nearer the camera and perspective enlarges it. uCamD is the camera+ distance in shape units. 1.0248 is the flat overlay's own size+ against the true projection (its 0.34 was fitted by eye), so the 3D+ outline and the flat mark are the same curve. cov is the pixel's+ coverage over a one pixel ramp (uPx = shape units per pixel), which+ antialiases the trimmed curve the way MSAA does a mesh edge. */+ if (inside && uEdge > 0.0001) {+ float da = atan(ad.x*qn.y - ad.y*qn.x, dot(qn, ad));+ float x = clamp((da + 0.7853981634) / 1.5707963268, 0.0, 1.0);+ float qp = (uCamD > 0.0) ? ql * uCamD / max(0.05, uCamD + vZ) : ql;+ float lim = outlineAt(x) * 1.0248 * mix(1.3, 1.0, uEdge);+ cov = (uPx > 0.0) ? clamp((lim - qp) / uPx + 0.5, 0.0, 1.0) : step(qp, lim);+ }+ }+ /* Pass 0 (opaque) keeps the fully covered leaf. Pass 1 (blended, front+ surface only) carries the rest: the antialiased rim of the trim, and+ the overflow outside the quadrant melting away at 1 - uFlat. */+ if (uPass < 0.5) { if (!inside || cov < 0.999) discard; }+ else if (inside) { if (cov >= 0.999 || cov <= 0.001) discard; fade = cov; }+ else { if (uFlat >= 0.999) discard; fade = 1.0 - uFlat; }+ } else if (uPass > 0.5) discard;+ vec3 base = vPsi >= 0.0 ? cPos : cNeg;+ vec3 n = normalize(vN);+ /* Looking INTO a cut lobe (free view only; square-on the cut is edge-on)+ shows the far wall from behind. Shade it as the flat cut face instead,+ so the solid reads closed rather than hollow. */+ if (uFlat > 0.0001 && uPass < 0.5 && vFace < 0.0) n = vec3(0.0, 0.0, -1.0);+ float lam = 0.42 + 0.58*max(0.0, dot(n, normalize(vec3(-0.4,0.85,-0.55))));+ float rim = pow(1.0 - abs(n.z), 2.5)*0.32;+ /* uShade flattens the surface itself to the brandmark teal. The logo moment+ used to be a separate flat canvas laid over the 3D; whenever the two+ shapes were not identical (fading in while the dive was still arriving,+ lingering while it left) that read as a ghost double image. Fading the+ surface means there is only ever one shape on screen. */+ vec3 lit = base*lam + vec3(0.0,0.72,0.68)*rim;+ gl_FragColor = vec4(mix(lit, vec3(0.0, 0.7216, 0.6902), uShade), fade);+}`;+var LOGO_R=[0.29682, 0.31691, 0.33085, 0.34219, 0.3519, 0.36055, 0.36839, 0.37555, 0.38216, 0.3883, 0.39398, 0.39936, 0.40453, 0.40917, 0.41376, 0.41798, 0.422, 0.42584, 0.4294, 0.43293, 0.43608, 0.43927, 0.44211, 0.445, 0.44757, 0.45018, 0.45253, 0.45491, 0.45702, 0.45917, 0.46107, 0.46303, 0.46475, 0.46655, 0.46809, 0.46969, 0.4711, 0.47252, 0.47382, 0.47507, 0.47627, 0.47735, 0.47847, 0.47938, 0.48038, 0.48119, 0.48205, 0.48281, 0.4835, 0.48421, 0.48477, 0.48541, 0.48586, 0.48634, 0.48677, 0.48712, 0.48754, 0.48774, 0.48802, 0.4882, 0.48834, 0.48853, 0.48852, 0.48859, 0.48859, 0.48852, 0.48853, 0.48834, 0.4882, 0.48802, 0.48774, 0.48754, 0.48712, 0.48677, 0.48634, 0.48586, 0.48541, 0.48477, 0.48421, 0.4835, 0.48281, 0.48205, 0.48119, 0.48038, 0.47938, 0.47847, 0.47735, 0.47627, 0.47507, 0.47382, 0.47252, 0.4711, 0.46969, 0.46807, 0.46651, 0.46473, 0.46303, 0.46107, 0.45918, 0.45702, 0.45491, 0.45253, 0.45018, 0.44757, 0.445, 0.44211, 0.43927, 0.43608, 0.43293, 0.4294, 0.42584, 0.422, 0.41798, 0.41376, 0.40917, 0.40453, 0.3993, 0.39391, 0.38829, 0.38214, 0.37552, 0.36839, 0.36056, 0.3519, 0.34209, 0.33073, 0.31683, 0.2966];+var PROF=[0.27485, 0.28587, 0.30119, 0.3168, 0.33233, 0.34751, 0.3623, 0.37662, 0.39025, 0.4033, 0.41541, 0.42673, 0.43684, 0.44607, 0.45439, 0.46153, 0.46783, 0.47326, 0.47775, 0.48137, 0.48427, 0.4864, 0.48773, 0.48841, 0.48841, 0.48773, 0.4864, 0.48427, 0.48137, 0.47775, 0.47326, 0.46781, 0.46153, 0.45439, 0.44607, 0.43684, 0.42673, 0.41541, 0.40329, 0.39022, 0.37661, 0.36231, 0.34745, 0.33216, 0.31673, 0.30103, 0.28552, 0.27309];+var PATHS=[[[0.8046, 0.8046], [0.7789, 0.8291], [0.7525, 0.852], [0.7254, 0.8733], [0.6977, 0.8929], [0.6695, 0.911], [0.6408, 0.9274], [0.6118, 0.9422], [0.5825, 0.9553], [0.5531, 0.9668], [0.5235, 0.9766], [0.4939, 0.9847], [0.4644, 0.9911], [0.435, 0.9957], [0.4059, 0.9987], [0.3771, 1.0], [0.3486, 0.9995], [0.3206, 0.9972], [0.2932, 0.9932], [0.2664, 0.9874], [0.2403, 0.9799], [0.215, 0.9705], [0.1906, 0.9594], [0.1672, 0.9464], [0.1448, 0.9316], [0.1236, 0.9149], [0.1035, 0.8965], [0.0958, 0.8885], [0.0884, 0.8803], [0.0813, 0.8719], [0.0745, 0.8633], [0.0679, 0.8545], [0.0617, 0.8456], [0.0558, 0.8364], [0.0502, 0.8271], [0.0449, 0.8176], [0.0399, 0.8079], [0.0352, 0.7981], [0.0308, 0.7882], [0.0267, 0.7781], [0.0229, 0.7678], [0.0194, 0.7574], [0.0162, 0.7469], [0.0132, 0.7363], [0.0106, 0.7255], [0.0083, 0.7146], [0.0062, 0.7036], [0.0045, 0.6926], [0.003, 0.6814], [0.0018, 0.6701], [0.0009, 0.6587], [0.0003, 0.6473], [0.0, 0.6358], [0.0, 0.6357], [0.0, 0.6356], [0.0, 0.6354], [0.0, 0.6353], [0.0, 0.6352], [0.0, 0.6351], [0.0, 0.635], [0.0, 0.6349], [0.0, 0.6348], [0.0, 0.6346], [0.0, 0.0135], [0.0001, 0.0127], [0.0001, 0.0118], [0.0003, 0.011], [0.0004, 0.0102], [0.0007, 0.0094], [0.0009, 0.0086], [0.0013, 0.0079], [0.0016, 0.0071], [0.002, 0.0064], [0.0025, 0.0058], [0.003, 0.0051], [0.0035, 0.0045], [0.004, 0.0039], [0.0046, 0.0034], [0.0052, 0.0028], [0.0059, 0.0024], [0.0065, 0.0019], [0.0073, 0.0015], [0.008, 0.0012], [0.0087, 0.0008], [0.0095, 0.0006], [0.0103, 0.0003], [0.0111, 0.0002], [0.0119, 0.0], [0.0128, -0.0001], [0.0137, -0.0001], [0.6281, -0.0001], [0.64, 0.0], [0.6517, 0.0005], [0.6635, 0.0012], [0.6751, 0.0022], [0.6866, 0.0036], [0.698, 0.0052], [0.7093, 0.0072], [0.7206, 0.0094], [0.7316, 0.012], [0.7426, 0.0148], [0.7534, 0.018], [0.7641, 0.0215], [0.7747, 0.0253], [0.7851, 0.0295], [0.7954, 0.0339], [0.8055, 0.0386], [0.8154, 0.0437], [0.8252, 0.0491], [0.8348, 0.0548], [0.8442, 0.0608], [0.8534, 0.0671], [0.8624, 0.0737], [0.8712, 0.0807], [0.8799, 0.088], [0.8883, 0.0956], [0.8965, 0.1035], [0.915, 0.1235], [0.9316, 0.1448], [0.9464, 0.1672], [0.9594, 0.1906], [0.9705, 0.215], [0.9799, 0.2403], [0.9874, 0.2664], [0.9932, 0.2932], [0.9972, 0.3206], [0.9995, 0.3486], [1.0, 0.377], [0.9987, 0.4059], [0.9958, 0.435], [0.9911, 0.4644], [0.9847, 0.4939], [0.9766, 0.5235], [0.9668, 0.5531], [0.9553, 0.5825], [0.9422, 0.6118], [0.9274, 0.6408], [0.911, 0.6695], [0.8929, 0.6977], [0.8733, 0.7254], [0.852, 0.7525], [0.8291, 0.7789], [0.8046, 0.8046]], [[-0.8046, -0.8047], [-0.7789, -0.8292], [-0.7525, -0.8521], [-0.7254, -0.8734], [-0.6977, -0.893], [-0.6695, -0.9111], [-0.6408, -0.9275], [-0.6118, -0.9423], [-0.5825, -0.9554], [-0.5531, -0.9669], [-0.5235, -0.9767], [-0.4939, -0.9847], [-0.4644, -0.9912], [-0.435, -0.9958], [-0.4059, -0.9988], [-0.3771, -1.0001], [-0.3486, -0.9996], [-0.3206, -0.9973], [-0.2932, -0.9933], [-0.2664, -0.9875], [-0.2403, -0.98], [-0.215, -0.9706], [-0.1906, -0.9595], [-0.1672, -0.9465], [-0.1448, -0.9317], [-0.1236, -0.915], [-0.1035, -0.8965], [-0.0958, -0.8886], [-0.0884, -0.8804], [-0.0813, -0.872], [-0.0745, -0.8634], [-0.0679, -0.8546], [-0.0617, -0.8456], [-0.0558, -0.8365], [-0.0502, -0.8272], [-0.0449, -0.8177], [-0.0399, -0.808], [-0.0352, -0.7982], [-0.0308, -0.7883], [-0.0267, -0.7782], [-0.0229, -0.7679], [-0.0194, -0.7575], [-0.0162, -0.747], [-0.0132, -0.7364], [-0.0106, -0.7256], [-0.0083, -0.7147], [-0.0062, -0.7037], [-0.0045, -0.6927], [-0.003, -0.6815], [-0.0018, -0.6702], [-0.0009, -0.6588], [-0.0003, -0.6474], [-0.0, -0.6359], [-0.0, -0.6357], [-0.0, -0.6356], [-0.0, -0.6355], [-0.0, -0.6354], [-0.0, -0.6353], [-0.0, -0.6352], [-0.0, -0.6351], [-0.0, -0.635], [-0.0, -0.6349], [-0.0, -0.6347], [-0.0, -0.0136], [-0.0001, -0.0128], [-0.0001, -0.0119], [-0.0003, -0.0111], [-0.0004, -0.0103], [-0.0007, -0.0095], [-0.0009, -0.0087], [-0.0013, -0.008], [-0.0016, -0.0072], [-0.002, -0.0065], [-0.0025, -0.0059], [-0.003, -0.0052], [-0.0035, -0.0046], [-0.004, -0.004], [-0.0046, -0.0034], [-0.0052, -0.0029], [-0.0059, -0.0025], [-0.0065, -0.002], [-0.0073, -0.0016], [-0.008, -0.0012], [-0.0087, -0.0009], [-0.0095, -0.0007], [-0.0103, -0.0004], [-0.0111, -0.0002], [-0.0119, -0.0001], [-0.0128, -0.0], [-0.0137, -0.0], [-0.6281, -0.0], [-0.6399, -0.0001], [-0.6517, -0.0006], [-0.6634, -0.0013], [-0.6751, -0.0023], [-0.6866, -0.0037], [-0.698, -0.0053], [-0.7093, -0.0072], [-0.7205, -0.0095], [-0.7316, -0.0121], [-0.7426, -0.0149], [-0.7534, -0.0181], [-0.7641, -0.0216], [-0.7747, -0.0254], [-0.7851, -0.0295], [-0.7954, -0.034], [-0.8055, -0.0387], [-0.8154, -0.0438], [-0.8252, -0.0492], [-0.8347, -0.0549], [-0.8442, -0.0609], [-0.8534, -0.0672], [-0.8624, -0.0738], [-0.8712, -0.0808], [-0.8798, -0.0881], [-0.8883, -0.0957], [-0.8965, -0.1036], [-0.9149, -0.1236], [-0.9316, -0.1449], [-0.9464, -0.1673], [-0.9593, -0.1907], [-0.9705, -0.2151], [-0.9799, -0.2404], [-0.9874, -0.2665], [-0.9932, -0.2933], [-0.9972, -0.3207], [-0.9995, -0.3487], [-1.0, -0.3771], [-0.9987, -0.406], [-0.9957, -0.4351], [-0.991, -0.4645], [-0.9846, -0.494], [-0.9765, -0.5236], [-0.9668, -0.5532], [-0.9553, -0.5826], [-0.9422, -0.6119], [-0.9274, -0.6409], [-0.911, -0.6695], [-0.8929, -0.6978], [-0.8732, -0.7255], [-0.852, -0.7526], [-0.8291, -0.779], [-0.8046, -0.8047]]];++var glopt={antialias:AAON,alpha:true,premultipliedAlpha:true};+var glc=document.getElementById('gl'), gl=glc.getContext('webgl2',glopt)||glc.getContext('webgl',glopt);+var ovc=document.getElementById('ov'), ox=ovc.getContext('2d');+if(!gl){ document.body.style.background='#0d1117'; throw new Error('no webgl'); }++function sh(type,src){var s=gl.createShader(type);gl.shaderSource(s,src);gl.compileShader(s);+ if(!gl.getShaderParameter(s,gl.COMPILE_STATUS)) throw new Error(gl.getShaderInfoLog(s));return s;}+var prog=gl.createProgram();+gl.attachShader(prog,sh(gl.VERTEX_SHADER,VS));+gl.attachShader(prog,sh(gl.FRAGMENT_SHADER,FS));+gl.linkProgram(prog);+if(!gl.getProgramParameter(prog,gl.LINK_STATUS)) throw new Error(gl.getProgramInfoLog(prog));+gl.useProgram(prog);+var U={}; ['uMVP','c','uScale','uFlat','uRot','uPlump','uGap','uEdge','uCorner','uLogoR','cPos','cNeg','uShade','uPass','uProf','uCamD','uPx']+ .forEach(function(n){U[n]=gl.getUniformLocation(prog,n);});++/* unit sphere, displaced entirely in the vertex shader */+var SEG=SEGQ, verts=[], idx=[];+for(var i=0;i<=SEG;i++){var th=i/SEG*Math.PI;+ for(var j=0;j<=SEG;j++){var ph=j/SEG*2*Math.PI;+ verts.push(Math.sin(th)*Math.cos(ph), Math.cos(th), Math.sin(th)*Math.sin(ph));}}+for(var r=0;r<SEG;r++)for(var q2=0;q2<SEG;q2++){+ var a=r*(SEG+1)+q2,b=a+SEG+1;+ idx.push(a,b,a+1,b,b+1,a+1);}+var vb=gl.createBuffer();gl.bindBuffer(gl.ARRAY_BUFFER,vb);+gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(verts),gl.STATIC_DRAW);+var ib=gl.createBuffer();gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,ib);+gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,new Uint16Array(idx),gl.STATIC_DRAW);+var loc=gl.getAttribLocation(prog,'position');+gl.enableVertexAttribArray(loc);gl.vertexAttribPointer(loc,3,gl.FLOAT,false,0,0);+gl.enable(gl.DEPTH_TEST); gl.disable(gl.CULL_FACE);+gl.uniform1fv(U.uLogoR,new Float32Array(LOGO_R));+gl.uniform4fv(U.uProf,new Float32Array(PROF));+gl.uniform1f(U.uPlump,0);gl.uniform1f(U.uGap,0);gl.uniform1f(U.uCorner,0);gl.uniform1f(U.uRot,45);++var C_POS=[0x19/255,0xc8/255,0xbd/255], C_NEG=[0x12/255,0x3a/255,0x63/255];+gl.uniform3fv(U.cPos,C_POS);++/* Babylon LEFT-HANDED camera, reproduced exactly: eye (0,0,-4.4) looking +Z,+ fov 0.8 fixed on the LIMITING axis so the mark keeps its fraction of any+ canvas shape (the lab's fitFraming rule). */+var R=4.4, HOME=homeFor(MARGIN), CAMR=HOME, PANX=0, PANY=0, FOV=0.8, ZN=0.1, ZF=Math.max(100,HOME*3);+/* Babylon's ACTUAL zoom model, tuned against the lab's measured curve: each+ notch deposits a decaying velocity integral (inertia 0.9) that is consumed+ frame by frame straight into the radius, while the lab's springs pull+ radius and pan home every frame. NOTCH below is the one tuning constant,+ calibrated so a 12-notch burst matches the lab: dip to ~4.0, home ~200ms+ after release. */+var NOTCH=0.085, velR=0, lastNX=0, lastNY=0;+function proj(w,h){+ var f=1/Math.tan(FOV/2), a=w/h;+ return (a>=1)? {m0:f/a, m5:f} : {m0:f, m5:f*a};+}+function setMVP2(w,h,r,px,py,s){+ r=(r===undefined)?CAMR:r; px=px||0; py=py||0; s=(s===undefined)?1:s;+ var m=proj(w,h);+ var A=ZF/(ZF-ZN), B=-ZN*ZF/(ZF-ZN);+ // view: yaw orbA about Y, model scale s (emerge birth), pan, then+ // z' = z + r (eye at -r on z, LH). c=1,sn=0 reduces to the plain matrix.+ var c=Math.cos(orbA), sn=Math.sin(orbA);+ gl.uniformMatrix4fv(U.uMVP,false,new Float32Array([+ m.m0*s*c,0,-A*s*sn,-s*sn,+ 0,m.m5*s,0,0,+ m.m0*s*sn,0,A*s*c,s*c,+ -m.m0*px,-m.m5*py,A*r+B,r+ ]));+}++var W=0,H=0,DPR=1,needSize=true;+/* Resize events only mark dirty. Re-backing a canvas CLEARS it, and doing+ that on every event mid-drag leaves blank frames until the next rAF: the+ jerk. Instead the size is applied at the TOP of the frame and the frame+ draws immediately at the new size, so a continuous drag repaints clean+ every single frame with at most one reallocation per frame. */+function resize(){ needSize=true; }+function applySize(){+ var w=glc.clientWidth, h=glc.clientHeight, d=Math.min(DPRCAP,window.devicePixelRatio||1);+ if(!needSize && w===W && h===H && d===DPR) return;+ needSize=false;+ if(w===W && h===H && d===DPR) return;+ W=w; H=h; DPR=d;+ glc.width=w*d; glc.height=h*d;+ ovc.width=w*d; ovc.height=h*d;+ gl.viewport(0,0,glc.width,glc.height);+}+window.addEventListener('resize',resize);+/* Containers resize without warning in webviews; the window resize event+ covers iframe viewport changes, and the ResizeObserver is the belt for+ any host that reflows the document instead. */+if(window.ResizeObserver) new ResizeObserver(resize).observe(document.documentElement);+resize();++/* ---- the directed loop, distilled ---- */+var L=[0,1,1,1,2,2,2,2,2,3,3,3,3,3,3,3];+var E=L.map(function(l){return -13.6/((l+1)*(l+1));});+var LOGO=new Array(16).fill(0); LOGO[1]=0.7071; LOGO[3]=0.7071;+function smooth(x){x=Math.max(0,Math.min(1,x));return x*x*(3-2*x);}+function lerp(a,b,t){return a+(b-a)*t;}+var gains=null;+function roll(){gains=new Array(16).fill(0);+ var n=2+Math.floor(Math.random()*4);+ for(var j=0;j<n;j++)gains[(Math.random()*16)|0]=0.35+Math.random()*0.65;}+roll();+var eS=PT+DT+(OV?0:CT), eE=eS+ST, CYC=eE+(OV?0:CT)+DT;+var INTRO={dark:0.9,logoIn:1.4,hold:0.5,reveal:1.2};+var inIntro=DO_INTRO, introT=0, t=(DO_INTRO||EMERGE)?0:eE, tEvo=0, rolled=false, last=performance.now();+/* emerge=1 replaces the logo intro: the equation runs from t=0 and the+ surface condenses out of nothing (scale+fade over BIRTH_S seconds) into+ plain play, then the normal pt/dt/ct/st timeline takes over. Keep pt+ comfortably above BIRTH_S so the first epoch never lands mid-birth. */+var BIRTH_S=2.6, birth=EMERGE?0:1, birthT=0;+var orbA=0; // auto-orbit yaw, radians++function frame(now){+ /* STOP WHEN HIDDEN (the header comment promised this; it was never implemented). An+ off-screen orbital must not keep burning GPU. Reschedule without drawing or advancing+ time; keep `last` current so returning to visible never computes a jumped dt. */+ if(document.hidden){ last=now; requestAnimationFrame(frame); return; }+ if(FPSCAP>0){+ if(now-lastDraw < 1000/FPSCAP - 1){ requestAnimationFrame(frame); return; }+ lastDraw=now;+ }+ applySize();+ /* Clamp dt to [0, 0.05]: never negative (a backwards clock across resume/DST would run+ the sim in reverse) and never a big jump (a stalled frame can't lurch). */+ var dt=Math.max(0,Math.min(0.05,(now-last)/1000)); last=now;+ var adt=dt*SPEED; tEvo+=adt;+ if(birth<1){birthT+=adt;birth=smooth(Math.min(1,birthT/BIRTH_S));+ glc.style.opacity=birth>=1?'':String(0.04+0.96*birth);}+ var k,cheat,fill,teal,pinned=false,drawMesh=true;+ if(inIntro){+ introT+=adt;+ var e1=INTRO.dark,e2=e1+INTRO.logoIn,e3=e2+INTRO.hold,e4=e3+INTRO.reveal,x=introT;+ k=1;cheat=1;teal=1;pinned=true;drawMesh=x>=e2;+ fill = x<e1?0 : x<e2?smooth((x-e1)/(e2-e1)) : x<e3?1 : 1-smooth((x-e3)/(e4-e3));+ if(x>=e4){inIntro=false;t=eE;roll();}+ }else{+ t=(t+adt)%CYC;+ var ctw=OV?Math.min(CT,DT):CT;+ if(t<PT){k=0;}+ else if(t<PT+DT){k=smooth((t-PT)/DT);}+ else if(t<eS){k=1;}+ else if(t<eE){k=1;pinned=true;}+ else if(!OV&&t<eE+CT){k=1;}+ else{var o=OV?t-eE:t-eE-CT;k=1-smooth(Math.min(1,o/DT));}+ cheat = t<eS ? (t<=eS-ctw?0:smooth(1-(eS-t)/ctw))+ : t<=eE ? 1 : (t>=eE+ctw?0:smooth(1-(t-eE)/ctw));+ if(t>=eS&&!rolled){roll();rolled=true;} if(t<eS)rolled=false;+ var mid=(eS+eE)/2, a2=mid-Math.max(0.001,(eE-eS)/2+LLEAD), b2=mid+Math.max(0.001,(eE-eS)/2+LLEAD);+ fill=(LOGO_PK<=0||t<=a2||t>=b2||(b2-a2)<0.02)?0+ :(t<mid?smooth((t-a2)/(mid-a2)):smooth((b2-t)/(b2-mid)))*LOGO_PK;+ teal = t<eS ? (TLEAD<=0.01?0:(t<=eS-TLEAD?0:smooth(1-(eS-t)/TLEAD)))+ : t<=eE ? 1 : (TLEAD<=0.01?0:(t>=eE+TLEAD?0:smooth(1-(t-eE)/TLEAD)));+ }+ /* Auto-orbit: yaw advances only in pure play; the moment sculpting starts+ the angle is pulled to the nearest whole turn, so the epoch pose is the+ calibrated square-on view and nothing ever has to spin backwards. */+ if(ORBIT!==0){+ var kk=inIntro?1:k;+ if(kk<=0){ orbA+=ORBIT*adt; }+ else{+ var whole=Math.round(orbA/(2*Math.PI))*(2*Math.PI);+ orbA=orbA+(whole-orbA)*smooth(Math.min(1,kk));+ }+ }+ /* The camera comes HOME for the logo. Whatever the user zoomed or panned,+ the framing glides back to the exact calibrated pose before epoch-start,+ holds through the epoch (the overlay match depends on it), and hands the+ wheel back afterwards from the home pose. */+ var effR=CAMR, effPX=PANX, effPY=PANY, camK=0;+ if(!inIntro){+ /* Glide home for the logo, then home IS the new state: no gliding back+ to the old zoom, the wheel simply frees again the moment the sit ends+ and play resumes from the calibrated framing. */+ var RET=Math.max(0.6, LLEAD+0.2, Math.min(1.2,DT));+ camK = (t>eS-RET&&t<eS) ? smooth((t-(eS-RET))/RET) : 0;+ if(t>=eS&&t<=eE+0.001){ CAMR=HOME; PANX=0; PANY=0; velR=0; camK=1; }+ // consume the wheel's decaying integral, zooming toward the cursor+ if(Math.abs(velR)>0.0001){+ var stepK=1-Math.pow(0.8, dt*240);+ var step=velR*stepK; velR-=step;+ var m2=proj(W,H);+ var wx=lastNX*CAMR/m2.m0+PANX, wy=lastNY*CAMR/m2.m5+PANY;+ /* zoom in to the screen freely; zoom out capped 40% past the epoch framing */+ var r2=Math.max(2.4,Math.min(HOME*1.4,CAMR-step));+ PANX=wx-lastNX*r2/m2.m0; PANY=wy-lastNY*r2/m2.m5;+ CAMR=r2;+ }+ /* The lab's springs, verbatim: radius 6% and pan 5% per frame at the+ lab's 240fps cadence, frame-rate independent. */+ var spr=1-Math.pow(0.94, dt*240), sprT=1-Math.pow(0.95, dt*240);+ CAMR+=(HOME-CAMR)*spr; PANX-=PANX*sprT; PANY-=PANY*sprT;+ window.__lock = (t>eS-RET && t<=eE);+ effR=CAMR+(HOME-CAMR)*camK; effPX=PANX*(1-camK); effPY=PANY*(1-camK);+ } else { effR=HOME; effPX=0; effPY=0; }+ setMVP2(W,H,effR,effPX,effPY,birth);+ window.__cam={r:+effR.toFixed(3),x:+effPX.toFixed(3),y:+effPY.toFixed(3),k:+camK.toFixed(2)};++ var c=new Array(16), nrm=0, i;+ if(pinned){ for(i=0;i<16;i++)c[i]=LOGO[i]; }+ else{+ for(i=0;i<16;i++){+ var env=0.55+0.45*Math.cos(tEvo*(0.13+i*0.017)+i*1.7);+ var live=gains[i]*env*Math.cos(E[i]*tEvo*0.5);+ c[i]=live*(1-k)+LOGO[i]*k;+ }+ }+ for(i=0;i<16;i++)nrm+=c[i]*c[i]; nrm=Math.sqrt(nrm)||1;+ for(i=0;i<16;i++)c[i]/=nrm;++ /* One shape on screen at a time: the flat vector mark only overlays the 3D+ while the geometry IS the mark (pinned); elsewhere the surface itself+ fades to flat teal. Inside the sit the overlay eases in over 0.15s while+ the surface hands its flatness to it, so the composite is exactly `fill`+ flat throughout (the lab's driveLoop, same maths). */+ var ovK=0;+ if(pinned){ if(inIntro) ovK=1;+ else{ var ee=Math.min(0.15,(eE-eS)/2); ovK=ee<=0.001?0:smooth(Math.min(t-eS,eE-t)/ee); } }+ var ovA=fill*ovK, shade=ovA>=0.999?0:Math.max(0,Math.min(1,(fill-ovA)/(1-ovA)));++ if(TRANSP) gl.clearColor(0,0,0,0); else gl.clearColor(BG[0],BG[1],BG[2],1);+ gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT);+ if(drawMesh){+ gl.uniform1fv(U.c,new Float32Array(c));+ gl.uniform1f(U.uScale,2.5*(0.9+0.25*k));+ gl.uniform1f(U.uCamD,effR/(2.5*(0.9+0.25*k)*birth));+ var mpx=proj(W,H); gl.uniform1f(U.uPx,effR/(mpx.m5*glc.height/2*2.5*(0.9+0.25*k)*birth));+ gl.uniform1f(U.uFlat,cheat);gl.uniform1f(U.uEdge,cheat);gl.uniform1f(U.uShade,shade);+ gl.uniform3f(U.cNeg,lerp(C_NEG[0],C_POS[0],teal),lerp(C_NEG[1],C_POS[1],teal),lerp(C_NEG[2],C_POS[2],teal));+ gl.uniform1f(U.uPass,0);+ gl.drawElements(gl.TRIANGLES,idx.length,gl.UNSIGNED_SHORT,0);+ /* The blended pass (the lab's matOver): the trim's antialiased rim, and+ while the cut is partway in the overflow (the round lobe outside the+ quadrant) melting away at 1-cheat. Depth prepass first so only the+ front surface blends, then one blended color pass. */+ if(cheat>0.0001){+ gl.uniform1f(U.uPass,1);+ gl.colorMask(false,false,false,false);+ gl.drawElements(gl.TRIANGLES,idx.length,gl.UNSIGNED_SHORT,0);+ gl.colorMask(true,true,true,true);+ gl.depthFunc(gl.LEQUAL); gl.depthMask(false); gl.enable(gl.BLEND);+ gl.blendFuncSeparate(gl.SRC_ALPHA,gl.ONE_MINUS_SRC_ALPHA,gl.ONE,gl.ONE_MINUS_SRC_ALPHA);+ gl.drawElements(gl.TRIANGLES,idx.length,gl.UNSIGNED_SHORT,0);+ gl.disable(gl.BLEND); gl.depthMask(true); gl.depthFunc(gl.LESS);+ }+ }+ ox.clearRect(0,0,ovc.width,ovc.height);+ if(ovA>0.004){+ var mm=proj(W,H), ppw=mm.m0*ovc.width/2/(window.__cam?window.__cam.r:CAMR);+ var er=window.__cam?window.__cam.r:CAMR;+ var s=Math.min(ovc.width,ovc.height)*0.34*(R/er);+ ox.save();ox.translate(ovc.width/2-(window.__cam?window.__cam.x:0)*ppw,+ ovc.height/2+(window.__cam?window.__cam.y:0)*ppw);+ ox.globalAlpha=ovA;ox.fillStyle='#00b8b0';+ for(var p2=0;p2<PATHS.length;p2++){var pts=PATHS[p2];ox.beginPath();+ for(var j2=0;j2<pts.length;j2++){var X=pts[j2][0]*s,Y=-pts[j2][1]*s;+ j2?ox.lineTo(X,Y):ox.moveTo(X,Y);}+ ox.closePath();ox.fill();}+ ox.restore();+ }+ requestAnimationFrame(frame);+}+/* EXACTLY ONE loop per document: if this script ever evaluates twice, a second concurrent+ frame() loop would advance the sim clock in parallel (2x/3x "crazy speed"). */+if(!window.__ADOM_ORBITAL_RUNNING){+ window.__ADOM_ORBITAL_RUNNING=true;+ requestAnimationFrame(frame);+}++/* Click-to-zoom, OFF unless armed: real load screens must never eat input.+ Armed via ?interact=1 (or window.__ADOM_LOADER_INTERACT, which the wiki+ readme's inline preview sets). Click the canvas to capture the wheel for+ zoom; click is released on window blur (clicking outside the iframe). */+if (Q.get('interact')==='1' || window.__ADOM_LOADER_INTERACT){+ var live=false;+ /* The hint pill is OFF by default even when armed: production wants purity.+ ?hint=1 shows it, and armed contexts can flip it live by postMessage. The+ teal edge glow always communicates the armed state either way. */+ var HINTON = P('hint',0)>=1;+ var edge=document.createElement('div');+ edge.style.cssText='position:fixed;inset:0;pointer-events:none;opacity:0;'++ 'transition:opacity .18s ease;border:1px solid #00b8b0;'++ 'box-shadow:inset 0 0 26px rgba(0,184,176,.16), inset 0 0 0 1px rgba(0,184,176,.35);';+ document.body.appendChild(edge);+ var hint=document.createElement('div');+ hint.style.cssText='position:absolute;left:50%;bottom:16px;transform:translateX(-50%);'++ 'padding:5px 12px;border-radius:999px;background:rgba(13,17,23,.78);'++ 'border:1px solid #30363d;font:10px monospace;letter-spacing:.05em;'++ 'color:#8b949e;pointer-events:none;opacity:0;transition:opacity .2s';+ hint.textContent='click to zoom';+ document.body.appendChild(hint);+ function hintShow(o){ hint.style.opacity=(HINTON&&o)?'1':'0'; }+ document.body.style.cursor='pointer';+ document.addEventListener('mouseenter',function(){ if(!live) hintShow(true); });+ document.addEventListener('mouseleave',function(){ hintShow(false); });+ document.addEventListener('pointerdown',function(){+ live=true; edge.style.opacity='1'; document.body.style.cursor='default';+ hint.textContent='scroll to zoom'; hint.style.color='#00b8b0'; hintShow(true);+ setTimeout(function(){ hintShow(false); },1400);+ });+ /* Armed contexts accept live control: {adomLoader:{margin:N}} retargets the+ framing and the spring CARRIES the camera to its new home, animated. Real+ load screens never install this listener. */+ window.addEventListener('message',function(e){+ var d=e.data&&e.data.adomLoader; if(!d) return;+ if(typeof d.hint!=='undefined'){ HINTON=!!d.hint; if(!HINTON) hint.style.opacity='0'; }+ if(typeof d.bg==='string'){ applyBg(d.bg); }+ if(typeof d.fps==='number'){ FPSCAP=Math.max(0,d.fps); if(FPSCAP>0&&FPSCAP<20)FPSCAP=20; }+ if(typeof d.margin==='number'){+ MARGIN=Math.max(-70,Math.min(90,d.margin));+ HOME=homeFor(MARGIN);+ ZF=Math.max(100,HOME*3);+ }+ if(typeof d.speed==='number'){ SPEED=Math.max(0.05,Math.min(3,Math.abs(d.speed)/100)); }+ if(typeof d.orbit==='number'){ ORBIT=d.orbit*Math.PI/180; }+ if(typeof d.logo==='number'){ LOGO_PK=Math.max(0,Math.min(1,d.logo/100)); }+ });+ window.addEventListener('blur',function(){ live=false; edge.style.opacity='0'; document.body.style.cursor='pointer';+ hint.textContent='click to zoom'; hint.style.color='#8b949e'; });+ document.addEventListener('wheel',function(e){+ if(!live) return;+ e.preventDefault();+ if(window.__lock) return; // the epoch owns the framing+ lastNX=2*e.clientX/W-1; lastNY=1-2*e.clientY/H;+ velR+=CAMR*NOTCH*(-e.deltaY/100); // wheel up = zoom in = radius shrinks+ velR=Math.max(-HOME*0.75,Math.min(HOME*0.75,velR));+ },{passive:false});+}+</script>+</body>+</html>
loader.html+235−37@@ -23,9 +23,9 @@ function P(k,d){ if(k in o) return o[k]; var v=parseFloat(Q.get(k));return isFinite(v)?v:d; }-var PT=P('pt',4.5), DT=P('dt',3), CT=P('ct',0.3), ST=P('st',0);+var PT=P('pt',5), DT=P('dt',1.5), CT=P('ct',0.6), ST=P('st',1); var LOGO_PK=Math.max(0,Math.min(1,P('logo',100)/100));-var LLEAD=Math.abs(P('llead',1)), TLEAD=Math.abs(P('tlead',1.5));+var LLEAD=Math.abs(P('llead',0.9)), TLEAD=Math.abs(P('tlead',0.4)); var EMERGE=String(P('emerge',0))==='1'; /* speed: percent playback rate for the ANIMATION clocks (timeline, evolution, birth). 100 is real time; 10 is a tenth speed. Camera springs and user@@ -115,6 +115,45 @@ float psiOf(vec3 d){ uniform float uFlat, uRot, uPlump, uGap, uEdge, uCorner; uniform float uLogoR[128]; // the mark's measured edge, 0..90 degrees+varying vec2 vQ; // in-plane shape position, before the gap: the pixel cut reads it+varying float vFace; // > 0 where the outward normal faces the camera+varying float vZ; // shape-space depth, for the trim's perspective++/* TAKE 2: the morph. Instead of cutting the orbital to the mark and fading+ what is cut away, the lobes BECOME the leaves. A pure 2p lobe is a ball of+ radius R0 touching the origin; its cross-section disk is mapped onto the+ leaf, radially from a center m on the leaf's axis: the ball's center goes+ to m, its rim to the leaf's outline, the node at the origin to the leaf's+ corner. Heights are kept, so the ball lands on a leaf-shaped lens whose+ silhouette IS the mark, with nothing cut and nothing faded. */+uniform float uMorph; // 0 the orbital, 1 the leaf solid+uniform float uOrtho; // 0 the camera's perspective, 1 none (the mark is flat)+uniform float uLeafM; // m's distance from the origin along the leaf axis+uniform float uNode; // psi of one mesh step off the node: that band collapses to the corner+uniform vec4 uLeaf[32]; // distance from m to the outline at 128 angles, -pi..pi++float leafAt(int i){+ int q = i / 4;+ int r = i - q * 4;+ vec4 v = uLeaf[q];+ return r == 0 ? v.x : (r == 1 ? v.y : (r == 2 ? v.z : v.w));+}+float leafR(float beta){+ float u = (beta + 3.14159265) / 6.28318531 * 127.0;+ float fi = floor(clamp(u, 0.0, 126.0));+ return mix(leafAt(int(fi)), leafAt(int(fi) + 1), clamp(u - fi, 0.0, 1.0));+}+vec3 leafPos(vec3 P, float pp){+ float R0 = 0.2443013; // the 2p lobe's radius: 0.4886 cos(angle) is a ball+ float ax = radians(uRot) + (pp >= 0.0 ? 0.0 : 3.14159265);+ vec2 a = vec2(cos(ax), sin(ax));+ vec2 b = vec2(-a.y, a.x);+ vec2 rel = vec2(dot(P.xy, a), dot(P.xy, b)) - vec2(R0, 0.0);+ float rho = length(rel);+ float be = rho > 1e-7 ? atan(rel.y, rel.x) : 0.0;+ vec2 l = vec2(uLeafM, 0.0) + (rho / R0) * leafR(be) * vec2(cos(be), sin(be));+ return vec3(l.x * a + l.y * b, P.z);+} /* The morph target for ANY direction. @@ -135,42 +174,55 @@ uniform float uLogoR[128]; // the mark's measured edge, 0..90 degrees exactly as the wavefunction gives it, and cut it to the mark's quadrants. That scored 95.9% IoU at 0.8% spill and renders clean, because it never moves a vertex anywhere the surface was not already. It IS a clip, and that- is the honest description of the licence in the mark. */-vec3 shapedPos(vec3 dir){+ is the honest description of the license in the mark. */+vec3 shapedPos(vec3 dir, float ovK){ float pp = psiOf(dir); vec3 physics = dir * abs(pp); if (uFlat <= 0.0001) return physics; float PI4 = 0.7853981634; float axis = radians(uRot);- vec2 e1 = vec2(cos(axis - PI4), sin(axis - PI4));- vec2 e2 = vec2(cos(axis + PI4), sin(axis + PI4)); float s = (pp >= 0.0) ? 1.0 : -1.0; float lobe = (pp >= 0.0) ? axis : axis + 3.14159265; - /* A hard half-plane cut leaves a sharp corner where the flat edge meets the- outer curve; the mark has a real radius there. min(d,0) rounded is- 0.5*(d - sqrt(d*d + rc*rc)), which eases into the cut over a band of- width rc instead of hitting it as a crease. */+ /* The quadrant cut itself is done PER PIXEL in the fragment shader (vQ+ below). Doing it here, by projecting every out-of-quadrant vertex onto+ the cut planes, built a paper-thin sheet of squashed triangles along each+ plane: edge-on it rendered as a hairline at the seam, and while the cut+ ramped in it fanned out into jagged fins. Discarding fragments instead+ gives a mathematically straight edge exactly on the plane, with no+ geometry left behind to catch the light.++ What stays here is only the CORNER rounding, and only its soft excess+ over a hard cut: min(d,0) rounded is 0.5*(d - sqrt(d*d + rc*rc)), and+ subtracting min(d,0) leaves the gentle inward ease near the plane while+ the hard part is left to the pixel cut. */ vec2 q = physics.xy; float rc = uCorner;- float d1 = dot(q, e1) * s;- float p1 = (rc > 1e-5) ? 0.5 * (d1 - sqrt(d1*d1 + rc*rc)) : min(d1, 0.0);- q -= e1 * (p1 * s);- float d2 = dot(q, e2) * s;- float p2 = (rc > 1e-5) ? 0.5 * (d2 - sqrt(d2*d2 + rc*rc)) : min(d2, 0.0);- q -= e2 * (p2 * s);+ if (rc > 1e-5) {+ vec2 e1 = vec2(cos(axis - PI4), sin(axis - PI4));+ vec2 e2 = vec2(cos(axis + PI4), sin(axis + PI4));+ float d1 = dot(q, e1) * s;+ q -= e1 * ((0.5 * (d1 - sqrt(d1*d1 + rc*rc)) - min(d1, 0.0)) * s);+ float d2 = dot(q, e2) * s;+ q -= e2 * ((0.5 * (d2 - sqrt(d2*d2 + rc*rc)) - min(d2, 0.0)) * s);+ } vec3 clipped = vec3(mix(physics.xy, q, uFlat), physics.z); /* OUTER BOUNDARY correction.- The clip fixes the inner corner but leaves the outer edge as the plain+ The cut fixes the inner corner but leaves the outer edge as the plain circle the physics gives: it overshoots the mark in some directions and falls short in others. So for each direction, compare the orbital's own in-plane radius against the mark's measured edge at that same angle and scale by the ratio. Points outside the mark are pulled in, points inside are pushed out, and the silhouette lands exactly on the vectors. + Directions past the quadrant (about to be cut away) take the ratio AT the+ quadrant edge rather than none at all. Switching the correction off right+ at the edge kinked every triangle that straddled it, which showed as a+ notch where the flat edge meets the outer curve.+ This scales the in-plane component only, so the solid stays coherent out of plane rather than collapsing. */ if (uEdge > 0.0001) {@@ -179,7 +231,7 @@ vec3 shapedPos(vec3 dir){ if (cl > 1e-5) { float cang = atan(cq.y, cq.x); float cda = atan(sin(cang - lobe), cos(cang - lobe));- if (abs(cda) <= PI4 + 0.001) {+ { float u = (clamp(cda, -PI4, PI4) + PI4) / (2.0 * PI4) * 127.0; float fi = floor(min(u, 126.0)); float f = u - fi;@@ -187,11 +239,18 @@ vec3 shapedPos(vec3 dir){ int j = int(fi + 1.0); float rEdge = mix(uLogoR[i], uLogoR[j], f); - // the orbital's own equatorial radius in this same direction- vec3 eqd = vec3(cos(cang), sin(cang), 0.0);- float rPsi = abs(psiOf(eqd));+ // the orbital's own equatorial radius in this (quadrant-clamped) direction+ float ea = lobe + clamp(cda, -PI4, PI4);+ float rPsi = abs(psiOf(vec3(cos(ea), sin(ea), 0.0)));+ /* Aim 6% PAST the mark and let the fragment shader trim the outline+ exactly. Where the vector's curve leaves the flat edge it is+ tangent to it, a detail far finer than the sphere's vertex+ spacing, so aiming at it directly left a chord there: a sharp+ corner. ovK is 0 for the lighting, so the overshoot only moves+ the silhouette the trim cuts, never the shading. */+ float ov = mix(1.0, 1.06, ovK); if (rPsi > 1e-5) {- float k = rEdge / rPsi;+ float k = min(rEdge / rPsi * ov, 3.0); clipped.xy = cq * mix(1.0, k, uEdge); } }@@ -205,7 +264,29 @@ void main(void){ float p = psiOf(d); vPsi = p; - vec3 pos = shapedPos(d) * uScale;+ vec3 shaped = shapedPos(d, 1.0);+ /* The target is the LOGO state's own lobe in this direction, never the+ live state's: on the way out the next roll's small new lobes would be+ mapped through the wrong lobe's frame and thrown out as a flat sheet.+ So the leaf solid is a fixed shape and the morph is a plain blend+ between the live orbital and it. */+ if (uMorph > 0.0001) {+ float lp = 0.4886025 * dot(d.xy, vec2(cos(radians(uRot)), sin(radians(uRot))));+ vec3 ball = d * abs(lp);+ /* Triangles that straddle the node join a vertex of one lobe to a vertex+ of the other. On the leaves those land on the two leaves' flat edges,+ so each spanned the empty quadrant between them: a small chamfered+ bridge across the center all through the morph. Every vertex within+ one mesh step of the node (uNode, set from the tessellation) goes to+ the corner itself, so any triangle crossing between the lobes has no+ area. Pulling a point toward the corner keeps it on its flat edge, so+ the edges stay straight. */+ float nodeK = smoothstep(uNode, 2.0 * uNode, abs(lp));+ shaped = mix(shaped, leafPos(ball, lp) * nodeK, uMorph);+ }+ vQ = shaped.xy;+ vZ = shaped.z;+ vec3 pos = shaped * uScale; pos.xy += normalize(vec2(cos(radians(uRot)), sin(radians(uRot)))) * ((p >= 0.0) ? 1.0 : -1.0) * uGap * uScale * uFlat; @@ -217,25 +298,122 @@ void main(void){ vec3 t2 = cross(d, t1); float hh = 0.03; vec3 a = normalize(d + t1*hh), b = normalize(d + t2*hh);- vec3 pa = shapedPos(a) * uScale;- vec3 pb = shapedPos(b) * uScale;- vec3 nn = cross(pa - pos, pb - pos);+ vec3 p0 = shapedPos(d, 0.0) * uScale;+ vec3 pa = shapedPos(a, 0.0) * uScale;+ vec3 pb = shapedPos(b, 0.0) * uScale;+ vec3 nn = cross(pa - p0, pb - p0); vN = normalize(dot(nn, d) < 0.0 ? -nn : nn); + /* Facing, measured rather than read from gl_FrontFacing: the winding is+ opposite between Babylon and the raw WebGL loader. Stepping along the+ outward normal moves toward the camera exactly when the surface faces+ it, so the clip-space depth drops. */ gl_Position = uMVP * vec4(pos, 1.0);+ vec4 cn = uMVP * vec4(pos + vN * 0.05, 1.0);+ vFace = gl_Position.z / gl_Position.w - cn.z / cn.w;++ /* Perspective goes as the mark arrives: each vertex is placed where an+ orthographic camera with the same scale at the mark's plane would put+ it, so the silhouette is the flat outline exactly. Depth is untouched.+ The lighting keeps the orbital's own normals (computed above from the+ unmorphed surface), so the map cannot crease the shading. */+ if (uOrtho > 0.0001) {+ float w0 = (uMVP * vec4(0.0, 0.0, 0.0, 1.0)).w;+ gl_Position.xy *= gl_Position.w / mix(gl_Position.w, w0, uOrtho);+ } }`; var FS=`precision highp float; varying float vPsi; varying vec3 vN;+varying vec2 vQ;+varying float vFace;+varying float vZ; uniform vec3 cPos, cNeg;+uniform float uFlat, uRot, uShade, uPass, uEdge, uCamD, uPx;+uniform vec4 uProf[12]; // the mark's outline: 48 radii, sampled densely at both flat edges++/* The outline radius at x across the leaf (0 and 1 are the flat edges).+ Sampled at smoothstep-spaced angles: near a flat edge the radius grows+ like the square root of the angle, which smoothstep's spacing makes+ linear, so plain interpolation stays within about a pixel. Picked out by+ comparison, because GLSL ES 1.00 fragment shaders may not index uniform+ arrays dynamically. */+float outlineAt(float x){+ float sx = clamp(0.5 - sin(asin(clamp(1.0 - 2.0*x, -1.0, 1.0)) / 3.0), 0.0, 1.0);+ float u = sx * 47.0;+ float fi = floor(min(u, 46.0));+ float a = 0.0, b = 0.0;+ for (int k = 0; k < 12; k++) {+ float q0 = float(k * 4);+ vec4 id = vec4(q0, q0 + 1.0, q0 + 2.0, q0 + 3.0);+ a += dot(uProf[k], vec4(equal(id, vec4(fi))));+ b += dot(uProf[k], vec4(equal(id, vec4(fi + 1.0))));+ }+ return mix(a, b, u - fi);+}+ void main(void){+ /* The quadrant cut, per pixel, always at the mark's own 45 degree planes.+ Pass 0 (opaque) keeps each lobe's quadrant. Pass 1 is the OVERFLOW, the+ part of the round lobe outside the quadrant, drawn translucent at+ 1 - uFlat, so as the cheat ramps the excess melts away and leaves the+ leaf. Nothing moves and nothing is squashed: a rotating cut read as+ scissors closing, and squashing vertices onto the planes (the first+ version) left paper-thin sheets that showed as a hairline at the seam. */+ float fade = 1.0;+ if (uFlat > 0.0001) {+ float ql = length(vQ);+ bool inside = true;+ float cov = 1.0;+ if (ql > 1e-6) {+ float ax = radians(uRot) + (vPsi >= 0.0 ? 0.0 : 3.14159265);+ vec2 ad = vec2(cos(ax), sin(ax));+ vec2 qn = vQ / ql;+ inside = dot(qn, ad) >= 0.7071067 - 1e-4;+ /* The outer trim: the exact vector outline, eased in with the edge+ correction (1.3x, beyond any physics radius, down to 1x) so it+ never pops. Measured where this pixel's ray meets the mark's plane+ (z = 0), so the cut lands on SCREEN: a front-facing point sits+ nearer the camera and perspective enlarges it. uCamD is the camera+ distance in shape units. 1.0248 is the flat overlay's own size+ against the true projection (its 0.34 was fitted by eye), so the 3D+ outline and the flat mark are the same curve. cov is the pixel's+ coverage over a one pixel ramp (uPx = shape units per pixel), which+ antialiases the trimmed curve the way MSAA does a mesh edge. */+ if (inside && uEdge > 0.0001) {+ float da = atan(ad.x*qn.y - ad.y*qn.x, dot(qn, ad));+ float x = clamp((da + 0.7853981634) / 1.5707963268, 0.0, 1.0);+ float qp = (uCamD > 0.0) ? ql * uCamD / max(0.05, uCamD + vZ) : ql;+ float lim = outlineAt(x) * 1.0248 * mix(1.3, 1.0, uEdge);+ cov = (uPx > 0.0) ? clamp((lim - qp) / uPx + 0.5, 0.0, 1.0) : step(qp, lim);+ }+ }+ /* Pass 0 (opaque) keeps the fully covered leaf. Pass 1 (blended, front+ surface only) carries the rest: the antialiased rim of the trim, and+ the overflow outside the quadrant melting away at 1 - uFlat. */+ if (uPass < 0.5) { if (!inside || cov < 0.999) discard; }+ else if (inside) { if (cov >= 0.999 || cov <= 0.001) discard; fade = cov; }+ else { if (uFlat >= 0.999) discard; fade = 1.0 - uFlat; }+ } else if (uPass > 0.5) discard; vec3 base = vPsi >= 0.0 ? cPos : cNeg; vec3 n = normalize(vN);+ /* Looking INTO a cut lobe (free view only; square-on the cut is edge-on)+ shows the far wall from behind. Shade it as the flat cut face instead,+ so the solid reads closed rather than hollow. */+ if (uFlat > 0.0001 && uPass < 0.5 && vFace < 0.0) n = vec3(0.0, 0.0, -1.0); float lam = 0.42 + 0.58*max(0.0, dot(n, normalize(vec3(-0.4,0.85,-0.55)))); float rim = pow(1.0 - abs(n.z), 2.5)*0.32;- gl_FragColor = vec4(base*lam + vec3(0.0,0.72,0.68)*rim, 1.0);+ /* uShade flattens the surface itself to the brandmark teal. The logo moment+ used to be a separate flat canvas laid over the 3D; whenever the two+ shapes were not identical (fading in while the dive was still arriving,+ lingering while it left) that read as a ghost double image. Fading the+ surface means there is only ever one shape on screen. */+ vec3 lit = base*lam + vec3(0.0,0.72,0.68)*rim;+ gl_FragColor = vec4(mix(lit, vec3(0.0, 0.7216, 0.6902), uShade), fade); }`; var LOGO_R=[0.29682, 0.31691, 0.33085, 0.34219, 0.3519, 0.36055, 0.36839, 0.37555, 0.38216, 0.3883, 0.39398, 0.39936, 0.40453, 0.40917, 0.41376, 0.41798, 0.422, 0.42584, 0.4294, 0.43293, 0.43608, 0.43927, 0.44211, 0.445, 0.44757, 0.45018, 0.45253, 0.45491, 0.45702, 0.45917, 0.46107, 0.46303, 0.46475, 0.46655, 0.46809, 0.46969, 0.4711, 0.47252, 0.47382, 0.47507, 0.47627, 0.47735, 0.47847, 0.47938, 0.48038, 0.48119, 0.48205, 0.48281, 0.4835, 0.48421, 0.48477, 0.48541, 0.48586, 0.48634, 0.48677, 0.48712, 0.48754, 0.48774, 0.48802, 0.4882, 0.48834, 0.48853, 0.48852, 0.48859, 0.48859, 0.48852, 0.48853, 0.48834, 0.4882, 0.48802, 0.48774, 0.48754, 0.48712, 0.48677, 0.48634, 0.48586, 0.48541, 0.48477, 0.48421, 0.4835, 0.48281, 0.48205, 0.48119, 0.48038, 0.47938, 0.47847, 0.47735, 0.47627, 0.47507, 0.47382, 0.47252, 0.4711, 0.46969, 0.46807, 0.46651, 0.46473, 0.46303, 0.46107, 0.45918, 0.45702, 0.45491, 0.45253, 0.45018, 0.44757, 0.445, 0.44211, 0.43927, 0.43608, 0.43293, 0.4294, 0.42584, 0.422, 0.41798, 0.41376, 0.40917, 0.40453, 0.3993, 0.39391, 0.38829, 0.38214, 0.37552, 0.36839, 0.36056, 0.3519, 0.34209, 0.33073, 0.31683, 0.2966];+var PROF=[0.27485, 0.28587, 0.30119, 0.3168, 0.33233, 0.34751, 0.3623, 0.37662, 0.39025, 0.4033, 0.41541, 0.42673, 0.43684, 0.44607, 0.45439, 0.46153, 0.46783, 0.47326, 0.47775, 0.48137, 0.48427, 0.4864, 0.48773, 0.48841, 0.48841, 0.48773, 0.4864, 0.48427, 0.48137, 0.47775, 0.47326, 0.46781, 0.46153, 0.45439, 0.44607, 0.43684, 0.42673, 0.41541, 0.40329, 0.39022, 0.37661, 0.36231, 0.34745, 0.33216, 0.31673, 0.30103, 0.28552, 0.27309];+var LEAF=[0.28704, 0.27386, 0.26243, 0.25251, 0.24388, 0.23638, 0.22988, 0.22426, 0.21943, 0.21532, 0.21188, 0.20904, 0.20678, 0.20506, 0.20386, 0.20318, 0.20299, 0.2033, 0.20412, 0.20544, 0.20729, 0.20969, 0.21268, 0.21628, 0.22016, 0.22398, 0.22771, 0.23133, 0.2347, 0.23783, 0.24065, 0.24312, 0.24521, 0.24691, 0.24812, 0.24898, 0.24943, 0.24947, 0.24912, 0.24839, 0.24734, 0.246, 0.24444, 0.24269, 0.24079, 0.23877, 0.23668, 0.23459, 0.23252, 0.23047, 0.22847, 0.22649, 0.2246, 0.22286, 0.22128, 0.21984, 0.21845, 0.21725, 0.21624, 0.21541, 0.21465, 0.21412, 0.21383, 0.21357, 0.21357, 0.21383, 0.21412, 0.21465, 0.21541, 0.21624, 0.21725, 0.21845, 0.21984, 0.22128, 0.22286, 0.2246, 0.22649, 0.22847, 0.23047, 0.23252, 0.23459, 0.23668, 0.23877, 0.24079, 0.24269, 0.24444, 0.246, 0.24734, 0.24839, 0.24912, 0.24947, 0.24943, 0.24898, 0.24812, 0.24691, 0.24521, 0.24312, 0.24065, 0.23783, 0.2347, 0.23133, 0.22771, 0.22398, 0.22016, 0.21628, 0.21268, 0.20969, 0.20729, 0.20544, 0.20412, 0.2033, 0.20299, 0.20318, 0.20386, 0.20506, 0.20678, 0.20904, 0.21188, 0.21532, 0.21943, 0.22426, 0.22988, 0.23638, 0.24388, 0.25251, 0.26243, 0.27386, 0.28704]; var PATHS=[[[0.8046, 0.8046], [0.7789, 0.8291], [0.7525, 0.852], [0.7254, 0.8733], [0.6977, 0.8929], [0.6695, 0.911], [0.6408, 0.9274], [0.6118, 0.9422], [0.5825, 0.9553], [0.5531, 0.9668], [0.5235, 0.9766], [0.4939, 0.9847], [0.4644, 0.9911], [0.435, 0.9957], [0.4059, 0.9987], [0.3771, 1.0], [0.3486, 0.9995], [0.3206, 0.9972], [0.2932, 0.9932], [0.2664, 0.9874], [0.2403, 0.9799], [0.215, 0.9705], [0.1906, 0.9594], [0.1672, 0.9464], [0.1448, 0.9316], [0.1236, 0.9149], [0.1035, 0.8965], [0.0958, 0.8885], [0.0884, 0.8803], [0.0813, 0.8719], [0.0745, 0.8633], [0.0679, 0.8545], [0.0617, 0.8456], [0.0558, 0.8364], [0.0502, 0.8271], [0.0449, 0.8176], [0.0399, 0.8079], [0.0352, 0.7981], [0.0308, 0.7882], [0.0267, 0.7781], [0.0229, 0.7678], [0.0194, 0.7574], [0.0162, 0.7469], [0.0132, 0.7363], [0.0106, 0.7255], [0.0083, 0.7146], [0.0062, 0.7036], [0.0045, 0.6926], [0.003, 0.6814], [0.0018, 0.6701], [0.0009, 0.6587], [0.0003, 0.6473], [0.0, 0.6358], [0.0, 0.6357], [0.0, 0.6356], [0.0, 0.6354], [0.0, 0.6353], [0.0, 0.6352], [0.0, 0.6351], [0.0, 0.635], [0.0, 0.6349], [0.0, 0.6348], [0.0, 0.6346], [0.0, 0.0135], [0.0001, 0.0127], [0.0001, 0.0118], [0.0003, 0.011], [0.0004, 0.0102], [0.0007, 0.0094], [0.0009, 0.0086], [0.0013, 0.0079], [0.0016, 0.0071], [0.002, 0.0064], [0.0025, 0.0058], [0.003, 0.0051], [0.0035, 0.0045], [0.004, 0.0039], [0.0046, 0.0034], [0.0052, 0.0028], [0.0059, 0.0024], [0.0065, 0.0019], [0.0073, 0.0015], [0.008, 0.0012], [0.0087, 0.0008], [0.0095, 0.0006], [0.0103, 0.0003], [0.0111, 0.0002], [0.0119, 0.0], [0.0128, -0.0001], [0.0137, -0.0001], [0.6281, -0.0001], [0.64, 0.0], [0.6517, 0.0005], [0.6635, 0.0012], [0.6751, 0.0022], [0.6866, 0.0036], [0.698, 0.0052], [0.7093, 0.0072], [0.7206, 0.0094], [0.7316, 0.012], [0.7426, 0.0148], [0.7534, 0.018], [0.7641, 0.0215], [0.7747, 0.0253], [0.7851, 0.0295], [0.7954, 0.0339], [0.8055, 0.0386], [0.8154, 0.0437], [0.8252, 0.0491], [0.8348, 0.0548], [0.8442, 0.0608], [0.8534, 0.0671], [0.8624, 0.0737], [0.8712, 0.0807], [0.8799, 0.088], [0.8883, 0.0956], [0.8965, 0.1035], [0.915, 0.1235], [0.9316, 0.1448], [0.9464, 0.1672], [0.9594, 0.1906], [0.9705, 0.215], [0.9799, 0.2403], [0.9874, 0.2664], [0.9932, 0.2932], [0.9972, 0.3206], [0.9995, 0.3486], [1.0, 0.377], [0.9987, 0.4059], [0.9958, 0.435], [0.9911, 0.4644], [0.9847, 0.4939], [0.9766, 0.5235], [0.9668, 0.5531], [0.9553, 0.5825], [0.9422, 0.6118], [0.9274, 0.6408], [0.911, 0.6695], [0.8929, 0.6977], [0.8733, 0.7254], [0.852, 0.7525], [0.8291, 0.7789], [0.8046, 0.8046]], [[-0.8046, -0.8047], [-0.7789, -0.8292], [-0.7525, -0.8521], [-0.7254, -0.8734], [-0.6977, -0.893], [-0.6695, -0.9111], [-0.6408, -0.9275], [-0.6118, -0.9423], [-0.5825, -0.9554], [-0.5531, -0.9669], [-0.5235, -0.9767], [-0.4939, -0.9847], [-0.4644, -0.9912], [-0.435, -0.9958], [-0.4059, -0.9988], [-0.3771, -1.0001], [-0.3486, -0.9996], [-0.3206, -0.9973], [-0.2932, -0.9933], [-0.2664, -0.9875], [-0.2403, -0.98], [-0.215, -0.9706], [-0.1906, -0.9595], [-0.1672, -0.9465], [-0.1448, -0.9317], [-0.1236, -0.915], [-0.1035, -0.8965], [-0.0958, -0.8886], [-0.0884, -0.8804], [-0.0813, -0.872], [-0.0745, -0.8634], [-0.0679, -0.8546], [-0.0617, -0.8456], [-0.0558, -0.8365], [-0.0502, -0.8272], [-0.0449, -0.8177], [-0.0399, -0.808], [-0.0352, -0.7982], [-0.0308, -0.7883], [-0.0267, -0.7782], [-0.0229, -0.7679], [-0.0194, -0.7575], [-0.0162, -0.747], [-0.0132, -0.7364], [-0.0106, -0.7256], [-0.0083, -0.7147], [-0.0062, -0.7037], [-0.0045, -0.6927], [-0.003, -0.6815], [-0.0018, -0.6702], [-0.0009, -0.6588], [-0.0003, -0.6474], [-0.0, -0.6359], [-0.0, -0.6357], [-0.0, -0.6356], [-0.0, -0.6355], [-0.0, -0.6354], [-0.0, -0.6353], [-0.0, -0.6352], [-0.0, -0.6351], [-0.0, -0.635], [-0.0, -0.6349], [-0.0, -0.6347], [-0.0, -0.0136], [-0.0001, -0.0128], [-0.0001, -0.0119], [-0.0003, -0.0111], [-0.0004, -0.0103], [-0.0007, -0.0095], [-0.0009, -0.0087], [-0.0013, -0.008], [-0.0016, -0.0072], [-0.002, -0.0065], [-0.0025, -0.0059], [-0.003, -0.0052], [-0.0035, -0.0046], [-0.004, -0.004], [-0.0046, -0.0034], [-0.0052, -0.0029], [-0.0059, -0.0025], [-0.0065, -0.002], [-0.0073, -0.0016], [-0.008, -0.0012], [-0.0087, -0.0009], [-0.0095, -0.0007], [-0.0103, -0.0004], [-0.0111, -0.0002], [-0.0119, -0.0001], [-0.0128, -0.0], [-0.0137, -0.0], [-0.6281, -0.0], [-0.6399, -0.0001], [-0.6517, -0.0006], [-0.6634, -0.0013], [-0.6751, -0.0023], [-0.6866, -0.0037], [-0.698, -0.0053], [-0.7093, -0.0072], [-0.7205, -0.0095], [-0.7316, -0.0121], [-0.7426, -0.0149], [-0.7534, -0.0181], [-0.7641, -0.0216], [-0.7747, -0.0254], [-0.7851, -0.0295], [-0.7954, -0.034], [-0.8055, -0.0387], [-0.8154, -0.0438], [-0.8252, -0.0492], [-0.8347, -0.0549], [-0.8442, -0.0609], [-0.8534, -0.0672], [-0.8624, -0.0738], [-0.8712, -0.0808], [-0.8798, -0.0881], [-0.8883, -0.0957], [-0.8965, -0.1036], [-0.9149, -0.1236], [-0.9316, -0.1449], [-0.9464, -0.1673], [-0.9593, -0.1907], [-0.9705, -0.2151], [-0.9799, -0.2404], [-0.9874, -0.2665], [-0.9932, -0.2933], [-0.9972, -0.3207], [-0.9995, -0.3487], [-1.0, -0.3771], [-0.9987, -0.406], [-0.9957, -0.4351], [-0.991, -0.4645], [-0.9846, -0.494], [-0.9765, -0.5236], [-0.9668, -0.5532], [-0.9553, -0.5826], [-0.9422, -0.6119], [-0.9274, -0.6409], [-0.911, -0.6695], [-0.8929, -0.6978], [-0.8732, -0.7255], [-0.852, -0.7526], [-0.8291, -0.779], [-0.8046, -0.8047]]]; var glopt={antialias:AAON,alpha:true,premultipliedAlpha:true};@@ -251,7 +429,7 @@ gl.attachShader(prog,sh(gl.FRAGMENT_SHADER,FS)); gl.linkProgram(prog); if(!gl.getProgramParameter(prog,gl.LINK_STATUS)) throw new Error(gl.getProgramInfoLog(prog)); gl.useProgram(prog);-var U={}; ['uMVP','c','uScale','uFlat','uRot','uPlump','uGap','uEdge','uCorner','uLogoR','cPos','cNeg']+var U={}; ['uMVP','c','uScale','uFlat','uRot','uPlump','uGap','uEdge','uCorner','uLogoR','cPos','cNeg','uShade','uPass','uProf','uCamD','uPx','uMorph','uOrtho','uLeafM','uLeaf','uNode'] .forEach(function(n){U[n]=gl.getUniformLocation(prog,n);}); /* unit sphere, displaced entirely in the vertex shader */@@ -270,6 +448,11 @@ var loc=gl.getAttribLocation(prog,'position'); gl.enableVertexAttribArray(loc);gl.vertexAttribPointer(loc,3,gl.FLOAT,false,0,0); gl.enable(gl.DEPTH_TEST); gl.disable(gl.CULL_FACE); gl.uniform1fv(U.uLogoR,new Float32Array(LOGO_R));+gl.uniform4fv(U.uProf,new Float32Array(PROF));+gl.uniform4fv(U.uLeaf,new Float32Array(LEAF));gl.uniform1f(U.uLeafM,0.28704);+/* one mesh step in psi (the longitude step, 1.5x for the quads' diagonals):+ that band around the node collapses to the leaves' corner */+gl.uniform1f(U.uNode,0.4886025*(2*Math.PI/SEG)*1.5); gl.uniform1f(U.uPlump,0);gl.uniform1f(U.uGap,0);gl.uniform1f(U.uCorner,0);gl.uniform1f(U.uRot,45); var C_POS=[0x19/255,0xc8/255,0xbd/255], C_NEG=[0x12/255,0x3a/255,0x63/255];@@ -366,12 +549,16 @@ function frame(now){ var adt=dt*SPEED; tEvo+=adt; if(birth<1){birthT+=adt;birth=smooth(Math.min(1,birthT/BIRTH_S)); glc.style.opacity=birth>=1?'':String(0.04+0.96*birth);}- var k,cheat,fill,teal,pinned=false,drawMesh=true;+ var k,cheat,fill,teal,pinned=false,drawMesh=true,crisp=0; if(inIntro){ introT+=adt; var e1=INTRO.dark,e2=e1+INTRO.logoIn,e3=e2+INTRO.hold,e4=e3+INTRO.reveal,x=introT;- k=1;cheat=1;teal=1;pinned=true;drawMesh=x>=e2;- fill = x<e1?0 : x<e2?smooth((x-e1)/(e2-e1)) : x<e3?1 : 1-smooth((x-e3)/(e4-e3));+ /* The crisp mark fades in alone and holds; then the 3D leaf solid, fully+ morphed and fully flat (identical to it), replaces it WHOLE on one+ frame and lets its shading back in. No crossfade. */+ k=1;cheat=1;teal=1;pinned=true;drawMesh=x>=e3;+ crisp = x<e1?0 : x<e2?smooth((x-e1)/(e2-e1)) : x<e3?1 : 0;+ fill = x<e3?1 : 1-smooth((x-e3)/(e4-e3)); if(x>=e4){inIntro=false;t=eE;roll();} }else{ t=(t+adt)%CYC;@@ -385,9 +572,14 @@ function frame(now){ cheat = t<eS ? (t<=eS-ctw?0:smooth(1-(eS-t)/ctw)) : t<=eE ? 1 : (t>=eE+ctw?0:smooth(1-(t-eE)/ctw)); if(t>=eS&&!rolled){roll();rolled=true;} if(t<eS)rolled=false;- var mid=(eS+eE)/2, a2=mid-Math.max(0.001,(eE-eS)/2+LLEAD), b2=mid+Math.max(0.001,(eE-eS)/2+LLEAD);- fill=(LOGO_PK<=0||t<=a2||t>=b2||(b2-a2)<0.02)?0- :(t<mid?smooth((t-a2)/(mid-a2)):smooth((b2-t)/(b2-mid)))*LOGO_PK;+ /* The flattening is the 3D's own shading going to flat teal, on its+ lead, held through the sit. The crisp vector replaces the 3D whole, on+ a frame boundary, only while the two are identical: fully morphed+ (the sit) and fully flat. */+ fill=(LOGO_PK<=0)?0:(t<eS?(LLEAD<=0.001?0:(t<=eS-LLEAD?0:smooth(1-(eS-t)/LLEAD)))+ :t<=eE?1:(LLEAD<=0.001?0:(t>=eE+LLEAD?0:smooth(1-(t-eE)/LLEAD))))*LOGO_PK;+ crisp=(LOGO_PK>=0.999&&t>=eS&&t<=eE&&eE-eS>1e-4)?1:0;+ if(crisp)drawMesh=false; teal = t<eS ? (TLEAD<=0.01?0:(t<=eS-TLEAD?0:smooth(1-(eS-t)/TLEAD))) : t<=eE ? 1 : (TLEAD<=0.01?0:(t>=eE+TLEAD?0:smooth(1-(t-eE)/TLEAD))); }@@ -447,23 +639,29 @@ function frame(now){ for(i=0;i<16;i++)nrm+=c[i]*c[i]; nrm=Math.sqrt(nrm)||1; for(i=0;i<16;i++)c[i]/=nrm; + var ovA=crisp, shade=fill;+ if(TRANSP) gl.clearColor(0,0,0,0); else gl.clearColor(BG[0],BG[1],BG[2],1); gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT); if(drawMesh){ gl.uniform1fv(U.c,new Float32Array(c)); gl.uniform1f(U.uScale,2.5*(0.9+0.25*k));- gl.uniform1f(U.uFlat,cheat);gl.uniform1f(U.uEdge,cheat);+ gl.uniform1f(U.uCamD,effR/(2.5*(0.9+0.25*k)*birth));+ var mpx=proj(W,H); gl.uniform1f(U.uPx,effR/(mpx.m5*glc.height/2*2.5*(0.9+0.25*k)*birth));+ gl.uniform1f(U.uFlat,0);gl.uniform1f(U.uEdge,0);gl.uniform1f(U.uShade,shade);+ gl.uniform1f(U.uMorph,cheat);gl.uniform1f(U.uOrtho,cheat); gl.uniform3f(U.cNeg,lerp(C_NEG[0],C_POS[0],teal),lerp(C_NEG[1],C_POS[1],teal),lerp(C_NEG[2],C_POS[2],teal));+ gl.uniform1f(U.uPass,0); gl.drawElements(gl.TRIANGLES,idx.length,gl.UNSIGNED_SHORT,0); } ox.clearRect(0,0,ovc.width,ovc.height);- if(fill>0.004){+ if(ovA>0.004){ var mm=proj(W,H), ppw=mm.m0*ovc.width/2/(window.__cam?window.__cam.r:CAMR); var er=window.__cam?window.__cam.r:CAMR; var s=Math.min(ovc.width,ovc.height)*0.34*(R/er); ox.save();ox.translate(ovc.width/2-(window.__cam?window.__cam.x:0)*ppw, ovc.height/2+(window.__cam?window.__cam.y:0)*ppw);- ox.globalAlpha=fill;ox.fillStyle='#00b8b0';+ ox.globalAlpha=ovA;ox.fillStyle='#00b8b0'; for(var p2=0;p2<PATHS.length;p2++){var pts=PATHS[p2];ox.beginPath(); for(var j2=0;j2<pts.length;j2++){var X=pts[j2][0]*s,Y=-pts[j2][1]*s; j2?ox.lineTo(X,Y):ox.moveTo(X,Y);}
orbital-lab.html+314−70@@ -308,7 +308,7 @@ <button id="mExplore" title="All 16 real spherical harmonics for l=0 to 3, as live gain sliders over an evolving superposition." class="mode on">Explore</button> <button id="mLogo" title="Align the orbital against the real logo vectors and measure how well it actually fits." class="mode">Logo cheat</button> <button id="mFinal" title="The earlier cut, kept as a scratchpad: wander mode, camera grab and timing experiments live here." class="mode">Scratch</button>- <button id="mLoop" title="The final cut: a clean teal intro, then play, dinner call, cheat, sit, and back out, with a fresh roll every pass." class="mode">Final</button>+ <button id="mLoop" title="The final cut: a clean teal intro, then play, dinner call, morph, sit, and back out, with a fresh roll every pass." class="mode">Final</button> </div> <div class="head"> <h1>Orbital lab</h1>@@ -406,7 +406,7 @@ how many <b>after</b> it fades away. Steering always finishes before sculpting starts, so the knife only ever touches a finished 2p. The <span style="color:var(--danger)">red pip</span> marks the old- behaviour, sculpting the whole steer, which is what caused the+ behavior, sculpting the whole steer, which is what caused the stretch artefacts. </p> <div class="row">@@ -442,8 +442,10 @@ <p style="font-size:11px;color:var(--text-2);line-height:1.6;margin:6px 0 10px"> Opens clean: the teal mark fades in alone, the 3D arrives underneath it exactly on the epoch, the mark lets go and the loop runs. Play, dinner- call, cheat, sit, back out to play, and a fresh roll every pass so no- two loops are ever the same.+ call, morph, sit, back out to play, and a fresh roll every pass so no+ two loops are ever the same. The lobes MORPH into the leaves (nothing is+ cut or faded), flatten to teal, and the crisp vector mark takes over on+ one frame only once it is identical to the 3D. </p> <div class="acts"> <button id="lRestart" title="Replay everything from the teal intro.">Restart intro</button>@@ -461,15 +463,15 @@ </div> <div class="row"> <label title="dt, the dinner timeline. Mom calls: every coefficient steers from wherever play left it onto the known epoch numbers, p_x and p_y at 0.7071 and everything else 0, arriving exactly as these seconds end. The way back out to play afterwards uses this same length.">dt dinner</label>- <span class="mark"><input type="range" id="l_dt" min="0.5" max="8" step="0.1" value="0.7"><i class="livepip" id="lp4dt"></i></span>- <output id="o_dt">0.7s</output>+ <span class="mark"><input type="range" id="l_dt" min="0.5" max="8" step="0.1" value="1.5"><i class="livepip" id="lp4dt"></i></span>+ <output id="o_dt">1.5s</output> </div> <div class="row">- <label title="ct, the cheat timeline. The tab 2 trick, the quadrant clip and edge correction that force the exact logo outline, ramped 0 to 100% and reaching exactly 100% at the epoch. The harsh edges live here, so experiment with WHEN it runs. The un-cheat on the way out mirrors this length.">ct cheat</label>- <span class="mark"><input type="range" id="l_ct" min="0.2" max="5" step="0.1" value="0.2"><i class="livepip" id="lp4ct"></i></span>- <output id="o_ct">0.2s</output>+ <label title="ct, the morph timeline. The two lobes morph into the logo's two leaves (a leaf-shaped solid whose outline IS the mark) while perspective flattens away, reaching exactly 100% at the epoch. The way back out mirrors this length. Keep it in the late part of dt: early in the dive the state is still a random multi-lobe orbital and morphing it tangles.">ct morph</label>+ <span class="mark"><input type="range" id="l_ct" min="0.2" max="5" step="0.1" value="0.6"><i class="livepip" id="lp4ct"></i></span>+ <output id="o_ct">0.6s</output> </div>- <label class="chk" title="Checked: ct OVERLAYS the tail of dt, carving while the steer is still finishing underneath, busier and the cycle stays shorter. Unchecked: ct becomes its OWN act after dt, carving a finished, still 2p into the mark, calmer, and adds ct to each side of the cycle.">+ <label class="chk" title="Checked: ct OVERLAYS the tail of dt, morphing while the steer is still finishing underneath, and the cycle stays shorter. Unchecked: ct becomes its OWN act after dt, morphing a finished, still 2p into the mark, and adds ct to each side of the cycle."> <input type="checkbox" id="l_ctMode" checked><span>ct is an overlay on dt</span> </label> <div class="row">@@ -477,23 +479,23 @@ <span class="mark"><input type="range" id="l_st" min="0" max="5" step="0.1" value="1"><i class="livepip" id="lp4st"></i></span> <output id="o_st">1.0s</output> </div>- <label class="chk" title="Fade the flat teal logomark over the 3D during the sit: in across the first half of the sit, out across the second half.">- <input type="checkbox" id="l_logoOn" checked><span>logo fade during the sit</span>+ <label class="chk" title="Flatten the 3D's own shading to the flat brand teal for the logo moment, held through the sit. At 100% the crisp vector mark takes over on one frame during the sit, where it is identical to the 3D. Nothing is laid over the 3D and nothing crossfades.">+ <input type="checkbox" id="l_logoOn" checked><span>flatten to the mark for the sit</span> </label> <div class="row">- <label title="Peak opacity the logo fade reaches, halfway through the sit. 0% never shows it, 100% fully covers the shading.">logo peak</label>+ <label title="How flat the 3D gets for the sit. 100% is the flat brand teal (and lets the crisp mark take over); lower keeps some of the 3D shading.">logo peak</label> <span class="mark"><input type="range" id="l_logoPeak" min="0" max="1" step="0.01" value="1"><i class="livepip" id="lp4peak"></i></span> <output id="o_logoPeak">100%</output> </div> <div class="row">- <label title="Start the logo fade this many seconds BEFORE the sit begins, and let the fade-out run the same amount past its end. Negative means earlier. With sit at 0.0s this slider alone still creates a logo moment around the epoch instant.">logo lead</label>- <span class="mark"><input type="range" id="l_logoLead" min="-3" max="0" step="0.1" value="-0.6"><i class="livepip" id="lp4llead"></i></span>- <output id="o_logoLead">-0.6s</output>+ <label title="Start flattening this many seconds BEFORE the sit begins, reaching full flatness as it begins, and let the shading return over the same time after it ends. Negative means earlier.">logo lead</label>+ <span class="mark"><input type="range" id="l_logoLead" min="-3" max="0" step="0.1" value="-0.9"><i class="livepip" id="lp4llead"></i></span>+ <output id="o_logoLead">-0.9s</output> </div> <div class="row">- <label title="The dark negative lobe fades to the positive teal this many seconds before the epoch, and fades back the same amount after it, so the mark reads as one colour by the time the logo lands. Negative means earlier. At 0.0s the colour snaps exactly on the epoch.">teal lead</label>- <span class="mark"><input type="range" id="l_tealLead" min="-3" max="0" step="0.1" value="-0.2"><i class="livepip" id="lp4tlead"></i></span>- <output id="o_tealLead">-0.2s</output>+ <label title="The dark negative lobe fades to the positive teal this many seconds before the epoch, and fades back the same amount after it, so the mark reads as one color by the time the logo lands. Negative means earlier. At 0.0s the color snaps exactly on the epoch.">teal lead</label>+ <span class="mark"><input type="range" id="l_tealLead" min="-3" max="0" step="0.1" value="-0.4"><i class="livepip" id="lp4tlead"></i></span>+ <output id="o_tealLead">-0.4s</output> </div> <label class="chk" title="Draw the dashed logo vectors over the 3D as it steers in, for checking the match against the real mark. A debug aid: off is the clean look. Never shown during the intro."> <input type="checkbox" id="l_guides"><span>dashed logo guides</span>@@ -517,7 +519,7 @@ diagonal. Measured against the real vectors: <b>99.9%</b> of the mark covered, <b>0.6%</b> spill, <b>99.3%</b> IoU.<br>- Untouched, the same state already scores <b>79.2%</b>. The licence is+ Untouched, the same state already scores <b>79.2%</b>. The license is a quadrant clip plus a per-direction edge correction. </div> <button id="bCopy" title="Copy the equation and the fit numbers to the clipboard as plain text." class="copy">Copy the state</button>@@ -701,6 +703,45 @@ float psiOf(vec3 d){ uniform float uFlat, uRot, uPlump, uGap, uEdge, uCorner; uniform float uLogoR[128]; // the mark's measured edge, 0..90 degrees+varying vec2 vQ; // in-plane shape position, before the gap: the pixel cut reads it+varying float vFace; // > 0 where the outward normal faces the camera+varying float vZ; // shape-space depth, for the trim's perspective++/* TAKE 2: the morph. Instead of cutting the orbital to the mark and fading+ what is cut away, the lobes BECOME the leaves. A pure 2p lobe is a ball of+ radius R0 touching the origin; its cross-section disk is mapped onto the+ leaf, radially from a center m on the leaf's axis: the ball's center goes+ to m, its rim to the leaf's outline, the node at the origin to the leaf's+ corner. Heights are kept, so the ball lands on a leaf-shaped lens whose+ silhouette IS the mark, with nothing cut and nothing faded. */+uniform float uMorph; // 0 the orbital, 1 the leaf solid+uniform float uOrtho; // 0 the camera's perspective, 1 none (the mark is flat)+uniform float uLeafM; // m's distance from the origin along the leaf axis+uniform float uNode; // psi of one mesh step off the node: that band collapses to the corner+uniform vec4 uLeaf[32]; // distance from m to the outline at 128 angles, -pi..pi++float leafAt(int i){+ int q = i / 4;+ int r = i - q * 4;+ vec4 v = uLeaf[q];+ return r == 0 ? v.x : (r == 1 ? v.y : (r == 2 ? v.z : v.w));+}+float leafR(float beta){+ float u = (beta + 3.14159265) / 6.28318531 * 127.0;+ float fi = floor(clamp(u, 0.0, 126.0));+ return mix(leafAt(int(fi)), leafAt(int(fi) + 1), clamp(u - fi, 0.0, 1.0));+}+vec3 leafPos(vec3 P, float pp){+ float R0 = 0.2443013; // the 2p lobe's radius: 0.4886 cos(angle) is a ball+ float ax = radians(uRot) + (pp >= 0.0 ? 0.0 : 3.14159265);+ vec2 a = vec2(cos(ax), sin(ax));+ vec2 b = vec2(-a.y, a.x);+ vec2 rel = vec2(dot(P.xy, a), dot(P.xy, b)) - vec2(R0, 0.0);+ float rho = length(rel);+ float be = rho > 1e-7 ? atan(rel.y, rel.x) : 0.0;+ vec2 l = vec2(uLeafM, 0.0) + (rho / R0) * leafR(be) * vec2(cos(be), sin(be));+ return vec3(l.x * a + l.y * b, P.z);+} /* The morph target for ANY direction. @@ -721,42 +762,55 @@ uniform float uLogoR[128]; // the mark's measured edge, 0..90 degrees exactly as the wavefunction gives it, and cut it to the mark's quadrants. That scored 95.9% IoU at 0.8% spill and renders clean, because it never moves a vertex anywhere the surface was not already. It IS a clip, and that- is the honest description of the licence in the mark. */-vec3 shapedPos(vec3 dir){+ is the honest description of the license in the mark. */+vec3 shapedPos(vec3 dir, float ovK){ float pp = psiOf(dir); vec3 physics = dir * abs(pp); if (uFlat <= 0.0001) return physics; float PI4 = 0.7853981634; float axis = radians(uRot);- vec2 e1 = vec2(cos(axis - PI4), sin(axis - PI4));- vec2 e2 = vec2(cos(axis + PI4), sin(axis + PI4)); float s = (pp >= 0.0) ? 1.0 : -1.0; float lobe = (pp >= 0.0) ? axis : axis + 3.14159265; - /* A hard half-plane cut leaves a sharp corner where the flat edge meets the- outer curve; the mark has a real radius there. min(d,0) rounded is- 0.5*(d - sqrt(d*d + rc*rc)), which eases into the cut over a band of- width rc instead of hitting it as a crease. */+ /* The quadrant cut itself is done PER PIXEL in the fragment shader (vQ+ below). Doing it here, by projecting every out-of-quadrant vertex onto+ the cut planes, built a paper-thin sheet of squashed triangles along each+ plane: edge-on it rendered as a hairline at the seam, and while the cut+ ramped in it fanned out into jagged fins. Discarding fragments instead+ gives a mathematically straight edge exactly on the plane, with no+ geometry left behind to catch the light.++ What stays here is only the CORNER rounding, and only its soft excess+ over a hard cut: min(d,0) rounded is 0.5*(d - sqrt(d*d + rc*rc)), and+ subtracting min(d,0) leaves the gentle inward ease near the plane while+ the hard part is left to the pixel cut. */ vec2 q = physics.xy; float rc = uCorner;- float d1 = dot(q, e1) * s;- float p1 = (rc > 1e-5) ? 0.5 * (d1 - sqrt(d1*d1 + rc*rc)) : min(d1, 0.0);- q -= e1 * (p1 * s);- float d2 = dot(q, e2) * s;- float p2 = (rc > 1e-5) ? 0.5 * (d2 - sqrt(d2*d2 + rc*rc)) : min(d2, 0.0);- q -= e2 * (p2 * s);+ if (rc > 1e-5) {+ vec2 e1 = vec2(cos(axis - PI4), sin(axis - PI4));+ vec2 e2 = vec2(cos(axis + PI4), sin(axis + PI4));+ float d1 = dot(q, e1) * s;+ q -= e1 * ((0.5 * (d1 - sqrt(d1*d1 + rc*rc)) - min(d1, 0.0)) * s);+ float d2 = dot(q, e2) * s;+ q -= e2 * ((0.5 * (d2 - sqrt(d2*d2 + rc*rc)) - min(d2, 0.0)) * s);+ } vec3 clipped = vec3(mix(physics.xy, q, uFlat), physics.z); /* OUTER BOUNDARY correction.- The clip fixes the inner corner but leaves the outer edge as the plain+ The cut fixes the inner corner but leaves the outer edge as the plain circle the physics gives: it overshoots the mark in some directions and falls short in others. So for each direction, compare the orbital's own in-plane radius against the mark's measured edge at that same angle and scale by the ratio. Points outside the mark are pulled in, points inside are pushed out, and the silhouette lands exactly on the vectors. + Directions past the quadrant (about to be cut away) take the ratio AT the+ quadrant edge rather than none at all. Switching the correction off right+ at the edge kinked every triangle that straddled it, which showed as a+ notch where the flat edge meets the outer curve.+ This scales the in-plane component only, so the solid stays coherent out of plane rather than collapsing. */ if (uEdge > 0.0001) {@@ -765,18 +819,25 @@ vec3 shapedPos(vec3 dir){ if (cl > 1e-5) { float cang = atan(cq.y, cq.x); float cda = atan(sin(cang - lobe), cos(cang - lobe));- if (abs(cda) <= PI4 + 0.001) {+ { float u = (clamp(cda, -PI4, PI4) + PI4) / (2.0 * PI4) * 127.0; int i = int(floor(u)); float f = u - float(i); int j = min(i + 1, 127); float rEdge = mix(uLogoR[i], uLogoR[j], f); - // the orbital's own equatorial radius in this same direction- vec3 eqd = vec3(cos(cang), sin(cang), 0.0);- float rPsi = abs(psiOf(eqd));+ // the orbital's own equatorial radius in this (quadrant-clamped) direction+ float ea = lobe + clamp(cda, -PI4, PI4);+ float rPsi = abs(psiOf(vec3(cos(ea), sin(ea), 0.0)));+ /* Aim 6% PAST the mark and let the fragment shader trim the outline+ exactly. Where the vector's curve leaves the flat edge it is+ tangent to it, a detail far finer than the sphere's vertex+ spacing, so aiming at it directly left a chord there: a sharp+ corner. ovK is 0 for the lighting, so the overshoot only moves+ the silhouette the trim cuts, never the shading. */+ float ov = mix(1.0, 1.06, ovK); if (rPsi > 1e-5) {- float k = rEdge / rPsi;+ float k = min(rEdge / rPsi * ov, 3.0); clipped.xy = cq * mix(1.0, k, uEdge); } }@@ -790,7 +851,29 @@ void main(void){ float p = psiOf(d); vPsi = p; - vec3 pos = shapedPos(d) * uScale;+ vec3 shaped = shapedPos(d, 1.0);+ /* The target is the LOGO state's own lobe in this direction, never the+ live state's: on the way out the next roll's small new lobes would be+ mapped through the wrong lobe's frame and thrown out as a flat sheet.+ So the leaf solid is a fixed shape and the morph is a plain blend+ between the live orbital and it. */+ if (uMorph > 0.0001) {+ float lp = 0.4886025 * dot(d.xy, vec2(cos(radians(uRot)), sin(radians(uRot))));+ vec3 ball = d * abs(lp);+ /* Triangles that straddle the node join a vertex of one lobe to a vertex+ of the other. On the leaves those land on the two leaves' flat edges,+ so each spanned the empty quadrant between them: a small chamfered+ bridge across the center all through the morph. Every vertex within+ one mesh step of the node (uNode, set from the tessellation) goes to+ the corner itself, so any triangle crossing between the lobes has no+ area. Pulling a point toward the corner keeps it on its flat edge, so+ the edges stay straight. */+ float nodeK = smoothstep(uNode, 2.0 * uNode, abs(lp));+ shaped = mix(shaped, leafPos(ball, lp) * nodeK, uMorph);+ }+ vQ = shaped.xy;+ vZ = shaped.z;+ vec3 pos = shaped * uScale; pos.xy += normalize(vec2(cos(radians(uRot)), sin(radians(uRot)))) * ((p >= 0.0) ? 1.0 : -1.0) * uGap * uScale * uFlat; @@ -802,39 +885,177 @@ void main(void){ vec3 t2 = cross(d, t1); float hh = 0.03; vec3 a = normalize(d + t1*hh), b = normalize(d + t2*hh);- vec3 pa = shapedPos(a) * uScale;- vec3 pb = shapedPos(b) * uScale;- vec3 nn = cross(pa - pos, pb - pos);+ vec3 p0 = shapedPos(d, 0.0) * uScale;+ vec3 pa = shapedPos(a, 0.0) * uScale;+ vec3 pb = shapedPos(b, 0.0) * uScale;+ vec3 nn = cross(pa - p0, pb - p0); vN = normalize(dot(nn, d) < 0.0 ? -nn : nn); + /* Facing, measured rather than read from gl_FrontFacing: the winding is+ opposite between Babylon and the raw WebGL loader. Stepping along the+ outward normal moves toward the camera exactly when the surface faces+ it, so the clip-space depth drops. */ gl_Position = worldViewProjection * vec4(pos, 1.0);+ vec4 cn = worldViewProjection * vec4(pos + vN * 0.05, 1.0);+ vFace = gl_Position.z / gl_Position.w - cn.z / cn.w;++ /* Perspective goes as the mark arrives: each vertex is placed where an+ orthographic camera with the same scale at the mark's plane would put+ it, so the silhouette is the flat outline exactly. Depth is untouched.+ The lighting keeps the orbital's own normals (computed above from the+ unmorphed surface), so the map cannot crease the shading. */+ if (uOrtho > 0.0001) {+ float w0 = (worldViewProjection * vec4(0.0, 0.0, 0.0, 1.0)).w;+ gl_Position.xy *= gl_Position.w / mix(gl_Position.w, w0, uOrtho);+ } }`; BABYLON.Effect.ShadersStore['labFragmentShader'] = ` precision highp float; varying float vPsi; varying vec3 vN;+varying vec2 vQ;+varying float vFace;+varying float vZ; uniform vec3 cPos, cNeg;+uniform float uFlat, uRot, uShade, uPass, uEdge, uCamD, uPx;+uniform vec4 uProf[12]; // the mark's outline: 48 radii, sampled densely at both flat edges++/* The outline radius at x across the leaf (0 and 1 are the flat edges).+ Sampled at smoothstep-spaced angles: near a flat edge the radius grows+ like the square root of the angle, which smoothstep's spacing makes+ linear, so plain interpolation stays within about a pixel. Picked out by+ comparison, because GLSL ES 1.00 fragment shaders may not index uniform+ arrays dynamically. */+float outlineAt(float x){+ float sx = clamp(0.5 - sin(asin(clamp(1.0 - 2.0*x, -1.0, 1.0)) / 3.0), 0.0, 1.0);+ float u = sx * 47.0;+ float fi = floor(min(u, 46.0));+ float a = 0.0, b = 0.0;+ for (int k = 0; k < 12; k++) {+ float q0 = float(k * 4);+ vec4 id = vec4(q0, q0 + 1.0, q0 + 2.0, q0 + 3.0);+ a += dot(uProf[k], vec4(equal(id, vec4(fi))));+ b += dot(uProf[k], vec4(equal(id, vec4(fi + 1.0))));+ }+ return mix(a, b, u - fi);+}+ void main(void){+ /* The quadrant cut, per pixel, always at the mark's own 45 degree planes.+ Pass 0 (opaque) keeps each lobe's quadrant. Pass 1 is the OVERFLOW, the+ part of the round lobe outside the quadrant, drawn translucent at+ 1 - uFlat, so as the cheat ramps the excess melts away and leaves the+ leaf. Nothing moves and nothing is squashed: a rotating cut read as+ scissors closing, and squashing vertices onto the planes (the first+ version) left paper-thin sheets that showed as a hairline at the seam. */+ float fade = 1.0;+ if (uFlat > 0.0001) {+ float ql = length(vQ);+ bool inside = true;+ float cov = 1.0;+ if (ql > 1e-6) {+ float ax = radians(uRot) + (vPsi >= 0.0 ? 0.0 : 3.14159265);+ vec2 ad = vec2(cos(ax), sin(ax));+ vec2 qn = vQ / ql;+ inside = dot(qn, ad) >= 0.7071067 - 1e-4;+ /* The outer trim: the exact vector outline, eased in with the edge+ correction (1.3x, beyond any physics radius, down to 1x) so it+ never pops. Measured where this pixel's ray meets the mark's plane+ (z = 0), so the cut lands on SCREEN: a front-facing point sits+ nearer the camera and perspective enlarges it. uCamD is the camera+ distance in shape units. 1.0248 is the flat overlay's own size+ against the true projection (its 0.34 was fitted by eye), so the 3D+ outline and the flat mark are the same curve. cov is the pixel's+ coverage over a one pixel ramp (uPx = shape units per pixel), which+ antialiases the trimmed curve the way MSAA does a mesh edge. */+ if (inside && uEdge > 0.0001) {+ float da = atan(ad.x*qn.y - ad.y*qn.x, dot(qn, ad));+ float x = clamp((da + 0.7853981634) / 1.5707963268, 0.0, 1.0);+ float qp = (uCamD > 0.0) ? ql * uCamD / max(0.05, uCamD + vZ) : ql;+ float lim = outlineAt(x) * 1.0248 * mix(1.3, 1.0, uEdge);+ cov = (uPx > 0.0) ? clamp((lim - qp) / uPx + 0.5, 0.0, 1.0) : step(qp, lim);+ }+ }+ /* Pass 0 (opaque) keeps the fully covered leaf. Pass 1 (blended, front+ surface only) carries the rest: the antialiased rim of the trim, and+ the overflow outside the quadrant melting away at 1 - uFlat. */+ if (uPass < 0.5) { if (!inside || cov < 0.999) discard; }+ else if (inside) { if (cov >= 0.999 || cov <= 0.001) discard; fade = cov; }+ else { if (uFlat >= 0.999) discard; fade = 1.0 - uFlat; }+ } else if (uPass > 0.5) discard; vec3 base = vPsi >= 0.0 ? cPos : cNeg; vec3 n = normalize(vN);+ /* Looking INTO a cut lobe (free view only; square-on the cut is edge-on)+ shows the far wall from behind. Shade it as the flat cut face instead,+ so the solid reads closed rather than hollow. */+ if (uFlat > 0.0001 && uPass < 0.5 && vFace < 0.0) n = vec3(0.0, 0.0, -1.0); float lam = 0.42 + 0.58*max(0.0, dot(n, normalize(vec3(-0.4,0.85,-0.55)))); float rim = pow(1.0 - abs(n.z), 2.5)*0.32;- gl_FragColor = vec4(base*lam + vec3(0.0,0.72,0.68)*rim, 1.0);+ /* uShade flattens the surface itself to the brandmark teal. The logo moment+ used to be a separate flat canvas laid over the 3D; whenever the two+ shapes were not identical (fading in while the dive was still arriving,+ lingering while it left) that read as a ghost double image. Fading the+ surface means there is only ever one shape on screen. */+ vec3 lit = base*lam + vec3(0.0,0.72,0.68)*rim;+ gl_FragColor = vec4(mix(lit, vec3(0.0, 0.7216, 0.6902), uShade), fade); }`; const mat = new BABYLON.ShaderMaterial('lab', scene, 'lab', {- attributes:['position'], uniforms:['worldViewProjection','c','uScale','cPos','cNeg','uFlat','uRot','uPlump','uGap','uEdge','uCorner','uLogoR']+ attributes:['position'], uniforms:['worldViewProjection','c','uScale','cPos','cNeg','uFlat','uRot','uPlump','uGap','uEdge','uCorner','uLogoR','uShade','uPass','uProf','uCamD','uPx','uMorph','uOrtho','uLeafM','uLeaf','uNode'] });+/* The blended pass: the same shader on a child copy of the mesh, alpha+ blended, with a depth prepass so only its FRONT surface blends (otherwise+ its own back wall would double the opacity). It carries the trim's+ antialiased rim and, while the cut is partway in, the melting overflow, so+ it is enabled whenever the cut is. Every uniform set on mat is mirrored. */+const matOver = new BABYLON.ShaderMaterial('labOver', scene, 'lab', {+ attributes:['position'], uniforms:['worldViewProjection','c','uScale','cPos','cNeg','uFlat','uRot','uPlump','uGap','uEdge','uCorner','uLogoR','uShade','uPass','uProf','uCamD','uPx','uMorph','uOrtho','uLeafM','uLeaf','uNode'],+ needAlphaBlending:true+});+matOver.backFaceCulling = false;+matOver.needDepthPrePass = true;+matOver.setFloat('uPass', 1);+let meshOver = null;+['setFloat','setFloats','setColor3','setArray4'].forEach(fn => {+ const own = mat[fn].bind(mat), over = matOver[fn].bind(matOver);+ mat[fn] = (n, v) => {+ own(n, v); over(n, v);+ if (n === 'uFlat' && meshOver) meshOver.setEnabled(v > 0.0001);+ return mat;+ };+});+mat.setFloat('uPass', 0);+matOver.setFloat('uPass', 1); mat.setFloats('uLogoR', [0.29682, 0.31691, 0.33085, 0.34219, 0.3519, 0.36055, 0.36839, 0.37555, 0.38216, 0.3883, 0.39398, 0.39936, 0.40453, 0.40917, 0.41376, 0.41798, 0.422, 0.42584, 0.4294, 0.43293, 0.43608, 0.43927, 0.44211, 0.445, 0.44757, 0.45018, 0.45253, 0.45491, 0.45702, 0.45917, 0.46107, 0.46303, 0.46475, 0.46655, 0.46809, 0.46969, 0.4711, 0.47252, 0.47382, 0.47507, 0.47627, 0.47735, 0.47847, 0.47938, 0.48038, 0.48119, 0.48205, 0.48281, 0.4835, 0.48421, 0.48477, 0.48541, 0.48586, 0.48634, 0.48677, 0.48712, 0.48754, 0.48774, 0.48802, 0.4882, 0.48834, 0.48853, 0.48852, 0.48859, 0.48859, 0.48852, 0.48853, 0.48834, 0.4882, 0.48802, 0.48774, 0.48754, 0.48712, 0.48677, 0.48634, 0.48586, 0.48541, 0.48477, 0.48421, 0.4835, 0.48281, 0.48205, 0.48119, 0.48038, 0.47938, 0.47847, 0.47735, 0.47627, 0.47507, 0.47382, 0.47252, 0.4711, 0.46969, 0.46807, 0.46651, 0.46473, 0.46303, 0.46107, 0.45918, 0.45702, 0.45491, 0.45253, 0.45018, 0.44757, 0.445, 0.44211, 0.43927, 0.43608, 0.43293, 0.4294, 0.42584, 0.422, 0.41798, 0.41376, 0.40917, 0.40453, 0.3993, 0.39391, 0.38829, 0.38214, 0.37552, 0.36839, 0.36056, 0.3519, 0.34209, 0.33073, 0.31683, 0.2966]);+mat.setArray4('uProf', [0.27485, 0.28587, 0.30119, 0.3168, 0.33233, 0.34751, 0.3623, 0.37662, 0.39025, 0.4033, 0.41541, 0.42673, 0.43684, 0.44607, 0.45439, 0.46153, 0.46783, 0.47326, 0.47775, 0.48137, 0.48427, 0.4864, 0.48773, 0.48841, 0.48841, 0.48773, 0.4864, 0.48427, 0.48137, 0.47775, 0.47326, 0.46781, 0.46153, 0.45439, 0.44607, 0.43684, 0.42673, 0.41541, 0.40329, 0.39022, 0.37661, 0.36231, 0.34745, 0.33216, 0.31673, 0.30103, 0.28552, 0.27309]); const C_POS = BABYLON.Color3.FromHexString('#19c8bd'); const C_NEG = BABYLON.Color3.FromHexString('#123a63'); mat.setColor3('cPos', C_POS); mat.setColor3('cNeg', C_NEG);+mat.setFloat('uShade', 0);+mat.setFloat('uMorph', 0);+mat.setFloat('uOrtho', 0);+/* One mesh step in psi: Babylon's sphere has segments+2 rings over 180+ degrees, 1.5x for the quads' diagonals. */+mat.setFloat('uNode', 0.4886025 * (Math.PI / (128 + 2)) * 1.5);+mat.setFloat('uLeafM', 0.28704);+mat.setArray4('uLeaf', [0.28704, 0.27386, 0.26243, 0.25251, 0.24388, 0.23638, 0.22988, 0.22426, 0.21943, 0.21532, 0.21188, 0.20904, 0.20678, 0.20506, 0.20386, 0.20318, 0.20299, 0.2033, 0.20412, 0.20544, 0.20729, 0.20969, 0.21268, 0.21628, 0.22016, 0.22398, 0.22771, 0.23133, 0.2347, 0.23783, 0.24065, 0.24312, 0.24521, 0.24691, 0.24812, 0.24898, 0.24943, 0.24947, 0.24912, 0.24839, 0.24734, 0.246, 0.24444, 0.24269, 0.24079, 0.23877, 0.23668, 0.23459, 0.23252, 0.23047, 0.22847, 0.22649, 0.2246, 0.22286, 0.22128, 0.21984, 0.21845, 0.21725, 0.21624, 0.21541, 0.21465, 0.21412, 0.21383, 0.21357, 0.21357, 0.21383, 0.21412, 0.21465, 0.21541, 0.21624, 0.21725, 0.21845, 0.21984, 0.22128, 0.22286, 0.2246, 0.22649, 0.22847, 0.23047, 0.23252, 0.23459, 0.23668, 0.23877, 0.24079, 0.24269, 0.24444, 0.246, 0.24734, 0.24839, 0.24912, 0.24947, 0.24943, 0.24898, 0.24812, 0.24691, 0.24521, 0.24312, 0.24065, 0.23783, 0.2347, 0.23133, 0.22771, 0.22398, 0.22016, 0.21628, 0.21268, 0.20969, 0.20729, 0.20544, 0.20412, 0.2033, 0.20299, 0.20318, 0.20386, 0.20506, 0.20678, 0.20904, 0.21188, 0.21532, 0.21943, 0.22426, 0.22988, 0.23638, 0.24388, 0.25251, 0.26243, 0.27386, 0.28704]); mat.backFaceCulling = false; const mesh = BABYLON.MeshBuilder.CreateSphere('orb', { diameter:2, segments:128 }, scene); mesh.material = mat;+/* Shape units per screen pixel at the mark's plane, for the trim's one pixel+ antialiasing ramp. fitFraming fixes the FOV on the limiting axis. */+function shapePx(scale){+ const px = Math.min(engine.getRenderWidth(), engine.getRenderHeight()) / 2;+ return Math.tan(camera.fov / 2) * camera.radius / Math.max(1, px) / scale;+}+// a child, so it follows the spin and the intro's setEnabled for free+meshOver = mesh.clone('orbOver', mesh);+meshOver.position.setAll(0); meshOver.rotation.setAll(0);+meshOver.material = matOver;+meshOver.setEnabled(false); /* ---------- the weights ---------- */ /* The sliders are GAINS on the running evolution, not a frozen pose. The@@ -971,12 +1192,16 @@ scene.registerBeforeRender(() => { mat.setFloats('c', c); mat.setFloat('uScale', 2.5 * (logoMode ? cheat.size : 1));+ mat.setFloat('uCamD', camera.radius / (2.5 * (logoMode ? cheat.size : 1)));+ mat.setFloat('uPx', shapePx(2.5 * (logoMode ? cheat.size : 1))); mat.setFloat('uFlat', logoMode ? cheat.flat : 0); mat.setFloat('uRot', cheat.rot); mat.setFloat('uPlump', logoMode ? cheat.plump : 0); mat.setFloat('uGap', logoMode ? cheat.gap : 0); mat.setFloat('uEdge', logoMode ? cheat.edge : 0); mat.setFloat('uCorner',logoMode ? cheat.corner: 0);+ mat.setFloat('uShade', 0);+ mat.setFloat('uMorph', 0); mat.setFloat('uOrtho', 0); syncLogoLines(); @@ -1021,7 +1246,7 @@ scene.registerBeforeRender(() => { The brandmark is a 2p orbital (measured: the real isosurface at 135 degrees contains 96.5% of the mark), but not exactly one. The designers squared off the inner edges where the physics has a smooth pinch. These- controls dial that licence in, so you can see precisely how much cheating+ controls dial that license in, so you can see precisely how much cheating the mark costs, and the real vectors are ghosted on top to judge against. ===================================================================== */ const cheat = { face:1, flat:0, rot:45, plump:0, gap:0, edge:0, corner:0, size:1, ghost:0.45, fill:0 };@@ -1190,7 +1415,7 @@ document.getElementById('bPure').addEventListener('click',()=> aligned 2p alone gives 79.2% IoU; adding only the quadrant clip takes it to 95.9% at 0.8% spill. plump and gap both make it WORSE (they push coverage to 100% but spill to 17%+), so the honest optimum leaves them at zero. The- entire licence in the Adom mark is one clip. */+ entire license in the Adom mark is one clip. */ document.getElementById('bMark').addEventListener('click',()=> setCheat({face:1,flat:1,rot:45,plump:0,gap:0,edge:1,corner:0,size:1.15})); @@ -1333,7 +1558,7 @@ function setMode(which){ + 'on the right are the live coefficient right now.' : isLoop ? 'The final cut. A clean teal open, then forever: <b>pt</b> play, '- + '<b>dt</b> dinner call, <b>ct</b> cheat, <b>st</b> sit as the mark, '+ + '<b>dt</b> dinner call, <b>ct</b> morph, <b>st</b> sit as the mark, ' + 'then back out, with a fresh roll every pass. Hover any control, ' + 'every one explains itself.' : isFinal@@ -1456,9 +1681,9 @@ const SAY = { lSnapSave:() => lsOK ? ['Snapshot saved', (loadSnaps().slice(-1)[0]||{}).name || 'stored'] : ['No storage on this surface', 'The wiki sandbox cannot save. Factory snapshots still apply; tune and save on the lab page.'], lSnapDel: () => ['Snapshot deleted', `${allSnaps().length} left · factory ones (*) ship with the page`],- mLoop: () => ['Final', 'The final cut: teal intro, then play, dinner, cheat, sit, and back out, fresh roll every pass'],+ mLoop: () => ['Final', 'The final cut: teal intro, then play, dinner, morph, sit, and back out, fresh roll every pass'], lRestart: () => ['Intro restarted', 'From the teal open'],- lDefaults:() => ['Loop defaults restored', 'john fav: pt 5s, dt 0.7s, ct 0.2s overlay, 1s sit, logo 100% on a 0.6s lead, teal lead 0.2s'],+ lDefaults:() => ['Loop defaults restored', 'take 2 D: pt 5s, dt 1.5s, ct 0.6s morph, 1s sit, flat on a 0.9s lead, teal lead 0.4s'], fDefaults:() => ['Defaults restored', 'Morph 2.6s each way, lead in and tail out 0.6s, ease 0.35, hold 1.0s, fill 50%'], }; document.addEventListener('click', e => {@@ -1807,16 +2032,20 @@ function driveFinal(dt){ liveC = cN; mat.setFloat('uScale', 2.5 * (0.9 + 0.25*k));+ mat.setFloat('uCamD', camera.radius / (2.5 * (0.9 + 0.25*k)));+ mat.setFloat('uPx', shapePx(2.5 * (0.9 + 0.25*k))); mat.setFloat('uFlat', cheatK); mat.setFloat('uEdge', cheatK); mat.setFloat('uRot', 45); mat.setFloat('uPlump', 0); mat.setFloat('uGap', 0); mat.setFloat('uCorner',0);- /* Sculpting also unifies the phase colours. The negative lobe fades to the+ mat.setFloat('uShade', 0);+ mat.setFloat('uMorph', 0); mat.setFloat('uOrtho', 0);+ /* Sculpting also unifies the phase colors. The negative lobe fades to the positive teal exactly as the clip lands and back out as it releases, so by the time the flat logo fades over the 3D the whole mark already reads- as ONE colour. Driven by cheatK, so it needs no timing of its own. */+ as ONE color. Driven by cheatK, so it needs no timing of its own. */ mat.setColor3('cNeg', BABYLON.Color3.Lerp(C_NEG, C_POS, cheatK)); // Camera: drifting while the physics runs, square on for the mark.@@ -1852,7 +2081,7 @@ function driveFinal(dt){ } /* At the exact epoch moment (k=1 and the logo is visible), the pose must be- canonical: dead centre, head on, everything right. Once we leave the epoch,+ canonical: dead center, head on, everything right. Once we leave the epoch, release control back to the user/animator. */ const AT_EPOCH = k > 0.99 && cheatK > 0.99; if (AT_EPOCH) {@@ -1958,8 +2187,8 @@ function driveFinal(dt){ The whole thing opens with the teal intro: mark fades in alone, the 3D arrives underneath exactly on the epoch, mark lets go, loop runs. */ let loopMode=false, loopT=0, introT=0, inIntro=true, loopRolled=false;-let l_pt=5, l_dt=0.7, l_ct=0.2, l_ctOverlay=true, l_st=1; // john fav ships as the default-let l_logoOn=true, l_logoPeak=1, l_logoLead=0.6, l_tealLead=0.2, l_guides=false; // leads kept positive+let l_pt=5, l_dt=1.5, l_ct=0.6, l_ctOverlay=true, l_st=1; // take 2 D ships as the default+let l_logoOn=true, l_logoPeak=1, l_logoLead=0.9, l_tealLead=0.4, l_guides=false; // leads kept positive let loopGains=null; function rollLoopGains(){ // tab 1's Randomise, verbatim@@ -1996,7 +2225,7 @@ function driveLoop(dt){ return g[i]*env*Math.cos(E_LEVELS[i]*tEvo*0.5); }); const EA=-Math.PI/2, EB=Math.PI/2, ER=4.4;- let k=0, cheatK=0, fill=0, tealK=0, phaseName='', pinned=false;+ let k=0, cheatK=0, fill=0, tealK=0, phaseName='', pinned=false, crisp=0; if (inIntro){ introT+=dt;@@ -2006,12 +2235,15 @@ function driveLoop(dt){ /* The mark fades in ALONE, at full teal. The 3D is enabled only once the mark is solid, so it arrives already congruent underneath it, and the reveal is the mark letting go of its own 3D self. */- mesh.setEnabled(t>=e2+0.01);- fill = t<e1?0 : t<e2? smooth(seg(e1,e2,t)) : t<e3? 1 : 1-smooth(seg(e3,e4,t));+ /* Take 2: the crisp mark fades in alone and holds; then the 3D leaf+ solid, fully morphed and fully flat (so identical to it), replaces it+ WHOLE on one frame and lets its shading back in. No crossfade. */+ mesh.setEnabled(t>=e3);+ crisp = t<e1?0 : t<e2? smooth(seg(e1,e2,t)) : t<e3? 1 : 0;+ fill = t<e3? 1 : 1-smooth(seg(e3,e4,t)); camera.alpha=EA; camera.beta=EB; camera.radius=ER; camera.target.set(0,0,0); if (t>=e4){ inIntro=false; mesh.setEnabled(true); loopT=loopEpochEnd(); rollLoopGains(); } } else {- mesh.setEnabled(true); loopT=(loopT+dt)%loopCycle(); const eS=loopEpochStart(), eE=loopEpochEnd(), t=loopT; const ctw=l_ctOverlay? Math.min(l_ct,l_dt) : l_ct;@@ -2028,9 +2260,16 @@ function driveLoop(dt){ pinned to the mark, so the new state is only met on the way out. */ if (t>=eS && !loopRolled){ rollLoopGains(); loopRolled=true; } if (t<eS) loopRolled=false;- const L=l_logoLead, mid=(eS+eE)/2, a=mid-Math.max(0.001,(eE-eS)/2+L), b=mid+Math.max(0.001,(eE-eS)/2+L);- fill = (!l_logoOn||l_logoPeak<=0||t<=a||t>=b||(b-a)<0.02) ? 0- : (t<mid? smooth((t-a)/(mid-a)) : smooth((b-t)/(b-mid))) * l_logoPeak;+ /* Take 2: the flattening (logo peak, on its lead) is the 3D's own+ shading going to flat teal; it holds through the sit. The crisp vector+ mark replaces the 3D whole, on a frame boundary, only while the two+ are identical: fully morphed (the sit) and fully flat. */+ const L=l_logoLead;+ fill = (!l_logoOn||l_logoPeak<=0) ? 0+ : (t<eS ? (L<=0.001?0:(t<=eS-L?0:smooth(1-(eS-t)/L)))+ : t<=eE ? 1 : (L<=0.001?0:(t>=eE+L?0:smooth(1-(t-eE)/L)))) * l_logoPeak;+ crisp = (l_logoOn && l_logoPeak>=0.999 && t>=eS && t<=eE && eE-eS>1e-4) ? 1 : 0;+ mesh.setEnabled(!crisp); const TL=l_tealLead; tealK = t<eS ? (TL<=0.01?0:(t<=eS-TL?0:smooth(1-(eS-t)/TL))) : t<=eE ? 1@@ -2049,9 +2288,12 @@ function driveLoop(dt){ const nrm=Math.hypot(...c)||1; const cN=c.map(v=>v/nrm); mat.setFloats('c',cN); liveC=cN; mat.setFloat('uScale',2.5*(0.9+0.25*k));- mat.setFloat('uFlat',cheatK); mat.setFloat('uEdge',cheatK);+ mat.setFloat('uCamD',camera.radius/(2.5*(0.9+0.25*k)));+ mat.setFloat('uPx',shapePx(2.5*(0.9+0.25*k)));+ mat.setFloat('uFlat',0); mat.setFloat('uEdge',0);+ mat.setFloat('uMorph',cheatK); mat.setFloat('uOrtho',cheatK); mat.setFloat('uShade',fill); mat.setFloat('uRot',45); mat.setFloat('uPlump',0); mat.setFloat('uGap',0); mat.setFloat('uCorner',0);- cheat.fill=fill; cheat.ghost=(l_guides && !inIntro) ? 0.9*k : 0;+ cheat.fill=crisp; cheat.ghost=(l_guides && !inIntro) ? 0.9*k : 0; syncLogoLines(2.5*(0.9+0.25*k)); drawGhost(); @@ -2092,7 +2334,7 @@ function driveLoop(dt){ } /* ---- tab 4 controls ---- */-const LOOP_DEFAULTS={l_pt:5,l_dt:0.7,l_ct:0.2,l_st:1,l_logoPeak:1,l_logoLead:-0.6,l_tealLead:-0.2};+const LOOP_DEFAULTS={l_pt:5,l_dt:1.5,l_ct:0.6,l_st:1,l_logoPeak:1,l_logoLead:-0.9,l_tealLead:-0.4}; [['l_pt','o_pt',v=>{l_pt=v;return v.toFixed(1)+'s';}], ['l_dt','o_dt',v=>{l_dt=v;return v.toFixed(1)+'s';}], ['l_ct','o_ct',v=>{l_ct=v;return v.toFixed(1)+'s';}],@@ -2127,7 +2369,9 @@ const SNAP_KEY='orbital-lab-snapshots-v1'; including the wiki sandbox where there is no storage at all. Saved user snapshots live per browser origin and appear after these. */ const FACTORY_SNAPS = [- { name: 'john fav · pt5 dt0.7 ct0.2 st1', factory: true, // the shipped default+ { name: 'take 2 D · pt5 dt1.5 ct0.6 st1', factory: true, // the shipped default+ vals: { pt:5, dt:1.5, ct:0.6, ov:true, st:1, lo:true, lp:1, ll:0.9, tl:0.4, gd:false } },+ { name: 'john fav · pt5 dt0.7 ct0.2 st1', factory: true, vals: { pt:5, dt:0.7, ct:0.2, ov:true, st:1, lo:true, lp:1, ll:0.6, tl:0.2, gd:false } }, { name: 'john 1 · pt4.5 dt3 ct0.3 st0', factory: true, vals: { pt:4.5, dt:3, ct:0.3, ov:true, st:0, lo:true, lp:1, ll:1, tl:1.5, gd:false } },@@ -2391,7 +2635,7 @@ document.getElementById('mLoop').addEventListener('click', () => setMode('loop') /* ---------- Getting back to the money shot ---------- Once the brandmark match is on screen, rotating away breaks it: the fit only- reads at all from square on, because the licence is a flat cut and any other+ reads at all from square on, because the license is a flat cut and any other angle shows the cut faces. So the first time someone spins it we say how to get back, and if they simply stop for five seconds we put it back ourselves. Recovery should not be something you have to know about. */@@ -2441,7 +2685,7 @@ Measured against the real logo vectors: 99.3% IoU Untouched, the same state already scores 79.2% IoU.-The licence is a quadrant clip plus a per-direction edge correction.`;+The license is a quadrant clip plus a per-direction edge correction.`; try { await navigator.clipboard.writeText(txt); e.target.textContent='Copied'; } catch { e.target.textContent='Copy failed'; } setTimeout(()=>{ e.target.textContent='Copy the state'; }, 1600);@@ -2456,7 +2700,7 @@ document.getElementById('bMeasure').addEventListener('click', async () => { const px=new Uint8Array(w*ht*4); gl.readPixels(0,0,w,ht,gl.RGBA,gl.UNSIGNED_BYTE,px); - // orbital silhouette = anything not the clear colour+ // orbital silhouette = anything not the clear color const bg=[13,17,23]; const orb=new Uint8Array(w*ht); for(let i=0;i<w*ht;i++){
package.json+1−1@@ -2,7 +2,7 @@ "slug": "orbital-lab", "title": "Orbital Lab", "type": "app",- "version": "1.0.24",+ "version": "1.1.0", "description": "The Adom logomark is a hydrogen 2p orbital: psi = (2p_x + 2p_y)/sqrt(2). A live Babylon.js lab that proves it (all 16 real spherical harmonics, the alignment cheat, and the directed loop), plus loader.html: the same animation as one dependency-free WebGL file for webview load screens.", "tags": [ "brand",
page.json+1−1@@ -2,7 +2,7 @@ "slug": "orbital-lab", "title": "Orbital Lab", "type": "app",- "version": "1.0.24",+ "version": "1.1.0", "description": "The Adom logomark is a hydrogen 2p orbital: psi = (2p_x + 2p_y)/sqrt(2). A live Babylon.js lab that proves it (all 16 real spherical harmonics, the alignment cheat, and the directed loop), plus loader.html: the same animation as one dependency-free WebGL file for webview load screens.", "tags": [ "brand",
readme.html+626−159@@ -314,7 +314,7 @@ <button id="mExplore" title="All 16 real spherical harmonics for l=0 to 3, as live gain sliders over an evolving superposition." class="mode on">Explore</button> <button id="mLogo" title="Align the orbital against the real logo vectors and measure how well it actually fits." class="mode">Logo cheat</button> <button id="mFinal" title="The earlier cut, kept as a scratchpad: wander mode, camera grab and timing experiments live here." class="mode">Scratch</button>- <button id="mLoop" title="The final cut: a clean teal intro, then play, dinner call, cheat, sit, and back out, with a fresh roll every pass." class="mode">Final</button>+ <button id="mLoop" title="The final cut: a clean teal intro, then play, dinner call, morph, sit, and back out, with a fresh roll every pass." class="mode">Final</button> </div> <div class="head"> <h1>Orbital lab</h1>@@ -412,7 +412,7 @@ how many <b>after</b> it fades away. Steering always finishes before sculpting starts, so the knife only ever touches a finished 2p. The <span style="color:var(--danger)">red pip</span> marks the old- behaviour, sculpting the whole steer, which is what caused the+ behavior, sculpting the whole steer, which is what caused the stretch artefacts. </p> <div class="row">@@ -448,8 +448,10 @@ <p style="font-size:11px;color:var(--text-2);line-height:1.6;margin:6px 0 10px"> Opens clean: the teal mark fades in alone, the 3D arrives underneath it exactly on the epoch, the mark lets go and the loop runs. Play, dinner- call, cheat, sit, back out to play, and a fresh roll every pass so no- two loops are ever the same.+ call, morph, sit, back out to play, and a fresh roll every pass so no+ two loops are ever the same. The lobes MORPH into the leaves (nothing is+ cut or faded), flatten to teal, and the crisp vector mark takes over on+ one frame only once it is identical to the 3D. </p> <div class="acts"> <button id="lRestart" title="Replay everything from the teal intro.">Restart intro</button>@@ -467,15 +469,15 @@ </div> <div class="row"> <label title="dt, the dinner timeline. Mom calls: every coefficient steers from wherever play left it onto the known epoch numbers, p_x and p_y at 0.7071 and everything else 0, arriving exactly as these seconds end. The way back out to play afterwards uses this same length.">dt dinner</label>- <span class="mark"><input type="range" id="l_dt" min="0.5" max="8" step="0.1" value="0.7"><i class="livepip" id="lp4dt"></i></span>- <output id="o_dt">0.7s</output>+ <span class="mark"><input type="range" id="l_dt" min="0.5" max="8" step="0.1" value="1.5"><i class="livepip" id="lp4dt"></i></span>+ <output id="o_dt">1.5s</output> </div> <div class="row">- <label title="ct, the cheat timeline. The tab 2 trick, the quadrant clip and edge correction that force the exact logo outline, ramped 0 to 100% and reaching exactly 100% at the epoch. The harsh edges live here, so experiment with WHEN it runs. The un-cheat on the way out mirrors this length.">ct cheat</label>- <span class="mark"><input type="range" id="l_ct" min="0.2" max="5" step="0.1" value="0.2"><i class="livepip" id="lp4ct"></i></span>- <output id="o_ct">0.2s</output>+ <label title="ct, the morph timeline. The two lobes morph into the logo's two leaves (a leaf-shaped solid whose outline IS the mark) while perspective flattens away, reaching exactly 100% at the epoch. The way back out mirrors this length. Keep it in the late part of dt: early in the dive the state is still a random multi-lobe orbital and morphing it tangles.">ct morph</label>+ <span class="mark"><input type="range" id="l_ct" min="0.2" max="5" step="0.1" value="0.6"><i class="livepip" id="lp4ct"></i></span>+ <output id="o_ct">0.6s</output> </div>- <label class="chk" title="Checked: ct OVERLAYS the tail of dt, carving while the steer is still finishing underneath, busier and the cycle stays shorter. Unchecked: ct becomes its OWN act after dt, carving a finished, still 2p into the mark, calmer, and adds ct to each side of the cycle.">+ <label class="chk" title="Checked: ct OVERLAYS the tail of dt, morphing while the steer is still finishing underneath, and the cycle stays shorter. Unchecked: ct becomes its OWN act after dt, morphing a finished, still 2p into the mark, and adds ct to each side of the cycle."> <input type="checkbox" id="l_ctMode" checked><span>ct is an overlay on dt</span> </label> <div class="row">@@ -483,23 +485,23 @@ <span class="mark"><input type="range" id="l_st" min="0" max="5" step="0.1" value="1"><i class="livepip" id="lp4st"></i></span> <output id="o_st">1.0s</output> </div>- <label class="chk" title="Fade the flat teal logomark over the 3D during the sit: in across the first half of the sit, out across the second half.">- <input type="checkbox" id="l_logoOn" checked><span>logo fade during the sit</span>+ <label class="chk" title="Flatten the 3D's own shading to the flat brand teal for the logo moment, held through the sit. At 100% the crisp vector mark takes over on one frame during the sit, where it is identical to the 3D. Nothing is laid over the 3D and nothing crossfades.">+ <input type="checkbox" id="l_logoOn" checked><span>flatten to the mark for the sit</span> </label> <div class="row">- <label title="Peak opacity the logo fade reaches, halfway through the sit. 0% never shows it, 100% fully covers the shading.">logo peak</label>+ <label title="How flat the 3D gets for the sit. 100% is the flat brand teal (and lets the crisp mark take over); lower keeps some of the 3D shading.">logo peak</label> <span class="mark"><input type="range" id="l_logoPeak" min="0" max="1" step="0.01" value="1"><i class="livepip" id="lp4peak"></i></span> <output id="o_logoPeak">100%</output> </div> <div class="row">- <label title="Start the logo fade this many seconds BEFORE the sit begins, and let the fade-out run the same amount past its end. Negative means earlier. With sit at 0.0s this slider alone still creates a logo moment around the epoch instant.">logo lead</label>- <span class="mark"><input type="range" id="l_logoLead" min="-3" max="0" step="0.1" value="-0.6"><i class="livepip" id="lp4llead"></i></span>- <output id="o_logoLead">-0.6s</output>+ <label title="Start flattening this many seconds BEFORE the sit begins, reaching full flatness as it begins, and let the shading return over the same time after it ends. Negative means earlier.">logo lead</label>+ <span class="mark"><input type="range" id="l_logoLead" min="-3" max="0" step="0.1" value="-0.9"><i class="livepip" id="lp4llead"></i></span>+ <output id="o_logoLead">-0.9s</output> </div> <div class="row">- <label title="The dark negative lobe fades to the positive teal this many seconds before the epoch, and fades back the same amount after it, so the mark reads as one colour by the time the logo lands. Negative means earlier. At 0.0s the colour snaps exactly on the epoch.">teal lead</label>- <span class="mark"><input type="range" id="l_tealLead" min="-3" max="0" step="0.1" value="-0.2"><i class="livepip" id="lp4tlead"></i></span>- <output id="o_tealLead">-0.2s</output>+ <label title="The dark negative lobe fades to the positive teal this many seconds before the epoch, and fades back the same amount after it, so the mark reads as one color by the time the logo lands. Negative means earlier. At 0.0s the color snaps exactly on the epoch.">teal lead</label>+ <span class="mark"><input type="range" id="l_tealLead" min="-3" max="0" step="0.1" value="-0.4"><i class="livepip" id="lp4tlead"></i></span>+ <output id="o_tealLead">-0.4s</output> </div> <label class="chk" title="Draw the dashed logo vectors over the 3D as it steers in, for checking the match against the real mark. A debug aid: off is the clean look. Never shown during the intro."> <input type="checkbox" id="l_guides"><span>dashed logo guides</span>@@ -523,7 +525,7 @@ diagonal. Measured against the real vectors: <b>99.9%</b> of the mark covered, <b>0.6%</b> spill, <b>99.3%</b> IoU.<br>- Untouched, the same state already scores <b>79.2%</b>. The licence is+ Untouched, the same state already scores <b>79.2%</b>. The license is a quadrant clip plus a per-direction edge correction. </div> <button id="bCopy" title="Copy the equation and the fit numbers to the clipboard as plain text." class="copy">Copy the state</button>@@ -712,6 +714,45 @@ float psiOf(vec3 d){ uniform float uFlat, uRot, uPlump, uGap, uEdge, uCorner; uniform float uLogoR[128]; // the mark's measured edge, 0..90 degrees+varying vec2 vQ; // in-plane shape position, before the gap: the pixel cut reads it+varying float vFace; // > 0 where the outward normal faces the camera+varying float vZ; // shape-space depth, for the trim's perspective++/* TAKE 2: the morph. Instead of cutting the orbital to the mark and fading+ what is cut away, the lobes BECOME the leaves. A pure 2p lobe is a ball of+ radius R0 touching the origin; its cross-section disk is mapped onto the+ leaf, radially from a center m on the leaf's axis: the ball's center goes+ to m, its rim to the leaf's outline, the node at the origin to the leaf's+ corner. Heights are kept, so the ball lands on a leaf-shaped lens whose+ silhouette IS the mark, with nothing cut and nothing faded. */+uniform float uMorph; // 0 the orbital, 1 the leaf solid+uniform float uOrtho; // 0 the camera's perspective, 1 none (the mark is flat)+uniform float uLeafM; // m's distance from the origin along the leaf axis+uniform float uNode; // psi of one mesh step off the node: that band collapses to the corner+uniform vec4 uLeaf[32]; // distance from m to the outline at 128 angles, -pi..pi++float leafAt(int i){+ int q = i / 4;+ int r = i - q * 4;+ vec4 v = uLeaf[q];+ return r == 0 ? v.x : (r == 1 ? v.y : (r == 2 ? v.z : v.w));+}+float leafR(float beta){+ float u = (beta + 3.14159265) / 6.28318531 * 127.0;+ float fi = floor(clamp(u, 0.0, 126.0));+ return mix(leafAt(int(fi)), leafAt(int(fi) + 1), clamp(u - fi, 0.0, 1.0));+}+vec3 leafPos(vec3 P, float pp){+ float R0 = 0.2443013; // the 2p lobe's radius: 0.4886 cos(angle) is a ball+ float ax = radians(uRot) + (pp >= 0.0 ? 0.0 : 3.14159265);+ vec2 a = vec2(cos(ax), sin(ax));+ vec2 b = vec2(-a.y, a.x);+ vec2 rel = vec2(dot(P.xy, a), dot(P.xy, b)) - vec2(R0, 0.0);+ float rho = length(rel);+ float be = rho > 1e-7 ? atan(rel.y, rel.x) : 0.0;+ vec2 l = vec2(uLeafM, 0.0) + (rho / R0) * leafR(be) * vec2(cos(be), sin(be));+ return vec3(l.x * a + l.y * b, P.z);+} /* The morph target for ANY direction. @@ -732,42 +773,55 @@ uniform float uLogoR[128]; // the mark's measured edge, 0..90 degrees exactly as the wavefunction gives it, and cut it to the mark's quadrants. That scored 95.9% IoU at 0.8% spill and renders clean, because it never moves a vertex anywhere the surface was not already. It IS a clip, and that- is the honest description of the licence in the mark. */-vec3 shapedPos(vec3 dir){+ is the honest description of the license in the mark. */+vec3 shapedPos(vec3 dir, float ovK){ float pp = psiOf(dir); vec3 physics = dir * abs(pp); if (uFlat <= 0.0001) return physics; float PI4 = 0.7853981634; float axis = radians(uRot);- vec2 e1 = vec2(cos(axis - PI4), sin(axis - PI4));- vec2 e2 = vec2(cos(axis + PI4), sin(axis + PI4)); float s = (pp >= 0.0) ? 1.0 : -1.0; float lobe = (pp >= 0.0) ? axis : axis + 3.14159265; - /* A hard half-plane cut leaves a sharp corner where the flat edge meets the- outer curve; the mark has a real radius there. min(d,0) rounded is- 0.5*(d - sqrt(d*d + rc*rc)), which eases into the cut over a band of- width rc instead of hitting it as a crease. */+ /* The quadrant cut itself is done PER PIXEL in the fragment shader (vQ+ below). Doing it here, by projecting every out-of-quadrant vertex onto+ the cut planes, built a paper-thin sheet of squashed triangles along each+ plane: edge-on it rendered as a hairline at the seam, and while the cut+ ramped in it fanned out into jagged fins. Discarding fragments instead+ gives a mathematically straight edge exactly on the plane, with no+ geometry left behind to catch the light.++ What stays here is only the CORNER rounding, and only its soft excess+ over a hard cut: min(d,0) rounded is 0.5*(d - sqrt(d*d + rc*rc)), and+ subtracting min(d,0) leaves the gentle inward ease near the plane while+ the hard part is left to the pixel cut. */ vec2 q = physics.xy; float rc = uCorner;- float d1 = dot(q, e1) * s;- float p1 = (rc > 1e-5) ? 0.5 * (d1 - sqrt(d1*d1 + rc*rc)) : min(d1, 0.0);- q -= e1 * (p1 * s);- float d2 = dot(q, e2) * s;- float p2 = (rc > 1e-5) ? 0.5 * (d2 - sqrt(d2*d2 + rc*rc)) : min(d2, 0.0);- q -= e2 * (p2 * s);+ if (rc > 1e-5) {+ vec2 e1 = vec2(cos(axis - PI4), sin(axis - PI4));+ vec2 e2 = vec2(cos(axis + PI4), sin(axis + PI4));+ float d1 = dot(q, e1) * s;+ q -= e1 * ((0.5 * (d1 - sqrt(d1*d1 + rc*rc)) - min(d1, 0.0)) * s);+ float d2 = dot(q, e2) * s;+ q -= e2 * ((0.5 * (d2 - sqrt(d2*d2 + rc*rc)) - min(d2, 0.0)) * s);+ } vec3 clipped = vec3(mix(physics.xy, q, uFlat), physics.z); /* OUTER BOUNDARY correction.- The clip fixes the inner corner but leaves the outer edge as the plain+ The cut fixes the inner corner but leaves the outer edge as the plain circle the physics gives: it overshoots the mark in some directions and falls short in others. So for each direction, compare the orbital's own in-plane radius against the mark's measured edge at that same angle and scale by the ratio. Points outside the mark are pulled in, points inside are pushed out, and the silhouette lands exactly on the vectors. + Directions past the quadrant (about to be cut away) take the ratio AT the+ quadrant edge rather than none at all. Switching the correction off right+ at the edge kinked every triangle that straddled it, which showed as a+ notch where the flat edge meets the outer curve.+ This scales the in-plane component only, so the solid stays coherent out of plane rather than collapsing. */ if (uEdge > 0.0001) {@@ -776,18 +830,25 @@ vec3 shapedPos(vec3 dir){ if (cl > 1e-5) { float cang = atan(cq.y, cq.x); float cda = atan(sin(cang - lobe), cos(cang - lobe));- if (abs(cda) <= PI4 + 0.001) {+ { float u = (clamp(cda, -PI4, PI4) + PI4) / (2.0 * PI4) * 127.0; int i = int(floor(u)); float f = u - float(i); int j = min(i + 1, 127); float rEdge = mix(uLogoR[i], uLogoR[j], f); - // the orbital's own equatorial radius in this same direction- vec3 eqd = vec3(cos(cang), sin(cang), 0.0);- float rPsi = abs(psiOf(eqd));+ // the orbital's own equatorial radius in this (quadrant-clamped) direction+ float ea = lobe + clamp(cda, -PI4, PI4);+ float rPsi = abs(psiOf(vec3(cos(ea), sin(ea), 0.0)));+ /* Aim 6% PAST the mark and let the fragment shader trim the outline+ exactly. Where the vector's curve leaves the flat edge it is+ tangent to it, a detail far finer than the sphere's vertex+ spacing, so aiming at it directly left a chord there: a sharp+ corner. ovK is 0 for the lighting, so the overshoot only moves+ the silhouette the trim cuts, never the shading. */+ float ov = mix(1.0, 1.06, ovK); if (rPsi > 1e-5) {- float k = rEdge / rPsi;+ float k = min(rEdge / rPsi * ov, 3.0); clipped.xy = cq * mix(1.0, k, uEdge); } }@@ -801,7 +862,29 @@ void main(void){ float p = psiOf(d); vPsi = p; - vec3 pos = shapedPos(d) * uScale;+ vec3 shaped = shapedPos(d, 1.0);+ /* The target is the LOGO state's own lobe in this direction, never the+ live state's: on the way out the next roll's small new lobes would be+ mapped through the wrong lobe's frame and thrown out as a flat sheet.+ So the leaf solid is a fixed shape and the morph is a plain blend+ between the live orbital and it. */+ if (uMorph > 0.0001) {+ float lp = 0.4886025 * dot(d.xy, vec2(cos(radians(uRot)), sin(radians(uRot))));+ vec3 ball = d * abs(lp);+ /* Triangles that straddle the node join a vertex of one lobe to a vertex+ of the other. On the leaves those land on the two leaves' flat edges,+ so each spanned the empty quadrant between them: a small chamfered+ bridge across the center all through the morph. Every vertex within+ one mesh step of the node (uNode, set from the tessellation) goes to+ the corner itself, so any triangle crossing between the lobes has no+ area. Pulling a point toward the corner keeps it on its flat edge, so+ the edges stay straight. */+ float nodeK = smoothstep(uNode, 2.0 * uNode, abs(lp));+ shaped = mix(shaped, leafPos(ball, lp) * nodeK, uMorph);+ }+ vQ = shaped.xy;+ vZ = shaped.z;+ vec3 pos = shaped * uScale; pos.xy += normalize(vec2(cos(radians(uRot)), sin(radians(uRot)))) * ((p >= 0.0) ? 1.0 : -1.0) * uGap * uScale * uFlat; @@ -813,39 +896,177 @@ void main(void){ vec3 t2 = cross(d, t1); float hh = 0.03; vec3 a = normalize(d + t1*hh), b = normalize(d + t2*hh);- vec3 pa = shapedPos(a) * uScale;- vec3 pb = shapedPos(b) * uScale;- vec3 nn = cross(pa - pos, pb - pos);+ vec3 p0 = shapedPos(d, 0.0) * uScale;+ vec3 pa = shapedPos(a, 0.0) * uScale;+ vec3 pb = shapedPos(b, 0.0) * uScale;+ vec3 nn = cross(pa - p0, pb - p0); vN = normalize(dot(nn, d) < 0.0 ? -nn : nn); + /* Facing, measured rather than read from gl_FrontFacing: the winding is+ opposite between Babylon and the raw WebGL loader. Stepping along the+ outward normal moves toward the camera exactly when the surface faces+ it, so the clip-space depth drops. */ gl_Position = worldViewProjection * vec4(pos, 1.0);+ vec4 cn = worldViewProjection * vec4(pos + vN * 0.05, 1.0);+ vFace = gl_Position.z / gl_Position.w - cn.z / cn.w;++ /* Perspective goes as the mark arrives: each vertex is placed where an+ orthographic camera with the same scale at the mark's plane would put+ it, so the silhouette is the flat outline exactly. Depth is untouched.+ The lighting keeps the orbital's own normals (computed above from the+ unmorphed surface), so the map cannot crease the shading. */+ if (uOrtho > 0.0001) {+ float w0 = (worldViewProjection * vec4(0.0, 0.0, 0.0, 1.0)).w;+ gl_Position.xy *= gl_Position.w / mix(gl_Position.w, w0, uOrtho);+ } }`; BABYLON.Effect.ShadersStore['labFragmentShader'] = ` precision highp float; varying float vPsi; varying vec3 vN;+varying vec2 vQ;+varying float vFace;+varying float vZ; uniform vec3 cPos, cNeg;+uniform float uFlat, uRot, uShade, uPass, uEdge, uCamD, uPx;+uniform vec4 uProf[12]; // the mark's outline: 48 radii, sampled densely at both flat edges++/* The outline radius at x across the leaf (0 and 1 are the flat edges).+ Sampled at smoothstep-spaced angles: near a flat edge the radius grows+ like the square root of the angle, which smoothstep's spacing makes+ linear, so plain interpolation stays within about a pixel. Picked out by+ comparison, because GLSL ES 1.00 fragment shaders may not index uniform+ arrays dynamically. */+float outlineAt(float x){+ float sx = clamp(0.5 - sin(asin(clamp(1.0 - 2.0*x, -1.0, 1.0)) / 3.0), 0.0, 1.0);+ float u = sx * 47.0;+ float fi = floor(min(u, 46.0));+ float a = 0.0, b = 0.0;+ for (int k = 0; k < 12; k++) {+ float q0 = float(k * 4);+ vec4 id = vec4(q0, q0 + 1.0, q0 + 2.0, q0 + 3.0);+ a += dot(uProf[k], vec4(equal(id, vec4(fi))));+ b += dot(uProf[k], vec4(equal(id, vec4(fi + 1.0))));+ }+ return mix(a, b, u - fi);+}+ void main(void){+ /* The quadrant cut, per pixel, always at the mark's own 45 degree planes.+ Pass 0 (opaque) keeps each lobe's quadrant. Pass 1 is the OVERFLOW, the+ part of the round lobe outside the quadrant, drawn translucent at+ 1 - uFlat, so as the cheat ramps the excess melts away and leaves the+ leaf. Nothing moves and nothing is squashed: a rotating cut read as+ scissors closing, and squashing vertices onto the planes (the first+ version) left paper-thin sheets that showed as a hairline at the seam. */+ float fade = 1.0;+ if (uFlat > 0.0001) {+ float ql = length(vQ);+ bool inside = true;+ float cov = 1.0;+ if (ql > 1e-6) {+ float ax = radians(uRot) + (vPsi >= 0.0 ? 0.0 : 3.14159265);+ vec2 ad = vec2(cos(ax), sin(ax));+ vec2 qn = vQ / ql;+ inside = dot(qn, ad) >= 0.7071067 - 1e-4;+ /* The outer trim: the exact vector outline, eased in with the edge+ correction (1.3x, beyond any physics radius, down to 1x) so it+ never pops. Measured where this pixel's ray meets the mark's plane+ (z = 0), so the cut lands on SCREEN: a front-facing point sits+ nearer the camera and perspective enlarges it. uCamD is the camera+ distance in shape units. 1.0248 is the flat overlay's own size+ against the true projection (its 0.34 was fitted by eye), so the 3D+ outline and the flat mark are the same curve. cov is the pixel's+ coverage over a one pixel ramp (uPx = shape units per pixel), which+ antialiases the trimmed curve the way MSAA does a mesh edge. */+ if (inside && uEdge > 0.0001) {+ float da = atan(ad.x*qn.y - ad.y*qn.x, dot(qn, ad));+ float x = clamp((da + 0.7853981634) / 1.5707963268, 0.0, 1.0);+ float qp = (uCamD > 0.0) ? ql * uCamD / max(0.05, uCamD + vZ) : ql;+ float lim = outlineAt(x) * 1.0248 * mix(1.3, 1.0, uEdge);+ cov = (uPx > 0.0) ? clamp((lim - qp) / uPx + 0.5, 0.0, 1.0) : step(qp, lim);+ }+ }+ /* Pass 0 (opaque) keeps the fully covered leaf. Pass 1 (blended, front+ surface only) carries the rest: the antialiased rim of the trim, and+ the overflow outside the quadrant melting away at 1 - uFlat. */+ if (uPass < 0.5) { if (!inside || cov < 0.999) discard; }+ else if (inside) { if (cov >= 0.999 || cov <= 0.001) discard; fade = cov; }+ else { if (uFlat >= 0.999) discard; fade = 1.0 - uFlat; }+ } else if (uPass > 0.5) discard; vec3 base = vPsi >= 0.0 ? cPos : cNeg; vec3 n = normalize(vN);+ /* Looking INTO a cut lobe (free view only; square-on the cut is edge-on)+ shows the far wall from behind. Shade it as the flat cut face instead,+ so the solid reads closed rather than hollow. */+ if (uFlat > 0.0001 && uPass < 0.5 && vFace < 0.0) n = vec3(0.0, 0.0, -1.0); float lam = 0.42 + 0.58*max(0.0, dot(n, normalize(vec3(-0.4,0.85,-0.55)))); float rim = pow(1.0 - abs(n.z), 2.5)*0.32;- gl_FragColor = vec4(base*lam + vec3(0.0,0.72,0.68)*rim, 1.0);+ /* uShade flattens the surface itself to the brandmark teal. The logo moment+ used to be a separate flat canvas laid over the 3D; whenever the two+ shapes were not identical (fading in while the dive was still arriving,+ lingering while it left) that read as a ghost double image. Fading the+ surface means there is only ever one shape on screen. */+ vec3 lit = base*lam + vec3(0.0,0.72,0.68)*rim;+ gl_FragColor = vec4(mix(lit, vec3(0.0, 0.7216, 0.6902), uShade), fade); }`; const mat = new BABYLON.ShaderMaterial('lab', scene, 'lab', {- attributes:['position'], uniforms:['worldViewProjection','c','uScale','cPos','cNeg','uFlat','uRot','uPlump','uGap','uEdge','uCorner','uLogoR']+ attributes:['position'], uniforms:['worldViewProjection','c','uScale','cPos','cNeg','uFlat','uRot','uPlump','uGap','uEdge','uCorner','uLogoR','uShade','uPass','uProf','uCamD','uPx','uMorph','uOrtho','uLeafM','uLeaf','uNode'] });+/* The blended pass: the same shader on a child copy of the mesh, alpha+ blended, with a depth prepass so only its FRONT surface blends (otherwise+ its own back wall would double the opacity). It carries the trim's+ antialiased rim and, while the cut is partway in, the melting overflow, so+ it is enabled whenever the cut is. Every uniform set on mat is mirrored. */+const matOver = new BABYLON.ShaderMaterial('labOver', scene, 'lab', {+ attributes:['position'], uniforms:['worldViewProjection','c','uScale','cPos','cNeg','uFlat','uRot','uPlump','uGap','uEdge','uCorner','uLogoR','uShade','uPass','uProf','uCamD','uPx','uMorph','uOrtho','uLeafM','uLeaf','uNode'],+ needAlphaBlending:true+});+matOver.backFaceCulling = false;+matOver.needDepthPrePass = true;+matOver.setFloat('uPass', 1);+let meshOver = null;+['setFloat','setFloats','setColor3','setArray4'].forEach(fn => {+ const own = mat[fn].bind(mat), over = matOver[fn].bind(matOver);+ mat[fn] = (n, v) => {+ own(n, v); over(n, v);+ if (n === 'uFlat' && meshOver) meshOver.setEnabled(v > 0.0001);+ return mat;+ };+});+mat.setFloat('uPass', 0);+matOver.setFloat('uPass', 1); mat.setFloats('uLogoR', [0.29682, 0.31691, 0.33085, 0.34219, 0.3519, 0.36055, 0.36839, 0.37555, 0.38216, 0.3883, 0.39398, 0.39936, 0.40453, 0.40917, 0.41376, 0.41798, 0.422, 0.42584, 0.4294, 0.43293, 0.43608, 0.43927, 0.44211, 0.445, 0.44757, 0.45018, 0.45253, 0.45491, 0.45702, 0.45917, 0.46107, 0.46303, 0.46475, 0.46655, 0.46809, 0.46969, 0.4711, 0.47252, 0.47382, 0.47507, 0.47627, 0.47735, 0.47847, 0.47938, 0.48038, 0.48119, 0.48205, 0.48281, 0.4835, 0.48421, 0.48477, 0.48541, 0.48586, 0.48634, 0.48677, 0.48712, 0.48754, 0.48774, 0.48802, 0.4882, 0.48834, 0.48853, 0.48852, 0.48859, 0.48859, 0.48852, 0.48853, 0.48834, 0.4882, 0.48802, 0.48774, 0.48754, 0.48712, 0.48677, 0.48634, 0.48586, 0.48541, 0.48477, 0.48421, 0.4835, 0.48281, 0.48205, 0.48119, 0.48038, 0.47938, 0.47847, 0.47735, 0.47627, 0.47507, 0.47382, 0.47252, 0.4711, 0.46969, 0.46807, 0.46651, 0.46473, 0.46303, 0.46107, 0.45918, 0.45702, 0.45491, 0.45253, 0.45018, 0.44757, 0.445, 0.44211, 0.43927, 0.43608, 0.43293, 0.4294, 0.42584, 0.422, 0.41798, 0.41376, 0.40917, 0.40453, 0.3993, 0.39391, 0.38829, 0.38214, 0.37552, 0.36839, 0.36056, 0.3519, 0.34209, 0.33073, 0.31683, 0.2966]);+mat.setArray4('uProf', [0.27485, 0.28587, 0.30119, 0.3168, 0.33233, 0.34751, 0.3623, 0.37662, 0.39025, 0.4033, 0.41541, 0.42673, 0.43684, 0.44607, 0.45439, 0.46153, 0.46783, 0.47326, 0.47775, 0.48137, 0.48427, 0.4864, 0.48773, 0.48841, 0.48841, 0.48773, 0.4864, 0.48427, 0.48137, 0.47775, 0.47326, 0.46781, 0.46153, 0.45439, 0.44607, 0.43684, 0.42673, 0.41541, 0.40329, 0.39022, 0.37661, 0.36231, 0.34745, 0.33216, 0.31673, 0.30103, 0.28552, 0.27309]); const C_POS = BABYLON.Color3.FromHexString('#19c8bd'); const C_NEG = BABYLON.Color3.FromHexString('#123a63'); mat.setColor3('cPos', C_POS); mat.setColor3('cNeg', C_NEG);+mat.setFloat('uShade', 0);+mat.setFloat('uMorph', 0);+mat.setFloat('uOrtho', 0);+/* One mesh step in psi: Babylon's sphere has segments+2 rings over 180+ degrees, 1.5x for the quads' diagonals. */+mat.setFloat('uNode', 0.4886025 * (Math.PI / (128 + 2)) * 1.5);+mat.setFloat('uLeafM', 0.28704);+mat.setArray4('uLeaf', [0.28704, 0.27386, 0.26243, 0.25251, 0.24388, 0.23638, 0.22988, 0.22426, 0.21943, 0.21532, 0.21188, 0.20904, 0.20678, 0.20506, 0.20386, 0.20318, 0.20299, 0.2033, 0.20412, 0.20544, 0.20729, 0.20969, 0.21268, 0.21628, 0.22016, 0.22398, 0.22771, 0.23133, 0.2347, 0.23783, 0.24065, 0.24312, 0.24521, 0.24691, 0.24812, 0.24898, 0.24943, 0.24947, 0.24912, 0.24839, 0.24734, 0.246, 0.24444, 0.24269, 0.24079, 0.23877, 0.23668, 0.23459, 0.23252, 0.23047, 0.22847, 0.22649, 0.2246, 0.22286, 0.22128, 0.21984, 0.21845, 0.21725, 0.21624, 0.21541, 0.21465, 0.21412, 0.21383, 0.21357, 0.21357, 0.21383, 0.21412, 0.21465, 0.21541, 0.21624, 0.21725, 0.21845, 0.21984, 0.22128, 0.22286, 0.2246, 0.22649, 0.22847, 0.23047, 0.23252, 0.23459, 0.23668, 0.23877, 0.24079, 0.24269, 0.24444, 0.246, 0.24734, 0.24839, 0.24912, 0.24947, 0.24943, 0.24898, 0.24812, 0.24691, 0.24521, 0.24312, 0.24065, 0.23783, 0.2347, 0.23133, 0.22771, 0.22398, 0.22016, 0.21628, 0.21268, 0.20969, 0.20729, 0.20544, 0.20412, 0.2033, 0.20299, 0.20318, 0.20386, 0.20506, 0.20678, 0.20904, 0.21188, 0.21532, 0.21943, 0.22426, 0.22988, 0.23638, 0.24388, 0.25251, 0.26243, 0.27386, 0.28704]); mat.backFaceCulling = false; const mesh = BABYLON.MeshBuilder.CreateSphere('orb', { diameter:2, segments:128 }, scene); mesh.material = mat;+/* Shape units per screen pixel at the mark's plane, for the trim's one pixel+ antialiasing ramp. fitFraming fixes the FOV on the limiting axis. */+function shapePx(scale){+ const px = Math.min(engine.getRenderWidth(), engine.getRenderHeight()) / 2;+ return Math.tan(camera.fov / 2) * camera.radius / Math.max(1, px) / scale;+}+// a child, so it follows the spin and the intro's setEnabled for free+meshOver = mesh.clone('orbOver', mesh);+meshOver.position.setAll(0); meshOver.rotation.setAll(0);+meshOver.material = matOver;+meshOver.setEnabled(false); /* ---------- the weights ---------- */ /* The sliders are GAINS on the running evolution, not a frozen pose. The@@ -982,12 +1203,16 @@ scene.registerBeforeRender(() => { mat.setFloats('c', c); mat.setFloat('uScale', 2.5 * (logoMode ? cheat.size : 1));+ mat.setFloat('uCamD', camera.radius / (2.5 * (logoMode ? cheat.size : 1)));+ mat.setFloat('uPx', shapePx(2.5 * (logoMode ? cheat.size : 1))); mat.setFloat('uFlat', logoMode ? cheat.flat : 0); mat.setFloat('uRot', cheat.rot); mat.setFloat('uPlump', logoMode ? cheat.plump : 0); mat.setFloat('uGap', logoMode ? cheat.gap : 0); mat.setFloat('uEdge', logoMode ? cheat.edge : 0); mat.setFloat('uCorner',logoMode ? cheat.corner: 0);+ mat.setFloat('uShade', 0);+ mat.setFloat('uMorph', 0); mat.setFloat('uOrtho', 0); syncLogoLines(); @@ -1032,7 +1257,7 @@ scene.registerBeforeRender(() => { The brandmark is a 2p orbital (measured: the real isosurface at 135 degrees contains 96.5% of the mark), but not exactly one. The designers squared off the inner edges where the physics has a smooth pinch. These- controls dial that licence in, so you can see precisely how much cheating+ controls dial that license in, so you can see precisely how much cheating the mark costs, and the real vectors are ghosted on top to judge against. ===================================================================== */ const cheat = { face:1, flat:0, rot:45, plump:0, gap:0, edge:0, corner:0, size:1, ghost:0.45, fill:0 };@@ -1200,7 +1425,7 @@ document.getElementById('bPure').addEventListener('click',()=> aligned 2p alone gives 79.2% IoU; adding only the quadrant clip takes it to 95.9% at 0.8% spill. plump and gap both make it WORSE (they push coverage to 100% but spill to 17%+), so the honest optimum leaves them at zero. The- entire licence in the Adom mark is one clip. */+ entire license in the Adom mark is one clip. */ document.getElementById('bMark').addEventListener('click',()=> setCheat({face:1,flat:1,rot:45,plump:0,gap:0,edge:1,corner:0,size:1.15})); @@ -1343,7 +1568,7 @@ function setMode(which){ + 'on the right are the live coefficient right now.' : isLoop ? 'The final cut. A clean teal open, then forever: <b>pt</b> play, '- + '<b>dt</b> dinner call, <b>ct</b> cheat, <b>st</b> sit as the mark, '+ + '<b>dt</b> dinner call, <b>ct</b> morph, <b>st</b> sit as the mark, ' + 'then back out, with a fresh roll every pass. Hover any control, ' + 'every one explains itself.' : isFinal@@ -1466,9 +1691,9 @@ const SAY = { lSnapSave:() => lsOK ? ['Snapshot saved', (loadSnaps().slice(-1)[0]||{}).name || 'stored'] : ['No storage on this surface', 'The wiki sandbox cannot save. Factory snapshots still apply; tune and save on the lab page.'], lSnapDel: () => ['Snapshot deleted', `${allSnaps().length} left · factory ones (*) ship with the page`],- mLoop: () => ['Final', 'The final cut: teal intro, then play, dinner, cheat, sit, and back out, fresh roll every pass'],+ mLoop: () => ['Final', 'The final cut: teal intro, then play, dinner, morph, sit, and back out, fresh roll every pass'], lRestart: () => ['Intro restarted', 'From the teal open'],- lDefaults:() => ['Loop defaults restored', 'john fav: pt 5s, dt 0.7s, ct 0.2s overlay, 1s sit, logo 100% on a 0.6s lead, teal lead 0.2s'],+ lDefaults:() => ['Loop defaults restored', 'take 2 D: pt 5s, dt 1.5s, ct 0.6s morph, 1s sit, flat on a 0.9s lead, teal lead 0.4s'], fDefaults:() => ['Defaults restored', 'Morph 2.6s each way, lead in and tail out 0.6s, ease 0.35, hold 1.0s, fill 50%'], }; document.addEventListener('click', e => {@@ -1817,16 +2042,20 @@ function driveFinal(dt){ liveC = cN; mat.setFloat('uScale', 2.5 * (0.9 + 0.25*k));+ mat.setFloat('uCamD', camera.radius / (2.5 * (0.9 + 0.25*k)));+ mat.setFloat('uPx', shapePx(2.5 * (0.9 + 0.25*k))); mat.setFloat('uFlat', cheatK); mat.setFloat('uEdge', cheatK); mat.setFloat('uRot', 45); mat.setFloat('uPlump', 0); mat.setFloat('uGap', 0); mat.setFloat('uCorner',0);- /* Sculpting also unifies the phase colours. The negative lobe fades to the+ mat.setFloat('uShade', 0);+ mat.setFloat('uMorph', 0); mat.setFloat('uOrtho', 0);+ /* Sculpting also unifies the phase colors. The negative lobe fades to the positive teal exactly as the clip lands and back out as it releases, so by the time the flat logo fades over the 3D the whole mark already reads- as ONE colour. Driven by cheatK, so it needs no timing of its own. */+ as ONE color. Driven by cheatK, so it needs no timing of its own. */ mat.setColor3('cNeg', BABYLON.Color3.Lerp(C_NEG, C_POS, cheatK)); // Camera: drifting while the physics runs, square on for the mark.@@ -1862,7 +2091,7 @@ function driveFinal(dt){ } /* At the exact epoch moment (k=1 and the logo is visible), the pose must be- canonical: dead centre, head on, everything right. Once we leave the epoch,+ canonical: dead center, head on, everything right. Once we leave the epoch, release control back to the user/animator. */ const AT_EPOCH = k > 0.99 && cheatK > 0.99; if (AT_EPOCH) {@@ -1968,8 +2197,8 @@ function driveFinal(dt){ The whole thing opens with the teal intro: mark fades in alone, the 3D arrives underneath exactly on the epoch, mark lets go, loop runs. */ let loopMode=false, loopT=0, introT=0, inIntro=true, loopRolled=false;-let l_pt=5, l_dt=0.7, l_ct=0.2, l_ctOverlay=true, l_st=1; // john fav ships as the default-let l_logoOn=true, l_logoPeak=1, l_logoLead=0.6, l_tealLead=0.2, l_guides=false; // leads kept positive+let l_pt=5, l_dt=1.5, l_ct=0.6, l_ctOverlay=true, l_st=1; // take 2 D ships as the default+let l_logoOn=true, l_logoPeak=1, l_logoLead=0.9, l_tealLead=0.4, l_guides=false; // leads kept positive let loopGains=null; function rollLoopGains(){ // tab 1's Randomise, verbatim@@ -2006,7 +2235,7 @@ function driveLoop(dt){ return g[i]*env*Math.cos(E_LEVELS[i]*tEvo*0.5); }); const EA=-Math.PI/2, EB=Math.PI/2, ER=4.4;- let k=0, cheatK=0, fill=0, tealK=0, phaseName='', pinned=false;+ let k=0, cheatK=0, fill=0, tealK=0, phaseName='', pinned=false, crisp=0; if (inIntro){ introT+=dt;@@ -2016,12 +2245,15 @@ function driveLoop(dt){ /* The mark fades in ALONE, at full teal. The 3D is enabled only once the mark is solid, so it arrives already congruent underneath it, and the reveal is the mark letting go of its own 3D self. */- mesh.setEnabled(t>=e2+0.01);- fill = t<e1?0 : t<e2? smooth(seg(e1,e2,t)) : t<e3? 1 : 1-smooth(seg(e3,e4,t));+ /* Take 2: the crisp mark fades in alone and holds; then the 3D leaf+ solid, fully morphed and fully flat (so identical to it), replaces it+ WHOLE on one frame and lets its shading back in. No crossfade. */+ mesh.setEnabled(t>=e3);+ crisp = t<e1?0 : t<e2? smooth(seg(e1,e2,t)) : t<e3? 1 : 0;+ fill = t<e3? 1 : 1-smooth(seg(e3,e4,t)); camera.alpha=EA; camera.beta=EB; camera.radius=ER; camera.target.set(0,0,0); if (t>=e4){ inIntro=false; mesh.setEnabled(true); loopT=loopEpochEnd(); rollLoopGains(); } } else {- mesh.setEnabled(true); loopT=(loopT+dt)%loopCycle(); const eS=loopEpochStart(), eE=loopEpochEnd(), t=loopT; const ctw=l_ctOverlay? Math.min(l_ct,l_dt) : l_ct;@@ -2038,9 +2270,16 @@ function driveLoop(dt){ pinned to the mark, so the new state is only met on the way out. */ if (t>=eS && !loopRolled){ rollLoopGains(); loopRolled=true; } if (t<eS) loopRolled=false;- const L=l_logoLead, mid=(eS+eE)/2, a=mid-Math.max(0.001,(eE-eS)/2+L), b=mid+Math.max(0.001,(eE-eS)/2+L);- fill = (!l_logoOn||l_logoPeak<=0||t<=a||t>=b||(b-a)<0.02) ? 0- : (t<mid? smooth((t-a)/(mid-a)) : smooth((b-t)/(b-mid))) * l_logoPeak;+ /* Take 2: the flattening (logo peak, on its lead) is the 3D's own+ shading going to flat teal; it holds through the sit. The crisp vector+ mark replaces the 3D whole, on a frame boundary, only while the two+ are identical: fully morphed (the sit) and fully flat. */+ const L=l_logoLead;+ fill = (!l_logoOn||l_logoPeak<=0) ? 0+ : (t<eS ? (L<=0.001?0:(t<=eS-L?0:smooth(1-(eS-t)/L)))+ : t<=eE ? 1 : (L<=0.001?0:(t>=eE+L?0:smooth(1-(t-eE)/L)))) * l_logoPeak;+ crisp = (l_logoOn && l_logoPeak>=0.999 && t>=eS && t<=eE && eE-eS>1e-4) ? 1 : 0;+ mesh.setEnabled(!crisp); const TL=l_tealLead; tealK = t<eS ? (TL<=0.01?0:(t<=eS-TL?0:smooth(1-(eS-t)/TL))) : t<=eE ? 1@@ -2059,9 +2298,12 @@ function driveLoop(dt){ const nrm=Math.hypot(...c)||1; const cN=c.map(v=>v/nrm); mat.setFloats('c',cN); liveC=cN; mat.setFloat('uScale',2.5*(0.9+0.25*k));- mat.setFloat('uFlat',cheatK); mat.setFloat('uEdge',cheatK);+ mat.setFloat('uCamD',camera.radius/(2.5*(0.9+0.25*k)));+ mat.setFloat('uPx',shapePx(2.5*(0.9+0.25*k)));+ mat.setFloat('uFlat',0); mat.setFloat('uEdge',0);+ mat.setFloat('uMorph',cheatK); mat.setFloat('uOrtho',cheatK); mat.setFloat('uShade',fill); mat.setFloat('uRot',45); mat.setFloat('uPlump',0); mat.setFloat('uGap',0); mat.setFloat('uCorner',0);- cheat.fill=fill; cheat.ghost=(l_guides && !inIntro) ? 0.9*k : 0;+ cheat.fill=crisp; cheat.ghost=(l_guides && !inIntro) ? 0.9*k : 0; syncLogoLines(2.5*(0.9+0.25*k)); drawGhost(); @@ -2102,7 +2344,7 @@ function driveLoop(dt){ } /* ---- tab 4 controls ---- */-const LOOP_DEFAULTS={l_pt:5,l_dt:0.7,l_ct:0.2,l_st:1,l_logoPeak:1,l_logoLead:-0.6,l_tealLead:-0.2};+const LOOP_DEFAULTS={l_pt:5,l_dt:1.5,l_ct:0.6,l_st:1,l_logoPeak:1,l_logoLead:-0.9,l_tealLead:-0.4}; [['l_pt','o_pt',v=>{l_pt=v;return v.toFixed(1)+'s';}], ['l_dt','o_dt',v=>{l_dt=v;return v.toFixed(1)+'s';}], ['l_ct','o_ct',v=>{l_ct=v;return v.toFixed(1)+'s';}],@@ -2137,7 +2379,9 @@ const SNAP_KEY='orbital-lab-snapshots-v1'; including the wiki sandbox where there is no storage at all. Saved user snapshots live per browser origin and appear after these. */ const FACTORY_SNAPS = [- { name: 'john fav · pt5 dt0.7 ct0.2 st1', factory: true, // the shipped default+ { name: 'take 2 D · pt5 dt1.5 ct0.6 st1', factory: true, // the shipped default+ vals: { pt:5, dt:1.5, ct:0.6, ov:true, st:1, lo:true, lp:1, ll:0.9, tl:0.4, gd:false } },+ { name: 'john fav · pt5 dt0.7 ct0.2 st1', factory: true, vals: { pt:5, dt:0.7, ct:0.2, ov:true, st:1, lo:true, lp:1, ll:0.6, tl:0.2, gd:false } }, { name: 'john 1 · pt4.5 dt3 ct0.3 st0', factory: true, vals: { pt:4.5, dt:3, ct:0.3, ov:true, st:0, lo:true, lp:1, ll:1, tl:1.5, gd:false } },@@ -2401,7 +2645,7 @@ document.getElementById('mLoop').addEventListener('click', () => setMode('loop') /* ---------- Getting back to the money shot ---------- Once the brandmark match is on screen, rotating away breaks it: the fit only- reads at all from square on, because the licence is a flat cut and any other+ reads at all from square on, because the license is a flat cut and any other angle shows the cut faces. So the first time someone spins it we say how to get back, and if they simply stop for five seconds we put it back ourselves. Recovery should not be something you have to know about. */@@ -2451,7 +2695,7 @@ Measured against the real logo vectors: 99.3% IoU Untouched, the same state already scores 79.2% IoU.-The licence is a quadrant clip plus a per-direction edge correction.`;+The license is a quadrant clip plus a per-direction edge correction.`; try { await navigator.clipboard.writeText(txt); e.target.textContent='Copied'; } catch { e.target.textContent='Copy failed'; } setTimeout(()=>{ e.target.textContent='Copy the state'; }, 1600);@@ -2466,7 +2710,7 @@ document.getElementById('bMeasure').addEventListener('click', async () => { const px=new Uint8Array(w*ht*4); gl.readPixels(0,0,w,ht,gl.RGBA,gl.UNSIGNED_BYTE,px); - // orbital silhouette = anything not the clear colour+ // orbital silhouette = anything not the clear color const bg=[13,17,23]; const orb=new Uint8Array(w*ht); for(let i=0;i<w*ht;i++){@@ -2618,7 +2862,7 @@ window.__lab = { push, zeros, HARMONICS, setAnim:v=>{animate=v;} }; #pbox.notrans{transition:none} /* the iframe ELEMENT must not paint: the base .prev rule gives it the dark background, which sat between the loader's transparent buffer and the- container's colour and swallowed the swatches */+ container's color and swallowed the swatches */ #pbox .prev{position:absolute;inset:0;width:100%;height:100%;aspect-ratio:auto;border:0;margin:0;background:transparent} #pgrip{position:absolute;right:-2px;bottom:-2px;width:22px;height:22px;cursor:nwse-resize;z-index:5; border-right:3px solid var(--accent);border-bottom:3px solid var(--accent);border-radius:0 0 8px 0}@@ -2682,16 +2926,16 @@ window.__lab = { push, zeros, HARMONICS, setAnim:v=>{animate=v;} }; <script> /* The Adom logomark is a hydrogen 2p orbital: psi = (2p_x + 2p_y)/sqrt(2). This file is the wiki page adom/orbital-lab distilled to a loader. */-'use strict';window.__ADOM_LOADER_INTERACT=1;window.__ADOM_LOADER_PARAMS={pt:5,dt:0.7,ct:0.2,st:1,logo:100,llead:0.6,tlead:0.2,bg:'transparent'};+'use strict';window.__ADOM_LOADER_INTERACT=1;window.__ADOM_LOADER_PARAMS={pt:5,dt:1.5,ct:0.6,st:1,logo:100,llead:0.9,tlead:0.4,bg:'transparent'}; var Q=new URLSearchParams(location.search); function P(k,d){ var o=window.__ADOM_LOADER_PARAMS||{}; if(k in o) return o[k]; var v=parseFloat(Q.get(k));return isFinite(v)?v:d; }-var PT=P('pt',4.5), DT=P('dt',3), CT=P('ct',0.3), ST=P('st',0);+var PT=P('pt',5), DT=P('dt',1.5), CT=P('ct',0.6), ST=P('st',1); var LOGO_PK=Math.max(0,Math.min(1,P('logo',100)/100));-var LLEAD=Math.abs(P('llead',1)), TLEAD=Math.abs(P('tlead',1.5));+var LLEAD=Math.abs(P('llead',0.9)), TLEAD=Math.abs(P('tlead',0.4)); var EMERGE=String(P('emerge',0))==='1'; /* speed: percent playback rate for the ANIMATION clocks (timeline, evolution, birth). 100 is real time; 10 is a tenth speed. Camera springs and user@@ -2723,7 +2967,11 @@ function homeFor(m){ return m<0 ? R*(1+m/100) : R/(1-m/100); } var MODE=String((window.__ADOM_LOADER_PARAMS&&window.__ADOM_LOADER_PARAMS.mode)||Q.get('mode')||'').toLowerCase(); if(MODE==='sexy')MODE='performance'; var LIGHT=(MODE==='lightweight'||MODE==='light');-var FPSCAP=Math.max(0,P('fps',LIGHT?30:0)); if(FPSCAP>0&&FPSCAP<20)FPSCAP=20;+/* SAFEGUARD (2026-08-04, upstreamed from Hydrogen Desktop): default to a BOUNDED 60fps even+ in performance mode instead of uncapped. An uncapped WebGL surface on a slower/integrated+ GPU pegs the GPU and starves the embedding app's UI thread (frozen nav) and delivers frame+ BURSTS that read as "crazy speed". A hero that genuinely wants uncapped opts out: ?fps=0. */+var FPSCAP=Math.max(0,P('fps',LIGHT?30:60)); if(FPSCAP>0&&FPSCAP<20)FPSCAP=20; var DPRCAP=Math.max(1,Math.min(3,P('dpr',LIGHT?1:2))); var SEGQ=Math.round(Math.max(24,Math.min(128,P('seg',LIGHT?48:80)))); var AAON=P('aa',LIGHT?0:1)>=1;@@ -2777,6 +3025,45 @@ float psiOf(vec3 d){ uniform float uFlat, uRot, uPlump, uGap, uEdge, uCorner; uniform float uLogoR[128]; // the mark's measured edge, 0..90 degrees+varying vec2 vQ; // in-plane shape position, before the gap: the pixel cut reads it+varying float vFace; // > 0 where the outward normal faces the camera+varying float vZ; // shape-space depth, for the trim's perspective++/* TAKE 2: the morph. Instead of cutting the orbital to the mark and fading+ what is cut away, the lobes BECOME the leaves. A pure 2p lobe is a ball of+ radius R0 touching the origin; its cross-section disk is mapped onto the+ leaf, radially from a center m on the leaf's axis: the ball's center goes+ to m, its rim to the leaf's outline, the node at the origin to the leaf's+ corner. Heights are kept, so the ball lands on a leaf-shaped lens whose+ silhouette IS the mark, with nothing cut and nothing faded. */+uniform float uMorph; // 0 the orbital, 1 the leaf solid+uniform float uOrtho; // 0 the camera's perspective, 1 none (the mark is flat)+uniform float uLeafM; // m's distance from the origin along the leaf axis+uniform float uNode; // psi of one mesh step off the node: that band collapses to the corner+uniform vec4 uLeaf[32]; // distance from m to the outline at 128 angles, -pi..pi++float leafAt(int i){+ int q = i / 4;+ int r = i - q * 4;+ vec4 v = uLeaf[q];+ return r == 0 ? v.x : (r == 1 ? v.y : (r == 2 ? v.z : v.w));+}+float leafR(float beta){+ float u = (beta + 3.14159265) / 6.28318531 * 127.0;+ float fi = floor(clamp(u, 0.0, 126.0));+ return mix(leafAt(int(fi)), leafAt(int(fi) + 1), clamp(u - fi, 0.0, 1.0));+}+vec3 leafPos(vec3 P, float pp){+ float R0 = 0.2443013; // the 2p lobe's radius: 0.4886 cos(angle) is a ball+ float ax = radians(uRot) + (pp >= 0.0 ? 0.0 : 3.14159265);+ vec2 a = vec2(cos(ax), sin(ax));+ vec2 b = vec2(-a.y, a.x);+ vec2 rel = vec2(dot(P.xy, a), dot(P.xy, b)) - vec2(R0, 0.0);+ float rho = length(rel);+ float be = rho > 1e-7 ? atan(rel.y, rel.x) : 0.0;+ vec2 l = vec2(uLeafM, 0.0) + (rho / R0) * leafR(be) * vec2(cos(be), sin(be));+ return vec3(l.x * a + l.y * b, P.z);+} /* The morph target for ANY direction. @@ -2797,42 +3084,55 @@ uniform float uLogoR[128]; // the mark's measured edge, 0..90 degree exactly as the wavefunction gives it, and cut it to the mark's quadrants. That scored 95.9% IoU at 0.8% spill and renders clean, because it never moves a vertex anywhere the surface was not already. It IS a clip, and that- is the honest description of the licence in the mark. */-vec3 shapedPos(vec3 dir){+ is the honest description of the license in the mark. */+vec3 shapedPos(vec3 dir, float ovK){ float pp = psiOf(dir); vec3 physics = dir * abs(pp); if (uFlat <= 0.0001) return physics; float PI4 = 0.7853981634; float axis = radians(uRot);- vec2 e1 = vec2(cos(axis - PI4), sin(axis - PI4));- vec2 e2 = vec2(cos(axis + PI4), sin(axis + PI4)); float s = (pp >= 0.0) ? 1.0 : -1.0; float lobe = (pp >= 0.0) ? axis : axis + 3.14159265; - /* A hard half-plane cut leaves a sharp corner where the flat edge meets the- outer curve; the mark has a real radius there. min(d,0) rounded is- 0.5*(d - sqrt(d*d + rc*rc)), which eases into the cut over a band of- width rc instead of hitting it as a crease. */+ /* The quadrant cut itself is done PER PIXEL in the fragment shader (vQ+ below). Doing it here, by projecting every out-of-quadrant vertex onto+ the cut planes, built a paper-thin sheet of squashed triangles along each+ plane: edge-on it rendered as a hairline at the seam, and while the cut+ ramped in it fanned out into jagged fins. Discarding fragments instead+ gives a mathematically straight edge exactly on the plane, with no+ geometry left behind to catch the light.++ What stays here is only the CORNER rounding, and only its soft excess+ over a hard cut: min(d,0) rounded is 0.5*(d - sqrt(d*d + rc*rc)), and+ subtracting min(d,0) leaves the gentle inward ease near the plane while+ the hard part is left to the pixel cut. */ vec2 q = physics.xy; float rc = uCorner;- float d1 = dot(q, e1) * s;- float p1 = (rc > 1e-5) ? 0.5 * (d1 - sqrt(d1*d1 + rc*rc)) : min(d1, 0.0);- q -= e1 * (p1 * s);- float d2 = dot(q, e2) * s;- float p2 = (rc > 1e-5) ? 0.5 * (d2 - sqrt(d2*d2 + rc*rc)) : min(d2, 0.0);- q -= e2 * (p2 * s);+ if (rc > 1e-5) {+ vec2 e1 = vec2(cos(axis - PI4), sin(axis - PI4));+ vec2 e2 = vec2(cos(axis + PI4), sin(axis + PI4));+ float d1 = dot(q, e1) * s;+ q -= e1 * ((0.5 * (d1 - sqrt(d1*d1 + rc*rc)) - min(d1, 0.0)) * s);+ float d2 = dot(q, e2) * s;+ q -= e2 * ((0.5 * (d2 - sqrt(d2*d2 + rc*rc)) - min(d2, 0.0)) * s);+ } vec3 clipped = vec3(mix(physics.xy, q, uFlat), physics.z); /* OUTER BOUNDARY correction.- The clip fixes the inner corner but leaves the outer edge as the plain+ The cut fixes the inner corner but leaves the outer edge as the plain circle the physics gives: it overshoots the mark in some directions and falls short in others. So for each direction, compare the orbital's own in-plane radius against the mark's measured edge at that same angle and scale by the ratio. Points outside the mark are pulled in, points inside are pushed out, and the silhouette lands exactly on the vectors. + Directions past the quadrant (about to be cut away) take the ratio AT the+ quadrant edge rather than none at all. Switching the correction off right+ at the edge kinked every triangle that straddled it, which showed as a+ notch where the flat edge meets the outer curve.+ This scales the in-plane component only, so the solid stays coherent out of plane rather than collapsing. */ if (uEdge > 0.0001) {@@ -2841,7 +3141,7 @@ vec3 shapedPos(vec3 dir){ if (cl > 1e-5) { float cang = atan(cq.y, cq.x); float cda = atan(sin(cang - lobe), cos(cang - lobe));- if (abs(cda) <= PI4 + 0.001) {+ { float u = (clamp(cda, -PI4, PI4) + PI4) / (2.0 * PI4) * 127.0; float fi = floor(min(u, 126.0)); float f = u - fi;@@ -2849,11 +3149,18 @@ vec3 shapedPos(vec3 dir){ int j = int(fi + 1.0); float rEdge = mix(uLogoR[i], uLogoR[j], f); - // the orbital's own equatorial radius in this same direction- vec3 eqd = vec3(cos(cang), sin(cang), 0.0);- float rPsi = abs(psiOf(eqd));+ // the orbital's own equatorial radius in this (quadrant-clamped) direction+ float ea = lobe + clamp(cda, -PI4, PI4);+ float rPsi = abs(psiOf(vec3(cos(ea), sin(ea), 0.0)));+ /* Aim 6% PAST the mark and let the fragment shader trim the outline+ exactly. Where the vector's curve leaves the flat edge it is+ tangent to it, a detail far finer than the sphere's vertex+ spacing, so aiming at it directly left a chord there: a sharp+ corner. ovK is 0 for the lighting, so the overshoot only moves+ the silhouette the trim cuts, never the shading. */+ float ov = mix(1.0, 1.06, ovK); if (rPsi > 1e-5) {- float k = rEdge / rPsi;+ float k = min(rEdge / rPsi * ov, 3.0); clipped.xy = cq * mix(1.0, k, uEdge); } }@@ -2867,7 +3174,29 @@ void main(void){ float p = psiOf(d); vPsi = p; - vec3 pos = shapedPos(d) * uScale;+ vec3 shaped = shapedPos(d, 1.0);+ /* The target is the LOGO state's own lobe in this direction, never the+ live state's: on the way out the next roll's small new lobes would be+ mapped through the wrong lobe's frame and thrown out as a flat sheet.+ So the leaf solid is a fixed shape and the morph is a plain blend+ between the live orbital and it. */+ if (uMorph > 0.0001) {+ float lp = 0.4886025 * dot(d.xy, vec2(cos(radians(uRot)), sin(radians(uRot))));+ vec3 ball = d * abs(lp);+ /* Triangles that straddle the node join a vertex of one lobe to a vertex+ of the other. On the leaves those land on the two leaves' flat edges,+ so each spanned the empty quadrant between them: a small chamfered+ bridge across the center all through the morph. Every vertex within+ one mesh step of the node (uNode, set from the tessellation) goes to+ the corner itself, so any triangle crossing between the lobes has no+ area. Pulling a point toward the corner keeps it on its flat edge, so+ the edges stay straight. */+ float nodeK = smoothstep(uNode, 2.0 * uNode, abs(lp));+ shaped = mix(shaped, leafPos(ball, lp) * nodeK, uMorph);+ }+ vQ = shaped.xy;+ vZ = shaped.z;+ vec3 pos = shaped * uScale; pos.xy += normalize(vec2(cos(radians(uRot)), sin(radians(uRot)))) * ((p >= 0.0) ? 1.0 : -1.0) * uGap * uScale * uFlat; @@ -2879,25 +3208,122 @@ void main(void){ vec3 t2 = cross(d, t1); float hh = 0.03; vec3 a = normalize(d + t1*hh), b = normalize(d + t2*hh);- vec3 pa = shapedPos(a) * uScale;- vec3 pb = shapedPos(b) * uScale;- vec3 nn = cross(pa - pos, pb - pos);+ vec3 p0 = shapedPos(d, 0.0) * uScale;+ vec3 pa = shapedPos(a, 0.0) * uScale;+ vec3 pb = shapedPos(b, 0.0) * uScale;+ vec3 nn = cross(pa - p0, pb - p0); vN = normalize(dot(nn, d) < 0.0 ? -nn : nn); + /* Facing, measured rather than read from gl_FrontFacing: the winding is+ opposite between Babylon and the raw WebGL loader. Stepping along the+ outward normal moves toward the camera exactly when the surface faces+ it, so the clip-space depth drops. */ gl_Position = uMVP * vec4(pos, 1.0);+ vec4 cn = uMVP * vec4(pos + vN * 0.05, 1.0);+ vFace = gl_Position.z / gl_Position.w - cn.z / cn.w;++ /* Perspective goes as the mark arrives: each vertex is placed where an+ orthographic camera with the same scale at the mark's plane would put+ it, so the silhouette is the flat outline exactly. Depth is untouched.+ The lighting keeps the orbital's own normals (computed above from the+ unmorphed surface), so the map cannot crease the shading. */+ if (uOrtho > 0.0001) {+ float w0 = (uMVP * vec4(0.0, 0.0, 0.0, 1.0)).w;+ gl_Position.xy *= gl_Position.w / mix(gl_Position.w, w0, uOrtho);+ } }`; var FS=`precision highp float; varying float vPsi; varying vec3 vN;+varying vec2 vQ;+varying float vFace;+varying float vZ; uniform vec3 cPos, cNeg;+uniform float uFlat, uRot, uShade, uPass, uEdge, uCamD, uPx;+uniform vec4 uProf[12]; // the mark's outline: 48 radii, sampled densely at both flat edges++/* The outline radius at x across the leaf (0 and 1 are the flat edges).+ Sampled at smoothstep-spaced angles: near a flat edge the radius grows+ like the square root of the angle, which smoothstep's spacing makes+ linear, so plain interpolation stays within about a pixel. Picked out by+ comparison, because GLSL ES 1.00 fragment shaders may not index uniform+ arrays dynamically. */+float outlineAt(float x){+ float sx = clamp(0.5 - sin(asin(clamp(1.0 - 2.0*x, -1.0, 1.0)) / 3.0), 0.0, 1.0);+ float u = sx * 47.0;+ float fi = floor(min(u, 46.0));+ float a = 0.0, b = 0.0;+ for (int k = 0; k < 12; k++) {+ float q0 = float(k * 4);+ vec4 id = vec4(q0, q0 + 1.0, q0 + 2.0, q0 + 3.0);+ a += dot(uProf[k], vec4(equal(id, vec4(fi))));+ b += dot(uProf[k], vec4(equal(id, vec4(fi + 1.0))));+ }+ return mix(a, b, u - fi);+}+ void main(void){+ /* The quadrant cut, per pixel, always at the mark's own 45 degree planes.+ Pass 0 (opaque) keeps each lobe's quadrant. Pass 1 is the OVERFLOW, the+ part of the round lobe outside the quadrant, drawn translucent at+ 1 - uFlat, so as the cheat ramps the excess melts away and leaves the+ leaf. Nothing moves and nothing is squashed: a rotating cut read as+ scissors closing, and squashing vertices onto the planes (the first+ version) left paper-thin sheets that showed as a hairline at the seam. */+ float fade = 1.0;+ if (uFlat > 0.0001) {+ float ql = length(vQ);+ bool inside = true;+ float cov = 1.0;+ if (ql > 1e-6) {+ float ax = radians(uRot) + (vPsi >= 0.0 ? 0.0 : 3.14159265);+ vec2 ad = vec2(cos(ax), sin(ax));+ vec2 qn = vQ / ql;+ inside = dot(qn, ad) >= 0.7071067 - 1e-4;+ /* The outer trim: the exact vector outline, eased in with the edge+ correction (1.3x, beyond any physics radius, down to 1x) so it+ never pops. Measured where this pixel's ray meets the mark's plane+ (z = 0), so the cut lands on SCREEN: a front-facing point sits+ nearer the camera and perspective enlarges it. uCamD is the camera+ distance in shape units. 1.0248 is the flat overlay's own size+ against the true projection (its 0.34 was fitted by eye), so the 3D+ outline and the flat mark are the same curve. cov is the pixel's+ coverage over a one pixel ramp (uPx = shape units per pixel), which+ antialiases the trimmed curve the way MSAA does a mesh edge. */+ if (inside && uEdge > 0.0001) {+ float da = atan(ad.x*qn.y - ad.y*qn.x, dot(qn, ad));+ float x = clamp((da + 0.7853981634) / 1.5707963268, 0.0, 1.0);+ float qp = (uCamD > 0.0) ? ql * uCamD / max(0.05, uCamD + vZ) : ql;+ float lim = outlineAt(x) * 1.0248 * mix(1.3, 1.0, uEdge);+ cov = (uPx > 0.0) ? clamp((lim - qp) / uPx + 0.5, 0.0, 1.0) : step(qp, lim);+ }+ }+ /* Pass 0 (opaque) keeps the fully covered leaf. Pass 1 (blended, front+ surface only) carries the rest: the antialiased rim of the trim, and+ the overflow outside the quadrant melting away at 1 - uFlat. */+ if (uPass < 0.5) { if (!inside || cov < 0.999) discard; }+ else if (inside) { if (cov >= 0.999 || cov <= 0.001) discard; fade = cov; }+ else { if (uFlat >= 0.999) discard; fade = 1.0 - uFlat; }+ } else if (uPass > 0.5) discard; vec3 base = vPsi >= 0.0 ? cPos : cNeg; vec3 n = normalize(vN);+ /* Looking INTO a cut lobe (free view only; square-on the cut is edge-on)+ shows the far wall from behind. Shade it as the flat cut face instead,+ so the solid reads closed rather than hollow. */+ if (uFlat > 0.0001 && uPass < 0.5 && vFace < 0.0) n = vec3(0.0, 0.0, -1.0); float lam = 0.42 + 0.58*max(0.0, dot(n, normalize(vec3(-0.4,0.85,-0.55)))); float rim = pow(1.0 - abs(n.z), 2.5)*0.32;- gl_FragColor = vec4(base*lam + vec3(0.0,0.72,0.68)*rim, 1.0);+ /* uShade flattens the surface itself to the brandmark teal. The logo moment+ used to be a separate flat canvas laid over the 3D; whenever the two+ shapes were not identical (fading in while the dive was still arriving,+ lingering while it left) that read as a ghost double image. Fading the+ surface means there is only ever one shape on screen. */+ vec3 lit = base*lam + vec3(0.0,0.72,0.68)*rim;+ gl_FragColor = vec4(mix(lit, vec3(0.0, 0.7216, 0.6902), uShade), fade); }`; var LOGO_R=[0.29682, 0.31691, 0.33085, 0.34219, 0.3519, 0.36055, 0.36839, 0.37555, 0.38216, 0.3883, 0.39398, 0.39936, 0.40453, 0.40917, 0.41376, 0.41798, 0.422, 0.42584, 0.4294, 0.43293, 0.43608, 0.43927, 0.44211, 0.445, 0.44757, 0.45018, 0.45253, 0.45491, 0.45702, 0.45917, 0.46107, 0.46303, 0.46475, 0.46655, 0.46809, 0.46969, 0.4711, 0.47252, 0.47382, 0.47507, 0.47627, 0.47735, 0.47847, 0.47938, 0.48038, 0.48119, 0.48205, 0.48281, 0.4835, 0.48421, 0.48477, 0.48541, 0.48586, 0.48634, 0.48677, 0.48712, 0.48754, 0.48774, 0.48802, 0.4882, 0.48834, 0.48853, 0.48852, 0.48859, 0.48859, 0.48852, 0.48853, 0.48834, 0.4882, 0.48802, 0.48774, 0.48754, 0.48712, 0.48677, 0.48634, 0.48586, 0.48541, 0.48477, 0.48421, 0.4835, 0.48281, 0.48205, 0.48119, 0.48038, 0.47938, 0.47847, 0.47735, 0.47627, 0.47507, 0.47382, 0.47252, 0.4711, 0.46969, 0.46807, 0.46651, 0.46473, 0.46303, 0.46107, 0.45918, 0.45702, 0.45491, 0.45253, 0.45018, 0.44757, 0.445, 0.44211, 0.43927, 0.43608, 0.43293, 0.4294, 0.42584, 0.422, 0.41798, 0.41376, 0.40917, 0.40453, 0.3993, 0.39391, 0.38829, 0.38214, 0.37552, 0.36839, 0.36056, 0.3519, 0.34209, 0.33073, 0.31683, 0.2966];+var PROF=[0.27485, 0.28587, 0.30119, 0.3168, 0.33233, 0.34751, 0.3623, 0.37662, 0.39025, 0.4033, 0.41541, 0.42673, 0.43684, 0.44607, 0.45439, 0.46153, 0.46783, 0.47326, 0.47775, 0.48137, 0.48427, 0.4864, 0.48773, 0.48841, 0.48841, 0.48773, 0.4864, 0.48427, 0.48137, 0.47775, 0.47326, 0.46781, 0.46153, 0.45439, 0.44607, 0.43684, 0.42673, 0.41541, 0.40329, 0.39022, 0.37661, 0.36231, 0.34745, 0.33216, 0.31673, 0.30103, 0.28552, 0.27309];+var LEAF=[0.28704, 0.27386, 0.26243, 0.25251, 0.24388, 0.23638, 0.22988, 0.22426, 0.21943, 0.21532, 0.21188, 0.20904, 0.20678, 0.20506, 0.20386, 0.20318, 0.20299, 0.2033, 0.20412, 0.20544, 0.20729, 0.20969, 0.21268, 0.21628, 0.22016, 0.22398, 0.22771, 0.23133, 0.2347, 0.23783, 0.24065, 0.24312, 0.24521, 0.24691, 0.24812, 0.24898, 0.24943, 0.24947, 0.24912, 0.24839, 0.24734, 0.246, 0.24444, 0.24269, 0.24079, 0.23877, 0.23668, 0.23459, 0.23252, 0.23047, 0.22847, 0.22649, 0.2246, 0.22286, 0.22128, 0.21984, 0.21845, 0.21725, 0.21624, 0.21541, 0.21465, 0.21412, 0.21383, 0.21357, 0.21357, 0.21383, 0.21412, 0.21465, 0.21541, 0.21624, 0.21725, 0.21845, 0.21984, 0.22128, 0.22286, 0.2246, 0.22649, 0.22847, 0.23047, 0.23252, 0.23459, 0.23668, 0.23877, 0.24079, 0.24269, 0.24444, 0.246, 0.24734, 0.24839, 0.24912, 0.24947, 0.24943, 0.24898, 0.24812, 0.24691, 0.24521, 0.24312, 0.24065, 0.23783, 0.2347, 0.23133, 0.22771, 0.22398, 0.22016, 0.21628, 0.21268, 0.20969, 0.20729, 0.20544, 0.20412, 0.2033, 0.20299, 0.20318, 0.20386, 0.20506, 0.20678, 0.20904, 0.21188, 0.21532, 0.21943, 0.22426, 0.22988, 0.23638, 0.24388, 0.25251, 0.26243, 0.27386, 0.28704]; var PATHS=[[[0.8046, 0.8046], [0.7789, 0.8291], [0.7525, 0.852], [0.7254, 0.8733], [0.6977, 0.8929], [0.6695, 0.911], [0.6408, 0.9274], [0.6118, 0.9422], [0.5825, 0.9553], [0.5531, 0.9668], [0.5235, 0.9766], [0.4939, 0.9847], [0.4644, 0.9911], [0.435, 0.9957], [0.4059, 0.9987], [0.3771, 1.0], [0.3486, 0.9995], [0.3206, 0.9972], [0.2932, 0.9932], [0.2664, 0.9874], [0.2403, 0.9799], [0.215, 0.9705], [0.1906, 0.9594], [0.1672, 0.9464], [0.1448, 0.9316], [0.1236, 0.9149], [0.1035, 0.8965], [0.0958, 0.8885], [0.0884, 0.8803], [0.0813, 0.8719], [0.0745, 0.8633], [0.0679, 0.8545], [0.0617, 0.8456], [0.0558, 0.8364], [0.0502, 0.8271], [0.0449, 0.8176], [0.0399, 0.8079], [0.0352, 0.7981], [0.0308, 0.7882], [0.0267, 0.7781], [0.0229, 0.7678], [0.0194, 0.7574], [0.0162, 0.7469], [0.0132, 0.7363], [0.0106, 0.7255], [0.0083, 0.7146], [0.0062, 0.7036], [0.0045, 0.6926], [0.003, 0.6814], [0.0018, 0.6701], [0.0009, 0.6587], [0.0003, 0.6473], [0.0, 0.6358], [0.0, 0.6357], [0.0, 0.6356], [0.0, 0.6354], [0.0, 0.6353], [0.0, 0.6352], [0.0, 0.6351], [0.0, 0.635], [0.0, 0.6349], [0.0, 0.6348], [0.0, 0.6346], [0.0, 0.0135], [0.0001, 0.0127], [0.0001, 0.0118], [0.0003, 0.011], [0.0004, 0.0102], [0.0007, 0.0094], [0.0009, 0.0086], [0.0013, 0.0079], [0.0016, 0.0071], [0.002, 0.0064], [0.0025, 0.0058], [0.003, 0.0051], [0.0035, 0.0045], [0.004, 0.0039], [0.0046, 0.0034], [0.0052, 0.0028], [0.0059, 0.0024], [0.0065, 0.0019], [0.0073, 0.0015], [0.008, 0.0012], [0.0087, 0.0008], [0.0095, 0.0006], [0.0103, 0.0003], [0.0111, 0.0002], [0.0119, 0.0], [0.0128, -0.0001], [0.0137, -0.0001], [0.6281, -0.0001], [0.64, 0.0], [0.6517, 0.0005], [0.6635, 0.0012], [0.6751, 0.0022], [0.6866, 0.0036], [0.698, 0.0052], [0.7093, 0.0072], [0.7206, 0.0094], [0.7316, 0.012], [0.7426, 0.0148], [0.7534, 0.018], [0.7641, 0.0215], [0.7747, 0.0253], [0.7851, 0.0295], [0.7954, 0.0339], [0.8055, 0.0386], [0.8154, 0.0437], [0.8252, 0.0491], [0.8348, 0.0548], [0.8442, 0.0608], [0.8534, 0.0671], [0.8624, 0.0737], [0.8712, 0.0807], [0.8799, 0.088], [0.8883, 0.0956], [0.8965, 0.1035], [0.915, 0.1235], [0.9316, 0.1448], [0.9464, 0.1672], [0.9594, 0.1906], [0.9705, 0.215], [0.9799, 0.2403], [0.9874, 0.2664], [0.9932, 0.2932], [0.9972, 0.3206], [0.9995, 0.3486], [1.0, 0.377], [0.9987, 0.4059], [0.9958, 0.435], [0.9911, 0.4644], [0.9847, 0.4939], [0.9766, 0.5235], [0.9668, 0.5531], [0.9553, 0.5825], [0.9422, 0.6118], [0.9274, 0.6408], [0.911, 0.6695], [0.8929, 0.6977], [0.8733, 0.7254], [0.852, 0.7525], [0.8291, 0.7789], [0.8046, 0.8046]], [[-0.8046, -0.8047], [-0.7789, -0.8292], [-0.7525, -0.8521], [-0.7254, -0.8734], [-0.6977, -0.893], [-0.6695, -0.9111], [-0.6408, -0.9275], [-0.6118, -0.9423], [-0.5825, -0.9554], [-0.5531, -0.9669], [-0.5235, -0.9767], [-0.4939, -0.9847], [-0.4644, -0.9912], [-0.435, -0.9958], [-0.4059, -0.9988], [-0.3771, -1.0001], [-0.3486, -0.9996], [-0.3206, -0.9973], [-0.2932, -0.9933], [-0.2664, -0.9875], [-0.2403, -0.98], [-0.215, -0.9706], [-0.1906, -0.9595], [-0.1672, -0.9465], [-0.1448, -0.9317], [-0.1236, -0.915], [-0.1035, -0.8965], [-0.0958, -0.8886], [-0.0884, -0.8804], [-0.0813, -0.872], [-0.0745, -0.8634], [-0.0679, -0.8546], [-0.0617, -0.8456], [-0.0558, -0.8365], [-0.0502, -0.8272], [-0.0449, -0.8177], [-0.0399, -0.808], [-0.0352, -0.7982], [-0.0308, -0.7883], [-0.0267, -0.7782], [-0.0229, -0.7679], [-0.0194, -0.7575], [-0.0162, -0.747], [-0.0132, -0.7364], [-0.0106, -0.7256], [-0.0083, -0.7147], [-0.0062, -0.7037], [-0.0045, -0.6927], [-0.003, -0.6815], [-0.0018, -0.6702], [-0.0009, -0.6588], [-0.0003, -0.6474], [-0.0, -0.6359], [-0.0, -0.6357], [-0.0, -0.6356], [-0.0, -0.6355], [-0.0, -0.6354], [-0.0, -0.6353], [-0.0, -0.6352], [-0.0, -0.6351], [-0.0, -0.635], [-0.0, -0.6349], [-0.0, -0.6347], [-0.0, -0.0136], [-0.0001, -0.0128], [-0.0001, -0.0119], [-0.0003, -0.0111], [-0.0004, -0.0103], [-0.0007, -0.0095], [-0.0009, -0.0087], [-0.0013, -0.008], [-0.0016, -0.0072], [-0.002, -0.0065], [-0.0025, -0.0059], [-0.003, -0.0052], [-0.0035, -0.0046], [-0.004, -0.004], [-0.0046, -0.0034], [-0.0052, -0.0029], [-0.0059, -0.0025], [-0.0065, -0.002], [-0.0073, -0.0016], [-0.008, -0.0012], [-0.0087, -0.0009], [-0.0095, -0.0007], [-0.0103, -0.0004], [-0.0111, -0.0002], [-0.0119, -0.0001], [-0.0128, -0.0], [-0.0137, -0.0], [-0.6281, -0.0], [-0.6399, -0.0001], [-0.6517, -0.0006], [-0.6634, -0.0013], [-0.6751, -0.0023], [-0.6866, -0.0037], [-0.698, -0.0053], [-0.7093, -0.0072], [-0.7205, -0.0095], [-0.7316, -0.0121], [-0.7426, -0.0149], [-0.7534, -0.0181], [-0.7641, -0.0216], [-0.7747, -0.0254], [-0.7851, -0.0295], [-0.7954, -0.034], [-0.8055, -0.0387], [-0.8154, -0.0438], [-0.8252, -0.0492], [-0.8347, -0.0549], [-0.8442, -0.0609], [-0.8534, -0.0672], [-0.8624, -0.0738], [-0.8712, -0.0808], [-0.8798, -0.0881], [-0.8883, -0.0957], [-0.8965, -0.1036], [-0.9149, -0.1236], [-0.9316, -0.1449], [-0.9464, -0.1673], [-0.9593, -0.1907], [-0.9705, -0.2151], [-0.9799, -0.2404], [-0.9874, -0.2665], [-0.9932, -0.2933], [-0.9972, -0.3207], [-0.9995, -0.3487], [-1.0, -0.3771], [-0.9987, -0.406], [-0.9957, -0.4351], [-0.991, -0.4645], [-0.9846, -0.494], [-0.9765, -0.5236], [-0.9668, -0.5532], [-0.9553, -0.5826], [-0.9422, -0.6119], [-0.9274, -0.6409], [-0.911, -0.6695], [-0.8929, -0.6978], [-0.8732, -0.7255], [-0.852, -0.7526], [-0.8291, -0.779], [-0.8046, -0.8047]]]; var glopt={antialias:AAON,alpha:true,premultipliedAlpha:true};@@ -2913,7 +3339,7 @@ gl.attachShader(prog,sh(gl.FRAGMENT_SHADER,FS)); gl.linkProgram(prog); if(!gl.getProgramParameter(prog,gl.LINK_STATUS)) throw new Error(gl.getProgramInfoLog(prog)); gl.useProgram(prog);-var U={}; ['uMVP','c','uScale','uFlat','uRot','uPlump','uGap','uEdge','uCorner','uLogoR','cPos','cNeg']+var U={}; ['uMVP','c','uScale','uFlat','uRot','uPlump','uGap','uEdge','uCorner','uLogoR','cPos','cNeg','uShade','uPass','uProf','uCamD','uPx','uMorph','uOrtho','uLeafM','uLeaf','uNode'] .forEach(function(n){U[n]=gl.getUniformLocation(prog,n);}); /* unit sphere, displaced entirely in the vertex shader */@@ -2932,6 +3358,11 @@ var loc=gl.getAttribLocation(prog,'position'); gl.enableVertexAttribArray(loc);gl.vertexAttribPointer(loc,3,gl.FLOAT,false,0,0); gl.enable(gl.DEPTH_TEST); gl.disable(gl.CULL_FACE); gl.uniform1fv(U.uLogoR,new Float32Array(LOGO_R));+gl.uniform4fv(U.uProf,new Float32Array(PROF));+gl.uniform4fv(U.uLeaf,new Float32Array(LEAF));gl.uniform1f(U.uLeafM,0.28704);+/* one mesh step in psi (the longitude step, 1.5x for the quads' diagonals):+ that band around the node collapses to the leaves' corner */+gl.uniform1f(U.uNode,0.4886025*(2*Math.PI/SEG)*1.5); gl.uniform1f(U.uPlump,0);gl.uniform1f(U.uGap,0);gl.uniform1f(U.uCorner,0);gl.uniform1f(U.uRot,45); var C_POS=[0x19/255,0xc8/255,0xbd/255], C_NEG=[0x12/255,0x3a/255,0x63/255];@@ -3013,21 +3444,31 @@ var BIRTH_S=2.6, birth=EMERGE?0:1, birthT=0; var orbA=0; // auto-orbit yaw, radians function frame(now){+ /* STOP WHEN HIDDEN (the header comment promised this; it was never implemented). An+ off-screen orbital must not keep burning GPU. Reschedule without drawing or advancing+ time; keep `last` current so returning to visible never computes a jumped dt. */+ if(document.hidden){ last=now; requestAnimationFrame(frame); return; } if(FPSCAP>0){ if(now-lastDraw < 1000/FPSCAP - 1){ requestAnimationFrame(frame); return; } lastDraw=now; } applySize();- var dt=Math.min(0.05,(now-last)/1000); last=now;+ /* Clamp dt to [0, 0.05]: never negative (a backwards clock across resume/DST would run+ the sim in reverse) and never a big jump (a stalled frame can't lurch). */+ var dt=Math.max(0,Math.min(0.05,(now-last)/1000)); last=now; var adt=dt*SPEED; tEvo+=adt; if(birth<1){birthT+=adt;birth=smooth(Math.min(1,birthT/BIRTH_S)); glc.style.opacity=birth>=1?'':String(0.04+0.96*birth);}- var k,cheat,fill,teal,pinned=false,drawMesh=true;+ var k,cheat,fill,teal,pinned=false,drawMesh=true,crisp=0; if(inIntro){ introT+=adt; var e1=INTRO.dark,e2=e1+INTRO.logoIn,e3=e2+INTRO.hold,e4=e3+INTRO.reveal,x=introT;- k=1;cheat=1;teal=1;pinned=true;drawMesh=x>=e2;- fill = x<e1?0 : x<e2?smooth((x-e1)/(e2-e1)) : x<e3?1 : 1-smooth((x-e3)/(e4-e3));+ /* The crisp mark fades in alone and holds; then the 3D leaf solid, fully+ morphed and fully flat (identical to it), replaces it WHOLE on one+ frame and lets its shading back in. No crossfade. */+ k=1;cheat=1;teal=1;pinned=true;drawMesh=x>=e3;+ crisp = x<e1?0 : x<e2?smooth((x-e1)/(e2-e1)) : x<e3?1 : 0;+ fill = x<e3?1 : 1-smooth((x-e3)/(e4-e3)); if(x>=e4){inIntro=false;t=eE;roll();} }else{ t=(t+adt)%CYC;@@ -3041,9 +3482,14 @@ function frame(now){ cheat = t<eS ? (t<=eS-ctw?0:smooth(1-(eS-t)/ctw)) : t<=eE ? 1 : (t>=eE+ctw?0:smooth(1-(t-eE)/ctw)); if(t>=eS&&!rolled){roll();rolled=true;} if(t<eS)rolled=false;- var mid=(eS+eE)/2, a2=mid-Math.max(0.001,(eE-eS)/2+LLEAD), b2=mid+Math.max(0.001,(eE-eS)/2+LLEAD);- fill=(LOGO_PK<=0||t<=a2||t>=b2||(b2-a2)<0.02)?0- :(t<mid?smooth((t-a2)/(mid-a2)):smooth((b2-t)/(b2-mid)))*LOGO_PK;+ /* The flattening is the 3D's own shading going to flat teal, on its+ lead, held through the sit. The crisp vector replaces the 3D whole, on+ a frame boundary, only while the two are identical: fully morphed+ (the sit) and fully flat. */+ fill=(LOGO_PK<=0)?0:(t<eS?(LLEAD<=0.001?0:(t<=eS-LLEAD?0:smooth(1-(eS-t)/LLEAD)))+ :t<=eE?1:(LLEAD<=0.001?0:(t>=eE+LLEAD?0:smooth(1-(t-eE)/LLEAD))))*LOGO_PK;+ crisp=(LOGO_PK>=0.999&&t>=eS&&t<=eE&&eE-eS>1e-4)?1:0;+ if(crisp)drawMesh=false; teal = t<eS ? (TLEAD<=0.01?0:(t<=eS-TLEAD?0:smooth(1-(eS-t)/TLEAD))) : t<=eE ? 1 : (TLEAD<=0.01?0:(t>=eE+TLEAD?0:smooth(1-(t-eE)/TLEAD))); }@@ -3103,23 +3549,29 @@ function frame(now){ for(i=0;i<16;i++)nrm+=c[i]*c[i]; nrm=Math.sqrt(nrm)||1; for(i=0;i<16;i++)c[i]/=nrm; + var ovA=crisp, shade=fill;+ if(TRANSP) gl.clearColor(0,0,0,0); else gl.clearColor(BG[0],BG[1],BG[2],1); gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT); if(drawMesh){ gl.uniform1fv(U.c,new Float32Array(c)); gl.uniform1f(U.uScale,2.5*(0.9+0.25*k));- gl.uniform1f(U.uFlat,cheat);gl.uniform1f(U.uEdge,cheat);+ gl.uniform1f(U.uCamD,effR/(2.5*(0.9+0.25*k)*birth));+ var mpx=proj(W,H); gl.uniform1f(U.uPx,effR/(mpx.m5*glc.height/2*2.5*(0.9+0.25*k)*birth));+ gl.uniform1f(U.uFlat,0);gl.uniform1f(U.uEdge,0);gl.uniform1f(U.uShade,shade);+ gl.uniform1f(U.uMorph,cheat);gl.uniform1f(U.uOrtho,cheat); gl.uniform3f(U.cNeg,lerp(C_NEG[0],C_POS[0],teal),lerp(C_NEG[1],C_POS[1],teal),lerp(C_NEG[2],C_POS[2],teal));+ gl.uniform1f(U.uPass,0); gl.drawElements(gl.TRIANGLES,idx.length,gl.UNSIGNED_SHORT,0); } ox.clearRect(0,0,ovc.width,ovc.height);- if(fill>0.004){+ if(ovA>0.004){ var mm=proj(W,H), ppw=mm.m0*ovc.width/2/(window.__cam?window.__cam.r:CAMR); var er=window.__cam?window.__cam.r:CAMR; var s=Math.min(ovc.width,ovc.height)*0.34*(R/er); ox.save();ox.translate(ovc.width/2-(window.__cam?window.__cam.x:0)*ppw, ovc.height/2+(window.__cam?window.__cam.y:0)*ppw);- ox.globalAlpha=fill;ox.fillStyle='#00b8b0';+ ox.globalAlpha=ovA;ox.fillStyle='#00b8b0'; for(var p2=0;p2<PATHS.length;p2++){var pts=PATHS[p2];ox.beginPath(); for(var j2=0;j2<pts.length;j2++){var X=pts[j2][0]*s,Y=-pts[j2][1]*s; j2?ox.lineTo(X,Y):ox.moveTo(X,Y);}@@ -3128,7 +3580,12 @@ function frame(now){ } requestAnimationFrame(frame); }-requestAnimationFrame(frame);+/* EXACTLY ONE loop per document: if this script ever evaluates twice, a second concurrent+ frame() loop would advance the sim clock in parallel (2x/3x "crazy speed"). */+if(!window.__ADOM_ORBITAL_RUNNING){+ window.__ADOM_ORBITAL_RUNNING=true;+ requestAnimationFrame(frame);+} /* Click-to-zoom, OFF unless armed: real load screens must never eat input. Armed via ?interact=1 (or window.__ADOM_LOADER_INTERACT, which the wiki@@ -3194,13 +3651,15 @@ if (Q.get('interact')==='1' || window.__ADOM_LOADER_INTERACT </html> "></iframe><div id="pgrip" title="drag to resize"></div></div> <div id="prd">container: …</div>- <p>This IS loader.html, inlined, running the <b>john fav</b> cut: the final output,- before any of the explanation. Click it once and your wheel zooms toward the cursor+ <p>This IS loader.html, inlined, running the <b>take 2 D</b> cut (the default): the final+ output, before any of the explanation. The lobes do not get cut to the mark and faded+ over: they MORPH into the logo's two leaves, flatten to the brand teal, and the crisp+ vector mark takes over on a single frame only once it is identical to the 3D. Click it once and your wheel zooms toward the cursor with the lab's exact springy feel; click anywhere else to give the wheel back to the page. Drag the teal corner or use the presets, the loader fills whatever you give it; the margin buttons retarget the framing live and the spring carries the camera to its new home. The loader here runs <b>bg=transparent</b>: tap the container bg swatches and- the box's own colour shows straight through the animation, which is how you sit it on a+ the box's own color shows straight through the animation, which is how you sit it on a toolbar, next to a wordmark, or on any surface. Everything below explains how to ship it.</p> <script>@@ -3271,8 +3730,8 @@ if (Q.get('interact')==='1' || window.__ADOM_LOADER_INTERACT </script> <h2 style="margin-top:30px">Ship it as a webview loader</h2> <p><b>loader.html</b> on this page is the animation above distilled to ONE dependency-free file:- raw WebGL, no Babylon, no CDN, no fonts, no fetch, about 30 KB. It boots instantly, which- is the point: it plays while your webview's real content is still loading. Under 10 KB+ raw WebGL, no Babylon, no CDN, no fonts, no fetch, about 44 KB. It boots instantly, which+ is the point: it plays while your webview's real content is still loading. About 18 KB gzipped, zero requests, one draw call over 12,800 vertex-shader-displaced triangles, and about 0.06 ms of JS per frame, so the CPU stays asleep. The wheel is tuned against the lab's measured response (same burst, same dip, same spring home), zooming toward the@@ -3288,12 +3747,12 @@ if (Q.get('interact')==='1' || window.__ADOM_LOADER_INTERACT <tr><th>approach</th><th>payload, gzipped</th><th>requests</th><th>first frame</th></tr> <tr><td>Babylon.js + app</td><td>~1.4 MB engine + your page</td><td>CDN + page</td><td>after download and parse</td></tr> <tr><td>three.js + app</td><td>~170 KB engine + your page</td><td>CDN + page</td><td>after download and parse</td></tr>- <tr><td><b>loader.html</b></td><td><b>9,912 bytes, everything included</b></td><td><b>zero</b></td><td><b>tens of milliseconds</b></td></tr>+ <tr><td><b>loader.html</b></td><td><b>18,314 bytes, everything included</b></td><td><b>zero</b></td><td><b>tens of milliseconds</b></td></tr> </table> <h3>The measured numbers</h3>- <p>Measured on this build, not estimated: <b>24,379 bytes</b> on disk and <b>9,912 bytes- gzipped</b>, including the shaders, the 286-point logomark vectors, the 128-sample- measured edge profile, and the whole timeline. Runtime: <b>0.057 ms of JavaScript per+ <p>Measured on this build, not estimated: <b>44,918 bytes</b> on disk and <b>18,314 bytes+ gzipped</b>, including the shaders, the 286-point logomark vectors, the measured edge+ profiles, the 128-angle leaf table the morph lands on, and the whole timeline. Runtime: <b>0.057 ms of JavaScript per frame</b> (16 coefficient cosines and uniform uploads, about 1.4% of a 240 Hz frame budget), then <b>one draw call</b> over <b>12,800 triangles / 6,561 vertices</b> with all displacement in the vertex shader. requestAnimationFrame pauses it completely when the@@ -3309,7 +3768,7 @@ if (Q.get('interact')==='1' || window.__ADOM_LOADER_INTERACT extracts the GLSL <b>verbatim</b> from the Babylon lab at build time (one source of truth), reproduces Babylon's left-handed view and projection matrices exactly, and the chirality is pixel-verified against the lab: teal lobe upper-right, navy lower-left.- Same equation, same cheat, same profile data, pixel-identical rendering. The camera feel+ Same equation, same morph, same outline data, pixel-identical rendering. The camera feel is tuned against the lab's <b>measured</b> response, not copied constants: the same 12-notch wheel burst dips both viewers to the same radius (3.99 vs 3.995) and both spring home in the same beat, via a Babylon-style decaying inertia integral, the lab's@@ -3369,14 +3828,13 @@ if (Q.get('interact')==='1' || window.__ADOM_LOADER_INTERACT <h3>Parameters</h3> <table> <tr><th>param</th><th>default</th><th>meaning</th></tr>- <tr><td>pt</td><td>4.5</td><td>playground seconds of free evolution between epochs</td></tr>- <tr><td>dt</td><td>3</td><td>seconds to steer onto the mark, and back out</td></tr>- <tr><td>ct</td><td>0.3</td><td>seconds before the epoch the outline cheat fades in</td></tr>- <tr><td>st</td><td>0</td><td>seconds the mark is held dead still</td></tr>- <tr><td>logo</td><td>100</td><td>peak opacity of the flat teal mark, in percent</td></tr>- <tr><td>llead</td><td>1</td><td>seconds the logo fade starts before the sit and ends after it</td></tr>- <tr><td>tlead</td><td>1.5</td><td>seconds before the epoch the dark lobe fades to teal</td></tr>- <tr><td>ov</td><td>1</td><td>0 makes the cheat its own act after the steer</td></tr>+ <tr><td>pt</td><td>5</td><td>playground seconds of free evolution between epochs</td></tr>+ <tr><td>dt</td><td>1.5</td><td>seconds to steer onto the mark (the dive), and back out</td></tr>+ <tr><td>ct</td><td>0.6</td><td>seconds the morph takes: the lobes become the leaves before the epoch, and become lobes again after it. Keep it in the late part of dt</td></tr>+ <tr><td>st</td><td>1</td><td>seconds the mark is held dead still (the crisp vector mark shows here)</td></tr>+ <tr><td>llead</td><td>0.9</td><td>seconds before the sit the 3D starts flattening to teal, and after it the shading comes back</td></tr>+ <tr><td>tlead</td><td>0.4</td><td>seconds before the epoch the dark lobe turns teal</td></tr>+ <tr><td>ov</td><td>1</td><td>0 makes the morph its own act after the steer</td></tr> <tr><td>intro</td><td>1</td><td>0 skips the teal logo intro</td></tr> <tr><td>interact</td><td>0</td><td>1 arms click-to-zoom (for previews and demos, never load screens)</td></tr> <tr><td>mode</td><td>performance</td><td><b>lightweight</b> bundles fps 30, dpr 1, seg 48, no antialias for spinner fleets and dialogs; <b>performance</b> (alias <b>sexy</b>) is the full-quality default. Explicit params override the mode</td></tr>@@ -3389,42 +3847,51 @@ if (Q.get('interact')==='1' || window.__ADOM_LOADER_INTERACT <tr><td>emerge</td><td>0</td><td>1 replaces the logo intro: the equation runs from t=0 and the surface condenses out of nothing (2.6 s scale and fade) straight into play, then the normal timeline. Keep pt above ~3 s so the first epoch never lands mid-birth. A taste toggle: try the start buttons in the rig above</td></tr> <tr><td>margin</td><td>0</td><td>percent of the container left empty around the mark: 80 sits it small in the middle of a big window, 20 nearly fills. NEGATIVE margins bleed: -50 moves the camera 50% closer so the animation runs off every edge (clamped at -70 to protect the near plane). Zoom-in still brings it to the screen; zoom-out caps at 40% past the margined framing. Live-settable by postMessage</td></tr> <tr><td>speed</td><td>100</td><td>percent playback rate for the animation clocks (timeline, evolution, birth): 10 runs it at a tenth speed. Camera springs and user interaction stay real time so the feel never goes gluey. Live-settable by postMessage</td></tr>- <tr><td>logo</td><td>100</td><td>peak opacity of the logo fill at the epoch, in percent: 100 is the full solid mark, 50 a translucent ghost, 10 barely a whisper, 0 disables the fill entirely (the sculpted surface still forms the mark shape). Live-settable by postMessage</td></tr>- <tr><td>orbit</td><td>0</td><td>automatic camera yaw during PLAY in degrees per second (try 12). As sculpting starts the angle glides to the nearest whole turn, so every epoch still lands square-on for the logo and play resumes with no unwinding sweep. Live-settable by postMessage</td></tr>+ <tr><td>logo</td><td>100</td><td>how flat the 3D gets for the logo moment, in percent: 100 is the flat brand teal, and only then does the crisp vector mark take over during the sit; lower keeps some 3D shading; 0 keeps the full shading (the morph still lands on the mark's shape). Live-settable by postMessage</td></tr>+ <tr><td>orbit</td><td>0</td><td>automatic camera yaw during PLAY in degrees per second (try 12). As the morph starts the angle glides to the nearest whole turn, so every epoch still lands square-on for the logo and play resumes with no unwinding sweep. Live-settable by postMessage</td></tr> </table>- <h3>The three tuned cuts</h3>- <p>These are the settings the loop was actually tuned to, saved live while dialing it in.- All three ship in the Final tab's snapshot pulldown (marked *), and each maps to loader- URL params. What the knobs mean: <b>pt</b> is free play between epochs, <b>dt</b> is how- long the dive onto the mark takes, <b>ct</b> is how late the outline cheat is held back- (smaller = the sculpting is nearly invisible), <b>st</b> is dead-still hold time,- <b>logo</b> is the flat mark's peak opacity, <b>llead</b> starts the logo fade that many- seconds before the epoch and ends it that many after, <b>tlead</b> turns the dark lobe- teal that many seconds early so the mark reads as one colour by arrival.</p>+ <h3>How the logo moment works (take 2)</h3>+ <p>A pure 2p lobe is a ball touching the origin. Its cross-section disk is mapped onto the+ logo's leaf, radially from a center on the leaf's axis: the ball's center lands on that+ center, its rim on the leaf's outline, the node at the origin on the leaf's corner.+ Heights are kept, so the ball becomes a leaf-shaped solid whose outline IS the vector+ mark. Over the <b>ct</b> window the live orbital blends into that solid while perspective+ flattens away (each vertex goes where an orthographic camera at the same scale would put+ it), so at the epoch the 3D silhouette is the flat outline exactly. The shading keeps the+ orbital's own normals, so the map never creases the light. Over <b>llead</b> the shading+ flattens to the brand teal, and the crisp vector mark replaces the 3D whole, on one frame,+ only during the sit, where the two are identical. Nothing is cut, and nothing crossfades.+ Every vertex within one mesh step of the node collapses to the corner, so no triangle+ can bridge the two leaves mid-morph.</p>+ <h3>The tuned cuts</h3>+ <p>All ship in the Final tab's snapshot pulldown, and each maps to loader URL params.+ <b>pt</b> is free play between epochs, <b>dt</b> the dive onto the mark, <b>ct</b> the+ morph, <b>st</b> the dead-still hold, <b>logo</b> how flat the 3D gets, <b>llead</b> how+ early it starts flattening, <b>tlead</b> how early the dark lobe turns teal.</p> <table> <tr><th>cut</th><th>numbers</th><th>why it feels the way it does</th></tr>- <tr><td><b>john fav</b><br>(the preview below)</td>+ <tr><td><b>take 2 D</b><br>(the default, and the preview above)</td>+ <td>pt 5 · dt 1.5 · ct 0.6 · st 1<br>logo 100% · llead 0.9 · tlead 0.4</td>+ <td>A 1.5s dive with the morph in its last 0.6s, so the orbital has settled to two+ round lobes before they flow into the leaves, then a 1s sit on the crisp mark.+ Unhurried, and nothing reads as a trick. Loader: no params needed.</td></tr>+ <tr><td><b>john fav</b></td> <td>pt 5 · dt 0.7 · ct 0.2 · st 1<br>logo 100% · llead 0.6 · tlead 0.2</td>- <td>The keeper. A 0.7s dive into a real 1s sit, and the teal unifies only 0.2s- before arrival, so the dark lobe survives almost to the mark and the colour- snap lands WITH the logo. Loader:+ <td>The previous default: a fast 0.7s dive into a 1s sit. With take 2 the 0.2s morph+ reads as a snap. Loader: <code>?pt=5&dt=0.7&ct=0.2&st=1&llead=0.6&tlead=0.2</code></td></tr>- <tr><td><b>john 1</b><br>(the default)</td>+ <tr><td><b>john 1</b></td> <td>pt 4.5 · dt 3 · ct 0.3 · st 0<br>logo 100% · llead 1 · tlead 1.5</td>- <td>The stately cut. A long 3s dinner call lets you watch the physics converge; the- cheat waits until the last 0.3s so you never catch it working; there is NO sit,- the whole logo moment lives on its 1s lead, swelling to full teal exactly across- the epoch and letting go. Loader: no params needed.</td></tr>- <tr><td><b>snap 2</b></td>- <td>pt 5 · dt 1 · ct 0.2 · st 0<br>logo 100% · llead 0.3 · tlead 1.5</td>- <td>The middle cut. A 1s dive and a tight 0.3s logo flash: punchy, still readable.- Loader: <code>?pt=5&dt=1&ct=0.2&llead=0.3</code></td></tr>- <tr><td><b>snap 3</b></td>- <td>pt 5 · dt 0.7 · ct 0.2 · st 0<br>logo 80% · llead 0.5 · tlead 1.5</td>- <td>The heartbeat cut. A 0.7s dive with the logo capped at 80% so the 3D still shows- through the flash: the mark reads as a pulse, not a poster.- Loader: <code>?pt=5&dt=0.7&ct=0.2&logo=80&llead=0.5</code></td></tr>+ <td>The stately cut: a long 3s dinner call, no sit, the logo moment on its 1s lead.+ Loader: <code>?pt=4.5&dt=3&ct=0.3&st=0&llead=1&tlead=1.5</code></td></tr> </table>+ <h3>Take 1, kept</h3>+ <p><b>loader-take1.html</b> is the earlier approach, kept as its own file: the orbital is cut+ to the mark per pixel (no seam line, no fins), the part outside the quadrant melts away,+ the outer edge is trimmed to the exact vector outline with antialiasing, and the flat+ mark is handed over inside the sit. Same parameters, with <b>ct</b> as the cut and+ <b>logo</b> as the flat overlay. It is a built snapshot: <code>tools/build-loader.py</code>+ regenerates <b>loader.html</b> (take 2) only.</p> </div> <script> /* The wiki parent listens for {type:'readme-height'} and resizes this iframe
tools/build-loader.py+66−17@@ -11,8 +11,9 @@ Constraints that shape it, in order: and logomark paths are inlined, and the camera reproduces Babylon's LEFT-HANDED view/projection exactly: this codebase already burned seven attempts on a mirrored mark, so chirality is not left to chance.- 3. John's tuned numbers as defaults (the "john 1" snapshot), overridable by- URL params: ?pt=4.5&dt=3&ct=0.3&st=0&logo=100&llead=1&tlead=1.5&ov=1&intro=1&interact=0&emerge=0&speed=100&orbit=0&margin=0..-80 for bleed+ 3. The "take 2 D" cut as defaults (the lobes morph into the leaves; nothing+ is cut or faded), overridable by URL params:+ ?pt=5&dt=1.5&ct=0.6&st=1&logo=100&llead=0.9&tlead=0.4&ov=1&intro=1&interact=0&emerge=0&speed=100&orbit=0&margin=0..-80 for bleed Run: python3 tools/build-loader.py """@@ -45,6 +46,15 @@ fs = extract('labFragmentShader') m = re.search(r"mat\.setFloats\('uLogoR', \[([^\]]+)\]\);", lab) if not m: sys.exit('build failed: uLogoR table not found') logoR = '[' + m.group(1).strip() + ']'+m = re.search(r"mat\.setFloat\('uLeafM', ([0-9.]+)\);", lab)+if not m: sys.exit('build failed: uLeafM not found')+leafM = m.group(1)+m = re.search(r"mat\.setArray4\('uLeaf', \[([^\]]+)\]\);", lab)+if not m: sys.exit('build failed: uLeaf table not found')+leaf = '[' + m.group(1).strip() + ']'+m = re.search(r"mat\.setArray4\('uProf', \[([^\]]+)\]\);", lab)+if not m: sys.exit('build failed: uProf outline table not found')+prof = '[' + m.group(1).strip() + ']' logomark = json.dumps(json.loads((ROOT / 'assets' / 'logomark.json').read_text())) @@ -73,9 +83,9 @@ function P(k,d){ if(k in o) return o[k]; var v=parseFloat(Q.get(k));return isFinite(v)?v:d; }-var PT=P('pt',4.5), DT=P('dt',3), CT=P('ct',0.3), ST=P('st',0);+var PT=P('pt',5), DT=P('dt',1.5), CT=P('ct',0.6), ST=P('st',1); var LOGO_PK=Math.max(0,Math.min(1,P('logo',100)/100));-var LLEAD=Math.abs(P('llead',1)), TLEAD=Math.abs(P('tlead',1.5));+var LLEAD=Math.abs(P('llead',0.9)), TLEAD=Math.abs(P('tlead',0.4)); var EMERGE=String(P('emerge',0))==='1'; /* speed: percent playback rate for the ANIMATION clocks (timeline, evolution, birth). 100 is real time; 10 is a tenth speed. Camera springs and user@@ -107,7 +117,11 @@ function homeFor(m){ return m<0 ? R*(1+m/100) : R/(1-m/100); } var MODE=String((window.__ADOM_LOADER_PARAMS&&window.__ADOM_LOADER_PARAMS.mode)||Q.get('mode')||'').toLowerCase(); if(MODE==='sexy')MODE='performance'; var LIGHT=(MODE==='lightweight'||MODE==='light');-var FPSCAP=Math.max(0,P('fps',LIGHT?30:0)); if(FPSCAP>0&&FPSCAP<20)FPSCAP=20;+/* SAFEGUARD (2026-08-04, upstreamed from Hydrogen Desktop): default to a BOUNDED 60fps even+ in performance mode instead of uncapped. An uncapped WebGL surface on a slower/integrated+ GPU pegs the GPU and starves the embedding app's UI thread (frozen nav) and delivers frame+ BURSTS that read as "crazy speed". A hero that genuinely wants uncapped opts out: ?fps=0. */+var FPSCAP=Math.max(0,P('fps',LIGHT?30:60)); if(FPSCAP>0&&FPSCAP<20)FPSCAP=20; var DPRCAP=Math.max(1,Math.min(3,P('dpr',LIGHT?1:2))); var SEGQ=Math.round(Math.max(24,Math.min(128,P('seg',LIGHT?48:80)))); var AAON=P('aa',LIGHT?0:1)>=1;@@ -132,6 +146,8 @@ applyBg((window.__ADOM_LOADER_PARAMS&&window.__ADOM_LOADER_PARAMS.bg)||Q.get('bg var VS=__VS__; var FS=__FS__; var LOGO_R=__LOGO_R__;+var PROF=__PROF__;+var LEAF=__LEAF__; var PATHS=__PATHS__; var glopt={antialias:AAON,alpha:true,premultipliedAlpha:true};@@ -147,7 +163,7 @@ gl.attachShader(prog,sh(gl.FRAGMENT_SHADER,FS)); gl.linkProgram(prog); if(!gl.getProgramParameter(prog,gl.LINK_STATUS)) throw new Error(gl.getProgramInfoLog(prog)); gl.useProgram(prog);-var U={}; ['uMVP','c','uScale','uFlat','uRot','uPlump','uGap','uEdge','uCorner','uLogoR','cPos','cNeg']+var U={}; ['uMVP','c','uScale','uFlat','uRot','uPlump','uGap','uEdge','uCorner','uLogoR','cPos','cNeg','uShade','uPass','uProf','uCamD','uPx','uMorph','uOrtho','uLeafM','uLeaf','uNode'] .forEach(function(n){U[n]=gl.getUniformLocation(prog,n);}); /* unit sphere, displaced entirely in the vertex shader */@@ -166,6 +182,11 @@ var loc=gl.getAttribLocation(prog,'position'); gl.enableVertexAttribArray(loc);gl.vertexAttribPointer(loc,3,gl.FLOAT,false,0,0); gl.enable(gl.DEPTH_TEST); gl.disable(gl.CULL_FACE); gl.uniform1fv(U.uLogoR,new Float32Array(LOGO_R));+gl.uniform4fv(U.uProf,new Float32Array(PROF));+gl.uniform4fv(U.uLeaf,new Float32Array(LEAF));gl.uniform1f(U.uLeafM,__LEAFM__);+/* one mesh step in psi (the longitude step, 1.5x for the quads' diagonals):+ that band around the node collapses to the leaves' corner */+gl.uniform1f(U.uNode,0.4886025*(2*Math.PI/SEG)*1.5); gl.uniform1f(U.uPlump,0);gl.uniform1f(U.uGap,0);gl.uniform1f(U.uCorner,0);gl.uniform1f(U.uRot,45); var C_POS=[0x19/255,0xc8/255,0xbd/255], C_NEG=[0x12/255,0x3a/255,0x63/255];@@ -255,21 +276,31 @@ var BIRTH_S=2.6, birth=EMERGE?0:1, birthT=0; var orbA=0; // auto-orbit yaw, radians function frame(now){+ /* STOP WHEN HIDDEN (the header comment promised this; it was never implemented). An+ off-screen orbital must not keep burning GPU. Reschedule without drawing or advancing+ time; keep `last` current so returning to visible never computes a jumped dt. */+ if(document.hidden){ last=now; requestAnimationFrame(frame); return; } if(FPSCAP>0){ if(now-lastDraw < 1000/FPSCAP - 1){ requestAnimationFrame(frame); return; } lastDraw=now; } applySize();- var dt=Math.min(0.05,(now-last)/1000); last=now;+ /* Clamp dt to [0, 0.05]: never negative (a backwards clock across resume/DST would run+ the sim in reverse) and never a big jump (a stalled frame can't lurch). */+ var dt=Math.max(0,Math.min(0.05,(now-last)/1000)); last=now; var adt=dt*SPEED; tEvo+=adt; if(birth<1){birthT+=adt;birth=smooth(Math.min(1,birthT/BIRTH_S)); glc.style.opacity=birth>=1?'':String(0.04+0.96*birth);}- var k,cheat,fill,teal,pinned=false,drawMesh=true;+ var k,cheat,fill,teal,pinned=false,drawMesh=true,crisp=0; if(inIntro){ introT+=adt; var e1=INTRO.dark,e2=e1+INTRO.logoIn,e3=e2+INTRO.hold,e4=e3+INTRO.reveal,x=introT;- k=1;cheat=1;teal=1;pinned=true;drawMesh=x>=e2;- fill = x<e1?0 : x<e2?smooth((x-e1)/(e2-e1)) : x<e3?1 : 1-smooth((x-e3)/(e4-e3));+ /* The crisp mark fades in alone and holds; then the 3D leaf solid, fully+ morphed and fully flat (identical to it), replaces it WHOLE on one+ frame and lets its shading back in. No crossfade. */+ k=1;cheat=1;teal=1;pinned=true;drawMesh=x>=e3;+ crisp = x<e1?0 : x<e2?smooth((x-e1)/(e2-e1)) : x<e3?1 : 0;+ fill = x<e3?1 : 1-smooth((x-e3)/(e4-e3)); if(x>=e4){inIntro=false;t=eE;roll();} }else{ t=(t+adt)%CYC;@@ -283,9 +314,14 @@ function frame(now){ cheat = t<eS ? (t<=eS-ctw?0:smooth(1-(eS-t)/ctw)) : t<=eE ? 1 : (t>=eE+ctw?0:smooth(1-(t-eE)/ctw)); if(t>=eS&&!rolled){roll();rolled=true;} if(t<eS)rolled=false;- var mid=(eS+eE)/2, a2=mid-Math.max(0.001,(eE-eS)/2+LLEAD), b2=mid+Math.max(0.001,(eE-eS)/2+LLEAD);- fill=(LOGO_PK<=0||t<=a2||t>=b2||(b2-a2)<0.02)?0- :(t<mid?smooth((t-a2)/(mid-a2)):smooth((b2-t)/(b2-mid)))*LOGO_PK;+ /* The flattening is the 3D's own shading going to flat teal, on its+ lead, held through the sit. The crisp vector replaces the 3D whole, on+ a frame boundary, only while the two are identical: fully morphed+ (the sit) and fully flat. */+ fill=(LOGO_PK<=0)?0:(t<eS?(LLEAD<=0.001?0:(t<=eS-LLEAD?0:smooth(1-(eS-t)/LLEAD)))+ :t<=eE?1:(LLEAD<=0.001?0:(t>=eE+LLEAD?0:smooth(1-(t-eE)/LLEAD))))*LOGO_PK;+ crisp=(LOGO_PK>=0.999&&t>=eS&&t<=eE&&eE-eS>1e-4)?1:0;+ if(crisp)drawMesh=false; teal = t<eS ? (TLEAD<=0.01?0:(t<=eS-TLEAD?0:smooth(1-(eS-t)/TLEAD))) : t<=eE ? 1 : (TLEAD<=0.01?0:(t>=eE+TLEAD?0:smooth(1-(t-eE)/TLEAD))); }@@ -345,23 +381,29 @@ function frame(now){ for(i=0;i<16;i++)nrm+=c[i]*c[i]; nrm=Math.sqrt(nrm)||1; for(i=0;i<16;i++)c[i]/=nrm; + var ovA=crisp, shade=fill;+ if(TRANSP) gl.clearColor(0,0,0,0); else gl.clearColor(BG[0],BG[1],BG[2],1); gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT); if(drawMesh){ gl.uniform1fv(U.c,new Float32Array(c)); gl.uniform1f(U.uScale,2.5*(0.9+0.25*k));- gl.uniform1f(U.uFlat,cheat);gl.uniform1f(U.uEdge,cheat);+ gl.uniform1f(U.uCamD,effR/(2.5*(0.9+0.25*k)*birth));+ var mpx=proj(W,H); gl.uniform1f(U.uPx,effR/(mpx.m5*glc.height/2*2.5*(0.9+0.25*k)*birth));+ gl.uniform1f(U.uFlat,0);gl.uniform1f(U.uEdge,0);gl.uniform1f(U.uShade,shade);+ gl.uniform1f(U.uMorph,cheat);gl.uniform1f(U.uOrtho,cheat); gl.uniform3f(U.cNeg,lerp(C_NEG[0],C_POS[0],teal),lerp(C_NEG[1],C_POS[1],teal),lerp(C_NEG[2],C_POS[2],teal));+ gl.uniform1f(U.uPass,0); gl.drawElements(gl.TRIANGLES,idx.length,gl.UNSIGNED_SHORT,0); } ox.clearRect(0,0,ovc.width,ovc.height);- if(fill>0.004){+ if(ovA>0.004){ var mm=proj(W,H), ppw=mm.m0*ovc.width/2/(window.__cam?window.__cam.r:CAMR); var er=window.__cam?window.__cam.r:CAMR; var s=Math.min(ovc.width,ovc.height)*0.34*(R/er); ox.save();ox.translate(ovc.width/2-(window.__cam?window.__cam.x:0)*ppw, ovc.height/2+(window.__cam?window.__cam.y:0)*ppw);- ox.globalAlpha=fill;ox.fillStyle='#00b8b0';+ ox.globalAlpha=ovA;ox.fillStyle='#00b8b0'; for(var p2=0;p2<PATHS.length;p2++){var pts=PATHS[p2];ox.beginPath(); for(var j2=0;j2<pts.length;j2++){var X=pts[j2][0]*s,Y=-pts[j2][1]*s; j2?ox.lineTo(X,Y):ox.moveTo(X,Y);}@@ -370,7 +412,12 @@ function frame(now){ } requestAnimationFrame(frame); }-requestAnimationFrame(frame);+/* EXACTLY ONE loop per document: if this script ever evaluates twice, a second concurrent+ frame() loop would advance the sim clock in parallel (2x/3x "crazy speed"). */+if(!window.__ADOM_ORBITAL_RUNNING){+ window.__ADOM_ORBITAL_RUNNING=true;+ requestAnimationFrame(frame);+} /* Click-to-zoom, OFF unless armed: real load screens must never eat input. Armed via ?interact=1 (or window.__ADOM_LOADER_INTERACT, which the wiki@@ -440,6 +487,8 @@ page = (page .replace('__VS__', '`' + vs + '`') .replace('__FS__', '`' + fs + '`') .replace('__LOGO_R__', logoR)+ .replace('__PROF__', prof)+ .replace('__LEAF__', leaf).replace('__LEAFM__', leafM) .replace('__PATHS__', logomark) .replace('__BG__', '#0d1117'))
tools/build-readme.py+59−49@@ -72,11 +72,11 @@ loader = loader_path.read_text() loader_kb = round(loader_path.stat().st_size / 1024) import html as _html # the inline preview arms the loader's click-to-zoom; standalone stays inert-# the inline preview runs john fav and arms click-to-zoom+# the inline preview runs the take 2 D cut (the default) and arms click-to-zoom loader_armed = loader.replace( "'use strict';", "'use strict';window.__ADOM_LOADER_INTERACT=1;"- "window.__ADOM_LOADER_PARAMS={pt:5,dt:0.7,ct:0.2,st:1,logo:100,llead:0.6,tlead:0.2,bg:'transparent'};", 1)+ "window.__ADOM_LOADER_PARAMS={pt:5,dt:1.5,ct:0.6,st:1,logo:100,llead:0.9,tlead:0.4,bg:'transparent'};", 1) loader_srcdoc = _html.escape(loader_armed, quote=True) edocs = """@@ -115,7 +115,7 @@ edocs = """ #pbox.notrans{transition:none} /* the iframe ELEMENT must not paint: the base .prev rule gives it the dark background, which sat between the loader's transparent buffer and the- container's colour and swallowed the swatches */+ container's color and swallowed the swatches */ #pbox .prev{position:absolute;inset:0;width:100%;height:100%;aspect-ratio:auto;border:0;margin:0;background:transparent} #pgrip{position:absolute;right:-2px;bottom:-2px;width:22px;height:22px;cursor:nwse-resize;z-index:5; border-right:3px solid var(--accent);border-bottom:3px solid var(--accent);border-radius:0 0 8px 0}@@ -163,13 +163,15 @@ edocs = """ </div> <div id="pbox"><iframe class="prev" srcdoc="__SRC__"></iframe><div id="pgrip" title="drag to resize"></div></div> <div id="prd">container: …</div>- <p>This IS loader.html, inlined, running the <b>john fav</b> cut: the final output,- before any of the explanation. Click it once and your wheel zooms toward the cursor+ <p>This IS loader.html, inlined, running the <b>take 2 D</b> cut (the default): the final+ output, before any of the explanation. The lobes do not get cut to the mark and faded+ over: they MORPH into the logo's two leaves, flatten to the brand teal, and the crisp+ vector mark takes over on a single frame only once it is identical to the 3D. Click it once and your wheel zooms toward the cursor with the lab's exact springy feel; click anywhere else to give the wheel back to the page. Drag the teal corner or use the presets, the loader fills whatever you give it; the margin buttons retarget the framing live and the spring carries the camera to its new home. The loader here runs <b>bg=transparent</b>: tap the container bg swatches and- the box's own colour shows straight through the animation, which is how you sit it on a+ the box's own color shows straight through the animation, which is how you sit it on a toolbar, next to a wordmark, or on any surface. Everything below explains how to ship it.</p> <script>@@ -241,7 +243,7 @@ edocs = """ <h2 style="margin-top:30px">Ship it as a webview loader</h2> <p><b>loader.html</b> on this page is the animation above distilled to ONE dependency-free file: raw WebGL, no Babylon, no CDN, no fonts, no fetch, about __KB__ KB. It boots instantly, which- is the point: it plays while your webview's real content is still loading. Under 10 KB+ is the point: it plays while your webview's real content is still loading. About 18 KB gzipped, zero requests, one draw call over 12,800 vertex-shader-displaced triangles, and about 0.06 ms of JS per frame, so the CPU stays asleep. The wheel is tuned against the lab's measured response (same burst, same dip, same spring home), zooming toward the@@ -257,12 +259,12 @@ edocs = """ <tr><th>approach</th><th>payload, gzipped</th><th>requests</th><th>first frame</th></tr> <tr><td>Babylon.js + app</td><td>~1.4 MB engine + your page</td><td>CDN + page</td><td>after download and parse</td></tr> <tr><td>three.js + app</td><td>~170 KB engine + your page</td><td>CDN + page</td><td>after download and parse</td></tr>- <tr><td><b>loader.html</b></td><td><b>9,912 bytes, everything included</b></td><td><b>zero</b></td><td><b>tens of milliseconds</b></td></tr>+ <tr><td><b>loader.html</b></td><td><b>18,314 bytes, everything included</b></td><td><b>zero</b></td><td><b>tens of milliseconds</b></td></tr> </table> <h3>The measured numbers</h3>- <p>Measured on this build, not estimated: <b>24,379 bytes</b> on disk and <b>9,912 bytes- gzipped</b>, including the shaders, the 286-point logomark vectors, the 128-sample- measured edge profile, and the whole timeline. Runtime: <b>0.057 ms of JavaScript per+ <p>Measured on this build, not estimated: <b>44,918 bytes</b> on disk and <b>18,314 bytes+ gzipped</b>, including the shaders, the 286-point logomark vectors, the measured edge+ profiles, the 128-angle leaf table the morph lands on, and the whole timeline. Runtime: <b>0.057 ms of JavaScript per frame</b> (16 coefficient cosines and uniform uploads, about 1.4% of a 240 Hz frame budget), then <b>one draw call</b> over <b>12,800 triangles / 6,561 vertices</b> with all displacement in the vertex shader. requestAnimationFrame pauses it completely when the@@ -278,7 +280,7 @@ edocs = """ extracts the GLSL <b>verbatim</b> from the Babylon lab at build time (one source of truth), reproduces Babylon's left-handed view and projection matrices exactly, and the chirality is pixel-verified against the lab: teal lobe upper-right, navy lower-left.- Same equation, same cheat, same profile data, pixel-identical rendering. The camera feel+ Same equation, same morph, same outline data, pixel-identical rendering. The camera feel is tuned against the lab's <b>measured</b> response, not copied constants: the same 12-notch wheel burst dips both viewers to the same radius (3.99 vs 3.995) and both spring home in the same beat, via a Babylon-style decaying inertia integral, the lab's@@ -338,14 +340,13 @@ edocs = """ <h3>Parameters</h3> <table> <tr><th>param</th><th>default</th><th>meaning</th></tr>- <tr><td>pt</td><td>4.5</td><td>playground seconds of free evolution between epochs</td></tr>- <tr><td>dt</td><td>3</td><td>seconds to steer onto the mark, and back out</td></tr>- <tr><td>ct</td><td>0.3</td><td>seconds before the epoch the outline cheat fades in</td></tr>- <tr><td>st</td><td>0</td><td>seconds the mark is held dead still</td></tr>- <tr><td>logo</td><td>100</td><td>peak opacity of the flat teal mark, in percent</td></tr>- <tr><td>llead</td><td>1</td><td>seconds the logo fade starts before the sit and ends after it</td></tr>- <tr><td>tlead</td><td>1.5</td><td>seconds before the epoch the dark lobe fades to teal</td></tr>- <tr><td>ov</td><td>1</td><td>0 makes the cheat its own act after the steer</td></tr>+ <tr><td>pt</td><td>5</td><td>playground seconds of free evolution between epochs</td></tr>+ <tr><td>dt</td><td>1.5</td><td>seconds to steer onto the mark (the dive), and back out</td></tr>+ <tr><td>ct</td><td>0.6</td><td>seconds the morph takes: the lobes become the leaves before the epoch, and become lobes again after it. Keep it in the late part of dt</td></tr>+ <tr><td>st</td><td>1</td><td>seconds the mark is held dead still (the crisp vector mark shows here)</td></tr>+ <tr><td>llead</td><td>0.9</td><td>seconds before the sit the 3D starts flattening to teal, and after it the shading comes back</td></tr>+ <tr><td>tlead</td><td>0.4</td><td>seconds before the epoch the dark lobe turns teal</td></tr>+ <tr><td>ov</td><td>1</td><td>0 makes the morph its own act after the steer</td></tr> <tr><td>intro</td><td>1</td><td>0 skips the teal logo intro</td></tr> <tr><td>interact</td><td>0</td><td>1 arms click-to-zoom (for previews and demos, never load screens)</td></tr> <tr><td>mode</td><td>performance</td><td><b>lightweight</b> bundles fps 30, dpr 1, seg 48, no antialias for spinner fleets and dialogs; <b>performance</b> (alias <b>sexy</b>) is the full-quality default. Explicit params override the mode</td></tr>@@ -358,42 +359,51 @@ edocs = """ <tr><td>emerge</td><td>0</td><td>1 replaces the logo intro: the equation runs from t=0 and the surface condenses out of nothing (2.6 s scale and fade) straight into play, then the normal timeline. Keep pt above ~3 s so the first epoch never lands mid-birth. A taste toggle: try the start buttons in the rig above</td></tr> <tr><td>margin</td><td>0</td><td>percent of the container left empty around the mark: 80 sits it small in the middle of a big window, 20 nearly fills. NEGATIVE margins bleed: -50 moves the camera 50% closer so the animation runs off every edge (clamped at -70 to protect the near plane). Zoom-in still brings it to the screen; zoom-out caps at 40% past the margined framing. Live-settable by postMessage</td></tr> <tr><td>speed</td><td>100</td><td>percent playback rate for the animation clocks (timeline, evolution, birth): 10 runs it at a tenth speed. Camera springs and user interaction stay real time so the feel never goes gluey. Live-settable by postMessage</td></tr>- <tr><td>logo</td><td>100</td><td>peak opacity of the logo fill at the epoch, in percent: 100 is the full solid mark, 50 a translucent ghost, 10 barely a whisper, 0 disables the fill entirely (the sculpted surface still forms the mark shape). Live-settable by postMessage</td></tr>- <tr><td>orbit</td><td>0</td><td>automatic camera yaw during PLAY in degrees per second (try 12). As sculpting starts the angle glides to the nearest whole turn, so every epoch still lands square-on for the logo and play resumes with no unwinding sweep. Live-settable by postMessage</td></tr>+ <tr><td>logo</td><td>100</td><td>how flat the 3D gets for the logo moment, in percent: 100 is the flat brand teal, and only then does the crisp vector mark take over during the sit; lower keeps some 3D shading; 0 keeps the full shading (the morph still lands on the mark's shape). Live-settable by postMessage</td></tr>+ <tr><td>orbit</td><td>0</td><td>automatic camera yaw during PLAY in degrees per second (try 12). As the morph starts the angle glides to the nearest whole turn, so every epoch still lands square-on for the logo and play resumes with no unwinding sweep. Live-settable by postMessage</td></tr> </table>- <h3>The three tuned cuts</h3>- <p>These are the settings the loop was actually tuned to, saved live while dialing it in.- All three ship in the Final tab's snapshot pulldown (marked *), and each maps to loader- URL params. What the knobs mean: <b>pt</b> is free play between epochs, <b>dt</b> is how- long the dive onto the mark takes, <b>ct</b> is how late the outline cheat is held back- (smaller = the sculpting is nearly invisible), <b>st</b> is dead-still hold time,- <b>logo</b> is the flat mark's peak opacity, <b>llead</b> starts the logo fade that many- seconds before the epoch and ends it that many after, <b>tlead</b> turns the dark lobe- teal that many seconds early so the mark reads as one colour by arrival.</p>+ <h3>How the logo moment works (take 2)</h3>+ <p>A pure 2p lobe is a ball touching the origin. Its cross-section disk is mapped onto the+ logo's leaf, radially from a center on the leaf's axis: the ball's center lands on that+ center, its rim on the leaf's outline, the node at the origin on the leaf's corner.+ Heights are kept, so the ball becomes a leaf-shaped solid whose outline IS the vector+ mark. Over the <b>ct</b> window the live orbital blends into that solid while perspective+ flattens away (each vertex goes where an orthographic camera at the same scale would put+ it), so at the epoch the 3D silhouette is the flat outline exactly. The shading keeps the+ orbital's own normals, so the map never creases the light. Over <b>llead</b> the shading+ flattens to the brand teal, and the crisp vector mark replaces the 3D whole, on one frame,+ only during the sit, where the two are identical. Nothing is cut, and nothing crossfades.+ Every vertex within one mesh step of the node collapses to the corner, so no triangle+ can bridge the two leaves mid-morph.</p>+ <h3>The tuned cuts</h3>+ <p>All ship in the Final tab's snapshot pulldown, and each maps to loader URL params.+ <b>pt</b> is free play between epochs, <b>dt</b> the dive onto the mark, <b>ct</b> the+ morph, <b>st</b> the dead-still hold, <b>logo</b> how flat the 3D gets, <b>llead</b> how+ early it starts flattening, <b>tlead</b> how early the dark lobe turns teal.</p> <table> <tr><th>cut</th><th>numbers</th><th>why it feels the way it does</th></tr>- <tr><td><b>john fav</b><br>(the preview below)</td>+ <tr><td><b>take 2 D</b><br>(the default, and the preview above)</td>+ <td>pt 5 · dt 1.5 · ct 0.6 · st 1<br>logo 100% · llead 0.9 · tlead 0.4</td>+ <td>A 1.5s dive with the morph in its last 0.6s, so the orbital has settled to two+ round lobes before they flow into the leaves, then a 1s sit on the crisp mark.+ Unhurried, and nothing reads as a trick. Loader: no params needed.</td></tr>+ <tr><td><b>john fav</b></td> <td>pt 5 · dt 0.7 · ct 0.2 · st 1<br>logo 100% · llead 0.6 · tlead 0.2</td>- <td>The keeper. A 0.7s dive into a real 1s sit, and the teal unifies only 0.2s- before arrival, so the dark lobe survives almost to the mark and the colour- snap lands WITH the logo. Loader:+ <td>The previous default: a fast 0.7s dive into a 1s sit. With take 2 the 0.2s morph+ reads as a snap. Loader: <code>?pt=5&dt=0.7&ct=0.2&st=1&llead=0.6&tlead=0.2</code></td></tr>- <tr><td><b>john 1</b><br>(the default)</td>+ <tr><td><b>john 1</b></td> <td>pt 4.5 · dt 3 · ct 0.3 · st 0<br>logo 100% · llead 1 · tlead 1.5</td>- <td>The stately cut. A long 3s dinner call lets you watch the physics converge; the- cheat waits until the last 0.3s so you never catch it working; there is NO sit,- the whole logo moment lives on its 1s lead, swelling to full teal exactly across- the epoch and letting go. Loader: no params needed.</td></tr>- <tr><td><b>snap 2</b></td>- <td>pt 5 · dt 1 · ct 0.2 · st 0<br>logo 100% · llead 0.3 · tlead 1.5</td>- <td>The middle cut. A 1s dive and a tight 0.3s logo flash: punchy, still readable.- Loader: <code>?pt=5&dt=1&ct=0.2&llead=0.3</code></td></tr>- <tr><td><b>snap 3</b></td>- <td>pt 5 · dt 0.7 · ct 0.2 · st 0<br>logo 80% · llead 0.5 · tlead 1.5</td>- <td>The heartbeat cut. A 0.7s dive with the logo capped at 80% so the 3D still shows- through the flash: the mark reads as a pulse, not a poster.- Loader: <code>?pt=5&dt=0.7&ct=0.2&logo=80&llead=0.5</code></td></tr>+ <td>The stately cut: a long 3s dinner call, no sit, the logo moment on its 1s lead.+ Loader: <code>?pt=4.5&dt=3&ct=0.3&st=0&llead=1&tlead=1.5</code></td></tr> </table>+ <h3>Take 1, kept</h3>+ <p><b>loader-take1.html</b> is the earlier approach, kept as its own file: the orbital is cut+ to the mark per pixel (no seam line, no fins), the part outside the quadrant melts away,+ the outer edge is trimmed to the exact vector outline with antialiasing, and the flat+ mark is handed over inside the sit. Same parameters, with <b>ct</b> as the cut and+ <b>logo</b> as the flat overlay. It is a built snapshot: <code>tools/build-loader.py</code>+ regenerates <b>loader.html</b> (take 2) only.</p> </div> <script> /* The wiki parent listens for {type:'readme-height'} and resizes this iframe