@vib3code/sdk 2.0.1 → 2.0.3-canary.75a3290
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/DOCS/AGENT_HARNESS_ARCHITECTURE.md +243 -0
- package/DOCS/CLI_ONBOARDING.md +1 -1
- package/DOCS/CROSS_SITE_DESIGN_PATTERNS.md +117 -0
- package/DOCS/EPIC_SCROLL_EVENTS.md +773 -0
- package/DOCS/HANDOFF_LANDING_PAGE.md +154 -0
- package/DOCS/HANDOFF_SDK_DEVELOPMENT.md +493 -0
- package/DOCS/MULTIVIZ_CHOREOGRAPHY_PATTERNS.md +937 -0
- package/DOCS/PRODUCT_STRATEGY.md +63 -0
- package/DOCS/README.md +103 -0
- package/DOCS/REFERENCE_SCROLL_ANALYSIS.md +97 -0
- package/DOCS/ROADMAP.md +111 -0
- package/DOCS/SCROLL_TIMELINE_v3.md +269 -0
- package/DOCS/SITE_REFACTOR_PLAN.md +100 -0
- package/DOCS/STATUS.md +24 -0
- package/DOCS/SYSTEM_INVENTORY.md +33 -30
- package/DOCS/VISUAL_ANALYSIS_CLICKERSS.md +85 -0
- package/DOCS/VISUAL_ANALYSIS_FACETAD.md +133 -0
- package/DOCS/VISUAL_ANALYSIS_SIMONE.md +95 -0
- package/DOCS/VISUAL_ANALYSIS_TABLESIDE.md +86 -0
- package/DOCS/{BLUEPRINT_EXECUTION_PLAN_2026-01-07.md → archive/BLUEPRINT_EXECUTION_PLAN_2026-01-07.md} +1 -1
- package/DOCS/{DEV_TRACK_ANALYSIS.md → archive/DEV_TRACK_ANALYSIS.md} +3 -0
- package/DOCS/{SYSTEM_AUDIT_2026-01-30.md → archive/SYSTEM_AUDIT_2026-01-30.md} +3 -0
- package/DOCS/{DEV_TRACK_SESSION_2026-01-31.md → dev-tracks/DEV_TRACK_SESSION_2026-01-31.md} +1 -1
- package/DOCS/dev-tracks/DEV_TRACK_SESSION_2026-02-06.md +231 -0
- package/DOCS/dev-tracks/DEV_TRACK_SESSION_2026-02-13.md +127 -0
- package/DOCS/dev-tracks/DEV_TRACK_SESSION_2026-02-15.md +142 -0
- package/DOCS/dev-tracks/README.md +10 -0
- package/README.md +26 -13
- package/cpp/CMakeLists.txt +236 -0
- package/cpp/bindings/embind.cpp +269 -0
- package/cpp/build.sh +129 -0
- package/cpp/geometry/Crystal.cpp +103 -0
- package/cpp/geometry/Fractal.cpp +136 -0
- package/cpp/geometry/GeometryGenerator.cpp +262 -0
- package/cpp/geometry/KleinBottle.cpp +71 -0
- package/cpp/geometry/Sphere.cpp +134 -0
- package/cpp/geometry/Tesseract.cpp +94 -0
- package/cpp/geometry/Tetrahedron.cpp +83 -0
- package/cpp/geometry/Torus.cpp +65 -0
- package/cpp/geometry/WarpFunctions.cpp +238 -0
- package/cpp/geometry/Wave.cpp +85 -0
- package/cpp/include/vib3_ffi.h +238 -0
- package/cpp/math/Mat4x4.cpp +409 -0
- package/cpp/math/Mat4x4.hpp +209 -0
- package/cpp/math/Projection.cpp +142 -0
- package/cpp/math/Projection.hpp +148 -0
- package/cpp/math/Rotor4D.cpp +322 -0
- package/cpp/math/Rotor4D.hpp +204 -0
- package/cpp/math/Vec4.cpp +303 -0
- package/cpp/math/Vec4.hpp +225 -0
- package/cpp/src/vib3_ffi.cpp +607 -0
- package/cpp/tests/Geometry_test.cpp +213 -0
- package/cpp/tests/Mat4x4_test.cpp +494 -0
- package/cpp/tests/Projection_test.cpp +298 -0
- package/cpp/tests/Rotor4D_test.cpp +423 -0
- package/cpp/tests/Vec4_test.cpp +489 -0
- package/package.json +40 -27
- package/src/agent/index.js +1 -3
- package/src/agent/mcp/MCPServer.js +918 -0
- package/src/agent/mcp/index.js +1 -1
- package/src/agent/mcp/stdio-server.js +264 -0
- package/src/agent/mcp/tools.js +454 -0
- package/src/cli/index.js +374 -44
- package/src/core/CanvasManager.js +97 -204
- package/src/core/ErrorReporter.js +1 -1
- package/src/core/Parameters.js +1 -1
- package/src/core/VIB3Engine.js +93 -4
- package/src/core/VitalitySystem.js +53 -0
- package/src/core/index.js +18 -0
- package/src/core/renderers/FacetedRendererAdapter.js +10 -9
- package/src/core/renderers/HolographicRendererAdapter.js +13 -9
- package/src/core/renderers/QuantumRendererAdapter.js +11 -7
- package/src/creative/AestheticMapper.js +628 -0
- package/src/creative/ChoreographyPlayer.js +481 -0
- package/src/creative/index.js +11 -0
- package/src/export/TradingCardManager.js +3 -4
- package/src/export/index.js +11 -1
- package/src/faceted/FacetedSystem.js +241 -388
- package/src/holograms/HolographicVisualizer.js +29 -12
- package/src/holograms/RealHolographicSystem.js +194 -43
- package/src/math/index.js +7 -7
- package/src/polychora/PolychoraSystem.js +77 -0
- package/src/quantum/QuantumEngine.js +103 -66
- package/src/quantum/QuantumVisualizer.js +7 -2
- package/src/reactivity/index.js +3 -5
- package/src/render/LayerPresetManager.js +372 -0
- package/src/render/LayerReactivityBridge.js +344 -0
- package/src/render/LayerRelationshipGraph.js +610 -0
- package/src/render/MultiCanvasBridge.js +148 -25
- package/src/render/UnifiedRenderBridge.js +3 -0
- package/src/render/index.js +27 -2
- package/src/scene/index.js +4 -4
- package/src/shaders/faceted/faceted.frag.glsl +220 -80
- package/src/shaders/faceted/faceted.frag.wgsl +138 -97
- package/src/shaders/holographic/holographic.frag.glsl +28 -9
- package/src/shaders/holographic/holographic.frag.wgsl +107 -38
- package/src/shaders/quantum/quantum.frag.glsl +1 -0
- package/src/shaders/quantum/quantum.frag.wgsl +1 -1
- package/src/testing/ParallelTestFramework.js +2 -2
- package/src/viewer/GalleryUI.js +17 -0
- package/src/viewer/ViewerPortal.js +2 -2
- package/src/viewer/index.js +1 -1
- package/tools/headless-renderer.js +258 -0
- package/tools/shader-sync-verify.js +8 -4
- package/tools/site-analysis/all-reports.json +32 -0
- package/tools/site-analysis/combined-analysis.md +50 -0
- package/tools/site-analyzer.mjs +779 -0
- package/tools/visual-catalog/capture.js +276 -0
- package/tools/visual-catalog/composite.js +138 -0
- package/types/adaptive-sdk.d.ts +204 -5
- package/types/agent/cli.d.ts +78 -0
- package/types/agent/index.d.ts +18 -0
- package/types/agent/mcp.d.ts +87 -0
- package/types/agent/telemetry.d.ts +190 -0
- package/types/core/VIB3Engine.d.ts +26 -0
- package/types/core/index.d.ts +261 -0
- package/types/creative/AestheticMapper.d.ts +72 -0
- package/types/creative/ChoreographyPlayer.d.ts +96 -0
- package/types/creative/index.d.ts +17 -0
- package/types/export/index.d.ts +243 -0
- package/types/geometry/index.d.ts +164 -0
- package/types/math/index.d.ts +214 -0
- package/types/render/LayerPresetManager.d.ts +78 -0
- package/types/render/LayerReactivityBridge.d.ts +85 -0
- package/types/render/LayerRelationshipGraph.d.ts +174 -0
- package/types/render/index.d.ts +3 -0
- package/types/scene/index.d.ts +204 -0
- package/types/systems/index.d.ts +244 -0
- package/types/variations/index.d.ts +62 -0
- package/types/viewer/index.d.ts +225 -0
- /package/DOCS/{DEV_TRACK_PLAN_2026-01-07.md → archive/DEV_TRACK_PLAN_2026-01-07.md} +0 -0
- /package/DOCS/{SESSION_014_PLAN.md → archive/SESSION_014_PLAN.md} +0 -0
- /package/DOCS/{SESSION_LOG_2026-01-07.md → archive/SESSION_LOG_2026-01-07.md} +0 -0
- /package/DOCS/{STRATEGIC_BLUEPRINT_2026-01-07.md → archive/STRATEGIC_BLUEPRINT_2026-01-07.md} +0 -0
- /package/src/viewer/{ReactivityManager.js → ViewerInputHandler.js} +0 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# VIB3+ Landing Page & Marketing Handoff Prompt
|
|
2
|
+
|
|
3
|
+
**Copy this entire document as the initial prompt when starting a new session focused on the landing page, marketing site, and forward-facing aspects.**
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Context
|
|
8
|
+
|
|
9
|
+
You are continuing development on the **VIB3+ landing page** — the marketing/showcase site for the `@vib3code/sdk` npm package (a 4D visualization SDK). The landing page demonstrates the SDK's three rendering systems (Quantum, Faceted, Holographic) through an immersive scroll-driven experience with GSAP choreography.
|
|
10
|
+
|
|
11
|
+
**Repository:** `Domusgpt/vib34d-xr-quaternion-sdk`
|
|
12
|
+
**Landing page location:** `site/` directory (separated from SDK code as of 2026-02-13)
|
|
13
|
+
**Live URL:** GitHub Pages deploy from `docs/` + root
|
|
14
|
+
**Owner:** Clear Seas Solutions LLC / Paul Phillips
|
|
15
|
+
|
|
16
|
+
## Architecture
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
site/
|
|
20
|
+
├── index.html # Landing page (1977 lines, 9 scroll sections)
|
|
21
|
+
├── styles/
|
|
22
|
+
│ ├── overlay-accents.css # CSS-only accent overlays (gradient washes, mirrors, particles)
|
|
23
|
+
│ └── reveal-layers.css # Multi-layer parallax reveal system (NEW)
|
|
24
|
+
└── js/
|
|
25
|
+
├── main.js # Boot script — GPU context pool + section initialization
|
|
26
|
+
├── config.js # Section parameter presets (hero, morph stages, etc.)
|
|
27
|
+
├── adapters.js # SDK system adapters (Quantum/Holographic/Faceted + AmbientLattice)
|
|
28
|
+
├── ContextPool.js # WebGL context budget manager (max 3 concurrent)
|
|
29
|
+
├── CardTiltSystem.js # Mouse/touch → CSS 3D tilt + visualizer param mapping
|
|
30
|
+
├── choreography.js # Main GSAP ScrollTrigger choreography (83KB, all sections)
|
|
31
|
+
├── overlay-choreography.js # CSS accent overlays (gradient wash, mirror, glow, particles)
|
|
32
|
+
└── reveal-choreography.js # Multi-layer parallax reveal transitions (NEW)
|
|
33
|
+
|
|
34
|
+
Root SDK demo (separate):
|
|
35
|
+
├── index.html # Clean SDK demo with toolbar (NOT the landing page)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**CDN Dependencies:** Lenis smooth scroll, GSAP 3.12.5, ScrollTrigger 3.12.5 (loaded dynamically with 5s timeout fallback)
|
|
39
|
+
|
|
40
|
+
**SDK Imports:** `site/js/adapters.js` imports directly from `../src/` (Quantum, Holographic, Faceted engines). This is intentional since the site lives in the monorepo.
|
|
41
|
+
|
|
42
|
+
## Current Page Sections (9 total, ~3050vh scroll)
|
|
43
|
+
|
|
44
|
+
| Section | Height | GPU Contexts | Systems | Key Feature |
|
|
45
|
+
|---------|--------|--------------|---------|-------------|
|
|
46
|
+
| Opening Cinematic | 800vh | 1 | Quantum | SVG text mask ("VIB3CODE") + lattice parallax |
|
|
47
|
+
| Hero | 100vh | 1 | Quantum | Title reveal + badge |
|
|
48
|
+
| Morph Experience | 1200vh | 1 (swaps) | Q→H→F | 6-stage card morphing with system swaps |
|
|
49
|
+
| Playground | static | 1 | User choice | Full parameter control (all 6D rotation planes) |
|
|
50
|
+
| Triptych | 200vh | 3 | Q+H+F | 3-system split-screen simultaneous render |
|
|
51
|
+
| Geometry Cascade | 400vh | 2+C2D | Q+H bg | Horizontal scroll cards with geometry showcase |
|
|
52
|
+
| Energy Transfer | 250vh | 2 | Q bg + F card | Interactive sweep demo |
|
|
53
|
+
| Agent Integration | static | 1 | Holographic | Download packs (MCP, Claude, OpenAI) |
|
|
54
|
+
| CTA | 100vh | 2 | Q+F diagonal | Installation code + links |
|
|
55
|
+
|
|
56
|
+
**Total GPU budget:** Max 3 concurrent WebGL contexts. ContextPool auto-evicts oldest.
|
|
57
|
+
|
|
58
|
+
## What's Working
|
|
59
|
+
|
|
60
|
+
### Choreography Engine (choreography.js — 83KB)
|
|
61
|
+
- **Depth Illusion Engine** — gridDensity = distance metaphor + CSS scale/blur/shadow
|
|
62
|
+
- **6 Coordination Modes** — opposition, convergence, call-response, heartbeat, energy-conservation, crossfade
|
|
63
|
+
- **Mathematical parameter curves** — Lissajous rotation, sine interference, exponential ramps
|
|
64
|
+
- **Section-specific timelines** — Each section has a pinned ScrollTrigger with multi-phase choreography
|
|
65
|
+
- **System swaps** — Morph section smoothly transitions Q→H→F with flash effects
|
|
66
|
+
|
|
67
|
+
### Overlay System (overlay-choreography.js — 35KB)
|
|
68
|
+
- 5 accent systems: GradientWash, MirrorReflection, EdgeGlowRing, ParticleField, CrossfadeBridge
|
|
69
|
+
- Quaternion-to-CSS bridge (feeds 4D rotation to CSS custom properties)
|
|
70
|
+
- AccentChoreographer master controller
|
|
71
|
+
|
|
72
|
+
### NEW: Reveal Layer System (reveal-choreography.js + reveal-layers.css)
|
|
73
|
+
- **Replaces ugly SVG section dividers** with dynamic transitions
|
|
74
|
+
- **8 transition patterns:** Iris aperture, diagonal bars, column split, glass panel retraction, bezel bar criss-cross, checkerboard dissolve
|
|
75
|
+
- **Persistent parallax field** — Subtle geometric depth texture at 0.3x scroll speed
|
|
76
|
+
- **Floating glassmorphic accent strips** — 3 colored lines at different parallax rates
|
|
77
|
+
- **Glow lines** — Luminous accent lines at section boundaries (replace SVG curves)
|
|
78
|
+
- **Section edge blending** — CSS gradient fades at section top/bottom (replace hard seams)
|
|
79
|
+
|
|
80
|
+
## Known Issues & Priorities
|
|
81
|
+
|
|
82
|
+
### HIGH PRIORITY — Visual Quality
|
|
83
|
+
1. **Rectangular layout problem** — Despite excellent choreography math, everything is constrained to rectangular cards. Need organic shapes (SVG blob paths, fluid bezier boundaries, non-rectilinear clip-paths).
|
|
84
|
+
2. **Predictable symmetry** — Triptych is perfect 33/33/33, CTA is 50/50 diagonal, energy is centered. Need asymmetry and visual tension.
|
|
85
|
+
3. **Universal accent treatment** — Every card gets the same vignette+shadow+glow+chroma. Differentiate: some sections should get unique treatments while others stay minimal.
|
|
86
|
+
4. **Mobile experience** — 3050vh total scroll on mobile is excessive. Canvas count should drop to 1 concurrent. Cascade horizontal scroll breaks at small viewports (6 cards at 88vw).
|
|
87
|
+
|
|
88
|
+
### MEDIUM PRIORITY — Functionality
|
|
89
|
+
5. **AmbientLattice anti-pattern** — 580-line Canvas2D renderer in adapters.js duplicates SDK geometry. Should use SDK's FacetedSystem with reduced GPU overhead instead.
|
|
90
|
+
6. **No audio demo** — Audio reactivity is a key SDK feature but not demonstrated anywhere on the landing page. Add a toggle or auto-detect section.
|
|
91
|
+
7. **No SpatialInput demo** — Device tilt/gyroscope is a selling point but not shown. Consider a "tilt your phone" section.
|
|
92
|
+
8. **Agent section download links** — Point to `agent-config/` which may not exist in the site/ directory. Verify paths.
|
|
93
|
+
|
|
94
|
+
### LOW PRIORITY — Polish
|
|
95
|
+
9. **Performance profiling** — Mirror/MultiInstance overlays copy canvases via 2D context (CPU-bound). Profile on low-end devices.
|
|
96
|
+
10. **Accessibility** — Many decorative elements lack `aria-hidden`. Heading hierarchy has duplicate `<h1>`. Keyboard navigation untested.
|
|
97
|
+
11. **Cascade card clip-path morphing** — The 8-point polygon system (rect/hex/diamond/oct) is clever but all shapes share the same bounding box. More dramatic shape variation needed.
|
|
98
|
+
|
|
99
|
+
## GSAP Pattern Reference (From Visual Codex)
|
|
100
|
+
|
|
101
|
+
These patterns were studied and should inform future development:
|
|
102
|
+
|
|
103
|
+
### Stagger Patterns
|
|
104
|
+
- `from: "center"` with elastic easing for outward reveals
|
|
105
|
+
- Grid-based: `stagger: { grid: [rows, cols], from: "edges", amount: 1.2 }`
|
|
106
|
+
- Function-based: `each: (i) => i * 0.05 + Math.random() * 0.1`
|
|
107
|
+
|
|
108
|
+
### 3D Transforms
|
|
109
|
+
- Z-depth emergence: `fromTo(el, { z: -500, scale: 0 }, { z: 0, scale: 1 })`
|
|
110
|
+
- Multi-axis spin: `{ rotationX: 720, rotationY: 540, rotationZ: 360 }` with elastic
|
|
111
|
+
- `perspective: 1000px` on body, `transform-style: preserve-3d` on containers
|
|
112
|
+
|
|
113
|
+
### Filter/Blur
|
|
114
|
+
- Progressive blur reveal: `fromTo(el, { filter: "blur(20px)" }, { filter: "blur(0px)" })`
|
|
115
|
+
- Layered blur stack: 3 layers at different blur levels, stagger `"<0.2"` relative timing
|
|
116
|
+
- Glassmorphism: `backdrop-filter: blur(20px)` on panels
|
|
117
|
+
|
|
118
|
+
### Multi-Visualizer Choreography
|
|
119
|
+
- 5-phase scroll modes: Intro→Grid→Carousel→Expand→Finale
|
|
120
|
+
- Impulse system: `targets.impulse = Math.min(targets.impulse + intensity, 1.5)`, decays at 92%/frame
|
|
121
|
+
- Scrub smoothing: `scrub: 0.3` (300ms delay)
|
|
122
|
+
|
|
123
|
+
## Design Direction
|
|
124
|
+
|
|
125
|
+
The current page has **world-class mathematical choreography** trapped in a **rigid rectangular grid**. The goal is to break free with:
|
|
126
|
+
|
|
127
|
+
1. **Multiple parallax layers** — Not just 2. Different areas should have different layer counts and behaviors (columns in one area, concentric iris in another, diagonal bars in a third).
|
|
128
|
+
2. **Negative space** — Solid layers with cutouts that reveal visualizers. The visualizers shine THROUGH the design, not inside rectangular boxes.
|
|
129
|
+
3. **Organic boundaries** — SVG blob paths, fluid beziers, non-rectangular clip-paths. Nothing should be a perfect rectangle.
|
|
130
|
+
4. **Asymmetrical compositions** — Break the grid. Unequal column widths, off-center elements, visual tension.
|
|
131
|
+
5. **Varied visual vocabulary** — Not every section needs every effect. Some should be minimal and clean, others dramatic and layered.
|
|
132
|
+
6. **Glass morphism as a design language** — Frosted glass panels that slide, morph, and shatter to reveal content.
|
|
133
|
+
|
|
134
|
+
## Commands
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
# From project root:
|
|
138
|
+
pnpm dev # Opens dev server (default: docs gallery)
|
|
139
|
+
# Then navigate to /site/index.html for landing page
|
|
140
|
+
# Or / for SDK demo
|
|
141
|
+
|
|
142
|
+
# To verify no SDK regressions:
|
|
143
|
+
pnpm test
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Session Instructions
|
|
147
|
+
|
|
148
|
+
1. Read `site/index.html` for the full HTML structure
|
|
149
|
+
2. Read `site/js/choreography.js` for the existing scroll timeline (it's 83KB — skim the section-level functions)
|
|
150
|
+
3. Read `site/js/reveal-choreography.js` for the new overlay layer system
|
|
151
|
+
4. **Do not break existing choreography** — the new system layers ON TOP
|
|
152
|
+
5. Test in browser after changes — the page relies on CDN-loaded GSAP
|
|
153
|
+
6. Focus on the visual quality issues listed above
|
|
154
|
+
7. Use the GSAP pattern reference for implementation guidance
|
|
@@ -0,0 +1,493 @@
|
|
|
1
|
+
# VIB3+ SDK — Comprehensive Agent Handoff
|
|
2
|
+
|
|
3
|
+
**Copy this entire document as the initial prompt when starting a new session focused on SDK development.**
|
|
4
|
+
|
|
5
|
+
Last updated: 2026-02-13
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. What VIB3+ Actually Is
|
|
10
|
+
|
|
11
|
+
VIB3+ is a **programmable 4D visualization SDK** — a JavaScript library that renders interactive, audio-reactive visualizations of four-dimensional geometry in real-time on the web.
|
|
12
|
+
|
|
13
|
+
The core idea: objects in four spatial dimensions (X, Y, Z, W) are mathematically rotated using six independent rotation planes, then projected down to 3D and rendered on-screen. This produces visual effects that are impossible to achieve with standard 3D graphics — objects that fold through themselves, invert, breathe, and transform in ways that feel alien and captivating.
|
|
14
|
+
|
|
15
|
+
It's not a toy or a demo. It's an SDK intended for production use — with framework adapters (React, Vue, Svelte), creative tools (color presets, post-processing, BPM-synced timelines), platform integrations (Figma, Three.js, TouchDesigner, OBS), advanced features (WebXR, MIDI, AI presets), and an agentic control layer (MCP server with 19 tools, CLI).
|
|
16
|
+
|
|
17
|
+
**Repository**: `Domusgpt/vib34d-xr-quaternion-sdk`
|
|
18
|
+
**Package**: `@vib3code/sdk` v2.0.3 (published on npm)
|
|
19
|
+
**Owner**: Clear Seas Solutions LLC / Paul Phillips (pallasite)
|
|
20
|
+
**License**: MIT (open-core — see `DOCS/LICENSING_TIERS.md` for commercial tier plans)
|
|
21
|
+
**Stack**: ES Modules, Vite, pnpm, Vitest, Playwright, C++ WASM (Emscripten)
|
|
22
|
+
|
|
23
|
+
### Why It Exists
|
|
24
|
+
|
|
25
|
+
Paul's vision: a **visual engine for the fourth dimension** that anyone can embed, control, and ship with. The differentiation vs. standard WebGL demos:
|
|
26
|
+
|
|
27
|
+
1. **Unified mathematical model** — Not one-off shader toys. A coherent 6D rotation system backed by Clifford algebra that works identically across WASM, GLSL, and WGSL.
|
|
28
|
+
2. **Multiple rendering aesthetics** — Three visual systems (Quantum, Faceted, Holographic) that share the same geometry/rotation math but produce completely different visual outputs.
|
|
29
|
+
3. **Production SDK structure** — Real npm package with 80+ export paths, TypeScript types, framework components, CI/CD, versioning, changelogs.
|
|
30
|
+
4. **Agent-first operability** — MCP server, CLI, telemetry. AI agents can create, tune, and operate visualizations programmatically.
|
|
31
|
+
5. **Breadth of integration** — Figma plugin, Three.js material, TouchDesigner export, OBS mode, WebXR, MIDI. It meets creators where they already work.
|
|
32
|
+
|
|
33
|
+
### Who Uses It
|
|
34
|
+
|
|
35
|
+
| Persona | What they care about |
|
|
36
|
+
|---|---|
|
|
37
|
+
| **Creative developers** | Shipping differentiated visual experiences — landing pages, dashboards, interactive art. They want stable APIs, fast iteration, framework adapters. |
|
|
38
|
+
| **Technical artists / VJs** | Driving visuals via presets, timelines, audio reactivity, and MIDI for live performance. They want rich control and real-time feedback. |
|
|
39
|
+
| **Product teams** | Embedding performant, controllable visualizations into production apps. They want clear lifecycle models, testability, long-term compatibility. |
|
|
40
|
+
| **AI/agent builders** | Automating scene generation, tuning, and operation. They want MCP tools, CLI, machine-readable schemas, guardrails. |
|
|
41
|
+
| **XR teams** | Extending 4D visuals into VR/AR. They want GPU-aware architecture, input abstraction, spatial rendering paths. |
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## 2. The Three Visualization Systems — What They Actually Are
|
|
46
|
+
|
|
47
|
+
This is the heart of VIB3+. Each system takes the same 24 geometries and 6D rotation math but renders them with a fundamentally different aesthetic and technical approach. Understanding what makes each one visually distinct is critical for anyone working on the project.
|
|
48
|
+
|
|
49
|
+
### Quantum System (`src/quantum/`)
|
|
50
|
+
|
|
51
|
+
**Files**: `QuantumEngine.js` (system manager), `QuantumVisualizer.js` (WebGL renderer)
|
|
52
|
+
|
|
53
|
+
**Visual character**: Dense, complex, scientific. Think crystalline lattices, energy field interference patterns, particle grids pulsing with life. This is the system that looks most like looking through a microscope at something alien.
|
|
54
|
+
|
|
55
|
+
**Technical approach**: Single procedural fragment shader running entirely on the GPU. Every pixel is computed mathematically from the rotation state, geometry type, and time. No mesh geometry — it's all raymarching and distance field math in the shader. This makes it incredibly flexible but means the visual complexity is bounded by fragment shader performance.
|
|
56
|
+
|
|
57
|
+
**When you'd choose Quantum**: Abstract backgrounds, scientific visualizations, anything where visual density and complexity are assets. It's the most "impressive at first glance" system.
|
|
58
|
+
|
|
59
|
+
**Audio reactivity**: Bass drives density pulsing, mid drives color shift, high drives edge definition. All wired through shader uniforms.
|
|
60
|
+
|
|
61
|
+
### Faceted System (`src/faceted/`)
|
|
62
|
+
|
|
63
|
+
**File**: `FacetedSystem.js` (complete system — shader and rendering in one file)
|
|
64
|
+
|
|
65
|
+
**Visual character**: Clean, precise, geometric. Think kaleidoscopic symmetry, sacred geometry tiles, wireframe patterns with perfect edges. Where Quantum feels organic and noisy, Faceted feels designed and intentional.
|
|
66
|
+
|
|
67
|
+
**Technical approach**: Also a procedural fragment shader, but the geometry functions produce clean 2D patterns projected from 4D rotation rather than 3D volumetric effects. Uses HSL color pipeline with full hue + saturation control — this was a v2.0.0 fix (originally missing saturation).
|
|
68
|
+
|
|
69
|
+
**When you'd choose Faceted**: UI elements, design-forward applications, polished product surfaces, anywhere clarity and elegance matter more than visual density. Also the best system for demonstrating how 4D rotation works — the 2D patterns make the dimensional folding intuitive.
|
|
70
|
+
|
|
71
|
+
**Audio reactivity**: Bass modulates density, mid modulates morph factor, high shifts hue. Click intensity provides interaction feedback. All wired via shader uniforms (this was also a v2.0.0 fix — audio was originally unwired).
|
|
72
|
+
|
|
73
|
+
### Holographic System (`src/holograms/`)
|
|
74
|
+
|
|
75
|
+
**Files**: `RealHolographicSystem.js` (system manager, 652 LOC), `HolographicVisualizer.js` (per-layer renderer)
|
|
76
|
+
|
|
77
|
+
**IMPORTANT**: The class name is `RealHolographicSystem`. Not `HolographicSystem`. This trips people up constantly.
|
|
78
|
+
|
|
79
|
+
**Visual character**: Layered, atmospheric, immersive. Think holographic trading cards, glassmorphic interfaces, aurora-like effects with depth and transparency. This is the system that feels most like holding a physical holographic object.
|
|
80
|
+
|
|
81
|
+
**Technical approach**: The key differentiator — a **5-layer canvas stack** where each layer has its own `HolographicVisualizer` instance with independent parameters:
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
background-canvas — Base layer, lowest opacity, sets the scene
|
|
85
|
+
shadow-canvas — Depth/shadow effects, creates perceived volume
|
|
86
|
+
content-canvas — Primary visual content, the main show
|
|
87
|
+
highlight-canvas — Bright accents that pop above the content
|
|
88
|
+
accent-canvas — Top layer effects, sparkle and shimmer
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Each layer gets per-layer uniforms (`u_layerScale`, `u_layerOpacity`, `u_layerColor`, `u_densityMult`, `u_speedMult`) on top of the standard parameter set. The layers composite with CSS opacity to create the glassmorphic depth effect.
|
|
92
|
+
|
|
93
|
+
**Audio reactivity**: Native microphone input. Beat detection on bass, melody detection on mid/high. Per-layer reactivity multipliers — so bass can punch the background while melody sparkles the accent layer.
|
|
94
|
+
|
|
95
|
+
**When you'd choose Holographic**: Trading card effects, immersive backgrounds, music visualizers, anything where depth and atmosphere matter. It's the most "physical feeling" system.
|
|
96
|
+
|
|
97
|
+
### Polychora (NOT ACTIVE)
|
|
98
|
+
|
|
99
|
+
Planned fourth system for rendering true 4D polytopes (5-cell, tesseract as wireframe, 16-cell, 24-cell, 600-cell, 120-cell). Files are archived in `archive/polychora/`. The 1,065-line system stub exists but is **not production-ready, not enabled in UI, and should not be built against**. It's a future roadmap item.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## 3. Core Mathematical Architecture
|
|
104
|
+
|
|
105
|
+
### The 24 Geometry System
|
|
106
|
+
|
|
107
|
+
Every visualization system renders 24 geometry variants. The encoding is:
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
geometry_index = core_type * 8 + base_geometry
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**8 base geometries** (index 0-7):
|
|
114
|
+
| Index | Name | What it looks like |
|
|
115
|
+
|---|---|---|
|
|
116
|
+
| 0 | Tetrahedron | Sharp, minimal — the simplest 3D solid extended to 4D |
|
|
117
|
+
| 1 | Hypercube | The iconic tesseract — a cube within a cube, 16 vertices, 32 edges |
|
|
118
|
+
| 2 | Sphere | Smooth, radial harmonics — a hypersphere projected down |
|
|
119
|
+
| 3 | Torus | Donut topology — continuous surface that wraps |
|
|
120
|
+
| 4 | Klein Bottle | Non-orientable — a surface that passes through itself (4D required!) |
|
|
121
|
+
| 5 | Fractal | Self-similar recursive subdivision — infinite detail at every scale |
|
|
122
|
+
| 6 | Wave | Sinusoidal interference — multiple waves interacting |
|
|
123
|
+
| 7 | Crystal | Octahedral lattice — geometric precision, sharp facets |
|
|
124
|
+
|
|
125
|
+
**3 core warps** that modify each base:
|
|
126
|
+
| Core | Index Range | What it does |
|
|
127
|
+
|---|---|---|
|
|
128
|
+
| Base (0) | 0-7 | Pure geometry, no warp |
|
|
129
|
+
| Hypersphere (1) | 8-15 | Wraps the geometry onto a 3-sphere (S3) using stereographic-like projection. Creates toroidal structures via Hopf fibration. |
|
|
130
|
+
| Hypertetrahedron (2) | 16-23 | Warps the geometry onto a pentatope (5-cell). Points cluster near pentatope vertices and edges, creating a tetrahedral skeleton. |
|
|
131
|
+
|
|
132
|
+
The warp functions live in `src/geometry/HypersphereCore.js` and `src/geometry/HypertetraCore.js`.
|
|
133
|
+
|
|
134
|
+
### The 6D Rotation System
|
|
135
|
+
|
|
136
|
+
This is mathematically the most important part of VIB3+. In 4D space, there are six independent rotation planes (not three like in 3D):
|
|
137
|
+
|
|
138
|
+
| Plane | Type | Intuitive effect |
|
|
139
|
+
|---|---|---|
|
|
140
|
+
| XY | 3D | Familiar rotation around Z axis |
|
|
141
|
+
| XZ | 3D | Familiar rotation around Y axis |
|
|
142
|
+
| YZ | 3D | Familiar rotation around X axis |
|
|
143
|
+
| XW | 4D | Rotates X into the fourth dimension — objects appear to stretch/compress in X |
|
|
144
|
+
| YW | 4D | Rotates Y into the fourth dimension |
|
|
145
|
+
| ZW | 4D | Rotates Z into the fourth dimension |
|
|
146
|
+
|
|
147
|
+
**Application order MATTERS**: XY, XZ, YZ, XW, YW, ZW. Rotation is not commutative in 4D. Changing the order produces different results. This is enforced in all three implementations:
|
|
148
|
+
|
|
149
|
+
1. **C++ WASM rotors** (`cpp/Rotor4D.cpp`): Uses Clifford algebra Cl(4,0). Mathematically exact. The "ground truth" implementation. An 8-component rotor (scalar + 6 bivectors + pseudoscalar) represents the rotation, applied via the sandwich product `v' = R * v * R_dagger`.
|
|
150
|
+
|
|
151
|
+
2. **GLSL matrices** (inline in visualizer `.js` files): GPU-accelerated, computed per-pixel in fragment shaders. Six 4x4 rotation matrices multiplied together. This is what actually renders on screen.
|
|
152
|
+
|
|
153
|
+
3. **WGSL matrices** (WebGPU path): Same math as GLSL but in WGSL syntax for the WebGPU backend.
|
|
154
|
+
|
|
155
|
+
All three must produce identical results. If they disagree, you have a bug.
|
|
156
|
+
|
|
157
|
+
### 4D to 3D Projection
|
|
158
|
+
|
|
159
|
+
After rotation, 4D points must be projected to 3D for display:
|
|
160
|
+
|
|
161
|
+
- **Perspective** (default): `P = xyz / (distance - w)`. The `dimension` parameter (3.0-4.5) controls the projection distance. Lower values = more dramatic distortion.
|
|
162
|
+
- **Stereographic**: `P = xyz / (1 - w)`. Conformal — preserves angles. Produces smoother deformations.
|
|
163
|
+
- **Orthographic**: `P = xyz`. Just drops W. Parallel projection — no foreshortening.
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## 4. Development History & Arc
|
|
168
|
+
|
|
169
|
+
Understanding where the project has been is essential for knowing where it's going.
|
|
170
|
+
|
|
171
|
+
### Phase 1-3: Foundation (pre-2026)
|
|
172
|
+
The core engine was built: 3 visualization systems, 24 geometry encoding, 6D rotation with WASM + GLSL, MCP agent tools, CLI, telemetry. This was ~60K lines of working code.
|
|
173
|
+
|
|
174
|
+
### Phase A: Parity & Polish (v2.0.0)
|
|
175
|
+
Fixed critical gaps discovered in audit:
|
|
176
|
+
- Quantum system had no color control — added
|
|
177
|
+
- Faceted system was missing saturation control and audio reactivity — added `hsl2rgb()` pipeline + bass/mid/high uniforms
|
|
178
|
+
- `clickIntensity` was mapped to wrong uniform — fixed
|
|
179
|
+
- Inline shaders could drift from external files — created `shader-sync-verify.js` tool (937 lines)
|
|
180
|
+
|
|
181
|
+
### Phase B-D: Feature Expansion (v2.0.0)
|
|
182
|
+
Added four major capability layers:
|
|
183
|
+
- **Creative Tooling** (`src/creative/`): 22 color presets, 14 easing functions, 14 post-processing effects, BPM-synced parameter timeline
|
|
184
|
+
- **Platform Integrations** (`src/integrations/`): React/Vue/Svelte components, Figma plugin generator, Three.js ShaderMaterial, TouchDesigner GLSL export, OBS transparent mode
|
|
185
|
+
- **Advanced Features** (`src/advanced/`): WebXR 6DOF renderer, WebGPU compute shaders, MIDI controller with learn mode, AI preset generator, OffscreenCanvas worker
|
|
186
|
+
- **SpatialInputSystem** (`src/reactivity/SpatialInputSystem.js`): Universal spatial input with 8 sources and 6 profiles
|
|
187
|
+
|
|
188
|
+
### January 31, 2026: Master Plan Execution
|
|
189
|
+
Full 570-file codebase audit revealed:
|
|
190
|
+
- 14 broken package exports (quaternion, pose, sensors etc. referencing nonexistent files) — removed
|
|
191
|
+
- No LICENSE file — created MIT
|
|
192
|
+
- No CHANGELOG — created
|
|
193
|
+
- No TypeScript barrel — created `types/adaptive-sdk.d.ts`
|
|
194
|
+
- No CI publish workflow — created
|
|
195
|
+
- `npm run dev` alias missing — added
|
|
196
|
+
- Created landing page, CLI `init` command, React/Vanilla/Three.js examples, Storybook config, cross-browser Playwright, accessibility CSS, WASM build CI, OBS setup guide, CONTRIBUTING.md, SECURITY.md, ErrorReporter
|
|
197
|
+
|
|
198
|
+
**Result**: 43 action items across 6 execution phases, ~25 files created.
|
|
199
|
+
|
|
200
|
+
### February 6, 2026: Hygiene + MCP + Landing Page
|
|
201
|
+
Two-phase session:
|
|
202
|
+
|
|
203
|
+
**Phase A (Hygiene)**:
|
|
204
|
+
- `CanvasManager.js` completely rewritten (217 to 110 lines) — API contract was broken against VIB3Engine
|
|
205
|
+
- `HolographicRendererAdapter.js` import was broken — fixed
|
|
206
|
+
- `TradingCardManager.js` had broken import paths — fixed
|
|
207
|
+
- External shader files missing `u_breath` uniform — synced across 4 shader files
|
|
208
|
+
- Version strings unified to 2.0.1 across all 4 locations
|
|
209
|
+
- `ViewerInputHandler.js` renamed from `ReactivityManager` (the viewer one, not the reactivity one)
|
|
210
|
+
- Stale `package-lock.json` removed (240KB)
|
|
211
|
+
|
|
212
|
+
**Phase B (Infrastructure)**:
|
|
213
|
+
- FacetedSystem RendererContract compliance (added `init()`, `resize()`, `dispose()`)
|
|
214
|
+
- HolographicVisualizer breath desync bug fixed
|
|
215
|
+
- Real MCP server created (`stdio-server.js`, 230 lines) — JSON-RPC 2.0 over stdio
|
|
216
|
+
- Agent documentation packs created (Claude + OpenAI configs)
|
|
217
|
+
- Enhanced landing page (`index-v2.html`, 2100+ lines)
|
|
218
|
+
- Test count: 933/933 passing
|
|
219
|
+
|
|
220
|
+
### February 13, 2026: Site Refactor + Documentation Overhaul
|
|
221
|
+
- Separated landing page into `site/` directory
|
|
222
|
+
- Extracted 1,318 lines of inline CSS to `site/styles/main.css`
|
|
223
|
+
- Updated hero/messaging to emphasize C++ WASM core, WebGPU, TypeScript, MCP
|
|
224
|
+
- Created product strategy, roadmap, system inventory, documentation index
|
|
225
|
+
- Root `index.html` now redirects to `site/index.html`; SDK demo moved to `demo/index.html`
|
|
226
|
+
- Rewrote `CLAUDE.md` from raw technical dump to proper project brief
|
|
227
|
+
- Rewrote this handoff document from skeleton to comprehensive reference
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## 5. Current State — Honest Assessment
|
|
232
|
+
|
|
233
|
+
### What Works Well
|
|
234
|
+
- **Core rendering pipeline**: All three systems render correctly. 24 geometries work. 6D rotation works.
|
|
235
|
+
- **Math foundation**: WASM rotors and JS fallback produce correct results. Projections are solid.
|
|
236
|
+
- **Test suite**: 933+ unit tests passing across 43 files. Math, render, geometry, scene, agent/telemetry all covered.
|
|
237
|
+
- **69 E2E tests**: Playwright browser tests running.
|
|
238
|
+
- **MCP server**: Real JSON-RPC 2.0 implementation with 19 tools and 4 documentation resources.
|
|
239
|
+
- **npm package**: Published and installable. 80+ export paths.
|
|
240
|
+
- **CI/CD**: 9 GitHub Actions workflows including auto-publish, WASM build, Pages deploy.
|
|
241
|
+
- **Shader sync tooling**: `shader-sync-verify.js` catches inline/external drift.
|
|
242
|
+
|
|
243
|
+
### What's Incomplete or Fragile
|
|
244
|
+
- **TypeScript types**: `types/adaptive-sdk.d.ts` is a basic barrel. Most v2.0 modules (creative, integrations, advanced, SpatialInput) have NO type definitions. IDE experience is poor for ~15,500 lines of new code.
|
|
245
|
+
- **WebGPU backend**: Scaffold exists (adapter, device, clear pass). Missing: pipeline creation, WGSL shader compilation, buffer binding, feature gating. WebGL is the tested path.
|
|
246
|
+
- **RendererContract compliance**: Not all systems fully implement the contract interface. FacetedSystem got `init()/resize()/dispose()` in Feb 2026 but compliance is inconsistent.
|
|
247
|
+
- **Test coverage for v2.0 modules**: 18 modules totaling ~15,500 lines have ZERO tests. Creative, integrations, advanced, SpatialInput, shader-sync-verify — all untested.
|
|
248
|
+
- **Polychora**: 1,065-line stub that's not production-ready. Decision needed: implement or remove.
|
|
249
|
+
|
|
250
|
+
### What's Aspirational (Described But Not Built)
|
|
251
|
+
- **Licensing/activation system**: Detailed tier/pricing/flow/schema defined in `DOCS/LICENSING_TIERS.md`. Zero implementation. No `LicenseManager`, `FeatureGate`, or server.
|
|
252
|
+
- **Figma Community publish**: Plugin code generator exists. Plugin is not published.
|
|
253
|
+
- **API documentation site**: No generated docs. JSDoc exists in source but no Docusaurus/TypeDoc pipeline.
|
|
254
|
+
- **Gallery web app**: Static gallery of HTML pages exists. No shareable permalinks, embed codes, or user-created presets.
|
|
255
|
+
- **Performance benchmarks as CI gates**: Benchmark runner exists. No threshold assertions. Benchmarks don't fail CI on regression.
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## 6. Current Priorities (Q1-Q2 2026)
|
|
260
|
+
|
|
261
|
+
### Q1 2026 — Shipping Now
|
|
262
|
+
| Milestone | Status | What it means |
|
|
263
|
+
|---|---|---|
|
|
264
|
+
| Stabilize core rendering + lifecycle contracts | In Progress | Harden RendererContract, fix edge cases in system switching, ensure destroy/dispose paths are clean |
|
|
265
|
+
| MCP/agent integration hardening | In Progress | Make the 19 MCP tools robust, improve error handling, add validation |
|
|
266
|
+
| Eliminate export + packaging regressions | Done | Broken exports removed, package.json cleaned up |
|
|
267
|
+
|
|
268
|
+
### Q2 2026 — Next
|
|
269
|
+
| Milestone | Status | Blocked by |
|
|
270
|
+
|---|---|---|
|
|
271
|
+
| Advanced viz subsystem parity (WebGPU, XR) | Planned | WebGPU backend completion |
|
|
272
|
+
| Cross-platform SDK examples refresh | Planned | Framework adapter stabilization |
|
|
273
|
+
| Observability + telemetry baseline | Blocked | Telemetry pipeline architecture decisions |
|
|
274
|
+
|
|
275
|
+
### The Honest Priority Stack
|
|
276
|
+
1. **Test coverage for critical path** — VIB3Engine.js, CanvasManager.js, system switching, 6D rotation end-to-end
|
|
277
|
+
2. **TypeScript types** — The main entry point's types field works but most modules have no types
|
|
278
|
+
3. **WebGPU backend** — Scaffold to real pipeline. This is the performance differentiator.
|
|
279
|
+
4. **Landing page quality** — Currently functional but visually rigid (see `DOCS/HANDOFF_LANDING_PAGE.md` for the full breakdown)
|
|
280
|
+
5. **Test coverage for v2.0 modules** — 18 modules at 0%. Not blocking launch but blocking confidence.
|
|
281
|
+
|
|
282
|
+
See `DOCS/ROADMAP.md` for the full quarterly milestone plan with owner assignments and evidence links.
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
## 7. Architecture Details That Matter
|
|
287
|
+
|
|
288
|
+
### File Structure
|
|
289
|
+
```
|
|
290
|
+
/
|
|
291
|
+
├── src/ # SDK source (~95K lines)
|
|
292
|
+
│ ├── core/ # Engine orchestration
|
|
293
|
+
│ │ ├── VIB3Engine.js # THE main file. System switching, params, canvas, spatial input.
|
|
294
|
+
│ │ ├── CanvasManager.js # 5-layer canvas lifecycle (rewritten Feb 2026)
|
|
295
|
+
│ │ ├── Parameters.js # Parameter definitions and validation
|
|
296
|
+
│ │ ├── ParameterMapper.js # Maps abstract params to system-specific values
|
|
297
|
+
│ │ ├── UnifiedResourceManager.js # GPU resource tracking + disposal
|
|
298
|
+
│ │ ├── ErrorReporter.js # Opt-in error reporting (v2.0.1)
|
|
299
|
+
│ │ └── renderers/ # Per-system adapter classes
|
|
300
|
+
│ ├── quantum/ # Quantum visualization system
|
|
301
|
+
│ ├── faceted/ # Faceted visualization system
|
|
302
|
+
│ ├── holograms/ # Holographic visualization system
|
|
303
|
+
│ ├── geometry/ # 24-geometry library + generators + warps
|
|
304
|
+
│ ├── math/ # Vec4, Rotor4D, Mat4x4, Projection (JS fallback for WASM)
|
|
305
|
+
│ ├── render/ # ShaderProgram, RenderState, WebGL/WebGPU backends
|
|
306
|
+
│ ├── scene/ # Node4D, Scene4D, ResourceManager, MemoryPool
|
|
307
|
+
│ ├── reactivity/ # ReactivityManager + SpatialInputSystem
|
|
308
|
+
│ ├── creative/ # ColorPresets, Transitions, PostProcessing, Timeline
|
|
309
|
+
│ ├── integrations/ # React, Vue, Svelte, Figma, Three.js, TouchDesigner, OBS
|
|
310
|
+
│ ├── advanced/ # WebXR, WebGPU Compute, MIDI, AI Presets, OffscreenWorker
|
|
311
|
+
│ ├── agent/ # MCP server, CLI, telemetry
|
|
312
|
+
│ ├── viewer/ # ViewerPortal, GalleryUI, CardBending, audio reactivity
|
|
313
|
+
│ ├── export/ # VIB3PackageExporter, TradingCardGenerator
|
|
314
|
+
│ ├── gallery/ # GallerySystem (save/load states)
|
|
315
|
+
│ ├── wasm/ # WasmLoader (optional C++ core)
|
|
316
|
+
│ ├── llm/ # LLMParameterInterface (text-to-params)
|
|
317
|
+
│ ├── schemas/ # JSON Schema validation
|
|
318
|
+
│ └── shaders/ # External shader files (GLSL + WGSL)
|
|
319
|
+
├── cpp/ # C++ WASM core (Rotor4D, Mat4x4, embind)
|
|
320
|
+
├── site/ # Landing page (HTML + GSAP choreography)
|
|
321
|
+
├── demo/ # SDK controls demo (moved from root)
|
|
322
|
+
├── docs/ # Static gallery pages (GitHub Pages)
|
|
323
|
+
├── tools/ # shader-sync-verify.js, CI scripts
|
|
324
|
+
├── tests/ # Vitest unit tests + Playwright E2E
|
|
325
|
+
├── types/ # TypeScript definitions
|
|
326
|
+
├── agent-config/ # MCP config, Claude/OpenAI context packs
|
|
327
|
+
├── examples/ # React, Vanilla, Three.js example apps
|
|
328
|
+
└── .storybook/ # Storybook config
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
### The Shader System — Where the Rendering Actually Happens
|
|
332
|
+
|
|
333
|
+
This is where new developers get confused. The shaders exist in TWO places:
|
|
334
|
+
|
|
335
|
+
1. **Inline in visualizer `.js` files**: `QuantumVisualizer.js`, `FacetedSystem.js`, `HolographicVisualizer.js` all contain GLSL shader source as template literals. This is what actually runs.
|
|
336
|
+
|
|
337
|
+
2. **External files in `src/shaders/`**: GLSL and WGSL files that are supposed to mirror the inline versions. These exist for tooling, documentation, and future build pipeline integration.
|
|
338
|
+
|
|
339
|
+
**The drift problem**: When someone edits the inline shader and forgets to update the external file (or vice versa), they desync. This was a real bug (the `u_breath` uniform existed inline but not externally). The `shader-sync-verify.js` tool (937 lines) parses both, compares uniforms/fields, and reports differences. Always run `pnpm verify:shaders` after touching any shader code.
|
|
340
|
+
|
|
341
|
+
### The Canvas Architecture
|
|
342
|
+
|
|
343
|
+
Each visualization system gets five HTML `<canvas>` elements stacked via CSS:
|
|
344
|
+
|
|
345
|
+
```
|
|
346
|
+
background-canvas (z-index lowest, lowest opacity)
|
|
347
|
+
shadow-canvas
|
|
348
|
+
content-canvas (primary rendering happens here)
|
|
349
|
+
highlight-canvas
|
|
350
|
+
accent-canvas (z-index highest)
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
Canvas IDs follow system-specific naming:
|
|
354
|
+
- Quantum: `quantum-background-canvas`, `quantum-shadow-canvas`, etc.
|
|
355
|
+
- Faceted: `background-canvas`, `shadow-canvas`, etc. (no prefix — historical quirk)
|
|
356
|
+
- Holographic: `holo-background-canvas`, `holo-shadow-canvas`, etc.
|
|
357
|
+
|
|
358
|
+
`CanvasManager.js` handles creation, sizing, and destruction. It was completely rewritten on Feb 6, 2026 because its API didn't match what VIB3Engine expected. The new version is 110 lines and provides `createSystemCanvases()`, `registerContext()`, and `destroy()`.
|
|
359
|
+
|
|
360
|
+
### The SpatialInputSystem
|
|
361
|
+
|
|
362
|
+
This is one of VIB3+'s most distinctive features. It decouples "card tilting" from physical device orientation, creating a universal spatial input layer:
|
|
363
|
+
|
|
364
|
+
**Input sources** (8): deviceTilt, mousePosition, gyroscope, gamepad, perspective, programmatic, audio, MIDI
|
|
365
|
+
|
|
366
|
+
**Built-in profiles** (6): cardTilt (default), wearablePerspective, gameAsset, vjAudioSpatial, uiElement, immersiveXR
|
|
367
|
+
|
|
368
|
+
**How it works**: Any input source feeds a normalized spatial state (pitch/yaw/roll/x/y/z/intensity/velocity). A profile defines how that state maps to visualization parameters. Per-axis lerp smoothing prevents jitter. "Dramatic mode" applies 8x amplification for live performance.
|
|
369
|
+
|
|
370
|
+
The system is integrated into VIB3Engine with 7 methods: `enableSpatialInput()`, `disableSpatialInput()`, `feedSpatialInput()`, `setSpatialSensitivity()`, `setSpatialDramaticMode()`, `getSpatialState()`, `setSpatialProfile()`.
|
|
371
|
+
|
|
372
|
+
### The MCP Agent Layer
|
|
373
|
+
|
|
374
|
+
The MCP server (`src/agent/mcp/stdio-server.js`) implements JSON-RPC 2.0 over stdio per the Model Context Protocol spec. It exposes:
|
|
375
|
+
|
|
376
|
+
- **19 tools** for controlling the engine: create visualizations, set rotation, change geometry, manage gallery, get state, randomize/reset, etc.
|
|
377
|
+
- **4 documentation resources**: CLAUDE.md, geometry summary, control reference, live state
|
|
378
|
+
- **Proper protocol handshake**: `initialize`/`initialized`, `tools/list`, `tools/call`, `resources/list`, `resources/read`, `ping`
|
|
379
|
+
|
|
380
|
+
The `vib3-mcp` binary in package.json makes it installable as an MCP server for Claude Desktop, Cursor, and other MCP clients. Agent config packs in `agent-config/` provide drop-in setup for Claude and OpenAI agents.
|
|
381
|
+
|
|
382
|
+
### The Creative Tooling Layer
|
|
383
|
+
|
|
384
|
+
Four systems in `src/creative/` that add production-quality creative control:
|
|
385
|
+
|
|
386
|
+
- **ColorPresetsSystem** (980 lines): 22 themed presets (Ocean, Lava, Neon, Monochrome, etc.) that set multiple parameters at once
|
|
387
|
+
- **TransitionAnimator** (683 lines): 14 easing functions (linear, easeInOutCubic, elastic, bounce, etc.) for smooth interpolation between states. Supports sequencing.
|
|
388
|
+
- **PostProcessingPipeline** (1,113 lines): 14 composable GPU effects (bloom, chromatic aberration, vignette, film grain, scanlines, etc.) with 7 preset chains (cinematic, retro, neon, etc.)
|
|
389
|
+
- **ParameterTimeline** (1,061 lines): Keyframe-based parameter animation with BPM sync. Drive any parameter on a musical timeline.
|
|
390
|
+
|
|
391
|
+
### The Breath System
|
|
392
|
+
|
|
393
|
+
A global organic breathing cycle from `VitalitySystem.js` — a 6-second cosine wave oscillating 0 to 1 to 0, modulating all three visualization systems via the `u_breath` uniform:
|
|
394
|
+
|
|
395
|
+
| System | Effect | Strength |
|
|
396
|
+
|---|---|---|
|
|
397
|
+
| Quantum | Lattice brightness pulse | +40% at full exhale |
|
|
398
|
+
| Faceted | Pattern intensity pulse | +30% at full exhale |
|
|
399
|
+
| Holographic | Projection expansion + glow + density | +20% / +10% / +40% |
|
|
400
|
+
|
|
401
|
+
A bug was found in Feb 2026 where HolographicVisualizer had its own independent breath cycle running out of sync with the centralized one. Fixed to use the centralized value with 0.0 default.
|
|
402
|
+
|
|
403
|
+
---
|
|
404
|
+
|
|
405
|
+
## 8. Gotchas, Traps, and Hard-Won Lessons
|
|
406
|
+
|
|
407
|
+
These are the things that waste hours if you don't know them:
|
|
408
|
+
|
|
409
|
+
1. **Use pnpm, not npm**. `pnpm-lock.yaml` is the canonical lockfile. Running `npm install` creates a `package-lock.json` that conflicts. The stale `package-lock.json` was already removed once (Feb 2026). Don't recreate it.
|
|
410
|
+
|
|
411
|
+
2. **`RealHolographicSystem`, not `HolographicSystem`**. The class was renamed during development. Old references and imports may still say `HolographicSystem`. The actual export is `RealHolographicSystem`.
|
|
412
|
+
|
|
413
|
+
3. **Version strings are in 4 places**. `package.json`, `VIB3Engine.exportState()`, `Parameters.exportConfiguration()`, and `ErrorReporter`. When bumping the version, update ALL FOUR. They were unified to 2.0.1 in Feb 2026 (previously VIB3Engine said 1.2.0 while package.json said 2.0.0).
|
|
414
|
+
|
|
415
|
+
4. **Two different ReactivityManagers**. `src/viewer/ViewerInputHandler.js` (renamed from ReactivityManager) handles viewer-level input (mouse, touch, tilt for the card-bending UI). `src/reactivity/ReactivityManager.js` is the SDK-level reactivity system. They are DIFFERENT files with different purposes. Don't confuse them.
|
|
416
|
+
|
|
417
|
+
5. **Inline shaders are the source of truth for rendering**. External shader files in `src/shaders/` are secondary. If they conflict, the inline version is what actually runs. But always keep them in sync — run `pnpm verify:shaders`.
|
|
418
|
+
|
|
419
|
+
6. **6D rotation order is XY, XZ, YZ, XW, YW, ZW**. This is hardcoded in WASM, GLSL, and WGSL. Changing the order in one implementation without changing the others will produce subtly wrong rotations that are very hard to debug.
|
|
420
|
+
|
|
421
|
+
7. **WASM is optional — JS fallback exists**. The math library in `src/math/` (Vec4, Rotor4D, Mat4x4, Projection) provides pure JS implementations of everything the C++ core does. If WASM fails to load (10-second timeout), the engine silently falls back. This is by design.
|
|
422
|
+
|
|
423
|
+
8. **WebGPU is optional — WebGL fallback exists**. `UnifiedRenderBridge` tries WebGPU first but falls back to WebGL. Currently WebGL is the well-tested path. WebGPU backend is a scaffold.
|
|
424
|
+
|
|
425
|
+
9. **The `u_breath` uniform**. This is a global organic breathing cycle from `VitalitySystem.js` — a 6-second cosine wave (0 to 1 to 0) that modulates all three systems. A bug was found in Feb 2026 where HolographicVisualizer had its own independent breath cycle that ran out of sync. Fixed to use centralized value with 0.0 default.
|
|
426
|
+
|
|
427
|
+
10. **Faceted canvas naming quirk**. Quantum uses `quantum-*-canvas`, Holographic uses `holo-*-canvas`, but Faceted uses unprefixed names (`background-canvas`, `content-canvas`, etc.). This is historical and affects DOM queries.
|
|
428
|
+
|
|
429
|
+
11. **The landing page is in `site/`, not root**. Root `index.html` is a redirect. The SDK demo is in `demo/index.html`. The landing page with GSAP choreography is `site/index.html` with JS in `site/js/`. Don't accidentally edit the wrong `index.html`.
|
|
430
|
+
|
|
431
|
+
12. **CanvasManager was rewritten**. If you see old code or references assuming the pre-Feb-2026 CanvasManager API (which was 217 lines with a different interface), it's stale. The current version is 110 lines with `createSystemCanvases()`, `registerContext()`, `destroy()`.
|
|
432
|
+
|
|
433
|
+
---
|
|
434
|
+
|
|
435
|
+
## 9. Documentation Map
|
|
436
|
+
|
|
437
|
+
| What you need | Where to find it |
|
|
438
|
+
|---|---|
|
|
439
|
+
| **Quick project onboarding** | `CLAUDE.md` — concise brief, start here |
|
|
440
|
+
| **Full architecture & module inventory** | `DOCS/SYSTEM_INVENTORY.md` — canonical technical reference |
|
|
441
|
+
| **Product strategy & personas** | `DOCS/PRODUCT_STRATEGY.md` |
|
|
442
|
+
| **Quarterly roadmap & milestones** | `DOCS/ROADMAP.md` |
|
|
443
|
+
| **Licensing tiers & commercial model** | `DOCS/LICENSING_TIERS.md` |
|
|
444
|
+
| **Master plan (comprehensive backlog)** | `DOCS/MASTER_PLAN_2026-01-31.md` — 43 items across 6 phases |
|
|
445
|
+
| **All parameter details & UI controls** | `DOCS/CONTROL_REFERENCE.md` |
|
|
446
|
+
| **Project setup from scratch** | `DOCS/PROJECT_SETUP.md` + `DOCS/ENV_SETUP.md` |
|
|
447
|
+
| **CI/CD & testing** | `DOCS/CI_TESTING.md` |
|
|
448
|
+
| **Renderer lifecycle & contracts** | `DOCS/RENDERER_LIFECYCLE.md` |
|
|
449
|
+
| **GPU resource disposal** | `DOCS/GPU_DISPOSAL_GUIDE.md` |
|
|
450
|
+
| **WebGPU backend status** | `DOCS/WEBGPU_STATUS.md` |
|
|
451
|
+
| **XR benchmarks** | `DOCS/XR_BENCHMARKS.md` |
|
|
452
|
+
| **Export formats** | `DOCS/EXPORT_FORMATS.md` |
|
|
453
|
+
| **Agent CLI onboarding** | `DOCS/CLI_ONBOARDING.md` |
|
|
454
|
+
| **Landing page handoff** | `DOCS/HANDOFF_LANDING_PAGE.md` — visual quality issues + GSAP patterns |
|
|
455
|
+
| **Site refactor details** | `DOCS/SITE_REFACTOR_PLAN.md` |
|
|
456
|
+
| **Full docs index + reading paths** | `DOCS/README.md` |
|
|
457
|
+
| **Dev session logs** | `DOCS/dev-tracks/` (Jan 31, Feb 6 2026) |
|
|
458
|
+
|
|
459
|
+
---
|
|
460
|
+
|
|
461
|
+
## 10. Commands
|
|
462
|
+
|
|
463
|
+
```bash
|
|
464
|
+
pnpm install # Install deps (NOT npm)
|
|
465
|
+
pnpm dev # Vite dev server (opens browser)
|
|
466
|
+
pnpm test # Vitest unit tests (933+ passing)
|
|
467
|
+
pnpm test:e2e # Playwright browser tests (69 passing)
|
|
468
|
+
pnpm test:all # Both
|
|
469
|
+
pnpm verify:shaders # Check inline vs external shader sync
|
|
470
|
+
pnpm build:web # Production build
|
|
471
|
+
pnpm build:lib # UMD + ESM library build for CDN/npm
|
|
472
|
+
pnpm lint # ESLint
|
|
473
|
+
pnpm bench # Performance benchmarks
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
Build WASM core (requires Emscripten): `cd cpp && ./build.sh`
|
|
477
|
+
|
|
478
|
+
---
|
|
479
|
+
|
|
480
|
+
## 11. Session Workflow
|
|
481
|
+
|
|
482
|
+
1. Read `CLAUDE.md` for the concise brief
|
|
483
|
+
2. Read this document for full context
|
|
484
|
+
3. Read `DOCS/SYSTEM_INVENTORY.md` if you need the complete module map
|
|
485
|
+
4. Run `pnpm test` to verify baseline before making changes
|
|
486
|
+
5. Always run `pnpm test` after changes
|
|
487
|
+
6. If touching shaders, run `pnpm verify:shaders`
|
|
488
|
+
7. Commit with descriptive messages referencing what was changed and why
|
|
489
|
+
8. Check `DOCS/ROADMAP.md` for current milestone context
|
|
490
|
+
|
|
491
|
+
---
|
|
492
|
+
|
|
493
|
+
**VIB3+ SDK — Clear Seas Solutions LLC**
|