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.0.19
7 files changed
+73−4
README.md+5−1@@ -58,6 +58,7 @@ state is rolled at every epoch. | 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 | | intro | 1 | 0 skips the teal logo intro |+| fps | off | cap the render rate for spinner duty (floor 20); 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 |@@ -81,7 +82,10 @@ the 286-point logomark vectors, the 128-sample edge profile, 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-nothing.+nothing. Spinner duty at 32x32 on a 240 Hz display, measured: one instance about+1 to 3% of a core, eight concurrent about 9%, eight capped at fps=30 about 2%+total, host page locked at 240 fps throughout; divide by four on 60 Hz; hidden+is exactly zero. Fidelity: tools/build-loader.py extracts the GLSL verbatim from the Babylon lab at build time (one source of truth), reproduces Babylon's left-handed matrices
SKILL.md+13@@ -88,6 +88,19 @@ Measured, not estimated, on the shipped build: - requestAnimationFrame pauses it completely when the tab is hidden: a backgrounded webview costs nothing. +## Spinner duty (use it as the brand spinner, measured cost)++Safe to use as the spinner everywhere, including a 32x32 corner of a progress+dialog. Measured at 32x32 on a 240 Hz display: one instance about 1 to 3% of a+single core; eight concurrent instances about 9% total; eight instances capped+with `?fps=30` about 2% total, and the host page held a locked 240 fps in every+case. On a 60 Hz display divide by four. It does not need to yield manually:+requestAnimationFrame schedules against vsync so the thread idles between+frames, and when the tab or webview is hidden rAF stops entirely, cost exactly+zero. For dialog spinners the recommended embed is+`loader.html?bg=transparent&fps=30` (fps floor is 20, below which motion would+slow); uncapped is also fine for a single spinner.+ ## Why raw WebGL and not Babylon or three.js A load screen plays while the real app is still fetching. Babylon.js is
loader.html+11@@ -32,6 +32,13 @@ var OV=Q.get('ov')!=='0', DO_INTRO=Q.get('intro')!=='0'; Implemented as camera distance, so perspective, the overlay match and the epoch glide all stay exact at any margin. */ var MARGIN=Math.max(0,Math.min(90,P('margin',0)));+/* fps: cap the render rate for spinner duty. rAF already yields the thread+ between frames and stops entirely when hidden; the cap multiplies that+ frugality (fps=30 on a 240 Hz display renders one frame in eight). The+ clock stays real-time; below 20 the dt clamp starts to slow the motion,+ so 20 is the floor. */+var FPSCAP=Math.max(0,P('fps',0)); if(FPSCAP>0&&FPSCAP<20)FPSCAP=20;+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,@@ -309,6 +316,10 @@ var INTRO={dark:0.9,logoIn:1.4,hold:0.5,reveal:1.2}; var inIntro=DO_INTRO, introT=0, t=DO_INTRO?0:eE, tEvo=0, rolled=false, last=performance.now(); function frame(now){+ 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; tEvo+=dt; var k,cheat,fill,teal,pinned=false,drawMesh=true;
package.json+1−1@@ -2,7 +2,7 @@ "slug": "orbital-lab", "title": "Orbital Lab", "type": "app",- "version": "1.0.18",+ "version": "1.0.19", "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.18",+ "version": "1.0.19", "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+17−1@@ -2680,6 +2680,13 @@ var OV=Q.get('ov')!=='0', DO_INTRO=Q.get('intro')! Implemented as camera distance, so perspective, the overlay match and the epoch glide all stay exact at any margin. */ var MARGIN=Math.max(0,Math.min(90,P('margin',0)));+/* fps: cap the render rate for spinner duty. rAF already yields the thread+ between frames and stops entirely when hidden; the cap multiplies that+ frugality (fps=30 on a 240 Hz display renders one frame in eight). The+ clock stays real-time; below 20 the dt clamp starts to slow the motion,+ so 20 is the floor. */+var FPSCAP=Math.max(0,P('fps',0)); if(FPSCAP>0&&FPSCAP<20)FPSCAP=20;+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,@@ -2957,6 +2964,10 @@ var INTRO={dark:0.9,logoIn:1.4,hold:0.5,reveal:1.2}; var inIntro=DO_INTRO, introT=0, t=DO_INTRO?0:eE, tEvo=0, rolled=false, last=performance.now(); function frame(now){+ 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; tEvo+=dt; var k,cheat,fill,teal,pinned=false,drawMesh=true;@@ -3194,7 +3205,11 @@ if (Q.get('interact')==='1' || window.__ADOM_LOADER_INTERACT 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- tab is hidden, so a backgrounded webview costs nothing.</p>+ tab is hidden, so a backgrounded webview costs nothing. Spinner duty, measured at+ 32x32 on a 240 Hz display: one instance costs about 1 to 3% of a single core, eight+ concurrent instances about 9%, and eight instances capped with <code>fps=30</code>+ about 2% total, all while the host page holds a locked 240 fps. On a 60 Hz machine+ divide by four. Hidden, the cost is exactly zero.</p> <h3>Fidelity guarantees</h3> <p>The loader is not a re-implementation of the look. <code>tools/build-loader.py</code> extracts the GLSL <b>verbatim</b> from the Babylon lab at build time (one source of@@ -3270,6 +3285,7 @@ if (Q.get('interact')==='1' || window.__ADOM_LOADER_INTERACT <tr><td>ov</td><td>1</td><td>0 makes the cheat 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>fps</td><td>off</td><td>cap the render rate for spinner duty (floor 20). rAF already yields between frames and stops when hidden; fps=30 renders one frame in eight on a 240 Hz display</td></tr> <tr><td>bg</td><td>0d1117</td><td>hex background, or <b>transparent</b> to composite over the container's own background (GL context runs with alpha). Also settable live by postMessage</td></tr> <tr><td>hint</td><td>0</td><td>1 shows the small "click to zoom" pill in armed contexts. Off by default: production stays pure. Armed contexts can also flip it live by postMessage</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. Zoom-in still brings it to the screen; zoom-out caps at 40% past the margined framing</td></tr>
spin-measure.htmladded+25@@ -0,0 +1,25 @@+<!DOCTYPE html>+<html><head><meta charset="UTF-8"><title>spinner cost</title>+<style>+ body{margin:0;background:#161b22;color:#e6edf3;font:12px monospace;padding:16px}+ .grid{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px}+ .cell{width:32px;height:32px}+ .cell iframe{width:32px;height:32px;border:0;background:transparent}+ #out{margin-top:14px;color:#00b8b0;white-space:pre}+</style></head>+<body>+<div>orbital loader at 32x32, N instances</div>+<div class="grid" id="grid"></div>+<div id="out">measuring...</div>+<script>+var N = parseInt(new URLSearchParams(location.search).get('n')||'1',10);+var FPS = new URLSearchParams(location.search).get('fps');+var grid=document.getElementById('grid');+for(var i=0;i<N;i++){+ var c=document.createElement('div'); c.className='cell';+ var f=document.createElement('iframe');+ f.src='loader.html?bg=transparent&intro=0'+(FPS?('&fps='+FPS):'');+ c.appendChild(f); grid.appendChild(c);+}+</script>+</body></html>