@vib3code/sdk 2.0.1
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 +118 -0
- package/DOCS/BLUEPRINT_EXECUTION_PLAN_2026-01-07.md +34 -0
- package/DOCS/CI_TESTING.md +38 -0
- package/DOCS/CLI_ONBOARDING.md +75 -0
- package/DOCS/CONTROL_REFERENCE.md +64 -0
- package/DOCS/DEV_TRACK_ANALYSIS.md +77 -0
- package/DOCS/DEV_TRACK_PLAN_2026-01-07.md +42 -0
- package/DOCS/DEV_TRACK_SESSION_2026-01-31.md +220 -0
- package/DOCS/ENV_SETUP.md +189 -0
- package/DOCS/EXPORT_FORMATS.md +417 -0
- package/DOCS/GPU_DISPOSAL_GUIDE.md +21 -0
- package/DOCS/LICENSING_TIERS.md +275 -0
- package/DOCS/MASTER_PLAN_2026-01-31.md +570 -0
- package/DOCS/OBS_SETUP_GUIDE.md +98 -0
- package/DOCS/PROJECT_SETUP.md +66 -0
- package/DOCS/RENDERER_LIFECYCLE.md +40 -0
- package/DOCS/REPO_MANIFEST.md +121 -0
- package/DOCS/SESSION_014_PLAN.md +195 -0
- package/DOCS/SESSION_LOG_2026-01-07.md +56 -0
- package/DOCS/STRATEGIC_BLUEPRINT_2026-01-07.md +72 -0
- package/DOCS/SYSTEM_AUDIT_2026-01-30.md +738 -0
- package/DOCS/SYSTEM_INVENTORY.md +520 -0
- package/DOCS/TELEMETRY_EXPORTS.md +34 -0
- package/DOCS/WEBGPU_STATUS.md +38 -0
- package/DOCS/XR_BENCHMARKS.md +608 -0
- package/LICENSE +21 -0
- package/README.md +426 -0
- package/docs/.nojekyll +0 -0
- package/docs/01-dissolution_of_euclidean_hegemony.html +346 -0
- package/docs/02-hyperspatial_ego_death.html +346 -0
- package/docs/03-post_cartesian_sublime.html +346 -0
- package/docs/04-crystalline_void_meditation.html +346 -0
- package/docs/05-quantum_decoherence_ballet.html +346 -0
- package/docs/06-dissolution_of_euclidean_hegemony.html +346 -0
- package/docs/07-hyperspatial_ego_death.html +346 -0
- package/docs/08-post_cartesian_sublime.html +346 -0
- package/docs/09-crystalline_void_meditation.html +346 -0
- package/docs/10-quantum_decoherence_ballet.html +346 -0
- package/docs/11-dissolution_of_euclidean_hegemony.html +346 -0
- package/docs/12-hyperspatial_ego_death.html +346 -0
- package/docs/13-post_cartesian_sublime.html +346 -0
- package/docs/index.html +794 -0
- package/docs/test-hub.html +441 -0
- package/docs/url-state.js +102 -0
- package/docs/vib3-exports/01-quantum-quantum-tetrahedron-lattice.html +489 -0
- package/docs/vib3-exports/02-quantum-quantum-hypersphere-matrix.html +489 -0
- package/docs/vib3-exports/03-quantum-quantum-hypertetra-fractal.html +489 -0
- package/docs/vib3-exports/04-faceted-faceted-crystal-structure.html +407 -0
- package/docs/vib3-exports/05-faceted-faceted-klein-bottle.html +407 -0
- package/docs/vib3-exports/06-faceted-faceted-hypertetra-torus.html +407 -0
- package/docs/vib3-exports/07-holographic-holographic-wave-field.html +457 -0
- package/docs/vib3-exports/08-holographic-holographic-hypersphere-sphere.html +457 -0
- package/docs/vib3-exports/09-holographic-holographic-hypertetra-crystal.html +457 -0
- package/docs/vib3-exports/index.html +238 -0
- package/docs/webgpu-live.html +702 -0
- package/package.json +367 -0
- package/src/advanced/AIPresetGenerator.js +777 -0
- package/src/advanced/MIDIController.js +703 -0
- package/src/advanced/OffscreenWorker.js +1051 -0
- package/src/advanced/WebGPUCompute.js +1051 -0
- package/src/advanced/WebXRRenderer.js +680 -0
- package/src/agent/cli/AgentCLI.js +615 -0
- package/src/agent/cli/index.js +14 -0
- package/src/agent/index.js +73 -0
- package/src/agent/mcp/MCPServer.js +950 -0
- package/src/agent/mcp/index.js +9 -0
- package/src/agent/mcp/tools.js +548 -0
- package/src/agent/telemetry/EventStream.js +669 -0
- package/src/agent/telemetry/Instrumentation.js +618 -0
- package/src/agent/telemetry/TelemetryExporters.js +427 -0
- package/src/agent/telemetry/TelemetryService.js +464 -0
- package/src/agent/telemetry/index.js +52 -0
- package/src/benchmarks/BenchmarkRunner.js +381 -0
- package/src/benchmarks/MetricsCollector.js +299 -0
- package/src/benchmarks/index.js +9 -0
- package/src/benchmarks/scenes.js +259 -0
- package/src/cli/index.js +675 -0
- package/src/config/ApiConfig.js +88 -0
- package/src/core/CanvasManager.js +217 -0
- package/src/core/ErrorReporter.js +117 -0
- package/src/core/ParameterMapper.js +333 -0
- package/src/core/Parameters.js +396 -0
- package/src/core/RendererContracts.js +200 -0
- package/src/core/UnifiedResourceManager.js +370 -0
- package/src/core/VIB3Engine.js +636 -0
- package/src/core/renderers/FacetedRendererAdapter.js +32 -0
- package/src/core/renderers/HolographicRendererAdapter.js +29 -0
- package/src/core/renderers/QuantumRendererAdapter.js +29 -0
- package/src/core/renderers/RendererLifecycleManager.js +63 -0
- package/src/creative/ColorPresetsSystem.js +980 -0
- package/src/creative/ParameterTimeline.js +1061 -0
- package/src/creative/PostProcessingPipeline.js +1113 -0
- package/src/creative/TransitionAnimator.js +683 -0
- package/src/export/CSSExporter.js +226 -0
- package/src/export/CardGeneratorBase.js +279 -0
- package/src/export/ExportManager.js +580 -0
- package/src/export/FacetedCardGenerator.js +279 -0
- package/src/export/HolographicCardGenerator.js +543 -0
- package/src/export/LottieExporter.js +552 -0
- package/src/export/QuantumCardGenerator.js +315 -0
- package/src/export/SVGExporter.js +519 -0
- package/src/export/ShaderExporter.js +903 -0
- package/src/export/TradingCardGenerator.js +3055 -0
- package/src/export/TradingCardManager.js +181 -0
- package/src/export/VIB3PackageExporter.js +559 -0
- package/src/export/index.js +14 -0
- package/src/export/systems/TradingCardSystemFaceted.js +494 -0
- package/src/export/systems/TradingCardSystemHolographic.js +452 -0
- package/src/export/systems/TradingCardSystemQuantum.js +411 -0
- package/src/faceted/FacetedSystem.js +963 -0
- package/src/features/CollectionManager.js +433 -0
- package/src/gallery/CollectionManager.js +240 -0
- package/src/gallery/GallerySystem.js +485 -0
- package/src/geometry/GeometryFactory.js +314 -0
- package/src/geometry/GeometryLibrary.js +72 -0
- package/src/geometry/buffers/BufferBuilder.js +338 -0
- package/src/geometry/buffers/index.js +18 -0
- package/src/geometry/generators/Crystal.js +420 -0
- package/src/geometry/generators/Fractal.js +298 -0
- package/src/geometry/generators/KleinBottle.js +197 -0
- package/src/geometry/generators/Sphere.js +192 -0
- package/src/geometry/generators/Tesseract.js +160 -0
- package/src/geometry/generators/Tetrahedron.js +225 -0
- package/src/geometry/generators/Torus.js +304 -0
- package/src/geometry/generators/Wave.js +341 -0
- package/src/geometry/index.js +142 -0
- package/src/geometry/warp/HypersphereCore.js +211 -0
- package/src/geometry/warp/HypertetraCore.js +386 -0
- package/src/geometry/warp/index.js +57 -0
- package/src/holograms/HolographicVisualizer.js +1073 -0
- package/src/holograms/RealHolographicSystem.js +966 -0
- package/src/holograms/variantRegistry.js +69 -0
- package/src/integrations/FigmaPlugin.js +854 -0
- package/src/integrations/OBSMode.js +754 -0
- package/src/integrations/ThreeJsPackage.js +660 -0
- package/src/integrations/TouchDesignerExport.js +552 -0
- package/src/integrations/frameworks/Vib3React.js +591 -0
- package/src/integrations/frameworks/Vib3Svelte.js +654 -0
- package/src/integrations/frameworks/Vib3Vue.js +628 -0
- package/src/llm/LLMParameterInterface.js +240 -0
- package/src/llm/LLMParameterUI.js +577 -0
- package/src/math/Mat4x4.js +708 -0
- package/src/math/Projection.js +341 -0
- package/src/math/Rotor4D.js +637 -0
- package/src/math/Vec4.js +476 -0
- package/src/math/constants.js +164 -0
- package/src/math/index.js +68 -0
- package/src/math/projections.js +54 -0
- package/src/math/rotations.js +196 -0
- package/src/quantum/QuantumEngine.js +906 -0
- package/src/quantum/QuantumVisualizer.js +1103 -0
- package/src/reactivity/ReactivityConfig.js +499 -0
- package/src/reactivity/ReactivityManager.js +586 -0
- package/src/reactivity/SpatialInputSystem.js +1783 -0
- package/src/reactivity/index.js +93 -0
- package/src/render/CommandBuffer.js +465 -0
- package/src/render/MultiCanvasBridge.js +340 -0
- package/src/render/RenderCommand.js +514 -0
- package/src/render/RenderResourceRegistry.js +523 -0
- package/src/render/RenderState.js +552 -0
- package/src/render/RenderTarget.js +512 -0
- package/src/render/ShaderLoader.js +253 -0
- package/src/render/ShaderProgram.js +599 -0
- package/src/render/UnifiedRenderBridge.js +496 -0
- package/src/render/backends/WebGLBackend.js +1108 -0
- package/src/render/backends/WebGPUBackend.js +1409 -0
- package/src/render/commands/CommandBufferExecutor.js +607 -0
- package/src/render/commands/RenderCommandBuffer.js +661 -0
- package/src/render/commands/index.js +17 -0
- package/src/render/index.js +367 -0
- package/src/scene/Disposable.js +498 -0
- package/src/scene/MemoryPool.js +618 -0
- package/src/scene/Node4D.js +697 -0
- package/src/scene/ResourceManager.js +599 -0
- package/src/scene/Scene4D.js +540 -0
- package/src/scene/index.js +98 -0
- package/src/schemas/error.schema.json +84 -0
- package/src/schemas/extension.schema.json +88 -0
- package/src/schemas/index.js +214 -0
- package/src/schemas/parameters.schema.json +142 -0
- package/src/schemas/tool-pack.schema.json +44 -0
- package/src/schemas/tool-response.schema.json +127 -0
- package/src/shaders/common/fullscreen.vert.glsl +5 -0
- package/src/shaders/common/fullscreen.vert.wgsl +17 -0
- package/src/shaders/common/geometry24.glsl +65 -0
- package/src/shaders/common/geometry24.wgsl +54 -0
- package/src/shaders/common/rotation4d.glsl +85 -0
- package/src/shaders/common/rotation4d.wgsl +86 -0
- package/src/shaders/common/uniforms.glsl +44 -0
- package/src/shaders/common/uniforms.wgsl +48 -0
- package/src/shaders/faceted/faceted.frag.glsl +129 -0
- package/src/shaders/faceted/faceted.frag.wgsl +164 -0
- package/src/shaders/holographic/holographic.frag.glsl +406 -0
- package/src/shaders/holographic/holographic.frag.wgsl +185 -0
- package/src/shaders/quantum/quantum.frag.glsl +513 -0
- package/src/shaders/quantum/quantum.frag.wgsl +361 -0
- package/src/testing/ParallelTestFramework.js +519 -0
- package/src/testing/__snapshots__/exportFormats.test.js.snap +24 -0
- package/src/testing/exportFormats.test.js +8 -0
- package/src/testing/projections.test.js +14 -0
- package/src/testing/rotations.test.js +37 -0
- package/src/ui/InteractivityMenu.js +516 -0
- package/src/ui/StatusManager.js +96 -0
- package/src/ui/adaptive/renderers/webgpu/BufferLayout.ts +252 -0
- package/src/ui/adaptive/renderers/webgpu/PolytopeInstanceBuffer.ts +144 -0
- package/src/ui/adaptive/renderers/webgpu/TripleBufferedUniform.ts +170 -0
- package/src/ui/adaptive/renderers/webgpu/WebGPURenderer.ts +735 -0
- package/src/ui/adaptive/renderers/webgpu/index.ts +112 -0
- package/src/variations/VariationManager.js +431 -0
- package/src/viewer/AudioReactivity.js +505 -0
- package/src/viewer/CardBending.js +481 -0
- package/src/viewer/GalleryUI.js +832 -0
- package/src/viewer/ReactivityManager.js +590 -0
- package/src/viewer/TradingCardExporter.js +600 -0
- package/src/viewer/ViewerPortal.js +374 -0
- package/src/viewer/index.js +12 -0
- package/src/wasm/WasmLoader.js +296 -0
- package/src/wasm/index.js +132 -0
- package/tools/agentic/mcpTools.js +88 -0
- package/tools/cli/agent-cli.js +92 -0
- package/tools/export/formats.js +24 -0
- package/tools/math/rotation-baseline.mjs +64 -0
- package/tools/shader-sync-verify.js +937 -0
- package/tools/telemetry/manifestPipeline.js +141 -0
- package/tools/telemetry/telemetryEvents.js +35 -0
- package/types/adaptive-sdk.d.ts +185 -0
- package/types/advanced/AIPresetGenerator.d.ts +81 -0
- package/types/advanced/MIDIController.d.ts +100 -0
- package/types/advanced/OffscreenWorker.d.ts +82 -0
- package/types/advanced/WebGPUCompute.d.ts +52 -0
- package/types/advanced/WebXRRenderer.d.ts +77 -0
- package/types/advanced/index.d.ts +46 -0
- package/types/core/ErrorReporter.d.ts +50 -0
- package/types/core/VIB3Engine.d.ts +204 -0
- package/types/creative/ColorPresetsSystem.d.ts +91 -0
- package/types/creative/ParameterTimeline.d.ts +74 -0
- package/types/creative/PostProcessingPipeline.d.ts +109 -0
- package/types/creative/TransitionAnimator.d.ts +71 -0
- package/types/creative/index.d.ts +35 -0
- package/types/integrations/FigmaPlugin.d.ts +46 -0
- package/types/integrations/OBSMode.d.ts +74 -0
- package/types/integrations/ThreeJsPackage.d.ts +62 -0
- package/types/integrations/TouchDesignerExport.d.ts +36 -0
- package/types/integrations/Vib3React.d.ts +74 -0
- package/types/integrations/Vib3Svelte.d.ts +63 -0
- package/types/integrations/Vib3Vue.d.ts +55 -0
- package/types/integrations/index.d.ts +52 -0
- package/types/reactivity/SpatialInputSystem.d.ts +173 -0
- package/types/reactivity/index.d.ts +394 -0
- package/types/render/CommandBuffer.d.ts +169 -0
- package/types/render/RenderCommand.d.ts +312 -0
- package/types/render/RenderState.d.ts +279 -0
- package/types/render/RenderTarget.d.ts +254 -0
- package/types/render/ShaderProgram.d.ts +277 -0
- package/types/render/UnifiedRenderBridge.d.ts +143 -0
- package/types/render/WebGLBackend.d.ts +168 -0
- package/types/render/WebGPUBackend.d.ts +186 -0
- package/types/render/index.d.ts +141 -0
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>POST CARTESIAN SUBLIME [13/13]</title>
|
|
7
|
+
<meta name="description" content="Deconstructs the coordinate system as a colonial imposition on pure geometric consciousness">
|
|
8
|
+
<meta name="generator" content="VIB3+ Algorithmic Avant-Garde Generator v2.718">
|
|
9
|
+
<meta name="pcs" content="1.35450891">
|
|
10
|
+
<style>
|
|
11
|
+
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
12
|
+
body {
|
|
13
|
+
background: #000;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
font-family: 'Courier New', monospace;
|
|
16
|
+
}
|
|
17
|
+
canvas {
|
|
18
|
+
display: block;
|
|
19
|
+
width: 100vw;
|
|
20
|
+
height: 100vh;
|
|
21
|
+
}
|
|
22
|
+
.metadata-panel {
|
|
23
|
+
position: fixed;
|
|
24
|
+
top: 20px;
|
|
25
|
+
right: 20px;
|
|
26
|
+
background: rgba(0,0,0,0.9);
|
|
27
|
+
border: 1px solid rgba(255,255,255,0.1);
|
|
28
|
+
border-radius: 4px;
|
|
29
|
+
padding: 20px;
|
|
30
|
+
color: #0f0;
|
|
31
|
+
font-size: 10px;
|
|
32
|
+
max-width: 400px;
|
|
33
|
+
backdrop-filter: blur(10px);
|
|
34
|
+
font-family: 'Courier New', monospace;
|
|
35
|
+
}
|
|
36
|
+
.metadata-panel h1 {
|
|
37
|
+
color: #0ff;
|
|
38
|
+
font-size: 12px;
|
|
39
|
+
margin-bottom: 10px;
|
|
40
|
+
text-transform: uppercase;
|
|
41
|
+
letter-spacing: 2px;
|
|
42
|
+
}
|
|
43
|
+
.metadata-panel .description {
|
|
44
|
+
color: #888;
|
|
45
|
+
font-style: italic;
|
|
46
|
+
margin-bottom: 15px;
|
|
47
|
+
line-height: 1.5;
|
|
48
|
+
}
|
|
49
|
+
.metadata-panel .param-group {
|
|
50
|
+
margin-bottom: 10px;
|
|
51
|
+
padding: 8px;
|
|
52
|
+
background: rgba(0,255,0,0.05);
|
|
53
|
+
border-left: 2px solid #0f0;
|
|
54
|
+
}
|
|
55
|
+
.metadata-panel .param-group h2 {
|
|
56
|
+
color: #0ff;
|
|
57
|
+
font-size: 10px;
|
|
58
|
+
margin-bottom: 5px;
|
|
59
|
+
}
|
|
60
|
+
.metadata-panel .param {
|
|
61
|
+
display: flex;
|
|
62
|
+
justify-content: space-between;
|
|
63
|
+
margin: 2px 0;
|
|
64
|
+
}
|
|
65
|
+
.metadata-panel .param-name { color: #888; }
|
|
66
|
+
.metadata-panel .param-value { color: #0f0; font-family: monospace; }
|
|
67
|
+
.metadata-panel .pcs {
|
|
68
|
+
margin-top: 15px;
|
|
69
|
+
padding-top: 15px;
|
|
70
|
+
border-top: 1px solid rgba(255,255,255,0.1);
|
|
71
|
+
text-align: center;
|
|
72
|
+
}
|
|
73
|
+
.metadata-panel .pcs-label { color: #888; font-size: 9px; }
|
|
74
|
+
.metadata-panel .pcs-value { color: #ff0; font-size: 16px; font-weight: bold; }
|
|
75
|
+
</style>
|
|
76
|
+
</head>
|
|
77
|
+
<body>
|
|
78
|
+
<canvas id="canvas"></canvas>
|
|
79
|
+
<div class="metadata-panel">
|
|
80
|
+
<h1>post cartesian sublime</h1>
|
|
81
|
+
<div class="description">Deconstructs the coordinate system as a colonial imposition on pure geometric consciousness</div>
|
|
82
|
+
|
|
83
|
+
<div class="param-group">
|
|
84
|
+
<h2>6D ROTATION MANIFOLD</h2>
|
|
85
|
+
<div class="param"><span class="param-name">XY:</span><span class="param-value">3.666817528025 rad</span></div>
|
|
86
|
+
<div class="param"><span class="param-name">XZ:</span><span class="param-value">4.233371993741 rad</span></div>
|
|
87
|
+
<div class="param"><span class="param-name">YZ:</span><span class="param-value">0.000000000000 rad</span></div>
|
|
88
|
+
<div class="param"><span class="param-name">XW:</span><span class="param-value">3.316667611735 rad</span></div>
|
|
89
|
+
<div class="param"><span class="param-name">YW:</span><span class="param-value">2.915431511140 rad</span></div>
|
|
90
|
+
<div class="param"><span class="param-name">ZW:</span><span class="param-value">0.598127463972 rad</span></div>
|
|
91
|
+
</div>
|
|
92
|
+
|
|
93
|
+
<div class="param-group">
|
|
94
|
+
<h2>CHROMATIC</h2>
|
|
95
|
+
<div class="param"><span class="param-name">Hue:</span><span class="param-value">180.09316860°</span></div>
|
|
96
|
+
<div class="param"><span class="param-name">Saturation:</span><span class="param-value">0.249296209384</span></div>
|
|
97
|
+
<div class="param"><span class="param-name">Intensity:</span><span class="param-value">0.952823923414</span></div>
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<div class="param-group">
|
|
101
|
+
<h2>DYNAMICS</h2>
|
|
102
|
+
<div class="param"><span class="param-name">Speed:</span><span class="param-value">0.774222544849</span></div>
|
|
103
|
+
<div class="param"><span class="param-name">Chaos:</span><span class="param-value">0.558094101014</span></div>
|
|
104
|
+
<div class="param"><span class="param-name">Morph:</span><span class="param-value">0.508707093863</span></div>
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<div class="pcs">
|
|
108
|
+
<div class="pcs-label">PERCEPTUAL COMPLEXITY SCORE</div>
|
|
109
|
+
<div class="pcs-value">1.35450891</div>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
|
|
113
|
+
<script>
|
|
114
|
+
// Mathematical constants
|
|
115
|
+
const PHI = 1.618033988749895;
|
|
116
|
+
const TAU = 6.283185307179586;
|
|
117
|
+
|
|
118
|
+
// Baked parameters from algorithmic generation
|
|
119
|
+
const PARAMS = {
|
|
120
|
+
"XY": 3.66681752802549,
|
|
121
|
+
"XZ": 4.233371993741395,
|
|
122
|
+
"YZ": 0,
|
|
123
|
+
"XW": 3.3166676117350136,
|
|
124
|
+
"YW": 2.9154315111399423,
|
|
125
|
+
"ZW": 0.5981274639716998,
|
|
126
|
+
"hue": 180.0931686004542,
|
|
127
|
+
"saturation": 0.24929620938378672,
|
|
128
|
+
"intensity": 0.9528239234136304,
|
|
129
|
+
"geometry": 5,
|
|
130
|
+
"speed": 0.7742225448492754,
|
|
131
|
+
"chaos": 0.5580941010135444,
|
|
132
|
+
"morphFactor": 0.508707093862547,
|
|
133
|
+
"gridDensity": 31
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
// WebGL initialization
|
|
137
|
+
const canvas = document.getElementById('canvas');
|
|
138
|
+
const gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
|
|
139
|
+
|
|
140
|
+
function resize() {
|
|
141
|
+
canvas.width = window.innerWidth * window.devicePixelRatio;
|
|
142
|
+
canvas.height = window.innerHeight * window.devicePixelRatio;
|
|
143
|
+
gl.viewport(0, 0, canvas.width, canvas.height);
|
|
144
|
+
}
|
|
145
|
+
resize();
|
|
146
|
+
window.addEventListener('resize', resize);
|
|
147
|
+
|
|
148
|
+
// Vertex shader
|
|
149
|
+
const vsSource = `
|
|
150
|
+
attribute vec4 aVertexPosition;
|
|
151
|
+
void main() {
|
|
152
|
+
gl_Position = aVertexPosition;
|
|
153
|
+
}
|
|
154
|
+
`;
|
|
155
|
+
|
|
156
|
+
// Fragment shader with quantum system characteristics
|
|
157
|
+
const fsSource = `
|
|
158
|
+
precision highp float;
|
|
159
|
+
|
|
160
|
+
uniform float u_time;
|
|
161
|
+
uniform vec2 u_resolution;
|
|
162
|
+
|
|
163
|
+
// Baked parameters
|
|
164
|
+
const float ROT_XY = 3.666817528025490;
|
|
165
|
+
const float ROT_XZ = 4.233371993741395;
|
|
166
|
+
const float ROT_YZ = 0.000000000000000;
|
|
167
|
+
const float ROT_XW = 3.316667611735014;
|
|
168
|
+
const float ROT_YW = 2.915431511139942;
|
|
169
|
+
const float ROT_ZW = 0.598127463971700;
|
|
170
|
+
const float HUE = 180.093168600454192;
|
|
171
|
+
const float SAT = 0.249296209383787;
|
|
172
|
+
const float INTENSITY = 0.952823923413630;
|
|
173
|
+
const float SPEED = 0.774222544849275;
|
|
174
|
+
const float CHAOS = 0.558094101013544;
|
|
175
|
+
const float MORPH = 0.508707093862547;
|
|
176
|
+
const float GRID = 31.0;
|
|
177
|
+
const int GEOMETRY = 5;
|
|
178
|
+
|
|
179
|
+
// 4D rotation matrices
|
|
180
|
+
mat4 rotateXY(float a) {
|
|
181
|
+
float c = cos(a), s = sin(a);
|
|
182
|
+
return mat4(c,-s,0,0, s,c,0,0, 0,0,1,0, 0,0,0,1);
|
|
183
|
+
}
|
|
184
|
+
mat4 rotateXZ(float a) {
|
|
185
|
+
float c = cos(a), s = sin(a);
|
|
186
|
+
return mat4(c,0,-s,0, 0,1,0,0, s,0,c,0, 0,0,0,1);
|
|
187
|
+
}
|
|
188
|
+
mat4 rotateYZ(float a) {
|
|
189
|
+
float c = cos(a), s = sin(a);
|
|
190
|
+
return mat4(1,0,0,0, 0,c,-s,0, 0,s,c,0, 0,0,0,1);
|
|
191
|
+
}
|
|
192
|
+
mat4 rotateXW(float a) {
|
|
193
|
+
float c = cos(a), s = sin(a);
|
|
194
|
+
return mat4(c,0,0,-s, 0,1,0,0, 0,0,1,0, s,0,0,c);
|
|
195
|
+
}
|
|
196
|
+
mat4 rotateYW(float a) {
|
|
197
|
+
float c = cos(a), s = sin(a);
|
|
198
|
+
return mat4(1,0,0,0, 0,c,0,-s, 0,0,1,0, 0,s,0,c);
|
|
199
|
+
}
|
|
200
|
+
mat4 rotateZW(float a) {
|
|
201
|
+
float c = cos(a), s = sin(a);
|
|
202
|
+
return mat4(1,0,0,0, 0,1,0,0, 0,0,c,-s, 0,0,s,c);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
vec3 hsv2rgb(vec3 c) {
|
|
206
|
+
vec4 K = vec4(1.0, 2.0/3.0, 1.0/3.0, 3.0);
|
|
207
|
+
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
|
|
208
|
+
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
float sdf4D(vec4 p) {
|
|
212
|
+
// Geometry selection based on index
|
|
213
|
+
int baseGeom = GEOMETRY - (GEOMETRY / 8) * 8;
|
|
214
|
+
int coreType = GEOMETRY / 8;
|
|
215
|
+
|
|
216
|
+
float d = length(p) - 1.0;
|
|
217
|
+
|
|
218
|
+
// Base geometry modifications
|
|
219
|
+
if (baseGeom == 0) { // Tetrahedron
|
|
220
|
+
d = max(d, dot(p.xyz, normalize(vec3(1,1,1))) - 0.5);
|
|
221
|
+
} else if (baseGeom == 1) { // Hypercube
|
|
222
|
+
vec4 q = abs(p) - vec4(0.5);
|
|
223
|
+
d = length(max(q, 0.0)) + min(max(q.x, max(q.y, max(q.z, q.w))), 0.0);
|
|
224
|
+
} else if (baseGeom == 3) { // Torus
|
|
225
|
+
vec2 q = vec2(length(p.xz) - 0.5, p.y);
|
|
226
|
+
d = length(q) - 0.2;
|
|
227
|
+
} else if (baseGeom == 4) { // Klein-ish
|
|
228
|
+
d = sin(p.x * 3.0) * sin(p.y * 3.0) * sin(p.z * 3.0) * 0.3 + length(p) - 1.0;
|
|
229
|
+
} else if (baseGeom == 5) { // Fractal
|
|
230
|
+
vec3 z = p.xyz;
|
|
231
|
+
float dr = 1.0;
|
|
232
|
+
float r = 0.0;
|
|
233
|
+
for (int i = 0; i < 4; i++) {
|
|
234
|
+
r = length(z);
|
|
235
|
+
if (r > 2.0) break;
|
|
236
|
+
float theta = acos(z.z / r);
|
|
237
|
+
float phi = atan(z.y, z.x);
|
|
238
|
+
dr = pow(r, 7.0) * 8.0 * dr + 1.0;
|
|
239
|
+
float zr = pow(r, 8.0);
|
|
240
|
+
theta *= 8.0;
|
|
241
|
+
phi *= 8.0;
|
|
242
|
+
z = zr * vec3(sin(theta)*cos(phi), sin(phi)*sin(theta), cos(theta)) + p.xyz;
|
|
243
|
+
}
|
|
244
|
+
d = 0.5 * log(r) * r / dr;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// Core type warp
|
|
248
|
+
if (coreType == 1) { // Hypersphere
|
|
249
|
+
d = mix(d, length(p) - 1.0, 0.5);
|
|
250
|
+
} else if (coreType == 2) { // Hypertetrahedron
|
|
251
|
+
d += sin(p.w * 5.0) * 0.1;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
return d;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
void main() {
|
|
258
|
+
vec2 uv = (gl_FragCoord.xy - 0.5 * u_resolution) / min(u_resolution.x, u_resolution.y);
|
|
259
|
+
float t = u_time * SPEED;
|
|
260
|
+
|
|
261
|
+
// Animated rotation
|
|
262
|
+
float aXY = ROT_XY + t * 0.1;
|
|
263
|
+
float aXZ = ROT_XZ + t * 0.07;
|
|
264
|
+
float aYZ = ROT_YZ + t * 0.05;
|
|
265
|
+
float aXW = ROT_XW + t * 0.13 * CHAOS;
|
|
266
|
+
float aYW = ROT_YW + t * 0.11 * CHAOS;
|
|
267
|
+
float aZW = ROT_ZW + t * 0.09 * CHAOS;
|
|
268
|
+
|
|
269
|
+
mat4 rot = rotateXY(aXY) * rotateXZ(aXZ) * rotateYZ(aYZ) *
|
|
270
|
+
rotateXW(aXW) * rotateYW(aYW) * rotateZW(aZW);
|
|
271
|
+
|
|
272
|
+
// Ray marching
|
|
273
|
+
vec3 ro = vec3(0, 0, -3);
|
|
274
|
+
vec3 rd = normalize(vec3(uv, 1.0));
|
|
275
|
+
|
|
276
|
+
float totalDist = 0.0;
|
|
277
|
+
vec3 col = vec3(0);
|
|
278
|
+
|
|
279
|
+
for (int i = 0; i < 64; i++) {
|
|
280
|
+
vec3 p3 = ro + rd * totalDist;
|
|
281
|
+
vec4 p4 = rot * vec4(p3, sin(t * 0.5) * MORPH);
|
|
282
|
+
|
|
283
|
+
float d = sdf4D(p4);
|
|
284
|
+
|
|
285
|
+
if (d < 0.001) {
|
|
286
|
+
float hue = HUE / 360.0 + totalDist * 0.1;
|
|
287
|
+
col = hsv2rgb(vec3(hue, SAT, INTENSITY));
|
|
288
|
+
col *= 1.0 - totalDist * 0.1;
|
|
289
|
+
break;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
if (totalDist > 10.0) break;
|
|
293
|
+
totalDist += d * 0.5;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// Grid overlay
|
|
297
|
+
vec2 grid = fract(uv * GRID);
|
|
298
|
+
float gridLine = smoothstep(0.02, 0.0, min(grid.x, grid.y)) * 0.1;
|
|
299
|
+
col += vec3(gridLine);
|
|
300
|
+
|
|
301
|
+
gl_FragColor = vec4(col, 1.0);
|
|
302
|
+
}
|
|
303
|
+
`;
|
|
304
|
+
|
|
305
|
+
// Compile shaders
|
|
306
|
+
function compileShader(gl, source, type) {
|
|
307
|
+
const shader = gl.createShader(type);
|
|
308
|
+
gl.shaderSource(shader, source);
|
|
309
|
+
gl.compileShader(shader);
|
|
310
|
+
return shader;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
const vertexShader = compileShader(gl, vsSource, gl.VERTEX_SHADER);
|
|
314
|
+
const fragmentShader = compileShader(gl, fsSource, gl.FRAGMENT_SHADER);
|
|
315
|
+
|
|
316
|
+
const program = gl.createProgram();
|
|
317
|
+
gl.attachShader(program, vertexShader);
|
|
318
|
+
gl.attachShader(program, fragmentShader);
|
|
319
|
+
gl.linkProgram(program);
|
|
320
|
+
gl.useProgram(program);
|
|
321
|
+
|
|
322
|
+
// Fullscreen quad
|
|
323
|
+
const positions = new Float32Array([-1,-1, 1,-1, -1,1, 1,1]);
|
|
324
|
+
const positionBuffer = gl.createBuffer();
|
|
325
|
+
gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);
|
|
326
|
+
gl.bufferData(gl.ARRAY_BUFFER, positions, gl.STATIC_DRAW);
|
|
327
|
+
|
|
328
|
+
const aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition');
|
|
329
|
+
gl.enableVertexAttribArray(aVertexPosition);
|
|
330
|
+
gl.vertexAttribPointer(aVertexPosition, 2, gl.FLOAT, false, 0, 0);
|
|
331
|
+
|
|
332
|
+
const uTime = gl.getUniformLocation(program, 'u_time');
|
|
333
|
+
const uResolution = gl.getUniformLocation(program, 'u_resolution');
|
|
334
|
+
|
|
335
|
+
// Animation loop
|
|
336
|
+
function render(time) {
|
|
337
|
+
gl.uniform1f(uTime, time * 0.001);
|
|
338
|
+
gl.uniform2f(uResolution, canvas.width, canvas.height);
|
|
339
|
+
gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
|
|
340
|
+
requestAnimationFrame(render);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
render(0);
|
|
344
|
+
</script>
|
|
345
|
+
</body>
|
|
346
|
+
</html>
|