shaders 2.3.73 → 2.3.75
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/dist/core/{AngularBlur-BBVuS72B.js → AngularBlur-BgZWbEjj.js} +1 -1
- package/dist/core/{Ascii-C57qusEP.js → Ascii-BwSMmD6Z.js} +1 -1
- package/dist/core/{Aurora-LKsAmrmY.js → Aurora-BPHeGEZ_.js} +2 -2
- package/dist/core/{Beam-BkYNheGX.js → Beam-CAnoOWgt.js} +1 -1
- package/dist/core/{Blob-CWfHiQeb.js → Blob-56vuq_qL.js} +2 -2
- package/dist/core/{Blur-BguzqgHU.js → Blur-DTyNQt1R.js} +1 -1
- package/dist/core/{Bulge-B8jPaomW.js → Bulge-DN2R75Hp.js} +1 -1
- package/dist/core/{CRTScreen-C5v58BPh.js → CRTScreen-BUsz0O_H.js} +1 -1
- package/dist/core/{ChannelBlur-BAq9PV6G.js → ChannelBlur-CCaPXjka.js} +1 -1
- package/dist/core/{Checkerboard-BtVQVtsL.js → Checkerboard-_IUtUrDv.js} +1 -1
- package/dist/core/{ChromaticAberration-Ck4Zd3W1.js → ChromaticAberration-G8_bwQtD.js} +1 -1
- package/dist/core/{Circle-DdVVbdgQ.js → Circle-CMeFMTtC.js} +1 -1
- package/dist/core/{ConcentricSpin-BQTBqzyV.js → ConcentricSpin-BzxzMieZ.js} +2 -2
- package/dist/core/{CursorRipples-CI8y0So9.js → CursorRipples-DHWY-hfP.js} +1 -1
- package/dist/core/{CursorTrail-BBTqzAWC.js → CursorTrail-BuULQ8qV.js} +1 -1
- package/dist/core/{DiffuseBlur-Qz6vgZgZ.js → DiffuseBlur-BiC31OND.js} +1 -1
- package/dist/core/{Dither-Csho-L_O.js → Dither-D6A9bH8T.js} +1 -1
- package/dist/core/{Duotone-haec3FrU.js → Duotone-sWs1rKEF.js} +2 -2
- package/dist/core/{FloatingParticles-D6fgcEbH.js → FloatingParticles-DFVXk0yT.js} +1 -1
- package/dist/core/{FlowField-C2KW9_D1.js → FlowField-CgGVA2lm.js} +2 -2
- package/dist/core/{GlassTiles-4nBI82dT.js → GlassTiles-Db7rr0eG.js} +1 -1
- package/dist/core/{Glitch-DoFQeNTD.js → Glitch-bQ7EdNTc.js} +1 -1
- package/dist/core/{Glow-CURvWSnB.js → Glow-DcYaI9pS.js} +1 -1
- package/dist/core/{Godrays-BWEMe4dJ.js → Godrays-kZhTEIHA.js} +1 -1
- package/dist/core/{GridDistortion-BjfEpWUs.js → GridDistortion-Bo3YMHwn.js} +1 -1
- package/dist/core/{Kaleidoscope-Wq5CGMiP.js → Kaleidoscope-ADmVP39h.js} +1 -1
- package/dist/core/{LensFlare-BvU6_Rjd.js → LensFlare-BChYlgBL.js} +1 -1
- package/dist/core/{LinearBlur-WcJbCWwj.js → LinearBlur-Bkjns5jv.js} +1 -1
- package/dist/core/{LinearGradient-CCTJoXKq.js → LinearGradient-CBtyQ7pS.js} +1 -1
- package/dist/core/{Liquify-Ad7waFTE.js → Liquify-DhAt-Zjw.js} +1 -1
- package/dist/core/{Mirror-QfQBv7v_.js → Mirror-P5PQHRqq.js} +1 -1
- package/dist/core/{Perspective-CZiW61kj.js → Perspective-P0odWfct.js} +1 -1
- package/dist/core/{Pixelate-DCUPU8V-.js → Pixelate-jzWGa_BV.js} +1 -1
- package/dist/core/{Plasma-CEs9bH1D.js → Plasma-D5SzUyO1.js} +2 -2
- package/dist/core/{PolarCoordinates-ituaMXaH.js → PolarCoordinates-CjJBXXYn.js} +1 -1
- package/dist/core/{ProgressiveBlur-DEfvy5dW.js → ProgressiveBlur-Bn6TW_Nm.js} +1 -1
- package/dist/core/{RadialGradient-Di_VuDot.js → RadialGradient-DPIwryzD.js} +1 -1
- package/dist/core/{RectangularCoordinates-xmILlyac.js → RectangularCoordinates-_wuy_3lH.js} +1 -1
- package/dist/core/{Ripples-rV1yHHuE.js → Ripples-DEhu4BiP.js} +2 -2
- package/dist/core/{Sharpness-DeD2T2-a.js → Sharpness-C3xiyyR2.js} +1 -1
- package/dist/core/{Shatter-DpPRGA0l.js → Shatter-DKKKjn-j.js} +1 -1
- package/dist/core/{SimplexNoise-C648ofLb.js → SimplexNoise-BrTbyAF8.js} +2 -2
- package/dist/core/{SineWave-t5aPlKh4.js → SineWave-C_J_VMwO.js} +1 -1
- package/dist/core/{Spherize-CkHw6wfO.js → Spherize-QQs5j4pJ.js} +1 -1
- package/dist/core/{Spiral-C4xcFRWd.js → Spiral-eZqdB4az.js} +2 -2
- package/dist/core/{Strands-FVw1VjAV.js → Strands-Dix27a_B.js} +1 -1
- package/dist/core/{Stretch-BmPCPWY8.js → Stretch-Bz3LETyz.js} +1 -1
- package/dist/core/{Stripes-D-fIDK48.js → Stripes-ClDdoKOx.js} +2 -2
- package/dist/core/{StudioBackground-BqIq7k14.js → StudioBackground-CmFJwN8P.js} +1 -1
- package/dist/core/{Swirl-C137NvM7.js → Swirl-Bx8HwjR-.js} +2 -2
- package/dist/core/{TiltShift-vr8k-bAX.js → TiltShift-YwQVnxTS.js} +1 -1
- package/dist/core/{Tritone-NDERRh_N.js → Tritone-BouzdhuC.js} +2 -2
- package/dist/core/{Twirl-BFocvCoq.js → Twirl-IM8zffEY.js} +1 -1
- package/dist/core/{WaveDistortion-HrmY6hF5.js → WaveDistortion-CO_2EMbJ.js} +2 -2
- package/dist/core/{ZoomBlur-DSCQQerF.js → ZoomBlur-DEy-f1iL.js} +1 -1
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +217 -10
- package/dist/core/presetRenderer.d.ts +75 -0
- package/dist/core/presetRenderer.d.ts.map +1 -0
- package/dist/core/registry.js +78 -188
- package/dist/core/renderer.d.ts +10 -2
- package/dist/core/renderer.d.ts.map +1 -1
- package/dist/core/shaderRegistry-C2JWSXay.js +186 -0
- package/dist/core/shaders/AngularBlur/index.js +2 -2
- package/dist/core/shaders/Ascii/index.js +2 -2
- package/dist/core/shaders/Aurora/index.js +3 -3
- package/dist/core/shaders/Beam/index.js +2 -2
- package/dist/core/shaders/Blob/index.js +3 -3
- package/dist/core/shaders/Blur/index.js +2 -2
- package/dist/core/shaders/Bulge/index.js +2 -2
- package/dist/core/shaders/CRTScreen/index.js +2 -2
- package/dist/core/shaders/ChannelBlur/index.js +2 -2
- package/dist/core/shaders/Checkerboard/index.js +2 -2
- package/dist/core/shaders/ChromaticAberration/index.js +2 -2
- package/dist/core/shaders/Circle/index.js +2 -2
- package/dist/core/shaders/ConcentricSpin/index.js +3 -3
- package/dist/core/shaders/CursorRipples/index.js +2 -2
- package/dist/core/shaders/CursorTrail/index.js +2 -2
- package/dist/core/shaders/DiffuseBlur/index.js +2 -2
- package/dist/core/shaders/Dither/index.js +2 -2
- package/dist/core/shaders/Duotone/index.js +3 -3
- package/dist/core/shaders/FloatingParticles/index.js +2 -2
- package/dist/core/shaders/FlowField/index.js +3 -3
- package/dist/core/shaders/GlassTiles/index.js +2 -2
- package/dist/core/shaders/Glitch/index.js +2 -2
- package/dist/core/shaders/Glow/index.js +2 -2
- package/dist/core/shaders/Godrays/index.js +2 -2
- package/dist/core/shaders/GridDistortion/index.js +2 -2
- package/dist/core/shaders/Kaleidoscope/index.js +2 -2
- package/dist/core/shaders/LensFlare/index.js +2 -2
- package/dist/core/shaders/LinearBlur/index.js +2 -2
- package/dist/core/shaders/LinearGradient/index.js +2 -2
- package/dist/core/shaders/Liquify/index.js +2 -2
- package/dist/core/shaders/Mirror/index.js +2 -2
- package/dist/core/shaders/Perspective/index.js +2 -2
- package/dist/core/shaders/Pixelate/index.js +2 -2
- package/dist/core/shaders/Plasma/index.js +3 -3
- package/dist/core/shaders/PolarCoordinates/index.js +2 -2
- package/dist/core/shaders/ProgressiveBlur/index.js +2 -2
- package/dist/core/shaders/RadialGradient/index.js +2 -2
- package/dist/core/shaders/RectangularCoordinates/index.js +2 -2
- package/dist/core/shaders/Ripples/index.js +3 -3
- package/dist/core/shaders/Sharpness/index.js +2 -2
- package/dist/core/shaders/Shatter/index.js +2 -2
- package/dist/core/shaders/SimplexNoise/index.js +3 -3
- package/dist/core/shaders/SineWave/index.js +2 -2
- package/dist/core/shaders/Spherize/index.js +2 -2
- package/dist/core/shaders/Spiral/index.js +3 -3
- package/dist/core/shaders/Strands/index.js +2 -2
- package/dist/core/shaders/Stretch/index.js +2 -2
- package/dist/core/shaders/Stripes/index.js +3 -3
- package/dist/core/shaders/StudioBackground/index.js +2 -2
- package/dist/core/shaders/Swirl/index.js +3 -3
- package/dist/core/shaders/TiltShift/index.js +2 -2
- package/dist/core/shaders/Tritone/index.js +3 -3
- package/dist/core/shaders/Twirl/index.js +2 -2
- package/dist/core/shaders/WaveDistortion/index.js +3 -3
- package/dist/core/shaders/ZoomBlur/index.js +2 -2
- package/dist/pixi/createShaderSprite.d.ts +54 -0
- package/dist/pixi/createShaderSprite.d.ts.map +1 -0
- package/dist/pixi/index.d.ts +20 -0
- package/dist/pixi/index.d.ts.map +1 -0
- package/dist/pixi/index.js +153 -0
- package/package.json +15 -3
- /package/dist/core/{alpha-Byel9eTg.js → alpha-C4ptedXe.js} +0 -0
- /package/dist/core/{colorMixing-jSm3tbMv.js → colorMixing-BPpDnR5I.js} +0 -0
- /package/dist/core/{time-BZqyVJXt.js → time-DUqSFWvT.js} +0 -0
package/dist/core/index.js
CHANGED
|
@@ -1,6 +1,84 @@
|
|
|
1
1
|
import { t as applyEdgeHandling } from "./edges-CfGcQniB.js";
|
|
2
2
|
import { a as transformColor, l as transformPosition, n as setColorSpaceMode, s as transformColorUpdate, u as transformPositionUpdate } from "./transformations-B5lM6fYX.js";
|
|
3
|
-
import
|
|
3
|
+
import "./alpha-C4ptedXe.js";
|
|
4
|
+
import "./AngularBlur-BgZWbEjj.js";
|
|
5
|
+
import "./Ascii-BwSMmD6Z.js";
|
|
6
|
+
import "./colorMixing-BPpDnR5I.js";
|
|
7
|
+
import { t as createAnimatedTime } from "./time-DUqSFWvT.js";
|
|
8
|
+
import "./Aurora-BPHeGEZ_.js";
|
|
9
|
+
import "./Beam-CAnoOWgt.js";
|
|
10
|
+
import "./Blob-56vuq_qL.js";
|
|
11
|
+
import "./Blur-DTyNQt1R.js";
|
|
12
|
+
import "./BrightnessContrast-BoR9bi58.js";
|
|
13
|
+
import "./Bulge-DN2R75Hp.js";
|
|
14
|
+
import "./ChannelBlur-CCaPXjka.js";
|
|
15
|
+
import "./Checkerboard-_IUtUrDv.js";
|
|
16
|
+
import "./ChromaFlow-Cq6hDVjX.js";
|
|
17
|
+
import "./ChromaticAberration-G8_bwQtD.js";
|
|
18
|
+
import "./Circle-CMeFMTtC.js";
|
|
19
|
+
import "./ConcentricSpin-BzxzMieZ.js";
|
|
20
|
+
import "./ContourLines-yEb5IJ1Y.js";
|
|
21
|
+
import "./CRTScreen-BUsz0O_H.js";
|
|
22
|
+
import "./CursorRipples-DHWY-hfP.js";
|
|
23
|
+
import "./CursorTrail-BuULQ8qV.js";
|
|
24
|
+
import "./DiffuseBlur-BiC31OND.js";
|
|
25
|
+
import "./Dither-D6A9bH8T.js";
|
|
26
|
+
import "./DotGrid-wOP8tqHX.js";
|
|
27
|
+
import "./Duotone-sWs1rKEF.js";
|
|
28
|
+
import "./FilmGrain-BVDkgA2W.js";
|
|
29
|
+
import "./FloatingParticles-DFVXk0yT.js";
|
|
30
|
+
import "./FlowField-CgGVA2lm.js";
|
|
31
|
+
import "./GlassTiles-Db7rr0eG.js";
|
|
32
|
+
import "./Glitch-bQ7EdNTc.js";
|
|
33
|
+
import "./Glow-DcYaI9pS.js";
|
|
34
|
+
import "./Godrays-kZhTEIHA.js";
|
|
35
|
+
import "./Grayscale-B_YZd3uy.js";
|
|
36
|
+
import "./Grid-BOgZleSo.js";
|
|
37
|
+
import "./GridDistortion-Bo3YMHwn.js";
|
|
38
|
+
import "./Group-NJlcbnkb.js";
|
|
39
|
+
import "./Halftone-DogLm5Sz.js";
|
|
40
|
+
import "./HueShift-CcobQ2yn.js";
|
|
41
|
+
import "./ImageTexture-6e1Gz4IG.js";
|
|
42
|
+
import "./Invert-c6RNEzsq.js";
|
|
43
|
+
import "./Kaleidoscope-ADmVP39h.js";
|
|
44
|
+
import "./LensFlare-BChYlgBL.js";
|
|
45
|
+
import "./LinearBlur-Bkjns5jv.js";
|
|
46
|
+
import "./LinearGradient-CBtyQ7pS.js";
|
|
47
|
+
import "./Liquify-DhAt-Zjw.js";
|
|
48
|
+
import "./Mirror-P5PQHRqq.js";
|
|
49
|
+
import "./Perspective-P0odWfct.js";
|
|
50
|
+
import "./Pixelate-jzWGa_BV.js";
|
|
51
|
+
import "./Plasma-D5SzUyO1.js";
|
|
52
|
+
import "./PolarCoordinates-CjJBXXYn.js";
|
|
53
|
+
import "./Posterize-B_XGPa8l.js";
|
|
54
|
+
import "./ProgressiveBlur-Bn6TW_Nm.js";
|
|
55
|
+
import "./RadialGradient-DPIwryzD.js";
|
|
56
|
+
import "./RectangularCoordinates-_wuy_3lH.js";
|
|
57
|
+
import "./Ripples-DEhu4BiP.js";
|
|
58
|
+
import "./Saturation-DmUZQ3u7.js";
|
|
59
|
+
import "./Sharpness-C3xiyyR2.js";
|
|
60
|
+
import "./Shatter-DKKKjn-j.js";
|
|
61
|
+
import "./SimplexNoise-BrTbyAF8.js";
|
|
62
|
+
import "./SineWave-C_J_VMwO.js";
|
|
63
|
+
import "./SolidColor-BY2tBGcO.js";
|
|
64
|
+
import "./Spherize-QQs5j4pJ.js";
|
|
65
|
+
import "./Spiral-eZqdB4az.js";
|
|
66
|
+
import "./Strands-Dix27a_B.js";
|
|
67
|
+
import "./Stretch-Bz3LETyz.js";
|
|
68
|
+
import "./Stripes-ClDdoKOx.js";
|
|
69
|
+
import "./StudioBackground-CmFJwN8P.js";
|
|
70
|
+
import "./Swirl-Bx8HwjR-.js";
|
|
71
|
+
import "./TiltShift-YwQVnxTS.js";
|
|
72
|
+
import "./Tint-Cw39HvaL.js";
|
|
73
|
+
import "./Tritone-BouzdhuC.js";
|
|
74
|
+
import "./Twirl-IM8zffEY.js";
|
|
75
|
+
import "./Vibrance-HMvQZ4tL.js";
|
|
76
|
+
import "./browser-C7ZSkE-t.js";
|
|
77
|
+
import "./VideoTexture-DUk9pA_6.js";
|
|
78
|
+
import "./WaveDistortion-CO_2EMbJ.js";
|
|
79
|
+
import "./WebcamTexture-BmeO4qY-.js";
|
|
80
|
+
import "./ZoomBlur-DEy-f1iL.js";
|
|
81
|
+
import { t as getAllShaders } from "./shaderRegistry-C2JWSXay.js";
|
|
4
82
|
import { Material, Mesh, MeshBasicNodeMaterial, OrthographicCamera, PlaneGeometry, SRGBColorSpace, Scene, WebGPURenderer } from "three/webgpu";
|
|
5
83
|
import { WebGLRenderer } from "three";
|
|
6
84
|
import { PI, abs, add, atan, clamp, convertToTexture, cos, div, dot, float, fract, max, min, mix, mul, pow, screenUV, sign, sin, smoothstep, sqrt, step, sub, time, uniform, uv, vec2, vec3, vec4 } from "three/tsl";
|
|
@@ -622,6 +700,7 @@ function shaderRenderer() {
|
|
|
622
700
|
let initializationAbortController = null;
|
|
623
701
|
let isVisible = false;
|
|
624
702
|
let shouldAnimate = true;
|
|
703
|
+
let forceFullFrameRate = false;
|
|
625
704
|
let currentWidth = 0;
|
|
626
705
|
let currentHeight = 0;
|
|
627
706
|
let lastRenderTime = 0;
|
|
@@ -1261,7 +1340,7 @@ function shaderRenderer() {
|
|
|
1261
1340
|
needsRecompose = true;
|
|
1262
1341
|
}
|
|
1263
1342
|
}
|
|
1264
|
-
if (
|
|
1343
|
+
if ("mask" in metadata && (existingNode.metadata.mask?.source !== metadata.mask?.source || existingNode.metadata.mask?.type !== metadata.mask?.type)) {
|
|
1265
1344
|
existingNode.metadata.mask = metadata.mask;
|
|
1266
1345
|
needsRecompose = true;
|
|
1267
1346
|
}
|
|
@@ -1417,8 +1496,8 @@ function shaderRenderer() {
|
|
|
1417
1496
|
const MIN_FRAME_INTERVAL = 1e3 / 120;
|
|
1418
1497
|
if (lastRenderTime > 0) {
|
|
1419
1498
|
const timeSinceLastRender = currentTime - lastRenderTime;
|
|
1420
|
-
if (!isVisible && timeSinceLastRender < OFF_SCREEN_FPS_INTERVAL) return;
|
|
1421
|
-
if (isVisible && timeSinceLastRender < MIN_FRAME_INTERVAL) return;
|
|
1499
|
+
if (!isVisible && !forceFullFrameRate && timeSinceLastRender < OFF_SCREEN_FPS_INTERVAL) return;
|
|
1500
|
+
if ((isVisible || forceFullFrameRate) && timeSinceLastRender < MIN_FRAME_INTERVAL) return;
|
|
1422
1501
|
}
|
|
1423
1502
|
const cappedDeltaTime = Math.min(deltaTime, .1);
|
|
1424
1503
|
lastRenderTime = currentTime;
|
|
@@ -1551,9 +1630,10 @@ function shaderRenderer() {
|
|
|
1551
1630
|
pendingRegistrationQueue = [];
|
|
1552
1631
|
for (const { id, fragmentNodeFunc, parentId, metadata, uniforms, componentDefinition } of queue) if (fragmentNodeFunc) registerNode(id, fragmentNodeFunc, parentId, metadata, uniforms, componentDefinition);
|
|
1553
1632
|
};
|
|
1554
|
-
const initialize = async ({ canvas, enablePerformanceTracking: enableTracking = true, colorSpace = "p3-linear" }) => {
|
|
1633
|
+
const initialize = async ({ canvas, enablePerformanceTracking: enableTracking = true, colorSpace = "p3-linear", context, gpu, forceFullFrameRate: forceFullFps = false }) => {
|
|
1555
1634
|
if (isInitialized || isInitializing) return;
|
|
1556
1635
|
enablePerformanceTracking = enableTracking;
|
|
1636
|
+
forceFullFrameRate = forceFullFps;
|
|
1557
1637
|
rendererColorSpace = colorSpace;
|
|
1558
1638
|
setColorSpaceMode(colorSpace);
|
|
1559
1639
|
isInitializing = true;
|
|
@@ -1579,7 +1659,18 @@ function shaderRenderer() {
|
|
|
1579
1659
|
};
|
|
1580
1660
|
window.addEventListener("beforeunload", unloadHandler);
|
|
1581
1661
|
if (localAbortController.signal.aborted) return;
|
|
1582
|
-
|
|
1662
|
+
if (context) {
|
|
1663
|
+
console.log("[Shaders] Using provided WebGL context");
|
|
1664
|
+
renderer = new WebGLRenderer({
|
|
1665
|
+
canvas,
|
|
1666
|
+
context,
|
|
1667
|
+
antialias: true,
|
|
1668
|
+
alpha: true,
|
|
1669
|
+
depth: false,
|
|
1670
|
+
stencil: true,
|
|
1671
|
+
powerPreference: "high-performance"
|
|
1672
|
+
});
|
|
1673
|
+
} else try {
|
|
1583
1674
|
renderer = new WebGPURenderer({
|
|
1584
1675
|
canvas,
|
|
1585
1676
|
antialias: true,
|
|
@@ -1587,19 +1678,26 @@ function shaderRenderer() {
|
|
|
1587
1678
|
depth: false,
|
|
1588
1679
|
powerPreference: "high-performance"
|
|
1589
1680
|
});
|
|
1590
|
-
await renderer.init(
|
|
1681
|
+
if (gpu?.device && gpu?.adapter) await renderer.init({
|
|
1682
|
+
device: gpu.device,
|
|
1683
|
+
adapter: gpu.adapter
|
|
1684
|
+
});
|
|
1685
|
+
else await renderer.init();
|
|
1591
1686
|
if (localAbortController.signal.aborted) return;
|
|
1592
1687
|
} catch (e) {
|
|
1593
1688
|
if (localAbortController.signal.aborted) return;
|
|
1594
1689
|
console.warn("[Shaders] WebGPU initialization failed, falling back to WebGL:", e);
|
|
1595
1690
|
try {
|
|
1596
|
-
|
|
1691
|
+
const webglOptions = {
|
|
1597
1692
|
canvas,
|
|
1598
1693
|
antialias: true,
|
|
1599
1694
|
alpha: true,
|
|
1600
1695
|
depth: false,
|
|
1696
|
+
stencil: true,
|
|
1601
1697
|
powerPreference: "high-performance"
|
|
1602
|
-
}
|
|
1698
|
+
};
|
|
1699
|
+
if (context) webglOptions.context = context;
|
|
1700
|
+
renderer = new WebGLRenderer(webglOptions);
|
|
1603
1701
|
if (localAbortController.signal.aborted) return;
|
|
1604
1702
|
} catch (webglError) {
|
|
1605
1703
|
if (localAbortController.signal.aborted) return;
|
|
@@ -1749,6 +1847,7 @@ function shaderRenderer() {
|
|
|
1749
1847
|
getPerformanceStats,
|
|
1750
1848
|
getNodeRegistry: () => ({ nodes: new Map(nodeRegistry.nodes) }),
|
|
1751
1849
|
getRendererType,
|
|
1850
|
+
getInternalRenderer: () => renderer ?? null,
|
|
1752
1851
|
__testing: {
|
|
1753
1852
|
needsTransformation,
|
|
1754
1853
|
findChildNodes,
|
|
@@ -1759,6 +1858,114 @@ function shaderRenderer() {
|
|
|
1759
1858
|
}
|
|
1760
1859
|
};
|
|
1761
1860
|
}
|
|
1861
|
+
function createRendererFromJSON(preset, options) {
|
|
1862
|
+
const coreRenderer = shaderRenderer();
|
|
1863
|
+
const componentRegistry = /* @__PURE__ */ new Map();
|
|
1864
|
+
const nodeIdMap = /* @__PURE__ */ new Map();
|
|
1865
|
+
getAllShaders().forEach((shader) => {
|
|
1866
|
+
componentRegistry.set(shader.definition.name, shader.definition);
|
|
1867
|
+
});
|
|
1868
|
+
async function initialize(canvas) {
|
|
1869
|
+
await coreRenderer.initialize({
|
|
1870
|
+
canvas,
|
|
1871
|
+
enablePerformanceTracking: options?.enablePerformanceTracking || false,
|
|
1872
|
+
context: options?.context,
|
|
1873
|
+
gpu: options?.gpu,
|
|
1874
|
+
forceFullFrameRate: options?.forceFullFrameRate || false
|
|
1875
|
+
});
|
|
1876
|
+
registerPresetNodes();
|
|
1877
|
+
coreRenderer.stopAnimation();
|
|
1878
|
+
}
|
|
1879
|
+
async function renderFrame() {
|
|
1880
|
+
if (!coreRenderer.isInitialized()) {
|
|
1881
|
+
console.warn("[presetRenderer] Renderer not yet initialized, skipping frame");
|
|
1882
|
+
return;
|
|
1883
|
+
}
|
|
1884
|
+
await coreRenderer.renderAndWait();
|
|
1885
|
+
}
|
|
1886
|
+
function updatePreset(newPreset) {
|
|
1887
|
+
nodeIdMap.forEach((_, nodeId) => {
|
|
1888
|
+
coreRenderer.removeNode(nodeId);
|
|
1889
|
+
});
|
|
1890
|
+
nodeIdMap.clear();
|
|
1891
|
+
preset = newPreset;
|
|
1892
|
+
registerPresetNodes();
|
|
1893
|
+
}
|
|
1894
|
+
function getGPUContext() {
|
|
1895
|
+
const rendererType = coreRenderer.getRendererType();
|
|
1896
|
+
const internalRenderer = coreRenderer.getInternalRenderer();
|
|
1897
|
+
if (rendererType === "webgpu") return {
|
|
1898
|
+
type: "webgpu",
|
|
1899
|
+
device: internalRenderer.backend?.device,
|
|
1900
|
+
adapter: internalRenderer.backend?.adapter,
|
|
1901
|
+
canvas: internalRenderer.domElement
|
|
1902
|
+
};
|
|
1903
|
+
else return {
|
|
1904
|
+
type: "webgl",
|
|
1905
|
+
context: internalRenderer.getContext?.(),
|
|
1906
|
+
canvas: internalRenderer.domElement
|
|
1907
|
+
};
|
|
1908
|
+
}
|
|
1909
|
+
function dispose() {
|
|
1910
|
+
coreRenderer.cleanup();
|
|
1911
|
+
}
|
|
1912
|
+
function registerPresetNodes() {
|
|
1913
|
+
const rootId = "preset-root";
|
|
1914
|
+
coreRenderer.registerNode(rootId, ({ childNode }) => childNode || vec4(0, 0, 0, 0), null, null, {});
|
|
1915
|
+
preset.components.forEach((component, index) => {
|
|
1916
|
+
registerComponent(component, rootId, index);
|
|
1917
|
+
});
|
|
1918
|
+
}
|
|
1919
|
+
function registerComponent(component, parentId, renderOrder) {
|
|
1920
|
+
const componentDef = componentRegistry.get(component.type);
|
|
1921
|
+
if (!componentDef) {
|
|
1922
|
+
console.warn(`[createRendererFromJSON] Unknown component type: ${component.type}`);
|
|
1923
|
+
return;
|
|
1924
|
+
}
|
|
1925
|
+
const nodeId = component.id || `${component.type}_${Date.now()}_${Math.random()}`;
|
|
1926
|
+
nodeIdMap.set(nodeId, component.type);
|
|
1927
|
+
const uniforms = propsToUniforms(component.props || {}, componentDef);
|
|
1928
|
+
const metadata = {
|
|
1929
|
+
blendMode: component.props?.blendMode || "normal",
|
|
1930
|
+
opacity: component.props?.opacity,
|
|
1931
|
+
visible: component.props?.visible,
|
|
1932
|
+
renderOrder,
|
|
1933
|
+
id: component.id,
|
|
1934
|
+
mask: component.props?.maskSource ? {
|
|
1935
|
+
source: component.props.maskSource,
|
|
1936
|
+
type: component.props.maskType || "alpha"
|
|
1937
|
+
} : void 0,
|
|
1938
|
+
transform: component.props?.transform
|
|
1939
|
+
};
|
|
1940
|
+
coreRenderer.registerNode(nodeId, componentDef.fragmentNode, parentId, metadata, uniforms, componentDef);
|
|
1941
|
+
component.children?.forEach((child, index) => {
|
|
1942
|
+
registerComponent(child, nodeId, index);
|
|
1943
|
+
});
|
|
1944
|
+
}
|
|
1945
|
+
function propsToUniforms(props, componentDef) {
|
|
1946
|
+
const uniforms = {};
|
|
1947
|
+
Object.entries(componentDef.props).forEach(([key, propConfig]) => {
|
|
1948
|
+
const value = props[key] !== void 0 ? props[key] : propConfig.default;
|
|
1949
|
+
const transformedValue = propConfig.transform ? propConfig.transform(value) : value;
|
|
1950
|
+
if (transformedValue && typeof transformedValue === "object" && "node" in transformedValue) uniforms[key] = {
|
|
1951
|
+
uniform: transformedValue.node,
|
|
1952
|
+
transform: propConfig.transform
|
|
1953
|
+
};
|
|
1954
|
+
else uniforms[key] = {
|
|
1955
|
+
uniform: uniform(transformedValue),
|
|
1956
|
+
transform: propConfig.transform
|
|
1957
|
+
};
|
|
1958
|
+
});
|
|
1959
|
+
return uniforms;
|
|
1960
|
+
}
|
|
1961
|
+
return {
|
|
1962
|
+
initialize,
|
|
1963
|
+
renderFrame,
|
|
1964
|
+
updatePreset,
|
|
1965
|
+
getGPUContext,
|
|
1966
|
+
dispose
|
|
1967
|
+
};
|
|
1968
|
+
}
|
|
1762
1969
|
function resolveMaskDependencies(nodes) {
|
|
1763
1970
|
const elementIdToNodeId = /* @__PURE__ */ new Map();
|
|
1764
1971
|
const maskDependencies = /* @__PURE__ */ new Map();
|
|
@@ -1833,4 +2040,4 @@ const edgeMask = (options = {}) => {
|
|
|
1833
2040
|
const ovalDistance = ovalX.mul(ovalX).add(ovalY.mul(ovalY)).sqrt();
|
|
1834
2041
|
return float(1).sub(smoothstep(float(1).sub(float(inset)), float(1).sub(float(inset)).add(float(softness)), ovalDistance.mul(float(1).add(float(softness)))));
|
|
1835
2042
|
};
|
|
1836
|
-
export { createAnimatedTime, createUniformsMap, distort, edgeMask, glow, grain, resolveMaskDependencies, shaderRenderer, updateUniformValue };
|
|
2043
|
+
export { createAnimatedTime, createRendererFromJSON, createUniformsMap, distort, edgeMask, glow, grain, resolveMaskDependencies, shaderRenderer, updateUniformValue };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component configuration from JSON preset
|
|
3
|
+
*/
|
|
4
|
+
export interface ComponentConfig {
|
|
5
|
+
type: string;
|
|
6
|
+
id?: string;
|
|
7
|
+
props?: Record<string, any>;
|
|
8
|
+
children?: ComponentConfig[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Preset configuration structure
|
|
12
|
+
*/
|
|
13
|
+
export interface PresetConfig {
|
|
14
|
+
components: ComponentConfig[];
|
|
15
|
+
structureVersion?: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Options for creating a preset renderer
|
|
19
|
+
*/
|
|
20
|
+
export interface PresetRendererOptions {
|
|
21
|
+
enablePerformanceTracking?: boolean;
|
|
22
|
+
gpu?: {
|
|
23
|
+
device: GPUDevice;
|
|
24
|
+
adapter: GPUAdapter;
|
|
25
|
+
};
|
|
26
|
+
context?: WebGLRenderingContext | WebGL2RenderingContext;
|
|
27
|
+
forceFullFrameRate?: boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* GPU context information for sharing with other renderers
|
|
31
|
+
*/
|
|
32
|
+
export interface GPUContext {
|
|
33
|
+
type: 'webgpu' | 'webgl';
|
|
34
|
+
device?: GPUDevice;
|
|
35
|
+
adapter?: GPUAdapter;
|
|
36
|
+
context?: WebGLRenderingContext | WebGL2RenderingContext;
|
|
37
|
+
canvas: HTMLCanvasElement;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Create a renderer from preset JSON configuration
|
|
41
|
+
* Provides manual render control for integration with third-party tools
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```typescript
|
|
45
|
+
* const preset = {
|
|
46
|
+
* components: [
|
|
47
|
+
* {
|
|
48
|
+
* type: 'RadialGradient',
|
|
49
|
+
* props: {
|
|
50
|
+
* color1: '#ff0000',
|
|
51
|
+
* color2: '#0000ff'
|
|
52
|
+
* }
|
|
53
|
+
* }
|
|
54
|
+
* ]
|
|
55
|
+
* }
|
|
56
|
+
*
|
|
57
|
+
* const renderer = createRendererFromJSON(preset)
|
|
58
|
+
* await renderer.initialize(canvas)
|
|
59
|
+
*
|
|
60
|
+
* // Manual render loop
|
|
61
|
+
* function animate() {
|
|
62
|
+
* await renderer.renderFrame()
|
|
63
|
+
* requestAnimationFrame(animate)
|
|
64
|
+
* }
|
|
65
|
+
* animate()
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
export declare function createRendererFromJSON(preset: PresetConfig, options?: PresetRendererOptions): {
|
|
69
|
+
initialize: (canvas: HTMLCanvasElement) => Promise<void>;
|
|
70
|
+
renderFrame: () => Promise<void>;
|
|
71
|
+
updatePreset: (newPreset: PresetConfig) => void;
|
|
72
|
+
getGPUContext: () => GPUContext;
|
|
73
|
+
dispose: () => void;
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=presetRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presetRenderer.d.ts","sourceRoot":"","sources":["../src/presetRenderer.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAA;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,eAAe,EAAE,CAAA;IAC7B,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,yBAAyB,CAAC,EAAE,OAAO,CAAA;IAEnC,GAAG,CAAC,EAAE;QACJ,MAAM,EAAE,SAAS,CAAA;QACjB,OAAO,EAAE,UAAU,CAAA;KACpB,CAAA;IACD,OAAO,CAAC,EAAE,qBAAqB,GAAG,sBAAsB,CAAA;IAExD,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAA;IACxB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,OAAO,CAAC,EAAE,UAAU,CAAA;IACpB,OAAO,CAAC,EAAE,qBAAqB,GAAG,sBAAsB,CAAA;IACxD,MAAM,EAAE,iBAAiB,CAAA;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,YAAY,EACpB,OAAO,CAAC,EAAE,qBAAqB;yBAgBG,iBAAiB,KAAG,OAAO,CAAC,IAAI,CAAC;uBAoBrC,OAAO,CAAC,IAAI,CAAC;8BAaV,YAAY,KAAG,IAAI;yBAgB1B,UAAU;mBAwBhB,IAAI;EAyHzB"}
|
package/dist/core/registry.js
CHANGED
|
@@ -1,192 +1,82 @@
|
|
|
1
1
|
import "./edges-CfGcQniB.js";
|
|
2
2
|
import "./transformations-B5lM6fYX.js";
|
|
3
|
-
import "./
|
|
4
|
-
import "./
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import "./
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import
|
|
48
|
-
import
|
|
49
|
-
import
|
|
50
|
-
import
|
|
51
|
-
import
|
|
52
|
-
import
|
|
53
|
-
import
|
|
54
|
-
import
|
|
55
|
-
import
|
|
56
|
-
import
|
|
57
|
-
import
|
|
58
|
-
import
|
|
59
|
-
import
|
|
60
|
-
import
|
|
61
|
-
import
|
|
62
|
-
import
|
|
63
|
-
import
|
|
64
|
-
import
|
|
65
|
-
import
|
|
66
|
-
import
|
|
67
|
-
import
|
|
68
|
-
import
|
|
69
|
-
import
|
|
70
|
-
import
|
|
71
|
-
import
|
|
72
|
-
import
|
|
73
|
-
import
|
|
74
|
-
import
|
|
75
|
-
import
|
|
3
|
+
import "./alpha-C4ptedXe.js";
|
|
4
|
+
import "./AngularBlur-BgZWbEjj.js";
|
|
5
|
+
import "./Ascii-BwSMmD6Z.js";
|
|
6
|
+
import "./colorMixing-BPpDnR5I.js";
|
|
7
|
+
import "./time-DUqSFWvT.js";
|
|
8
|
+
import "./Aurora-BPHeGEZ_.js";
|
|
9
|
+
import "./Beam-CAnoOWgt.js";
|
|
10
|
+
import "./Blob-56vuq_qL.js";
|
|
11
|
+
import "./Blur-DTyNQt1R.js";
|
|
12
|
+
import "./BrightnessContrast-BoR9bi58.js";
|
|
13
|
+
import "./Bulge-DN2R75Hp.js";
|
|
14
|
+
import "./ChannelBlur-CCaPXjka.js";
|
|
15
|
+
import "./Checkerboard-_IUtUrDv.js";
|
|
16
|
+
import "./ChromaFlow-Cq6hDVjX.js";
|
|
17
|
+
import "./ChromaticAberration-G8_bwQtD.js";
|
|
18
|
+
import "./Circle-CMeFMTtC.js";
|
|
19
|
+
import "./ConcentricSpin-BzxzMieZ.js";
|
|
20
|
+
import "./ContourLines-yEb5IJ1Y.js";
|
|
21
|
+
import "./CRTScreen-BUsz0O_H.js";
|
|
22
|
+
import "./CursorRipples-DHWY-hfP.js";
|
|
23
|
+
import "./CursorTrail-BuULQ8qV.js";
|
|
24
|
+
import "./DiffuseBlur-BiC31OND.js";
|
|
25
|
+
import "./Dither-D6A9bH8T.js";
|
|
26
|
+
import "./DotGrid-wOP8tqHX.js";
|
|
27
|
+
import "./Duotone-sWs1rKEF.js";
|
|
28
|
+
import "./FilmGrain-BVDkgA2W.js";
|
|
29
|
+
import "./FloatingParticles-DFVXk0yT.js";
|
|
30
|
+
import "./FlowField-CgGVA2lm.js";
|
|
31
|
+
import "./GlassTiles-Db7rr0eG.js";
|
|
32
|
+
import "./Glitch-bQ7EdNTc.js";
|
|
33
|
+
import "./Glow-DcYaI9pS.js";
|
|
34
|
+
import "./Godrays-kZhTEIHA.js";
|
|
35
|
+
import "./Grayscale-B_YZd3uy.js";
|
|
36
|
+
import "./Grid-BOgZleSo.js";
|
|
37
|
+
import "./GridDistortion-Bo3YMHwn.js";
|
|
38
|
+
import "./Group-NJlcbnkb.js";
|
|
39
|
+
import "./Halftone-DogLm5Sz.js";
|
|
40
|
+
import "./HueShift-CcobQ2yn.js";
|
|
41
|
+
import "./ImageTexture-6e1Gz4IG.js";
|
|
42
|
+
import "./Invert-c6RNEzsq.js";
|
|
43
|
+
import "./Kaleidoscope-ADmVP39h.js";
|
|
44
|
+
import "./LensFlare-BChYlgBL.js";
|
|
45
|
+
import "./LinearBlur-Bkjns5jv.js";
|
|
46
|
+
import "./LinearGradient-CBtyQ7pS.js";
|
|
47
|
+
import "./Liquify-DhAt-Zjw.js";
|
|
48
|
+
import "./Mirror-P5PQHRqq.js";
|
|
49
|
+
import "./Perspective-P0odWfct.js";
|
|
50
|
+
import "./Pixelate-jzWGa_BV.js";
|
|
51
|
+
import "./Plasma-D5SzUyO1.js";
|
|
52
|
+
import "./PolarCoordinates-CjJBXXYn.js";
|
|
53
|
+
import "./Posterize-B_XGPa8l.js";
|
|
54
|
+
import "./ProgressiveBlur-Bn6TW_Nm.js";
|
|
55
|
+
import "./RadialGradient-DPIwryzD.js";
|
|
56
|
+
import "./RectangularCoordinates-_wuy_3lH.js";
|
|
57
|
+
import "./Ripples-DEhu4BiP.js";
|
|
58
|
+
import "./Saturation-DmUZQ3u7.js";
|
|
59
|
+
import "./Sharpness-C3xiyyR2.js";
|
|
60
|
+
import "./Shatter-DKKKjn-j.js";
|
|
61
|
+
import "./SimplexNoise-BrTbyAF8.js";
|
|
62
|
+
import "./SineWave-C_J_VMwO.js";
|
|
63
|
+
import "./SolidColor-BY2tBGcO.js";
|
|
64
|
+
import "./Spherize-QQs5j4pJ.js";
|
|
65
|
+
import "./Spiral-eZqdB4az.js";
|
|
66
|
+
import "./Strands-Dix27a_B.js";
|
|
67
|
+
import "./Stretch-Bz3LETyz.js";
|
|
68
|
+
import "./Stripes-ClDdoKOx.js";
|
|
69
|
+
import "./StudioBackground-CmFJwN8P.js";
|
|
70
|
+
import "./Swirl-Bx8HwjR-.js";
|
|
71
|
+
import "./TiltShift-YwQVnxTS.js";
|
|
72
|
+
import "./Tint-Cw39HvaL.js";
|
|
73
|
+
import "./Tritone-BouzdhuC.js";
|
|
74
|
+
import "./Twirl-IM8zffEY.js";
|
|
75
|
+
import "./Vibrance-HMvQZ4tL.js";
|
|
76
76
|
import "./browser-C7ZSkE-t.js";
|
|
77
|
-
import
|
|
78
|
-
import
|
|
79
|
-
import
|
|
80
|
-
import
|
|
81
|
-
|
|
82
|
-
const registry = {};
|
|
83
|
-
const shaderDefinitions = {
|
|
84
|
-
AngularBlur: componentDefinition,
|
|
85
|
-
Ascii: componentDefinition$1,
|
|
86
|
-
Aurora: componentDefinition$2,
|
|
87
|
-
Beam: componentDefinition$3,
|
|
88
|
-
Blob: componentDefinition$4,
|
|
89
|
-
Blur: componentDefinition$5,
|
|
90
|
-
BrightnessContrast: componentDefinition$6,
|
|
91
|
-
Bulge: componentDefinition$7,
|
|
92
|
-
ChannelBlur: componentDefinition$8,
|
|
93
|
-
Checkerboard: componentDefinition$9,
|
|
94
|
-
ChromaFlow: componentDefinition$10,
|
|
95
|
-
ChromaticAberration: componentDefinition$11,
|
|
96
|
-
Circle: componentDefinition$12,
|
|
97
|
-
ConcentricSpin: componentDefinition$13,
|
|
98
|
-
ContourLines: componentDefinition$14,
|
|
99
|
-
CRTScreen: componentDefinition$15,
|
|
100
|
-
CursorRipples: componentDefinition$16,
|
|
101
|
-
CursorTrail: componentDefinition$17,
|
|
102
|
-
DiffuseBlur: componentDefinition$18,
|
|
103
|
-
Dither: componentDefinition$19,
|
|
104
|
-
DotGrid: componentDefinition$20,
|
|
105
|
-
Duotone: componentDefinition$21,
|
|
106
|
-
FilmGrain: componentDefinition$22,
|
|
107
|
-
FloatingParticles: componentDefinition$23,
|
|
108
|
-
FlowField: componentDefinition$24,
|
|
109
|
-
GlassTiles: componentDefinition$25,
|
|
110
|
-
Glitch: componentDefinition$26,
|
|
111
|
-
Glow: componentDefinition$27,
|
|
112
|
-
Godrays: componentDefinition$28,
|
|
113
|
-
Grayscale: componentDefinition$29,
|
|
114
|
-
Grid: componentDefinition$30,
|
|
115
|
-
GridDistortion: componentDefinition$31,
|
|
116
|
-
Group: componentDefinition$32,
|
|
117
|
-
Halftone: componentDefinition$33,
|
|
118
|
-
HueShift: componentDefinition$34,
|
|
119
|
-
ImageTexture: componentDefinition$35,
|
|
120
|
-
Invert: componentDefinition$36,
|
|
121
|
-
Kaleidoscope: componentDefinition$37,
|
|
122
|
-
LensFlare: componentDefinition$38,
|
|
123
|
-
LinearBlur: componentDefinition$39,
|
|
124
|
-
LinearGradient: componentDefinition$40,
|
|
125
|
-
Liquify: componentDefinition$41,
|
|
126
|
-
Mirror: componentDefinition$42,
|
|
127
|
-
Perspective: componentDefinition$43,
|
|
128
|
-
Pixelate: componentDefinition$44,
|
|
129
|
-
Plasma: componentDefinition$45,
|
|
130
|
-
PolarCoordinates: componentDefinition$46,
|
|
131
|
-
Posterize: componentDefinition$47,
|
|
132
|
-
ProgressiveBlur: componentDefinition$48,
|
|
133
|
-
RadialGradient: componentDefinition$49,
|
|
134
|
-
RectangularCoordinates: componentDefinition$50,
|
|
135
|
-
Ripples: componentDefinition$51,
|
|
136
|
-
Saturation: componentDefinition$52,
|
|
137
|
-
Sharpness: componentDefinition$53,
|
|
138
|
-
Shatter: componentDefinition$54,
|
|
139
|
-
SimplexNoise: componentDefinition$55,
|
|
140
|
-
SineWave: componentDefinition$56,
|
|
141
|
-
SolidColor: componentDefinition$57,
|
|
142
|
-
Spherize: componentDefinition$58,
|
|
143
|
-
Spiral: componentDefinition$59,
|
|
144
|
-
Strands: componentDefinition$60,
|
|
145
|
-
Stretch: componentDefinition$61,
|
|
146
|
-
Stripes: componentDefinition$62,
|
|
147
|
-
StudioBackground: componentDefinition$63,
|
|
148
|
-
Swirl: componentDefinition$64,
|
|
149
|
-
TiltShift: componentDefinition$65,
|
|
150
|
-
Tint: componentDefinition$66,
|
|
151
|
-
Tritone: componentDefinition$67,
|
|
152
|
-
Twirl: componentDefinition$68,
|
|
153
|
-
Vibrance: componentDefinition$69,
|
|
154
|
-
VideoTexture: componentDefinition$70,
|
|
155
|
-
WaveDistortion: componentDefinition$71,
|
|
156
|
-
WebcamTexture: componentDefinition$72,
|
|
157
|
-
ZoomBlur: componentDefinition$73
|
|
158
|
-
};
|
|
159
|
-
Object.entries(shaderDefinitions).forEach(([fileName, def]) => {
|
|
160
|
-
const propsMetadata = {};
|
|
161
|
-
if (def.props) Object.entries(def.props).forEach(([propName, propConfig]) => {
|
|
162
|
-
if (propConfig.ui) propsMetadata[propName] = {
|
|
163
|
-
ui: propConfig.ui,
|
|
164
|
-
default: propConfig.default,
|
|
165
|
-
description: propConfig.description
|
|
166
|
-
};
|
|
167
|
-
});
|
|
168
|
-
registry[def.name] = {
|
|
169
|
-
name: def.name,
|
|
170
|
-
fileName,
|
|
171
|
-
category: def.category || "Uncategorized",
|
|
172
|
-
definition: def,
|
|
173
|
-
propsMetadata
|
|
174
|
-
};
|
|
175
|
-
});
|
|
176
|
-
return registry;
|
|
177
|
-
};
|
|
178
|
-
const shaderRegistry = createShaderRegistry();
|
|
179
|
-
function getAllShaders() {
|
|
180
|
-
return Object.values(shaderRegistry);
|
|
181
|
-
}
|
|
182
|
-
function getShaderByName(name) {
|
|
183
|
-
return shaderRegistry[name];
|
|
184
|
-
}
|
|
185
|
-
function getShadersByCategory(category) {
|
|
186
|
-
return Object.values(shaderRegistry).filter((shader) => shader.category === category);
|
|
187
|
-
}
|
|
188
|
-
function getShaderCategories() {
|
|
189
|
-
const categories = new Set(Object.values(shaderRegistry).map((shader) => shader.category));
|
|
190
|
-
return Array.from(categories).sort();
|
|
191
|
-
}
|
|
77
|
+
import "./VideoTexture-DUk9pA_6.js";
|
|
78
|
+
import "./WaveDistortion-CO_2EMbJ.js";
|
|
79
|
+
import "./WebcamTexture-BmeO4qY-.js";
|
|
80
|
+
import "./ZoomBlur-DEy-f1iL.js";
|
|
81
|
+
import { a as shaderRegistry, i as getShadersByCategory, n as getShaderByName, r as getShaderCategories, t as getAllShaders } from "./shaderRegistry-C2JWSXay.js";
|
|
192
82
|
export { getAllShaders, getShaderByName, getShaderCategories, getShadersByCategory, shaderRegistry };
|