shaders 2.5.115 → 2.5.117
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-BgZWbEjj.js → AngularBlur-C1oRJ8Y9.js} +1 -1
- package/dist/core/{Aurora-KcUDr49P.js → Aurora-D5Pjk4ve.js} +1 -1
- package/dist/core/{Beam-CAnoOWgt.js → Beam-mvF5Ri7_.js} +1 -1
- package/dist/core/{Blob-CuRSRXmA.js → Blob-CLHx5s6k.js} +1 -1
- package/dist/core/{Bulge-6gRUYqZS.js → Bulge-wflTcWfI.js} +1 -1
- package/dist/core/{Checkerboard-ucave4-a.js → Checkerboard-Db7Rb57F.js} +1 -1
- package/dist/core/{ChromaFlow-DxQaUqPL.js → ChromaFlow-DbiVz3hF.js} +1 -1
- package/dist/core/{ChromaticAberration-DsMj-vBw.js → ChromaticAberration-Bg_I4XF-.js} +1 -1
- package/dist/core/{Circle-QgCuVo44.js → Circle-Bfi2e0Vm.js} +1 -1
- package/dist/core/{ConcentricSpin-Fegtvhl6.js → ConcentricSpin-bAFd5_WI.js} +1 -1
- package/dist/core/{ConicGradient-CQAPYlQg.js → ConicGradient-Bcw4_25S.js} +1 -1
- package/dist/core/{ContourLines-tDBvQOvb.js → ContourLines-CcQWPKLx.js} +1 -1
- package/dist/core/{Crescent-BkRt-XWy.js → Crescent-DiioCL2k.js} +1 -1
- package/dist/core/{Cross-kkY7feuC.js → Cross-CxQTHuxC.js} +1 -1
- package/dist/core/{Crystal-COGiLVvV.js → Crystal-B3iO7o_n.js} +1 -1
- package/dist/core/{CursorRipples-BqtHgpEq.js → CursorRipples-CsYAXG2E.js} +1 -1
- package/dist/core/{CursorTrail-CgRMXbTG.js → CursorTrail-CUtEP_-P.js} +1 -1
- package/dist/core/{DiamondGradient-BC3ugP8a.js → DiamondGradient-3b93bdrv.js} +1 -1
- package/dist/core/{DiffuseBlur-B-Vki4ab.js → DiffuseBlur-61Vuq571.js} +1 -1
- package/dist/core/{Dither-CDfDotR6.js → Dither-Cv0Uci60.js} +1 -1
- package/dist/core/{DotGrid-T9YbgC3V.js → DotGrid-C88Sux6D.js} +1 -1
- package/dist/core/{DropShadow-B7FzTp4H.js → DropShadow-EZyCC_97.js} +1 -1
- package/dist/core/{Duotone-CqQ0NMxS.js → Duotone-D4ads1T9.js} +1 -1
- package/dist/core/{Ellipse-CXxGqTYI.js → Ellipse-iwH-zEvD.js} +1 -1
- package/dist/core/{Emboss-LU-6cckT.js → Emboss-B4i61QDT.js} +1 -1
- package/dist/core/{FallingLines-CArEXajJ.js → FallingLines-CQBvwLqn.js} +1 -1
- package/dist/core/{FloatingParticles-DpYA0_TE.js → FloatingParticles-BAvsQDhF.js} +1 -1
- package/dist/core/{FlowField-CTWyjeXm.js → FlowField-D2xJ0Xr4.js} +1 -1
- package/dist/core/{Flower-MAwlZEv8.js → Flower-CdHVKJKu.js} +1 -1
- package/dist/core/{FlowingGradient-C0Zoyfd6.js → FlowingGradient-DVDnNpGd.js} +1 -1
- package/dist/core/{FlutedGlass-B4FlyBOn.js → FlutedGlass-trmBFfQr.js} +1 -1
- package/dist/core/{Fog-CIdU2Wn-.js → Fog-DrsxPyih.js} +1 -1
- package/dist/core/{Form3D-CqmOXXGj.js → Form3D-D1TtCjk8.js} +1 -1
- package/dist/core/{Glass-BCOkQbvW.js → Glass-B19xsZLn.js} +1 -1
- package/dist/core/{Godrays-w3ruw4NO.js → Godrays-Mvz7ha2E.js} +1 -1
- package/dist/core/{Grid-CKbLS5tU.js → Grid-CsD21Eqg.js} +1 -1
- package/dist/core/{GridDistortion-CVpebl48.js → GridDistortion-BcDqBh9i.js} +1 -1
- package/dist/core/{Halftone-BGQeBAgG.js → Halftone-3ImN5uQi.js} +1 -1
- package/dist/core/{HexGrid-BFrnZEZT.js → HexGrid-BWwIHYEg.js} +1 -1
- package/dist/core/{Kaleidoscope-B0_OCrob.js → Kaleidoscope-D1HmcoOv.js} +1 -1
- package/dist/core/{LensFlare-B8x1fOKu.js → LensFlare-Be-Z9whi.js} +1 -1
- package/dist/core/{LinearBlur-CshzmjfO.js → LinearBlur-xrHtMmWp.js} +1 -1
- package/dist/core/{LinearGradient-Bzwquw_Q.js → LinearGradient-BiIad_hA.js} +1 -1
- package/dist/core/{Liquify-ZMAyGUIb.js → Liquify-DkTxZZFW.js} +1 -1
- package/dist/core/{Mirror-Gb0fugtF.js → Mirror-BDTE51kP.js} +1 -1
- package/dist/core/{MultiPointGradient-D0QQwizn.js → MultiPointGradient-Bd-EGOI8.js} +1 -1
- package/dist/core/{Neon-eN4HlILk.js → Neon-BeGABHrs.js} +1 -1
- package/dist/core/{Perspective-SBZzprC5.js → Perspective-CqweSeFv.js} +1 -1
- package/dist/core/{Plasma-COq8mAw2.js → Plasma-DqKLBDYd.js} +1 -1
- package/dist/core/{PolarCoordinates-Ckvb1eG0.js → PolarCoordinates-CKT4CLT7.js} +1 -1
- package/dist/core/{Polygon-BP5eKEiz.js → Polygon-_3DSqSBg.js} +1 -1
- package/dist/core/{ProgressiveBlur-CNacb2Qx.js → ProgressiveBlur-Dh8W2bZ3.js} +1 -1
- package/dist/core/{RadialGradient-SASVv2vb.js → RadialGradient-Dj3-DdO7.js} +1 -1
- package/dist/core/{RectangularCoordinates-r0fTwVuL.js → RectangularCoordinates-DxeLJ2nt.js} +1 -1
- package/dist/core/{Ring-CdJlzjRV.js → Ring-4J6h5Iof.js} +1 -1
- package/dist/core/{Ripples-BRZPZszq.js → Ripples-CXeVzwUd.js} +1 -1
- package/dist/core/{RoundedRect-lzzi_1J7.js → RoundedRect-Dj-gqOc0.js} +1 -1
- package/dist/core/{Shatter-CC3EFcP9.js → Shatter-CDza7dSw.js} +1 -1
- package/dist/core/{SimplexNoise-0-rfeziU.js → SimplexNoise-HQTocBLm.js} +1 -1
- package/dist/core/{SineWave--i6bSrad.js → SineWave-S6nK8ZHR.js} +1 -1
- package/dist/core/{Smoke-BgPHDWDR.js → Smoke-DjlArYQW.js} +1 -1
- package/dist/core/{SmokeFill-Dtctgt2S.js → SmokeFill-rM9vUIm4.js} +1 -1
- package/dist/core/{SolidColor-D9ikFFu3.js → SolidColor-a8bCIksn.js} +1 -1
- package/dist/core/{Spherize-ZBorEEOU.js → Spherize-BHmD2ajL.js} +1 -1
- package/dist/core/{Spiral-sg-i02xw.js → Spiral-Bjsi8BMH.js} +1 -1
- package/dist/core/{Star-BcqCHzHG.js → Star-CJ4mkBZg.js} +1 -1
- package/dist/core/{Strands-XLpth60o.js → Strands-C9fEwaiR.js} +1 -1
- package/dist/core/{Stretch-CJUUU-I1.js → Stretch-Cvht8B0L.js} +1 -1
- package/dist/core/{Stripes-DEOXYnmy.js → Stripes-ChVSAeCO.js} +1 -1
- package/dist/core/{StudioBackground-B5dpTR_X.js → StudioBackground-B8hilROB.js} +1 -1
- package/dist/core/{Swirl-WqPvBF7u.js → Swirl-DZTPLx-W.js} +1 -1
- package/dist/core/{TiltShift-CYb6OQoU.js → TiltShift-DSQ-CsXz.js} +1 -1
- package/dist/core/{Tint-C-bJpwd0.js → Tint-P7KwJAU5.js} +1 -1
- package/dist/core/{Trapezoid-BvTEGdW_.js → Trapezoid-P9gXhH9a.js} +1 -1
- package/dist/core/{Tritone-LX-qUAGy.js → Tritone-_9VR2bhu.js} +1 -1
- package/dist/core/{Truchet-DE4lgYRb.js → Truchet-CbL5nYMj.js} +1 -1
- package/dist/core/{Twirl-CgRyZdT1.js → Twirl-C_97m32v.js} +1 -1
- package/dist/core/{Vesica-DqJMyqmy.js → Vesica-DYov_i53.js} +1 -1
- package/dist/core/{Vignette-CA12P9VO.js → Vignette-DmYVHciL.js} +1 -1
- package/dist/core/{Voronoi-DXeJ3xOf.js → Voronoi-kngFpTNB.js} +1 -1
- package/dist/core/{WaveDistortion-iyTUI1lj.js → WaveDistortion-DM-f_XCw.js} +1 -1
- package/dist/core/{Weave-Bn2CfeE4.js → Weave-DO0m0Dsh.js} +1 -1
- package/dist/core/WorleyNoise-Derik4n-.js +323 -0
- package/dist/core/{ZoomBlur-DOzP_sOK.js → ZoomBlur-BdLC9MCq.js} +1 -1
- package/dist/core/index.js +86 -85
- package/dist/core/registry.js +86 -85
- package/dist/core/{shaderRegistry-SmtG2mTo.js → shaderRegistry-Ceu0nAxP.js} +86 -84
- package/dist/core/shaderRegistry.d.ts.map +1 -1
- package/dist/core/shaders/AngularBlur/index.js +2 -2
- package/dist/core/shaders/Aurora/index.js +2 -2
- package/dist/core/shaders/Beam/index.js +2 -2
- package/dist/core/shaders/Blob/index.js +2 -2
- package/dist/core/shaders/Bulge/index.js +2 -2
- package/dist/core/shaders/Checkerboard/index.js +2 -2
- package/dist/core/shaders/ChromaFlow/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 +2 -2
- package/dist/core/shaders/ConicGradient/index.js +2 -2
- package/dist/core/shaders/ContourLines/index.js +2 -2
- package/dist/core/shaders/Crescent/index.js +2 -2
- package/dist/core/shaders/Cross/index.js +2 -2
- package/dist/core/shaders/Crystal/index.js +2 -2
- package/dist/core/shaders/CursorRipples/index.js +2 -2
- package/dist/core/shaders/CursorTrail/index.js +2 -2
- package/dist/core/shaders/DiamondGradient/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/DotGrid/index.js +2 -2
- package/dist/core/shaders/DropShadow/index.js +2 -2
- package/dist/core/shaders/Duotone/index.js +2 -2
- package/dist/core/shaders/Ellipse/index.js +2 -2
- package/dist/core/shaders/Emboss/index.js +2 -2
- package/dist/core/shaders/FallingLines/index.js +2 -2
- package/dist/core/shaders/FloatingParticles/index.js +2 -2
- package/dist/core/shaders/FlowField/index.js +2 -2
- package/dist/core/shaders/Flower/index.js +2 -2
- package/dist/core/shaders/FlowingGradient/index.js +2 -2
- package/dist/core/shaders/FlutedGlass/index.js +2 -2
- package/dist/core/shaders/Fog/index.js +2 -2
- package/dist/core/shaders/Form3D/index.js +2 -2
- package/dist/core/shaders/Glass/index.js +2 -2
- package/dist/core/shaders/Godrays/index.js +2 -2
- package/dist/core/shaders/Grid/index.js +2 -2
- package/dist/core/shaders/GridDistortion/index.js +2 -2
- package/dist/core/shaders/Halftone/index.js +2 -2
- package/dist/core/shaders/HexGrid/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/MultiPointGradient/index.js +2 -2
- package/dist/core/shaders/Neon/index.js +2 -2
- package/dist/core/shaders/Perspective/index.js +2 -2
- package/dist/core/shaders/Plasma/index.js +2 -2
- package/dist/core/shaders/PolarCoordinates/index.js +2 -2
- package/dist/core/shaders/Polygon/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/Ring/index.js +2 -2
- package/dist/core/shaders/Ripples/index.js +2 -2
- package/dist/core/shaders/RoundedRect/index.js +2 -2
- package/dist/core/shaders/Shatter/index.js +2 -2
- package/dist/core/shaders/SimplexNoise/index.js +2 -2
- package/dist/core/shaders/SineWave/index.js +2 -2
- package/dist/core/shaders/Smoke/index.js +2 -2
- package/dist/core/shaders/SmokeFill/index.js +2 -2
- package/dist/core/shaders/SolidColor/index.js +2 -2
- package/dist/core/shaders/Spherize/index.js +2 -2
- package/dist/core/shaders/Spiral/index.js +2 -2
- package/dist/core/shaders/Star/index.js +2 -2
- 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 +2 -2
- package/dist/core/shaders/StudioBackground/index.js +2 -2
- package/dist/core/shaders/Swirl/index.js +2 -2
- package/dist/core/shaders/TiltShift/index.js +2 -2
- package/dist/core/shaders/Tint/index.js +2 -2
- package/dist/core/shaders/Trapezoid/index.js +2 -2
- package/dist/core/shaders/Tritone/index.js +2 -2
- package/dist/core/shaders/Truchet/index.js +2 -2
- package/dist/core/shaders/Twirl/index.js +2 -2
- package/dist/core/shaders/Vesica/index.js +2 -2
- package/dist/core/shaders/Vignette/index.js +2 -2
- package/dist/core/shaders/Voronoi/index.js +2 -2
- package/dist/core/shaders/WaveDistortion/index.js +2 -2
- package/dist/core/shaders/Weave/index.js +2 -2
- package/dist/core/shaders/WorleyNoise/index.d.ts +99 -0
- package/dist/core/shaders/WorleyNoise/index.d.ts.map +1 -0
- package/dist/core/shaders/WorleyNoise/index.js +5 -0
- package/dist/core/shaders/ZoomBlur/index.js +2 -2
- package/dist/core/{transformations-B5lM6fYX.js → transformations-CJcUeZIC.js} +23 -8
- package/dist/core/utilities/transformations/index.js +1 -1
- package/dist/core/utilities/transformations.d.ts.map +1 -1
- package/dist/js/createShader.js +1 -1
- package/dist/js/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/js/utils/generatePresetCode.js +20 -1
- package/dist/react/Preview.js +1 -0
- package/dist/react/Shader.js +1 -1
- package/dist/react/WorleyNoise.js +217 -0
- package/dist/react/bundle.js +207 -207
- package/dist/react/components/WorleyNoise.d.ts +39 -0
- package/dist/react/components/WorleyNoise.d.ts.map +1 -0
- package/dist/react/engine/Preview.d.ts.map +1 -1
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +2 -1
- package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/react/utils/generatePresetCode.js +20 -1
- package/dist/react/utils/generatePresetCode.template.d.ts.map +1 -1
- package/dist/registry.js +519 -0
- package/dist/solid/components/WorleyNoise.d.ts +36 -0
- package/dist/solid/components/WorleyNoise.d.ts.map +1 -0
- package/dist/solid/components/WorleyNoise.js +228 -0
- package/dist/solid/engine/Preview.d.ts.map +1 -1
- package/dist/solid/engine/Preview.js +216 -214
- package/dist/solid/engine/Shader.js +1 -1
- package/dist/solid/index.d.ts +1 -0
- package/dist/solid/index.d.ts.map +1 -1
- package/dist/solid/index.js +8 -6
- package/dist/solid/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/solid/utils/generatePresetCode.js +20 -1
- package/dist/solid/utils/generatePresetCode.template.d.ts.map +1 -1
- package/dist/svelte/components/WorleyNoise.svelte.d.ts +26 -0
- package/dist/svelte/index.d.ts +1 -0
- package/dist/svelte/index.js +634 -434
- package/dist/svelte/source/components/WorleyNoise.svelte +332 -0
- package/dist/svelte/source/engine/Preview.svelte +2 -0
- package/dist/svelte/source/index.js +1 -0
- package/dist/svelte/utils/generatePresetCode.js +20 -1
- package/dist/vue/Preview.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/vue/Shader.vue_vue_type_script_setup_true_lang.js +28 -18
- package/dist/vue/WorleyNoise.js +3 -0
- package/dist/vue/WorleyNoise.vue_vue_type_script_setup_true_lang.js +226 -0
- package/dist/vue/components/WorleyNoise.vue.d.ts +61 -0
- package/dist/vue/components/WorleyNoise.vue.d.ts.map +1 -0
- package/dist/vue/engine/Shader.vue.d.ts.map +1 -1
- package/dist/vue/index.d.ts +1 -0
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/index.js +2 -1
- package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/vue/utils/generatePresetCode.js +20 -1
- package/dist/vue/utils/generatePresetCode.template.d.ts.map +1 -1
- package/package.json +9 -1
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { ComponentDefinition } from '../../types';
|
|
2
|
+
import { transformColor } from '../../utilities/transformations';
|
|
3
|
+
|
|
4
|
+
export interface ComponentProps {
|
|
5
|
+
/**
|
|
6
|
+
* Color where the noise field is low (typically near cell centers)
|
|
7
|
+
*
|
|
8
|
+
* Accepts hex strings (`#ff0000`), RGB objects (`{ r, g, b }`), or CSS color names (`limegreen`).
|
|
9
|
+
* @default "#ffffff"
|
|
10
|
+
*/
|
|
11
|
+
colorA: Parameters<typeof transformColor>[0];
|
|
12
|
+
/**
|
|
13
|
+
* Color where the noise field is high (typically near cell boundaries)
|
|
14
|
+
*
|
|
15
|
+
* Accepts hex strings (`#ff0000`), RGB objects (`{ r, g, b }`), or CSS color names (`limegreen`).
|
|
16
|
+
* @default "#000000"
|
|
17
|
+
*/
|
|
18
|
+
colorB: Parameters<typeof transformColor>[0];
|
|
19
|
+
/**
|
|
20
|
+
* Color space for color interpolation
|
|
21
|
+
*
|
|
22
|
+
* Accepts one of the predefined option values.
|
|
23
|
+
* @default "linear"
|
|
24
|
+
*/
|
|
25
|
+
colorSpace: string;
|
|
26
|
+
/**
|
|
27
|
+
* Number of cells across the canvas at the base octave
|
|
28
|
+
*
|
|
29
|
+
* @default 6
|
|
30
|
+
*/
|
|
31
|
+
scale: number;
|
|
32
|
+
/**
|
|
33
|
+
* Field type. F1 = distance to nearest point. F2 = distance to second-nearest. F2 − F1 emphasises cell boundaries.
|
|
34
|
+
*
|
|
35
|
+
* Accepts one of: `"f1"`, `"f2"`, `"f2MinusF1"`, `"f1PlusF2"`, `"f1TimesF2"`.
|
|
36
|
+
* @default "f1"
|
|
37
|
+
*/
|
|
38
|
+
mode: string;
|
|
39
|
+
/**
|
|
40
|
+
* Distance metric. Euclidean = round cells. Manhattan = diamond. Chebyshev = square.
|
|
41
|
+
*
|
|
42
|
+
* Accepts one of: `"euclidean"`, `"manhattan"`, `"chebyshev"`.
|
|
43
|
+
* @default "euclidean"
|
|
44
|
+
*/
|
|
45
|
+
distance: string;
|
|
46
|
+
/**
|
|
47
|
+
* Number of fractal layers stacked at progressively finer scales
|
|
48
|
+
*
|
|
49
|
+
* Accepts a number between 1 and 4.
|
|
50
|
+
* @default 1
|
|
51
|
+
*/
|
|
52
|
+
octaves: number;
|
|
53
|
+
/**
|
|
54
|
+
* Scale multiplier between octaves (only active when Octaves > 1)
|
|
55
|
+
*
|
|
56
|
+
* @default 2
|
|
57
|
+
*/
|
|
58
|
+
lacunarity: number;
|
|
59
|
+
/**
|
|
60
|
+
* Amplitude multiplier between octaves (only active when Octaves > 1)
|
|
61
|
+
*
|
|
62
|
+
* @default 0.5
|
|
63
|
+
*/
|
|
64
|
+
persistence: number;
|
|
65
|
+
/**
|
|
66
|
+
* How much each cell\
|
|
67
|
+
*
|
|
68
|
+
* @default 1
|
|
69
|
+
*/
|
|
70
|
+
jitter: number;
|
|
71
|
+
/**
|
|
72
|
+
* Steepness of the gradient between low and high regions
|
|
73
|
+
*
|
|
74
|
+
* @default 1
|
|
75
|
+
*/
|
|
76
|
+
contrast: number;
|
|
77
|
+
/**
|
|
78
|
+
* Shifts the gradient midpoint. Negative pulls the field toward Color A, positive toward Color B.
|
|
79
|
+
*
|
|
80
|
+
* @default 0
|
|
81
|
+
*/
|
|
82
|
+
balance: number;
|
|
83
|
+
/**
|
|
84
|
+
* Random seed — shifts the cell pattern without changing its overall structure
|
|
85
|
+
*
|
|
86
|
+
* @default 0
|
|
87
|
+
*/
|
|
88
|
+
seed: number;
|
|
89
|
+
/**
|
|
90
|
+
* Animation speed — how fast each cell\
|
|
91
|
+
*
|
|
92
|
+
* Accepts a number between 0 and 5.
|
|
93
|
+
* @default 0.5
|
|
94
|
+
*/
|
|
95
|
+
speed: number;
|
|
96
|
+
}
|
|
97
|
+
export declare const componentDefinition: ComponentDefinition<ComponentProps>;
|
|
98
|
+
export default componentDefinition;
|
|
99
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/WorleyNoise/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAsB,MAAM,iBAAiB,CAAA;AAGzE,OAAO,EAAE,cAAc,EAA0C,MAAM,qCAAqC,CAAA;AAoB5G,MAAM,WAAW,cAAc;IAC3B,MAAM,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;IAC5C,MAAM,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;IAC5C,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CAChB;AAYD,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,CAAC,cAAc,CAsPnE,CAAA;AAED,eAAe,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import "../../transformations-CJcUeZIC.js";
|
|
2
|
+
import "../../colorMixing-BPpDnR5I.js";
|
|
3
|
+
import "../../time-DUqSFWvT.js";
|
|
4
|
+
import { n as componentDefinition, t as WorleyNoise_default } from "../../WorleyNoise-Derik4n-.js";
|
|
5
|
+
export { componentDefinition, WorleyNoise_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../transformations-
|
|
1
|
+
import "../../transformations-CJcUeZIC.js";
|
|
2
2
|
import "../../alpha-C4ptedXe.js";
|
|
3
|
-
import { n as componentDefinition, t as ZoomBlur_default } from "../../ZoomBlur-
|
|
3
|
+
import { n as componentDefinition, t as ZoomBlur_default } from "../../ZoomBlur-BdLC9MCq.js";
|
|
4
4
|
export { componentDefinition, ZoomBlur_default as default };
|
|
@@ -4598,21 +4598,36 @@ const setColorSpaceMode = (mode) => {
|
|
|
4598
4598
|
colorSpaceMode = mode;
|
|
4599
4599
|
};
|
|
4600
4600
|
const transformBoolean = (value) => value ? 1 : -1;
|
|
4601
|
+
function parseColorChannels(value) {
|
|
4602
|
+
try {
|
|
4603
|
+
const threeColor = new Color(value);
|
|
4604
|
+
const targetSpace = colorSpaceMode === "srgb" ? "srgb-linear" : "p3-linear";
|
|
4605
|
+
const coords = threeColor.to(targetSpace).coords;
|
|
4606
|
+
return {
|
|
4607
|
+
r: Number.isFinite(coords?.[0]) ? coords[0] : 0,
|
|
4608
|
+
g: Number.isFinite(coords?.[1]) ? coords[1] : 0,
|
|
4609
|
+
b: Number.isFinite(coords?.[2]) ? coords[2] : 0,
|
|
4610
|
+
a: Number.isFinite(threeColor.alpha) ? threeColor.alpha : 0
|
|
4611
|
+
};
|
|
4612
|
+
} catch {
|
|
4613
|
+
return {
|
|
4614
|
+
r: 0,
|
|
4615
|
+
g: 0,
|
|
4616
|
+
b: 0,
|
|
4617
|
+
a: 0
|
|
4618
|
+
};
|
|
4619
|
+
}
|
|
4620
|
+
}
|
|
4601
4621
|
const transformColor = (value) => {
|
|
4602
|
-
const
|
|
4603
|
-
const targetSpace = colorSpaceMode === "srgb" ? "srgb-linear" : "p3-linear";
|
|
4604
|
-
const coords = threeColor.to(targetSpace).coords;
|
|
4605
|
-
const r = coords[0], g$1 = coords[1], b$2 = coords[2], a$1 = threeColor.alpha;
|
|
4622
|
+
const { r, g: g$1, b: b$2, a: a$1 } = parseColorChannels(value);
|
|
4606
4623
|
return {
|
|
4607
4624
|
node: vec4(r, g$1, b$2, a$1),
|
|
4608
4625
|
data: new Vector4(r, g$1, b$2, a$1)
|
|
4609
4626
|
};
|
|
4610
4627
|
};
|
|
4611
4628
|
const transformColorUpdate = (value) => {
|
|
4612
|
-
const
|
|
4613
|
-
|
|
4614
|
-
const coords = threeColor.to(targetSpace).coords;
|
|
4615
|
-
return getReusableVector4().set(coords[0], coords[1], coords[2], threeColor.alpha);
|
|
4629
|
+
const { r, g: g$1, b: b$2, a: a$1 } = parseColorChannels(value);
|
|
4630
|
+
return getReusableVector4().set(r, g$1, b$2, a$1);
|
|
4616
4631
|
};
|
|
4617
4632
|
const transformPosition = (value) => {
|
|
4618
4633
|
let x = .5;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as transformColor, c as transformEdges, i as transformBoolean, l as transformPosition, n as setColorSpaceMode, o as transformColorSpace, r as transformAngle, s as transformColorUpdate, t as colorSpaceOptions, u as transformPositionUpdate } from "../../transformations-
|
|
1
|
+
import { a as transformColor, c as transformEdges, i as transformBoolean, l as transformPosition, n as setColorSpaceMode, o as transformColorSpace, r as transformAngle, s as transformColorUpdate, t as colorSpaceOptions, u as transformPositionUpdate } from "../../transformations-CJcUeZIC.js";
|
|
2
2
|
export { colorSpaceOptions, setColorSpaceMode, transformAngle, transformBoolean, transformColor, transformColorSpace, transformColorUpdate, transformEdges, transformPosition, transformPositionUpdate };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformations.d.ts","sourceRoot":"","sources":["../../src/utilities/transformations.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,OAAO,EAAE,OAAO,EAAC,MAAM,OAAO,CAAA;AA4BtC,eAAO,MAAM,iBAAiB,SAAU,WAAW,GAAG,MAAM,SAE3D,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,UAAW,OAAO,WAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"transformations.d.ts","sourceRoot":"","sources":["../../src/utilities/transformations.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,OAAO,EAAE,OAAO,EAAC,MAAM,OAAO,CAAA;AA4BtC,eAAO,MAAM,iBAAiB,SAAU,WAAW,GAAG,MAAM,SAE3D,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,UAAW,OAAO,WAAkB,CAAA;AAgCjE;;;;;GAKG;AACH,eAAO,MAAM,cAAc,UAAW,MAAM;UAGV,GAAG;;CAGpC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,UAAW,MAAM,KAAG,OAGpD,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,UAAW;IAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAAC,GAAG,MAAM;UA4DzD,GAAG;;CAGnC,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,UAAW;IAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAAC,GAAG,MAAM,KAAG,OAiDlG,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,UAAW,MAAM,GAAG,MAAM,KAAG,MAyEvD,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,UAAW,MAAM,KAAG,MAe9C,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;GAO7B,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,UAAW,MAAM,KAAG,MAiBnD,CAAA"}
|
package/dist/js/createShader.js
CHANGED
|
@@ -48,7 +48,7 @@ async function createShader(canvas, preset, options) {
|
|
|
48
48
|
if (isExternalUser()) {
|
|
49
49
|
const checkRendering = () => {
|
|
50
50
|
if (renderer.getPerformanceStats().fps > 0) {
|
|
51
|
-
telemetryCollector = startTelemetry(renderer, "2.5.
|
|
51
|
+
telemetryCollector = startTelemetry(renderer, "2.5.117", options?.disableTelemetry || false, false);
|
|
52
52
|
if (telemetryCollector) telemetryCollector.start();
|
|
53
53
|
telemetryStartTimeout = null;
|
|
54
54
|
} else telemetryStartTimeout = setTimeout(checkRendering, 500);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generatePresetCode.d.ts","sourceRoot":"","sources":["../../src/utils/generatePresetCode.ts"],"names":[],"mappings":"AAAA,UAAU,eAAe;IACvB,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,UAAU,YAAY;IACpB,UAAU,EAAE,eAAe,EAAE,CAAA;CAC9B;
|
|
1
|
+
{"version":3,"file":"generatePresetCode.d.ts","sourceRoot":"","sources":["../../src/utils/generatePresetCode.ts"],"names":[],"mappings":"AAAA,UAAU,eAAe;IACvB,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,UAAU,YAAY;IACpB,UAAU,EAAE,eAAe,EAAE,CAAA;CAC9B;AAm/CD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,EAAE,UAAU,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,CAoBlG;AAGD,eAAO,MAAM,mBAAmB,UA+G/B,CAAA"}
|
|
@@ -1341,6 +1341,24 @@ var shaderMetadata = {
|
|
|
1341
1341
|
"objectFit": "cover",
|
|
1342
1342
|
"mirror": true
|
|
1343
1343
|
},
|
|
1344
|
+
"WorleyNoise": {
|
|
1345
|
+
"opacity": 1,
|
|
1346
|
+
"blendMode": "normal",
|
|
1347
|
+
"colorA": "#ffffff",
|
|
1348
|
+
"colorB": "#000000",
|
|
1349
|
+
"colorSpace": "linear",
|
|
1350
|
+
"scale": 6,
|
|
1351
|
+
"mode": "f1",
|
|
1352
|
+
"distance": "euclidean",
|
|
1353
|
+
"octaves": 1,
|
|
1354
|
+
"lacunarity": 2,
|
|
1355
|
+
"persistence": .5,
|
|
1356
|
+
"jitter": 1,
|
|
1357
|
+
"contrast": 1,
|
|
1358
|
+
"balance": 0,
|
|
1359
|
+
"seed": 0,
|
|
1360
|
+
"speed": .5
|
|
1361
|
+
},
|
|
1344
1362
|
"ZoomBlur": {
|
|
1345
1363
|
"opacity": 1,
|
|
1346
1364
|
"blendMode": "normal",
|
|
@@ -1374,7 +1392,7 @@ function formatValue(value, indent) {
|
|
|
1374
1392
|
}
|
|
1375
1393
|
function shouldIncludeProp(key, value, componentType, props) {
|
|
1376
1394
|
if (key === "maskType" && value === "alpha") return false;
|
|
1377
|
-
if (key === "shape" && props.shapeSdfUrl) return false;
|
|
1395
|
+
if ((key === "shape" || key === "shapeType") && props.shapeSdfUrl) return false;
|
|
1378
1396
|
if (key === "transform" && typeof value === "object") {
|
|
1379
1397
|
if (Object.keys(DEFAULT_TRANSFORM).every((k) => value[k] === DEFAULT_TRANSFORM[k])) return false;
|
|
1380
1398
|
}
|
|
@@ -1539,6 +1557,7 @@ const availableComponents = [
|
|
|
1539
1557
|
"WaveDistortion",
|
|
1540
1558
|
"Weave",
|
|
1541
1559
|
"WebcamTexture",
|
|
1560
|
+
"WorleyNoise",
|
|
1542
1561
|
"ZoomBlur"
|
|
1543
1562
|
];
|
|
1544
1563
|
export { availableComponents, generatePresetCode };
|
package/dist/react/Preview.js
CHANGED
|
@@ -215,6 +215,7 @@ var componentMap = {
|
|
|
215
215
|
WaveDistortion: lazy(() => import("./WaveDistortion.js")),
|
|
216
216
|
Weave: lazy(() => import("./Weave.js")),
|
|
217
217
|
WebcamTexture: lazy(() => import("./WebcamTexture.js")),
|
|
218
|
+
WorleyNoise: lazy(() => import("./WorleyNoise.js")),
|
|
218
219
|
ZoomBlur: lazy(() => import("./ZoomBlur.js"))
|
|
219
220
|
};
|
|
220
221
|
var DEFAULT_KEY = "shaders-preview-key";
|
package/dist/react/Shader.js
CHANGED
|
@@ -89,7 +89,7 @@ const Shader = ({ children, disableTelemetry = false, colorSpace = "p3-linear",
|
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
91
|
if (rendererRef.current.getPerformanceStats().fps > 0) {
|
|
92
|
-
telemetryCollectorRef.current = startTelemetry(rendererRef.current, "2.5.
|
|
92
|
+
telemetryCollectorRef.current = startTelemetry(rendererRef.current, "2.5.117", disableTelemetry, isPreview);
|
|
93
93
|
if (telemetryCollectorRef.current) telemetryCollectorRef.current.start();
|
|
94
94
|
telemetryStartTimeoutRef.current = null;
|
|
95
95
|
} else telemetryStartTimeoutRef.current = window.setTimeout(checkRendering, 500);
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { ShaderContext } from "./Shader.js";
|
|
2
|
+
import { useContext, useEffect, useId, useMemo, useRef, useState } from "react";
|
|
3
|
+
import { createPortal } from "react-dom";
|
|
4
|
+
import { createUniformsMap } from "../core/index.js";
|
|
5
|
+
import { setColorSpaceMode } from "../core/utilities/transformations/index.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { componentDefinition } from "../core/shaders/WorleyNoise/index.js";
|
|
8
|
+
function isPropDriver(value) {
|
|
9
|
+
return typeof value === "object" && value !== null && "type" in value && (value.type === "map" || value.type === "mouse" || value.type === "mouse-position" || value.type === "auto-animate");
|
|
10
|
+
}
|
|
11
|
+
function computeEffectiveProps(props, defaultProps$1) {
|
|
12
|
+
let baseProps = { ...defaultProps$1 };
|
|
13
|
+
for (const [key, value] of Object.entries(props)) if (key !== "children" && key !== "ref" && value !== void 0 && !isPropDriver(value)) baseProps[key] = value;
|
|
14
|
+
return baseProps;
|
|
15
|
+
}
|
|
16
|
+
var MARKER_STYLE = { display: "contents" };
|
|
17
|
+
var DEFAULT_TRANSFORM = {
|
|
18
|
+
offsetX: 0,
|
|
19
|
+
offsetY: 0,
|
|
20
|
+
rotation: 0,
|
|
21
|
+
scale: 1,
|
|
22
|
+
anchorX: .5,
|
|
23
|
+
anchorY: .5,
|
|
24
|
+
edges: "transparent"
|
|
25
|
+
};
|
|
26
|
+
var defaultProps = {
|
|
27
|
+
blendMode: "normal",
|
|
28
|
+
visible: true
|
|
29
|
+
};
|
|
30
|
+
try {
|
|
31
|
+
if (componentDefinition && componentDefinition.props) Object.entries(componentDefinition.props).forEach(([key, config]) => {
|
|
32
|
+
const propConfig = config;
|
|
33
|
+
if (propConfig && typeof propConfig === "object" && "default" in propConfig) defaultProps[key] = propConfig.default;
|
|
34
|
+
});
|
|
35
|
+
} catch (e) {
|
|
36
|
+
console.warn("Error extracting default props:", e);
|
|
37
|
+
}
|
|
38
|
+
const ShaderComponent = (props) => {
|
|
39
|
+
const context = useContext(ShaderContext);
|
|
40
|
+
if (!context) throw new Error("Shader components must be used inside an <Shader> component or another shader component");
|
|
41
|
+
const { shaderParentId: parentId, shaderNodeRegister: parentRegister, shaderUniformUpdate: parentUniformUpdate, shaderMetadataUpdate: parentMetadataUpdate, shaderColorSpace } = context;
|
|
42
|
+
const reactId = useId();
|
|
43
|
+
const instanceId = useMemo(() => {
|
|
44
|
+
return (props.id ? props.id.replace(/[^a-zA-Z0-9_]/g, "_") : null) || reactId.replace(/[^a-zA-Z0-9_]/g, "");
|
|
45
|
+
}, [props.id, reactId]);
|
|
46
|
+
const effectiveProps = useMemo(() => {
|
|
47
|
+
return computeEffectiveProps(props, defaultProps);
|
|
48
|
+
}, [props]);
|
|
49
|
+
const effectiveTransform = useMemo(() => ({
|
|
50
|
+
...DEFAULT_TRANSFORM,
|
|
51
|
+
...props.transform
|
|
52
|
+
}), [props.transform]);
|
|
53
|
+
const markerRef = useRef(null);
|
|
54
|
+
const isCapturesDOM = !!componentDefinition.capturesDOM;
|
|
55
|
+
const captureCanvasRef = useRef(null);
|
|
56
|
+
const [domMounted, setDomMounted] = useState(false);
|
|
57
|
+
const [captureSize, setCaptureSize] = useState(() => ({
|
|
58
|
+
w: typeof window !== "undefined" ? Math.round(window.innerWidth * Math.min(window.devicePixelRatio, 2)) : 0,
|
|
59
|
+
h: typeof window !== "undefined" ? Math.round(window.innerHeight * Math.min(window.devicePixelRatio, 2)) : 0
|
|
60
|
+
}));
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
if (!isCapturesDOM) return;
|
|
63
|
+
setDomMounted(true);
|
|
64
|
+
const onResize = () => {
|
|
65
|
+
const d = Math.min(window.devicePixelRatio, 2);
|
|
66
|
+
setCaptureSize({
|
|
67
|
+
w: Math.round(window.innerWidth * d),
|
|
68
|
+
h: Math.round(window.innerHeight * d)
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
window.addEventListener("resize", onResize);
|
|
72
|
+
return () => window.removeEventListener("resize", onResize);
|
|
73
|
+
}, [isCapturesDOM]);
|
|
74
|
+
const detectedOrderRef = useRef(void 0);
|
|
75
|
+
const uniformsRef = useRef(null);
|
|
76
|
+
if (uniformsRef.current === null) {
|
|
77
|
+
setColorSpaceMode(shaderColorSpace);
|
|
78
|
+
uniformsRef.current = createUniformsMap(componentDefinition, effectiveProps, instanceId);
|
|
79
|
+
}
|
|
80
|
+
const childContextValue = useMemo(() => {
|
|
81
|
+
return {
|
|
82
|
+
...context,
|
|
83
|
+
shaderParentId: instanceId
|
|
84
|
+
};
|
|
85
|
+
}, [context, instanceId]);
|
|
86
|
+
useEffect(() => {
|
|
87
|
+
if (!uniformsRef.current) return;
|
|
88
|
+
try {
|
|
89
|
+
const metadata = {
|
|
90
|
+
blendMode: props.blendMode || "normal",
|
|
91
|
+
opacity: props.opacity,
|
|
92
|
+
visible: props.visible === false ? false : true,
|
|
93
|
+
id: props.id,
|
|
94
|
+
mask: props.maskSource ? {
|
|
95
|
+
source: props.maskSource,
|
|
96
|
+
type: props.maskType || "alpha"
|
|
97
|
+
} : void 0,
|
|
98
|
+
maps: mapsFromProps,
|
|
99
|
+
renderOrder: props.renderOrder ?? detectedOrderRef.current,
|
|
100
|
+
transform: effectiveTransform
|
|
101
|
+
};
|
|
102
|
+
parentRegister(instanceId, componentDefinition.fragmentNode, parentId, metadata, uniformsRef.current, componentDefinition, isCapturesDOM ? captureCanvasRef.current ?? void 0 : void 0);
|
|
103
|
+
return () => {
|
|
104
|
+
parentRegister(instanceId, null, null, null, null);
|
|
105
|
+
};
|
|
106
|
+
} catch (error) {
|
|
107
|
+
console.error("Error registering shader node:", error);
|
|
108
|
+
return () => {};
|
|
109
|
+
}
|
|
110
|
+
}, [
|
|
111
|
+
instanceId,
|
|
112
|
+
parentId,
|
|
113
|
+
parentRegister,
|
|
114
|
+
domMounted
|
|
115
|
+
]);
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
if (props.renderOrder === void 0 && markerRef.current) {
|
|
118
|
+
const parent = markerRef.current.parentElement;
|
|
119
|
+
if (parent) {
|
|
120
|
+
const siblings = parent.querySelectorAll(":scope > [data-shader-id]");
|
|
121
|
+
const position = Array.from(siblings).indexOf(markerRef.current);
|
|
122
|
+
if (position >= 0) {
|
|
123
|
+
detectedOrderRef.current = position;
|
|
124
|
+
parentMetadataUpdate(instanceId, { renderOrder: position });
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}, []);
|
|
129
|
+
const prevPropsRef = useRef({});
|
|
130
|
+
const mapsFromProps = useMemo(() => {
|
|
131
|
+
const maps = {};
|
|
132
|
+
for (const [key, value] of Object.entries(props)) if (key !== "children" && key !== "ref" && isPropDriver(value)) maps[key] = value;
|
|
133
|
+
return Object.keys(maps).length > 0 ? maps : void 0;
|
|
134
|
+
}, [props]);
|
|
135
|
+
useEffect(() => {
|
|
136
|
+
if (!uniformsRef.current) return;
|
|
137
|
+
try {
|
|
138
|
+
Object.entries(uniformsRef.current).forEach(([propName, uniformData]) => {
|
|
139
|
+
if (!uniformData || typeof uniformData !== "object") return;
|
|
140
|
+
const { uniform } = uniformData;
|
|
141
|
+
if (uniform?.value !== void 0 && propName in effectiveProps) {
|
|
142
|
+
const newValue = effectiveProps[propName];
|
|
143
|
+
if (isPropDriver(newValue)) return;
|
|
144
|
+
if (newValue !== prevPropsRef.current[propName]) {
|
|
145
|
+
parentUniformUpdate(instanceId, propName, newValue);
|
|
146
|
+
prevPropsRef.current[propName] = newValue;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
} catch (error) {
|
|
151
|
+
console.error("Error updating uniforms:", error);
|
|
152
|
+
}
|
|
153
|
+
}, [
|
|
154
|
+
effectiveProps,
|
|
155
|
+
instanceId,
|
|
156
|
+
parentUniformUpdate
|
|
157
|
+
]);
|
|
158
|
+
useEffect(() => {
|
|
159
|
+
try {
|
|
160
|
+
parentMetadataUpdate(instanceId, {
|
|
161
|
+
blendMode: props.blendMode || "normal",
|
|
162
|
+
opacity: props.opacity,
|
|
163
|
+
visible: props.visible === false ? false : true,
|
|
164
|
+
id: props.id,
|
|
165
|
+
mask: props.maskSource ? {
|
|
166
|
+
source: props.maskSource,
|
|
167
|
+
type: props.maskType || "alpha"
|
|
168
|
+
} : void 0,
|
|
169
|
+
maps: mapsFromProps,
|
|
170
|
+
renderOrder: props.renderOrder ?? detectedOrderRef.current,
|
|
171
|
+
transform: effectiveTransform
|
|
172
|
+
});
|
|
173
|
+
} catch (error) {
|
|
174
|
+
console.error("Error updating metadata:", error);
|
|
175
|
+
}
|
|
176
|
+
}, [
|
|
177
|
+
props.blendMode,
|
|
178
|
+
props.opacity,
|
|
179
|
+
props.visible,
|
|
180
|
+
props.maskSource,
|
|
181
|
+
props.maskType,
|
|
182
|
+
props.renderOrder,
|
|
183
|
+
props.id,
|
|
184
|
+
mapsFromProps,
|
|
185
|
+
effectiveTransform,
|
|
186
|
+
instanceId,
|
|
187
|
+
parentMetadataUpdate
|
|
188
|
+
]);
|
|
189
|
+
if (props.ref && typeof props.ref === "function") try {
|
|
190
|
+
props.ref(null);
|
|
191
|
+
} catch (e) {}
|
|
192
|
+
const captureCanvas = isCapturesDOM && domMounted ? createPortal(/* @__PURE__ */ jsx("canvas", {
|
|
193
|
+
ref: captureCanvasRef,
|
|
194
|
+
"layoutsubtree": "",
|
|
195
|
+
width: captureSize.w,
|
|
196
|
+
height: captureSize.h,
|
|
197
|
+
style: {
|
|
198
|
+
position: "fixed",
|
|
199
|
+
inset: 0,
|
|
200
|
+
width: "100vw",
|
|
201
|
+
height: "100vh",
|
|
202
|
+
zIndex: -9999
|
|
203
|
+
},
|
|
204
|
+
children: props.children
|
|
205
|
+
}), document.body) : null;
|
|
206
|
+
return /* @__PURE__ */ jsxs(ShaderContext.Provider, {
|
|
207
|
+
value: childContextValue,
|
|
208
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
209
|
+
ref: markerRef,
|
|
210
|
+
style: MARKER_STYLE,
|
|
211
|
+
"data-shader-id": instanceId,
|
|
212
|
+
children: !isCapturesDOM && props.children
|
|
213
|
+
}), captureCanvas]
|
|
214
|
+
});
|
|
215
|
+
};
|
|
216
|
+
var WorleyNoise_default = ShaderComponent;
|
|
217
|
+
export { ShaderComponent, WorleyNoise_default as default };
|