You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .copilot/instructions.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -341,7 +341,7 @@ When adding features that span multiple windows/displays:
341
341
342
342
These complement `.github/copilot-instructions.md` (treat that file as the detailed source of truth).
343
343
344
-
- **Renderers**: `js/webgl/` (GLSL + regl **temporarily**, vendored `lib/regl.min.js`) and `js/webgpu/` (WGSL). URL `renderer=regl` is a legacy alias for WebGL. Holoplay / Looking Glass is **WebGL-only** — see [RENDERING.md](../RENDERING.md), [HOLOPLAY.md](../HOLOPLAY.md), and [DEPENDENCY_POLICY.md](../DEPENDENCY_POLICY.md).
344
+
- **Renderers**: `js/webgl/` (GLSL + regl **temporarily**, vendored `lib/regl.min.js`) and `js/webgpu/` (WGSL). Experimental: `renderer=three` (`js/three-rain/`), `renderer=p5` (`js/p5-rain/`). URL `renderer=regl` is a legacy alias for WebGL. Holoplay / Looking Glass is **WebGL-only** — see [RENDERING.md](../RENDERING.md), [RENDERING_PIPELINE.md](../RENDERING_PIPELINE.md), [HOLOPLAY.md](../HOLOPLAY.md), and [DEPENDENCY_POLICY.md](../DEPENDENCY_POLICY.md).
345
345
- **Tests**: `npm test` runs Node tests + Playwright smoke tests; `npm run test:regression` is the full mode×effect matrix (slow). Failures on `[Matrix][WebGL]` console lines are intentional.
346
346
- **PWA cache names**: Not just `matrix-v{version}` — the service worker uses `matrix-sw-{scope}-v{VERSION}-{VER}`; `js/main.js` prints the matching string for debugging.
347
347
- **GLSL**: Shared uniforms must match precision across vertex/fragment stages on some GPUs (`uniform mediump float` where shared). Shader sources are loaded as static strings after fetch (avoid undefined `shaderSource`).
Copy file name to clipboardExpand all lines: DEPENDENCY_POLICY.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,10 @@ This repository ships as **static files** (no app bundler). Anything we add must
32
32
33
33
-**npm `three`** + vendored **`lib/three.module.js`** power **`js/three-rain/`** only when **`renderer=three`** or the **`mathcode_alphabet_three`** version preset. This path is **not** a replacement for the MSDF rain pipeline; see **[RENDERING_PIPELINE.md](RENDERING_PIPELINE.md)**.
34
34
35
+
## Experimental: `p5` (p5.js)
36
+
37
+
-**npm `p5`** + vendored **`lib/p5.min.js`** (browser UMD) power **`js/p5-rain/`** when **`renderer=p5`** or **`version=mathcode_p5`**. **LGPL-2.1** — review `node_modules/p5/license.txt` before redistributing modified bundles. Not MSDF / bloom parity; see **[RENDERING_PIPELINE.md](RENDERING_PIPELINE.md)**.
38
+
35
39
## Removed (policy-compliant cleanup)
36
40
37
41
-`**twgl`**: Was listed as a dependency and copied to `lib/twgl-full.module.js` but **was not imported** by any application module. It has been **removed** entirely to avoid shipping unused third-party code.
- 🔗 [HOLOPLAY.md](HOLOPLAY.md) — Looking Glass HoloPlay Service client, vendored `holoplay-core`, code map, and upgrade notes.
81
81
- 💡 **Philosophy**: Treat graphics as pure functions — given the same inputs, always produce the same output. Very Matrix-like in its deterministic perfection.
-[Mathcode mode — mathematical symbols and arrows (∑∆∇∞≠≈∈∉ ←→↑↓↔↕⇒⇔ ඞ)](https://ap0ught.github.io/matrix?version=mathcode)
32
32
-[Mathcode + Latin alphabet (experimental Three.js column split)](https://ap0ught.github.io/matrix?version=mathcode_alphabet_three) — see [RENDERING_PIPELINE.md](RENDERING_PIPELINE.md)
33
+
-[Mathcode via p5.js (experimental 2D canvas rain)](https://ap0ught.github.io/matrix?version=mathcode_p5) — see [RENDERING_PIPELINE.md](RENDERING_PIPELINE.md)
|**WebGPU**|`[js/webgpu/](js/webgpu/)`| WGSL + WebGPU |`renderer=webgpu` and `navigator.gpu` is available |
9
9
|**WebGL**|`[js/webgl/](js/webgl/)`| GLSL + WebGL1 (currently via [regl](https://www.npmjs.com/package/regl), copied to `lib/regl.min.js` — **temporary**, see [DEPENDENCY_POLICY.md](DEPENDENCY_POLICY.md)) | Default, or `renderer=webgl`, or legacy `renderer=regl`|
|**p5.js** (experimental) |`[js/p5-rain/](js/p5-rain/)`|[p5](https://www.npmjs.com/package/p5) → `lib/p5.min.js` (UMD); 2D canvas `text()` columns, mathcode glyph list |`renderer=p5` or preset **`version=mathcode_p5`**|
11
12
12
13
13
14
## Strategy
@@ -20,7 +21,8 @@ This project uses two browser graphics paths:
20
21
21
22
## Dependencies
22
23
23
-
-`**regl`** is the only WebGL runtime npm dependency; `npm install` / `npm ci` runs `[scripts/vendor-webgl-deps.mjs](scripts/vendor-webgl-deps.mjs)` to refresh `lib/regl.min.js`. Commit updated `lib/regl.min.js` when the lockfile changes so static hosts without `node_modules` stay consistent.
24
+
-`**regl**` — `postinstall` runs [`scripts/vendor-webgl-deps.mjs`](scripts/vendor-webgl-deps.mjs) → `lib/regl.min.js`. Commit when the lockfile changes for static hosting without `node_modules`.
25
+
-**`three`** / **`p5`** — optional experimental renderers; [`scripts/vendor-three.mjs`](scripts/vendor-three.mjs) and [`scripts/vendor-p5.mjs`](scripts/vendor-p5.mjs) copy their browser builds into `lib/`. Commit updated `lib/three.module.js` / `lib/p5.min.js` when those dependencies change.
Copy file name to clipboardExpand all lines: RENDERING_PIPELINE.md
+21-10Lines changed: 21 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# How rendering works today (and how the Three.js demo relates)
2
2
3
-
This document explains **what the main Matrix rain does on the GPU**, how **`regl` / WebGL** and **WebGPU** paths differ, and how the experimental **`renderer=three`**mode compares to rewriting the same effect in **Three.js**.
3
+
This document explains **what the main Matrix rain does on the GPU**, how **`regl` / WebGL** and **WebGPU** paths differ, and how the experimental **`renderer=three`**and **`renderer=p5`** demos compare to the full pipeline.
4
4
5
5
For stack overview and links to policy, see **[RENDERING.md](RENDERING.md)**. Looking Glass is **[HOLOPLAY.md](HOLOPLAY.md)**.
6
6
@@ -14,7 +14,8 @@ For stack overview and links to policy, see **[RENDERING.md](RENDERING.md)**. Lo
14
14
-**`webgpu`** — dynamic `import("./webgpu/main.js")` when `navigator.gpu` is available **and** the user asked for WebGPU.
15
15
-**`webgl`** (default, or legacy `renderer=regl`) — `import("./webgl/main.js")`.
16
16
-**`three`** — `import("./three-rain/main.js")` (**experimental** demo; see §5).
17
-
4. Holoplay forces **WebGL**; **`renderer=three`** is rejected when **`useHoloplay`** is true (same entry as WebGPU override).
17
+
-**`p5`** — `import("./p5-rain/main.js")` (**experimental** demo; see §6).
18
+
4. Holoplay forces **WebGL**; **`renderer=three`** and **`renderer=p5`** are ignored when **`useHoloplay`** is true (same override path as WebGPU).
18
19
19
20
Each renderer’s **`default`** export is an **`async (canvas, config) => { ... }`** that owns the animation loop and resize handling.
20
21
@@ -71,13 +72,23 @@ So Three is **not a drop-in replacement for regl** here: it replaces **low-level
| Holoplay | Supported | Not used | Not supported |
77
+
**Purpose:** A **p5.js** sketch in **instance mode** that draws **mathcode** Unicode glyphs (same ordered list as **`three-rain/glyphs.js`**) in falling columns using the **2D** renderer (`text()`, `HSL` fills). It is a **CPU / canvas 2D** path: no MSDF, no GPU simulation textures, no bloom or post stack.
82
78
83
-
Use the Three mode as a **learning / comparison** slice and for dependency experiments; use **WebGL/WebGPU** for the full Matrix experience.
79
+
**Entry:****`js/p5-rain/main.js`** — loads **`lib/p5.min.js`** (UMD from the **`p5`** npm package via **`scripts/vendor-p5.mjs`**), hides the Matrix WebGL canvas element, injects a fullscreen p5 canvas on `document.body`, and runs `new p5(sketch, document.body)`.
80
+
81
+
**Try it:**`?version=mathcode_p5` or `?renderer=p5&version=mathcode`.
|**regl** (npm) | WebGL command wrapper used by `js/webgl/`| Pinned in `package.json`; `postinstall` copies `dist/regl.min.js` to `lib/` via `scripts/vendor-webgl-deps.mjs`|[regl-project/regl](https://github.com/regl-project/regl)|**Exception:** upstream is effectively unmaintained. **Removal is required** per [migration_repl.md](migration_repl.md); tracked explicitly so it is not mistaken for a long-term choice. |
58
58
|**three** (npm) | Experimental `js/three-rain/` demo (mathcode + alphabet columns) | Pinned in `package.json`; `postinstall` copies `build/three.module.js` to `lib/` via `scripts/vendor-three.mjs`|[mrdoob/three.js](https://github.com/mrdoob/three.js)| Actively maintained. Used only when `renderer=three` or `version=mathcode_alphabet_three`. Not feature-parity with main rain — see [RENDERING_PIPELINE.md](RENDERING_PIPELINE.md). |
59
+
|**p5** (npm) | Experimental `js/p5-rain/` mathcode demo (2D `text()` rain) | Pinned in `package.json`; `postinstall` copies `lib/p5.min.js` via `scripts/vendor-p5.mjs`|[processing/p5.js](https://github.com/processing/p5.js)| Actively maintained by the Processing Foundation. **LGPL-2.1** (see package `license.txt`). Used only when `renderer=p5` or `version=mathcode_p5`. See [RENDERING_PIPELINE.md](RENDERING_PIPELINE.md). |
59
60
|**holoplay-core** (vendored) | WebSocket client to HoloPlay Service for Looking Glass calibration / quilt flow | Checked in as [`lib/holoplaycore.module.js`](lib/holoplaycore.module.js) (not an npm `dependency` today); loaded from [`js/webgl/lkgHelper.js`](js/webgl/lkgHelper.js)|[holoplay-core (npm)](https://www.npmjs.com/package/holoplay-core)| Vendor SDK: LGF-owned; npm still receives occasional releases. In-tree copy may lag npm (header shows **0.0.8**; verify against latest on npm when upgrading). License: see upstream **LICENSE.txt**; file also contains **MIT** CBOR. Details: [HOLOPLAY.md](HOLOPLAY.md). |
60
61
|**gl-matrix**| High-performance matrix and vector math | Bundled locally in `/lib/`|[toji/gl-matrix](https://github.com/toji/gl-matrix)| Actively maintained and widely adopted for WebGL/WebGPU math. Receives regular releases. The bundled version tracks a stable 3.x release of the library. |
61
62
|**@playwright/test**| End-to-end browser testing (dev only) | npm `devDependency` — **not included in production builds**|[microsoft/playwright](https://github.com/microsoft/playwright)| Very actively maintained by Microsoft with frequent releases and an extensive user base. This project pins a recent stable major version in its devDependencies. |
0 commit comments