@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
|
@@ -7,30 +7,30 @@
|
|
|
7
7
|
* UnifiedRenderBridge instances — one per canvas — and coordinates shader
|
|
8
8
|
* compilation, uniform updates, and rendering across all layers.
|
|
9
9
|
*
|
|
10
|
+
* Layer parameters are derived through a LayerRelationshipGraph, where one
|
|
11
|
+
* layer acts as the keystone (driver) and others derive their state through
|
|
12
|
+
* configurable relationship functions — not static multipliers.
|
|
13
|
+
*
|
|
10
14
|
* Usage:
|
|
11
15
|
* const multi = new MultiCanvasBridge();
|
|
12
16
|
* await multi.initialize({
|
|
13
|
-
* canvases: {
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* content: document.getElementById('content-canvas'),
|
|
17
|
-
* highlight: document.getElementById('highlight-canvas'),
|
|
18
|
-
* accent: document.getElementById('accent-canvas'),
|
|
19
|
-
* },
|
|
20
|
-
* preferWebGPU: true
|
|
17
|
+
* canvases: { background, shadow, content, highlight, accent },
|
|
18
|
+
* preferWebGPU: true,
|
|
19
|
+
* relationshipProfile: 'holographic' // or 'symmetry', 'chord', 'storm'
|
|
21
20
|
* });
|
|
22
21
|
*
|
|
23
22
|
* multi.compileShaderAll('holographic', shaderSources);
|
|
24
|
-
* multi.
|
|
25
|
-
* multi.setLayerUniforms('background', { u_layerOpacity: 0.2, u_densityMult: 0.4 });
|
|
23
|
+
* multi.setKeystoneUniforms({ u_time: t, u_density: 1.0, u_hue: 320 });
|
|
26
24
|
* multi.renderAll('holographic');
|
|
27
25
|
*/
|
|
28
26
|
|
|
29
27
|
import { UnifiedRenderBridge } from './UnifiedRenderBridge.js';
|
|
28
|
+
import { LayerRelationshipGraph, LAYER_ORDER as GRAPH_LAYER_ORDER } from './LayerRelationshipGraph.js';
|
|
30
29
|
|
|
31
30
|
/**
|
|
32
|
-
* Default layer configuration
|
|
33
|
-
*
|
|
31
|
+
* Default layer configuration — used as fallback when no relationship graph
|
|
32
|
+
* is active (legacy mode). Preserved for backward compatibility only.
|
|
33
|
+
* @deprecated Use LayerRelationshipGraph profiles instead.
|
|
34
34
|
*/
|
|
35
35
|
const DEFAULT_LAYER_CONFIG = {
|
|
36
36
|
background: { layerScale: 1.0, layerOpacity: 0.2, densityMult: 0.4, speedMult: 0.2 },
|
|
@@ -43,7 +43,7 @@ const DEFAULT_LAYER_CONFIG = {
|
|
|
43
43
|
/**
|
|
44
44
|
* Standard layer order (back to front).
|
|
45
45
|
*/
|
|
46
|
-
const LAYER_ORDER =
|
|
46
|
+
const LAYER_ORDER = GRAPH_LAYER_ORDER;
|
|
47
47
|
|
|
48
48
|
export class MultiCanvasBridge {
|
|
49
49
|
constructor() {
|
|
@@ -59,7 +59,7 @@ export class MultiCanvasBridge {
|
|
|
59
59
|
/** @type {Map<string, object>} Per-layer uniform overrides */
|
|
60
60
|
this._layerUniforms = new Map();
|
|
61
61
|
|
|
62
|
-
/** @type {Map<string, object>} Per-layer config (opacity, density, speed) */
|
|
62
|
+
/** @type {Map<string, object>} Per-layer config (opacity, density, speed) — legacy fallback */
|
|
63
63
|
this._layerConfig = new Map();
|
|
64
64
|
|
|
65
65
|
/** @type {boolean} */
|
|
@@ -67,6 +67,12 @@ export class MultiCanvasBridge {
|
|
|
67
67
|
|
|
68
68
|
/** @type {string|null} Active backend type (set after init) */
|
|
69
69
|
this._backendType = null;
|
|
70
|
+
|
|
71
|
+
/** @type {LayerRelationshipGraph|null} */
|
|
72
|
+
this._relationshipGraph = null;
|
|
73
|
+
|
|
74
|
+
/** @type {number} Frame time counter for relationship resolution */
|
|
75
|
+
this._frameTime = 0;
|
|
70
76
|
}
|
|
71
77
|
|
|
72
78
|
/**
|
|
@@ -76,7 +82,9 @@ export class MultiCanvasBridge {
|
|
|
76
82
|
* @param {object} options.canvases - Map of layer name → HTMLCanvasElement
|
|
77
83
|
* @param {boolean} [options.preferWebGPU=true] - Try WebGPU for each canvas
|
|
78
84
|
* @param {boolean} [options.debug=false]
|
|
79
|
-
* @param {object} [options.layerConfig] - Override default layer configuration
|
|
85
|
+
* @param {object} [options.layerConfig] - Override default layer configuration (legacy)
|
|
86
|
+
* @param {string} [options.relationshipProfile] - Named relationship profile to load
|
|
87
|
+
* @param {LayerRelationshipGraph} [options.relationshipGraph] - Pre-configured graph instance
|
|
80
88
|
* @returns {Promise<void>}
|
|
81
89
|
*/
|
|
82
90
|
async initialize(options) {
|
|
@@ -84,7 +92,9 @@ export class MultiCanvasBridge {
|
|
|
84
92
|
canvases,
|
|
85
93
|
preferWebGPU = true,
|
|
86
94
|
debug = false,
|
|
87
|
-
layerConfig = {}
|
|
95
|
+
layerConfig = {},
|
|
96
|
+
relationshipProfile,
|
|
97
|
+
relationshipGraph
|
|
88
98
|
} = options;
|
|
89
99
|
|
|
90
100
|
// Initialize bridges in parallel
|
|
@@ -102,7 +112,7 @@ export class MultiCanvasBridge {
|
|
|
102
112
|
this._bridges.set(layerName, bridge);
|
|
103
113
|
this._canvases.set(layerName, canvas);
|
|
104
114
|
|
|
105
|
-
// Apply layer config (user override > default)
|
|
115
|
+
// Apply legacy layer config (user override > default)
|
|
106
116
|
const config = {
|
|
107
117
|
...(DEFAULT_LAYER_CONFIG[layerName] || {}),
|
|
108
118
|
...(layerConfig[layerName] || {})
|
|
@@ -118,9 +128,19 @@ export class MultiCanvasBridge {
|
|
|
118
128
|
}
|
|
119
129
|
}
|
|
120
130
|
|
|
131
|
+
// Set up relationship graph
|
|
132
|
+
if (relationshipGraph instanceof LayerRelationshipGraph) {
|
|
133
|
+
this._relationshipGraph = relationshipGraph;
|
|
134
|
+
} else if (relationshipProfile) {
|
|
135
|
+
this._relationshipGraph = new LayerRelationshipGraph({ profile: relationshipProfile });
|
|
136
|
+
}
|
|
137
|
+
|
|
121
138
|
this._initialized = this._bridges.size > 0;
|
|
122
139
|
if (debug) {
|
|
123
|
-
|
|
140
|
+
const graphInfo = this._relationshipGraph
|
|
141
|
+
? ` [graph: ${this._relationshipGraph.activeProfile || 'custom'}]`
|
|
142
|
+
: ' [legacy mode]';
|
|
143
|
+
console.log(`MultiCanvasBridge: ${this._bridges.size}/${entries.length} layers initialized (${this._backendType})${graphInfo}`);
|
|
124
144
|
}
|
|
125
145
|
}
|
|
126
146
|
|
|
@@ -157,6 +177,55 @@ export class MultiCanvasBridge {
|
|
|
157
177
|
return this._bridges.get(layerName);
|
|
158
178
|
}
|
|
159
179
|
|
|
180
|
+
// ========================================================================
|
|
181
|
+
// Layer Relationship Graph
|
|
182
|
+
// ========================================================================
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Get the active relationship graph. Creates one with 'holographic' profile
|
|
186
|
+
* if none exists.
|
|
187
|
+
* @returns {LayerRelationshipGraph}
|
|
188
|
+
*/
|
|
189
|
+
get relationshipGraph() {
|
|
190
|
+
if (!this._relationshipGraph) {
|
|
191
|
+
this._relationshipGraph = new LayerRelationshipGraph({ profile: 'holographic' });
|
|
192
|
+
}
|
|
193
|
+
return this._relationshipGraph;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Set or replace the relationship graph.
|
|
198
|
+
* @param {LayerRelationshipGraph} graph
|
|
199
|
+
*/
|
|
200
|
+
set relationshipGraph(graph) {
|
|
201
|
+
this._relationshipGraph = graph;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Load a named relationship profile.
|
|
206
|
+
* @param {string} profileName - holographic, symmetry, chord, storm, legacy
|
|
207
|
+
*/
|
|
208
|
+
loadRelationshipProfile(profileName) {
|
|
209
|
+
this.relationshipGraph.loadProfile(profileName);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Set the keystone (driver) layer.
|
|
214
|
+
* @param {string} layerName
|
|
215
|
+
*/
|
|
216
|
+
setKeystone(layerName) {
|
|
217
|
+
this.relationshipGraph.setKeystone(layerName);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Set the relationship for a dependent layer.
|
|
222
|
+
* @param {string} layerName
|
|
223
|
+
* @param {string|Function|Object} relationship - Preset name, function, or { preset, config }
|
|
224
|
+
*/
|
|
225
|
+
setLayerRelationship(layerName, relationship) {
|
|
226
|
+
this.relationshipGraph.setRelationship(layerName, relationship);
|
|
227
|
+
}
|
|
228
|
+
|
|
160
229
|
// ========================================================================
|
|
161
230
|
// Shader Compilation
|
|
162
231
|
// ========================================================================
|
|
@@ -204,6 +273,7 @@ export class MultiCanvasBridge {
|
|
|
204
273
|
|
|
205
274
|
/**
|
|
206
275
|
* Set uniforms shared across all layers (e.g. time, resolution, geometry).
|
|
276
|
+
* When a relationship graph is active, these are treated as keystone parameters.
|
|
207
277
|
*
|
|
208
278
|
* @param {object} uniforms
|
|
209
279
|
*/
|
|
@@ -212,7 +282,17 @@ export class MultiCanvasBridge {
|
|
|
212
282
|
}
|
|
213
283
|
|
|
214
284
|
/**
|
|
215
|
-
*
|
|
285
|
+
* Alias for setSharedUniforms when using relationship graph mode.
|
|
286
|
+
* Makes intent clearer — these are the keystone's parameters.
|
|
287
|
+
*
|
|
288
|
+
* @param {object} uniforms - Keystone parameters to derive other layers from
|
|
289
|
+
*/
|
|
290
|
+
setKeystoneUniforms(uniforms) {
|
|
291
|
+
this._sharedUniforms = uniforms;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Set per-layer uniform overrides. Applied after relationship resolution.
|
|
216
296
|
*
|
|
217
297
|
* @param {string} layerName
|
|
218
298
|
* @param {object} uniforms
|
|
@@ -223,7 +303,8 @@ export class MultiCanvasBridge {
|
|
|
223
303
|
}
|
|
224
304
|
|
|
225
305
|
/**
|
|
226
|
-
* Update the layer configuration.
|
|
306
|
+
* Update the legacy layer configuration.
|
|
307
|
+
* @deprecated Use setLayerRelationship() instead.
|
|
227
308
|
*
|
|
228
309
|
* @param {string} layerName
|
|
229
310
|
* @param {object} config - Partial config update
|
|
@@ -236,15 +317,38 @@ export class MultiCanvasBridge {
|
|
|
236
317
|
/**
|
|
237
318
|
* Build the merged uniform set for a specific layer.
|
|
238
319
|
*
|
|
239
|
-
*
|
|
320
|
+
* When a relationship graph is active:
|
|
321
|
+
* 1. Shared uniforms are treated as keystone parameters
|
|
322
|
+
* 2. The graph resolves derived parameters for the layer
|
|
323
|
+
* 3. Per-layer overrides are applied on top
|
|
324
|
+
*
|
|
325
|
+
* Legacy fallback (no graph):
|
|
326
|
+
* Priority: shared < layer config < layer overrides
|
|
240
327
|
*
|
|
241
328
|
* @param {string} layerName
|
|
242
329
|
* @returns {object}
|
|
243
330
|
*/
|
|
244
331
|
_buildLayerUniforms(layerName) {
|
|
245
|
-
const config = this._layerConfig.get(layerName) || {};
|
|
246
332
|
const overrides = this._layerUniforms.get(layerName) || {};
|
|
247
333
|
|
|
334
|
+
if (this._relationshipGraph) {
|
|
335
|
+
// Relationship graph mode: resolve layer params from keystone
|
|
336
|
+
const resolved = this._relationshipGraph.resolve(
|
|
337
|
+
this._sharedUniforms,
|
|
338
|
+
layerName,
|
|
339
|
+
this._frameTime
|
|
340
|
+
);
|
|
341
|
+
|
|
342
|
+
// Map relationship output to shader uniforms
|
|
343
|
+
return {
|
|
344
|
+
...resolved,
|
|
345
|
+
u_layerOpacity: resolved.layerOpacity || resolved.u_layerOpacity || 1.0,
|
|
346
|
+
...overrides
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// Legacy mode: static multipliers
|
|
351
|
+
const config = this._layerConfig.get(layerName) || {};
|
|
248
352
|
return {
|
|
249
353
|
...this._sharedUniforms,
|
|
250
354
|
u_layerScale: config.layerScale || 1.0,
|
|
@@ -260,15 +364,31 @@ export class MultiCanvasBridge {
|
|
|
260
364
|
// ========================================================================
|
|
261
365
|
|
|
262
366
|
/**
|
|
263
|
-
* Render all layers in order
|
|
367
|
+
* Render all layers in order.
|
|
368
|
+
*
|
|
369
|
+
* When a relationship graph is active, each layer may use a different shader
|
|
370
|
+
* as assigned by graph.setLayerShader(). The shaderName parameter serves as
|
|
371
|
+
* the default for layers without an explicit shader assignment.
|
|
264
372
|
*
|
|
265
|
-
* @param {string} shaderName -
|
|
373
|
+
* @param {string} shaderName - Default shader program to use
|
|
266
374
|
* @param {object} [options]
|
|
267
375
|
* @param {number[]} [options.clearColor] - RGBA clear color
|
|
376
|
+
* @param {number} [options.time] - Frame time for relationship resolution
|
|
268
377
|
*/
|
|
269
378
|
renderAll(shaderName, options = {}) {
|
|
379
|
+
if (options.time !== undefined) {
|
|
380
|
+
this._frameTime = options.time;
|
|
381
|
+
} else {
|
|
382
|
+
this._frameTime += 16; // ~60fps fallback
|
|
383
|
+
}
|
|
384
|
+
|
|
270
385
|
for (const layerName of this.layerNames) {
|
|
271
|
-
|
|
386
|
+
// Per-layer shader from relationship graph, or default
|
|
387
|
+
const layerShader = (this._relationshipGraph
|
|
388
|
+
? this._relationshipGraph.getLayerShader(layerName)
|
|
389
|
+
: null) || shaderName;
|
|
390
|
+
|
|
391
|
+
this.renderLayer(layerName, layerShader, options);
|
|
272
392
|
}
|
|
273
393
|
}
|
|
274
394
|
|
|
@@ -334,7 +454,10 @@ export class MultiCanvasBridge {
|
|
|
334
454
|
this._sharedUniforms = {};
|
|
335
455
|
this._initialized = false;
|
|
336
456
|
this._backendType = null;
|
|
457
|
+
this._relationshipGraph = null;
|
|
458
|
+
this._frameTime = 0;
|
|
337
459
|
}
|
|
338
460
|
}
|
|
339
461
|
|
|
462
|
+
export { DEFAULT_LAYER_CONFIG, LAYER_ORDER };
|
|
340
463
|
export default MultiCanvasBridge;
|
|
@@ -56,6 +56,9 @@ function packVIB3Uniforms(uniforms) {
|
|
|
56
56
|
data[22] = uniforms.u_mid || 0;
|
|
57
57
|
data[23] = uniforms.u_high || 0;
|
|
58
58
|
|
|
59
|
+
// Breath/Vitality parameter
|
|
60
|
+
data[32] = uniforms.u_breath || 0;
|
|
61
|
+
|
|
59
62
|
data[24] = uniforms.u_layerScale || 1.0;
|
|
60
63
|
data[25] = uniforms.u_layerOpacity || 1.0;
|
|
61
64
|
data[26] = 0; // _pad1
|
package/src/render/index.js
CHANGED
|
@@ -119,6 +119,31 @@ export {
|
|
|
119
119
|
MultiCanvasBridge
|
|
120
120
|
} from './MultiCanvasBridge.js';
|
|
121
121
|
|
|
122
|
+
// Layer relationship graph (keystone-driven inter-layer parameter system)
|
|
123
|
+
export {
|
|
124
|
+
LayerRelationshipGraph,
|
|
125
|
+
LAYER_ORDER,
|
|
126
|
+
PROFILES,
|
|
127
|
+
PRESET_REGISTRY,
|
|
128
|
+
echo,
|
|
129
|
+
mirror,
|
|
130
|
+
complement,
|
|
131
|
+
harmonic,
|
|
132
|
+
reactive,
|
|
133
|
+
chase
|
|
134
|
+
} from './LayerRelationshipGraph.js';
|
|
135
|
+
|
|
136
|
+
// Layer preset manager (save/load/tune relationship presets)
|
|
137
|
+
export {
|
|
138
|
+
LayerPresetManager
|
|
139
|
+
} from './LayerPresetManager.js';
|
|
140
|
+
|
|
141
|
+
// Layer reactivity bridge (audio/tilt/input → relationship modulation)
|
|
142
|
+
export {
|
|
143
|
+
LayerReactivityBridge,
|
|
144
|
+
MODULATION_PROFILES
|
|
145
|
+
} from './LayerReactivityBridge.js';
|
|
146
|
+
|
|
122
147
|
/**
|
|
123
148
|
* Create a complete rendering context
|
|
124
149
|
* @param {HTMLCanvasElement} canvas
|
|
@@ -129,8 +154,7 @@ export function createRenderContext(canvas, options = {}) {
|
|
|
129
154
|
if (options.backend === 'webgpu') {
|
|
130
155
|
return null;
|
|
131
156
|
}
|
|
132
|
-
const
|
|
133
|
-
const backend = createWebGLBackend(canvas, options);
|
|
157
|
+
const backend = _createWebGLBackend(canvas, options);
|
|
134
158
|
|
|
135
159
|
if (!backend) {
|
|
136
160
|
return null;
|
|
@@ -365,3 +389,4 @@ import { RenderState } from './RenderState.js';
|
|
|
365
389
|
import { ShaderProgram, ShaderLib } from './ShaderProgram.js';
|
|
366
390
|
import { UnifiedRenderBridge } from './UnifiedRenderBridge.js';
|
|
367
391
|
import { createWebGPUBackend } from './backends/WebGPUBackend.js';
|
|
392
|
+
import { createWebGLBackend as _createWebGLBackend } from './backends/WebGLBackend.js';
|
package/src/scene/index.js
CHANGED
|
@@ -60,10 +60,10 @@ export function createSceneContext(options = {}) {
|
|
|
60
60
|
poolInitialSize = 100
|
|
61
61
|
} = options;
|
|
62
62
|
|
|
63
|
-
const scene = new
|
|
64
|
-
const resources = new
|
|
65
|
-
const disposal = new
|
|
66
|
-
const poolManager = new
|
|
63
|
+
const scene = new Scene4D(sceneName);
|
|
64
|
+
const resources = new ResourceManager();
|
|
65
|
+
const disposal = new DisposalManager();
|
|
66
|
+
const poolManager = new PoolManager();
|
|
67
67
|
|
|
68
68
|
resources.memoryLimit = memoryLimit;
|
|
69
69
|
|