shaders 2.5.128 → 2.5.130
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/{Blur-5_t3tR_g.js → Blur-1GcG1L1y.js} +1 -1
- package/dist/core/{ChannelBlur-DWgS3nhn.js → ChannelBlur-CxlVaYGM.js} +1 -1
- package/dist/core/Exposure-CFn2J_t3.js +29 -0
- package/dist/core/{Glass-CXT1jdLw.js → Glass-D8DayF1P.js} +1 -1
- package/dist/core/{Glow-5PP4-rM9.js → Glow-chsUpCyj.js} +25 -8
- package/dist/core/{ProgressiveBlur-BJwJ5mE0.js → ProgressiveBlur-By_PgPtK.js} +1 -1
- package/dist/core/{ReflectivePlane-UIT4xlmn.js → ReflectivePlane-VjZ1E5B0.js} +1 -1
- package/dist/core/ThinFilm-CUsi8eSg.js +305 -0
- package/dist/core/{TiltShift-DtQ3dRL-.js → TiltShift-vG90NlLr.js} +1 -1
- package/dist/core/{VideoTexture-ClutlOqj.js → VideoTexture-FmV1l91c.js} +1 -1
- package/dist/core/{WebcamTexture-D4e06ajM.js → WebcamTexture-DlS4MCDm.js} +1 -1
- package/dist/core/blendModes/linearDodge.d.ts.map +1 -1
- package/dist/core/{computeBlur-CprKe0xa.js → computeBlur-oxyhoztH.js} +14 -7
- package/dist/core/effects/thinFilm.d.ts +81 -0
- package/dist/core/effects/thinFilm.d.ts.map +1 -0
- package/dist/core/index.js +90 -88
- package/dist/core/registry.js +89 -87
- package/dist/core/shaderRegistry-BVFBmRN3.js +276 -0
- package/dist/core/shaderRegistry.d.ts.map +1 -1
- package/dist/core/shaders/Blur/index.js +2 -2
- package/dist/core/shaders/ChannelBlur/index.js +2 -2
- package/dist/core/shaders/Exposure/index.d.ts +13 -0
- package/dist/core/shaders/Exposure/index.d.ts.map +1 -0
- package/dist/core/shaders/Exposure/index.js +2 -0
- package/dist/core/shaders/FallingLines/index.js +1 -1
- package/dist/core/shaders/FilmGrain/index.js +1 -1
- package/dist/core/shaders/FloatingParticles/index.js +1 -1
- package/dist/core/shaders/FlowField/index.js +1 -1
- package/dist/core/shaders/Flower/index.js +1 -1
- package/dist/core/shaders/FlowingGradient/index.js +1 -1
- package/dist/core/shaders/FlutedGlass/index.js +1 -1
- package/dist/core/shaders/Fog/index.js +1 -1
- package/dist/core/shaders/Form3D/index.js +1 -1
- package/dist/core/shaders/FractalNoise/index.js +1 -1
- package/dist/core/shaders/Glass/index.js +2 -2
- package/dist/core/shaders/GlassTiles/index.js +1 -1
- package/dist/core/shaders/Glitch/index.js +1 -1
- package/dist/core/shaders/Glow/index.d.ts.map +1 -1
- package/dist/core/shaders/Glow/index.js +2 -2
- package/dist/core/shaders/Godrays/index.js +1 -1
- package/dist/core/shaders/Grayscale/index.js +1 -1
- package/dist/core/shaders/Grid/index.js +1 -1
- package/dist/core/shaders/GridDistortion/index.js +1 -1
- package/dist/core/shaders/Group/index.js +1 -1
- package/dist/core/shaders/Halftone/index.js +1 -1
- package/dist/core/shaders/HexGrid/index.js +1 -1
- package/dist/core/shaders/HueShift/index.js +1 -1
- package/dist/core/shaders/ImageTexture/index.js +1 -1
- package/dist/core/shaders/Invert/index.js +1 -1
- package/dist/core/shaders/Kaleidoscope/index.js +1 -1
- package/dist/core/shaders/LensFlare/index.js +1 -1
- package/dist/core/shaders/LinearBlur/index.js +1 -1
- package/dist/core/shaders/LinearGradient/index.js +1 -1
- package/dist/core/shaders/Liquify/index.js +1 -1
- package/dist/core/shaders/Marble/index.js +1 -1
- package/dist/core/shaders/Mirror/index.js +1 -1
- package/dist/core/shaders/MultiPointGradient/index.js +1 -1
- package/dist/core/shaders/Neon/index.js +1 -1
- package/dist/core/shaders/Paper/index.js +1 -1
- package/dist/core/shaders/Perspective/index.js +1 -1
- package/dist/core/shaders/Pixelate/index.js +1 -1
- package/dist/core/shaders/Plasma/index.js +1 -1
- package/dist/core/shaders/PolarCoordinates/index.js +1 -1
- package/dist/core/shaders/Polygon/index.js +1 -1
- package/dist/core/shaders/Posterize/index.js +1 -1
- package/dist/core/shaders/ProgressiveBlur/index.js +2 -2
- package/dist/core/shaders/RadialGradient/index.js +1 -1
- package/dist/core/shaders/RectangularCoordinates/index.js +1 -1
- package/dist/core/shaders/ReflectivePlane/index.js +2 -2
- package/dist/core/shaders/Ring/index.js +1 -1
- package/dist/core/shaders/Ripples/index.js +1 -1
- package/dist/core/shaders/RoundedRect/index.js +1 -1
- package/dist/core/shaders/Saturation/index.js +1 -1
- package/dist/core/shaders/Sharpness/index.js +1 -1
- package/dist/core/shaders/Shatter/index.js +1 -1
- package/dist/core/shaders/SimplexNoise/index.js +1 -1
- package/dist/core/shaders/SineWave/index.js +1 -1
- package/dist/core/shaders/Smoke/index.js +1 -1
- package/dist/core/shaders/SmokeFill/index.js +1 -1
- package/dist/core/shaders/Solarize/index.js +1 -1
- package/dist/core/shaders/SolidColor/index.js +1 -1
- package/dist/core/shaders/Spherize/index.js +1 -1
- package/dist/core/shaders/Spiral/index.js +1 -1
- package/dist/core/shaders/Star/index.js +1 -1
- package/dist/core/shaders/Strands/index.js +1 -1
- package/dist/core/shaders/Stretch/index.js +1 -1
- package/dist/core/shaders/Stripes/index.js +1 -1
- package/dist/core/shaders/StudioBackground/index.js +1 -1
- package/dist/core/shaders/SunBurst/index.js +1 -1
- package/dist/core/shaders/Swirl/index.js +1 -1
- package/dist/core/shaders/ThinFilm/index.d.ts +130 -0
- package/dist/core/shaders/ThinFilm/index.d.ts.map +1 -0
- package/dist/core/shaders/ThinFilm/index.js +6 -0
- package/dist/core/shaders/TiltShift/index.js +2 -2
- package/dist/core/shaders/Tint/index.js +1 -1
- package/dist/core/shaders/Trapezoid/index.js +1 -1
- package/dist/core/shaders/Tritone/index.js +1 -1
- package/dist/core/shaders/Truchet/index.js +1 -1
- package/dist/core/shaders/Twirl/index.js +1 -1
- package/dist/core/shaders/VHS/index.js +1 -1
- package/dist/core/shaders/Vesica/index.js +1 -1
- package/dist/core/shaders/Vibrance/index.js +1 -1
- package/dist/core/shaders/VideoTexture/index.js +2 -2
- package/dist/core/shaders/Vignette/index.js +1 -1
- package/dist/core/shaders/Voronoi/index.js +1 -1
- package/dist/core/shaders/WaveDistortion/index.js +1 -1
- package/dist/core/shaders/Weave/index.js +1 -1
- package/dist/core/shaders/WebcamTexture/index.js +2 -2
- package/dist/core/shaders/WorleyNoise/index.js +1 -1
- package/dist/core/shaders/ZoomBlur/index.js +1 -1
- package/dist/core/utilities/computeBlur.d.ts +3 -1
- package/dist/core/utilities/computeBlur.d.ts.map +1 -1
- package/dist/js/bundle.js +199 -199
- package/dist/js/createShader.js +1 -1
- package/dist/js/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/js/utils/generatePresetCode.js +31 -0
- package/dist/react/Exposure.js +217 -0
- package/dist/react/Preview.js +2 -0
- package/dist/react/Shader.js +1 -1
- package/dist/react/ThinFilm.js +217 -0
- package/dist/react/bundle.js +214 -214
- package/dist/react/components/Exposure.d.ts +33 -0
- package/dist/react/components/Exposure.d.ts.map +1 -0
- package/dist/react/components/ThinFilm.d.ts +41 -0
- package/dist/react/components/ThinFilm.d.ts.map +1 -0
- package/dist/react/engine/Preview.d.ts.map +1 -1
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +3 -1
- package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/react/utils/generatePresetCode.js +31 -0
- package/dist/registry.js +590 -0
- package/dist/solid/components/Exposure.d.ts +30 -0
- package/dist/solid/components/Exposure.d.ts.map +1 -0
- package/dist/solid/components/Exposure.js +228 -0
- package/dist/solid/components/ThinFilm.d.ts +38 -0
- package/dist/solid/components/ThinFilm.d.ts.map +1 -0
- package/dist/solid/components/ThinFilm.js +228 -0
- package/dist/solid/engine/Preview.d.ts.map +1 -1
- package/dist/solid/engine/Preview.js +204 -200
- package/dist/solid/engine/Shader.js +1 -1
- package/dist/solid/index.d.ts +2 -0
- package/dist/solid/index.d.ts.map +1 -1
- package/dist/solid/index.js +172 -168
- package/dist/solid/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/solid/utils/generatePresetCode.js +31 -0
- package/dist/svelte/components/Exposure.svelte.d.ts +20 -0
- package/dist/svelte/components/ThinFilm.svelte.d.ts +28 -0
- package/dist/svelte/index.d.ts +2 -0
- package/dist/svelte/index.js +1033 -633
- package/dist/svelte/source/components/Exposure.svelte +326 -0
- package/dist/svelte/source/components/ThinFilm.svelte +334 -0
- package/dist/svelte/source/engine/Preview.svelte +4 -0
- package/dist/svelte/source/index.js +2 -0
- package/dist/svelte/utils/generatePresetCode.js +31 -0
- package/dist/vue/Exposure.js +3 -0
- package/dist/vue/Exposure.vue_vue_type_script_setup_true_lang.js +213 -0
- package/dist/vue/Preview.vue_vue_type_script_setup_true_lang.js +4 -0
- package/dist/vue/Shader.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/vue/ThinFilm.js +3 -0
- package/dist/vue/ThinFilm.vue_vue_type_script_setup_true_lang.js +231 -0
- package/dist/vue/components/Exposure.vue.d.ts +55 -0
- package/dist/vue/components/Exposure.vue.d.ts.map +1 -0
- package/dist/vue/components/ThinFilm.vue.d.ts +63 -0
- package/dist/vue/components/ThinFilm.vue.d.ts.map +1 -0
- package/dist/vue/index.d.ts +2 -0
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/index.js +3 -1
- package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/vue/utils/generatePresetCode.js +31 -0
- package/package.json +17 -1
- package/dist/core/shaderRegistry-Brvv9sO8.js +0 -272
- /package/dist/core/{FallingLines-DqIZ8wTH.js → FallingLines-9elMmSlj.js} +0 -0
- /package/dist/core/{FilmGrain-DdV7_b8g.js → FilmGrain-DIydVgOW.js} +0 -0
- /package/dist/core/{FloatingParticles-LMsFTJKp.js → FloatingParticles-B068TLIi.js} +0 -0
- /package/dist/core/{FlowField-D3CAHBBG.js → FlowField-CeZjhyEo.js} +0 -0
- /package/dist/core/{Flower-BbRNrXIa.js → Flower-DSr0JWa2.js} +0 -0
- /package/dist/core/{FlowingGradient-BRQ_K-k3.js → FlowingGradient-Bd8KBK5P.js} +0 -0
- /package/dist/core/{FlutedGlass-CyFWN_SM.js → FlutedGlass-BJtMfV2c.js} +0 -0
- /package/dist/core/{Fog-CLGVVVeo.js → Fog-BQuVDReH.js} +0 -0
- /package/dist/core/{Form3D-8tPyUgh4.js → Form3D-DOek31CJ.js} +0 -0
- /package/dist/core/{FractalNoise-Ccufnbw6.js → FractalNoise-Dyhbvx9a.js} +0 -0
- /package/dist/core/{GlassTiles-CXJHjEBe.js → GlassTiles-Bb3cuOkr.js} +0 -0
- /package/dist/core/{Glitch-Bg9W-KNm.js → Glitch-zqdbCc2E.js} +0 -0
- /package/dist/core/{Godrays-DHXKsw5B.js → Godrays-DdSLZtBs.js} +0 -0
- /package/dist/core/{Grayscale-DgXoUcmg.js → Grayscale-BC40hfXH.js} +0 -0
- /package/dist/core/{Grid-DwyhjFAT.js → Grid-Lc4S0Hmp.js} +0 -0
- /package/dist/core/{GridDistortion-DJ8S-96Y.js → GridDistortion-DQcPYbXS.js} +0 -0
- /package/dist/core/{Group-DmgNNlDd.js → Group-BeZhHbOT.js} +0 -0
- /package/dist/core/{Halftone-x9boWkFW.js → Halftone-CsblgxnY.js} +0 -0
- /package/dist/core/{HexGrid-BUsgyF8P.js → HexGrid-DWRNPMET.js} +0 -0
- /package/dist/core/{HueShift-D3_5D7jx.js → HueShift-C-p9W5sr.js} +0 -0
- /package/dist/core/{ImageTexture-6ZzBt79u.js → ImageTexture-bqgQxAt9.js} +0 -0
- /package/dist/core/{Invert-kXxY97QJ.js → Invert-D-RVP34v.js} +0 -0
- /package/dist/core/{Kaleidoscope-D4jRcZCt.js → Kaleidoscope-HQNQrRP_.js} +0 -0
- /package/dist/core/{LensFlare-D7vypE2Q.js → LensFlare-DtES749p.js} +0 -0
- /package/dist/core/{LinearBlur-2hspd2YP.js → LinearBlur-6mCJ9fY5.js} +0 -0
- /package/dist/core/{LinearGradient-glCc9IaB.js → LinearGradient-DIbCAHc7.js} +0 -0
- /package/dist/core/{Liquify-uZjs0wcu.js → Liquify-8dcdv2Sl.js} +0 -0
- /package/dist/core/{Marble-DkHLcqFD.js → Marble-DX29RG-p.js} +0 -0
- /package/dist/core/{Mirror-Dv5fOEp6.js → Mirror-BM2xf3Nr.js} +0 -0
- /package/dist/core/{MultiPointGradient-Dvt1GUiv.js → MultiPointGradient-BzM24vnR.js} +0 -0
- /package/dist/core/{Neon-DQDB7hAE.js → Neon-nPiMi3wt.js} +0 -0
- /package/dist/core/{Paper-DNP2-hPM.js → Paper-Ddpe8-EI.js} +0 -0
- /package/dist/core/{Perspective-CAIchX9p.js → Perspective-BIKpqd4H.js} +0 -0
- /package/dist/core/{Pixelate-BbT3Rrf2.js → Pixelate-Cp0-lwkG.js} +0 -0
- /package/dist/core/{Plasma-D9rhkH2y.js → Plasma-M--gLd1Q.js} +0 -0
- /package/dist/core/{PolarCoordinates-2RBCk-fo.js → PolarCoordinates-C42rlD2q.js} +0 -0
- /package/dist/core/{Polygon-C6_siOs0.js → Polygon-CKqH0ApY.js} +0 -0
- /package/dist/core/{Posterize-DNxTRgvF.js → Posterize-B6ZhRkH2.js} +0 -0
- /package/dist/core/{RadialGradient-CQIctl__.js → RadialGradient-SHxJ9ZNF.js} +0 -0
- /package/dist/core/{RectangularCoordinates-F2VzXmal.js → RectangularCoordinates-Dw6Xr9uV.js} +0 -0
- /package/dist/core/{Ring-UT__kmzY.js → Ring-V4sEHwwm.js} +0 -0
- /package/dist/core/{Ripples-CWVLSUP0.js → Ripples-DC1y3YuP.js} +0 -0
- /package/dist/core/{RoundedRect-BPWHTT1j.js → RoundedRect-JY2z6YEH.js} +0 -0
- /package/dist/core/{Saturation-DFOp2yD9.js → Saturation-ChJ9IWnl.js} +0 -0
- /package/dist/core/{Sharpness-PIWR4gYc.js → Sharpness-C1ufX8S-.js} +0 -0
- /package/dist/core/{Shatter-CUYQp-qy.js → Shatter-Du5THcwZ.js} +0 -0
- /package/dist/core/{SimplexNoise-LAxWw8fJ.js → SimplexNoise--vwIZVu0.js} +0 -0
- /package/dist/core/{SineWave-CEQWxC9Q.js → SineWave-BIVPG3oc.js} +0 -0
- /package/dist/core/{Smoke-DO4yylWk.js → Smoke-DSBQreo0.js} +0 -0
- /package/dist/core/{SmokeFill-Dm0sZS5F.js → SmokeFill-Dy-0kjsX.js} +0 -0
- /package/dist/core/{Solarize-mE7LU1li.js → Solarize-BymZlSu0.js} +0 -0
- /package/dist/core/{SolidColor-BljkSdvg.js → SolidColor-D8XC4aoJ.js} +0 -0
- /package/dist/core/{Spherize-DARagREe.js → Spherize-tRTB4WdO.js} +0 -0
- /package/dist/core/{Spiral-CumsIpkp.js → Spiral-CiDp2Tg2.js} +0 -0
- /package/dist/core/{Star-8fAlzR9L.js → Star-Cp4dt6Fl.js} +0 -0
- /package/dist/core/{Strands-BB4RIsFz.js → Strands-V3q8N-y1.js} +0 -0
- /package/dist/core/{Stretch-3S2atBkJ.js → Stretch-CTgtc3nG.js} +0 -0
- /package/dist/core/{Stripes-BGFVSZIt.js → Stripes-CZV6oGMy.js} +0 -0
- /package/dist/core/{StudioBackground-BtJ6b1Ki.js → StudioBackground-CWSHq6vE.js} +0 -0
- /package/dist/core/{SunBurst-BJRFFYhs.js → SunBurst-CskZwXc3.js} +0 -0
- /package/dist/core/{Swirl-fkUEZ2TQ.js → Swirl-CyGfVZ8n.js} +0 -0
- /package/dist/core/{Tint-W_EvzN1-.js → Tint-R7y5CJ4U.js} +0 -0
- /package/dist/core/{Trapezoid-cQzS6-bh.js → Trapezoid-BXzH--z9.js} +0 -0
- /package/dist/core/{Tritone-B3hI2nAi.js → Tritone-CF4Oj1sl.js} +0 -0
- /package/dist/core/{Truchet-s9PmowCP.js → Truchet-BL4jzZDX.js} +0 -0
- /package/dist/core/{Twirl-UDDXGkFl.js → Twirl-BVLPHKJD.js} +0 -0
- /package/dist/core/{VHS-DW1H7Wuy.js → VHS-B2IBdQgX.js} +0 -0
- /package/dist/core/{Vesica-ChQBYWuw.js → Vesica-DzIEa3aJ.js} +0 -0
- /package/dist/core/{Vibrance-DUj7hwzE.js → Vibrance-jrvT49Du.js} +0 -0
- /package/dist/core/{Vignette-F9yxi-UM.js → Vignette-ng_5gjXc.js} +0 -0
- /package/dist/core/{Voronoi-D8HHP_WR.js → Voronoi-C8iIU7AT.js} +0 -0
- /package/dist/core/{WaveDistortion-MbB-Kgjz.js → WaveDistortion-Crt9JSXN.js} +0 -0
- /package/dist/core/{Weave-ou5shgl3.js → Weave-CFmLkEaq.js} +0 -0
- /package/dist/core/{WorleyNoise-Uf6IPm7A.js → WorleyNoise-CEZiaVAN.js} +0 -0
- /package/dist/core/{ZoomBlur-DJ-RNKHM.js → ZoomBlur-DTVSwIvc.js} +0 -0
- /package/dist/core/{browser-NUM-x2tw.js → browser-CDogs09U.js} +0 -0
|
@@ -33,6 +33,7 @@ export { default as DropShadow } from './components/DropShadow.svelte';
|
|
|
33
33
|
export { default as Duotone } from './components/Duotone.svelte';
|
|
34
34
|
export { default as Ellipse } from './components/Ellipse.svelte';
|
|
35
35
|
export { default as Emboss } from './components/Emboss.svelte';
|
|
36
|
+
export { default as Exposure } from './components/Exposure.svelte';
|
|
36
37
|
export { default as FallingLines } from './components/FallingLines.svelte';
|
|
37
38
|
export { default as FilmGrain } from './components/FilmGrain.svelte';
|
|
38
39
|
export { default as FloatingParticles } from './components/FloatingParticles.svelte';
|
|
@@ -98,6 +99,7 @@ export { default as Stripes } from './components/Stripes.svelte';
|
|
|
98
99
|
export { default as StudioBackground } from './components/StudioBackground.svelte';
|
|
99
100
|
export { default as SunBurst } from './components/SunBurst.svelte';
|
|
100
101
|
export { default as Swirl } from './components/Swirl.svelte';
|
|
102
|
+
export { default as ThinFilm } from './components/ThinFilm.svelte';
|
|
101
103
|
export { default as TiltShift } from './components/TiltShift.svelte';
|
|
102
104
|
export { default as Tint } from './components/Tint.svelte';
|
|
103
105
|
export { default as Trapezoid } from './components/Trapezoid.svelte';
|
|
@@ -445,6 +445,11 @@ var shaderMetadata = {
|
|
|
445
445
|
"shadowIntensity": .3,
|
|
446
446
|
"shape": "{\"type\":\"circleSDF\",\"radius\":0.35}"
|
|
447
447
|
},
|
|
448
|
+
"Exposure": {
|
|
449
|
+
"opacity": 1,
|
|
450
|
+
"blendMode": "normal",
|
|
451
|
+
"exposure": 1
|
|
452
|
+
},
|
|
448
453
|
"FallingLines": {
|
|
449
454
|
"opacity": 1,
|
|
450
455
|
"blendMode": "normal",
|
|
@@ -1293,6 +1298,30 @@ var shaderMetadata = {
|
|
|
1293
1298
|
"blend": 50,
|
|
1294
1299
|
"colorSpace": "linear"
|
|
1295
1300
|
},
|
|
1301
|
+
"ThinFilm": {
|
|
1302
|
+
"opacity": 1,
|
|
1303
|
+
"blendMode": "normal",
|
|
1304
|
+
"center": {
|
|
1305
|
+
"x": .5,
|
|
1306
|
+
"y": .5
|
|
1307
|
+
},
|
|
1308
|
+
"scale": 1,
|
|
1309
|
+
"intensity": 1,
|
|
1310
|
+
"rimWidth": 1,
|
|
1311
|
+
"edgeSoftness": .3,
|
|
1312
|
+
"thickness": .5,
|
|
1313
|
+
"dispersion": .5,
|
|
1314
|
+
"saturation": 1,
|
|
1315
|
+
"hueShift": 0,
|
|
1316
|
+
"lightAngle": 300,
|
|
1317
|
+
"mode": "rainbow",
|
|
1318
|
+
"colorA": "#2b6fff",
|
|
1319
|
+
"colorB": "#ffffff",
|
|
1320
|
+
"colorC": "#ff7a21",
|
|
1321
|
+
"colorSpace": "oklch",
|
|
1322
|
+
"speed": .1,
|
|
1323
|
+
"shape": "{\"type\":\"circleSDF\",\"radius\":0.35}"
|
|
1324
|
+
},
|
|
1296
1325
|
"TiltShift": {
|
|
1297
1326
|
"opacity": 1,
|
|
1298
1327
|
"blendMode": "normal",
|
|
@@ -1619,6 +1648,7 @@ const availableComponents = [
|
|
|
1619
1648
|
"Duotone",
|
|
1620
1649
|
"Ellipse",
|
|
1621
1650
|
"Emboss",
|
|
1651
|
+
"Exposure",
|
|
1622
1652
|
"FallingLines",
|
|
1623
1653
|
"FilmGrain",
|
|
1624
1654
|
"FloatingParticles",
|
|
@@ -1684,6 +1714,7 @@ const availableComponents = [
|
|
|
1684
1714
|
"StudioBackground",
|
|
1685
1715
|
"SunBurst",
|
|
1686
1716
|
"Swirl",
|
|
1717
|
+
"ThinFilm",
|
|
1687
1718
|
"TiltShift",
|
|
1688
1719
|
"Tint",
|
|
1689
1720
|
"Trapezoid",
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, effectScope, inject, mergeDefaults, mergeProps, onBeforeUnmount, onMounted, openBlock, provide, ref, renderSlot, toValue, unref, useId, watch } from "vue";
|
|
2
|
+
import { createUniformsMap } from "../core/index.js";
|
|
3
|
+
import { setColorSpaceMode } from "../core/utilities/transformations/index.js";
|
|
4
|
+
import { componentDefinition } from "../core/shaders/Exposure/index.js";
|
|
5
|
+
var _hoisted_1 = ["data-shader-id"];
|
|
6
|
+
var _hoisted_2 = ["width", "height"];
|
|
7
|
+
var Exposure_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
8
|
+
__name: "Exposure",
|
|
9
|
+
props: /* @__PURE__ */ mergeDefaults({
|
|
10
|
+
exposure: {},
|
|
11
|
+
blendMode: {},
|
|
12
|
+
opacity: {},
|
|
13
|
+
visible: { type: Boolean },
|
|
14
|
+
id: {},
|
|
15
|
+
maskSource: {},
|
|
16
|
+
maskType: {},
|
|
17
|
+
renderOrder: {},
|
|
18
|
+
transform: {}
|
|
19
|
+
}, {
|
|
20
|
+
blendMode: "normal",
|
|
21
|
+
visible: true,
|
|
22
|
+
...Object.entries(componentDefinition.props).reduce((acc, [key, config]) => {
|
|
23
|
+
acc[key] = config.default;
|
|
24
|
+
return acc;
|
|
25
|
+
}, {})
|
|
26
|
+
}),
|
|
27
|
+
setup(__props) {
|
|
28
|
+
let _experimentalWarnedOnce = false;
|
|
29
|
+
if (componentDefinition.experimental && !_experimentalWarnedOnce) {
|
|
30
|
+
_experimentalWarnedOnce = true;
|
|
31
|
+
const _e = componentDefinition.experimental;
|
|
32
|
+
console.info(`%c⚠ [Shaders] ${componentDefinition.name} is experimental: ${_e.message}`, "color: #f59e0b; font-weight: bold");
|
|
33
|
+
}
|
|
34
|
+
function isPropDriver(value) {
|
|
35
|
+
return typeof value === "object" && value !== null && "type" in value && (value.type === "map" || value.type === "mouse" || value.type === "mouse-position" || value.type === "auto-animate");
|
|
36
|
+
}
|
|
37
|
+
const props = __props;
|
|
38
|
+
const instanceId = (props.id ? props.id.replace(/[^a-zA-Z0-9_]/g, "_") : null) || useId().replace(/[^a-zA-Z0-9_]/g, "");
|
|
39
|
+
provide("shaderParentId", instanceId);
|
|
40
|
+
const DEFAULT_TRANSFORM = {
|
|
41
|
+
offsetX: 0,
|
|
42
|
+
offsetY: 0,
|
|
43
|
+
rotation: 0,
|
|
44
|
+
scale: 1,
|
|
45
|
+
anchorX: .5,
|
|
46
|
+
anchorY: .5,
|
|
47
|
+
edges: "transparent"
|
|
48
|
+
};
|
|
49
|
+
const effectiveTransform = computed(() => ({
|
|
50
|
+
...DEFAULT_TRANSFORM,
|
|
51
|
+
...props.transform
|
|
52
|
+
}));
|
|
53
|
+
const shaderReadyProps = computed(() => {
|
|
54
|
+
let baseProps = { ...Object.entries(componentDefinition.props).reduce((acc, [key, config]) => {
|
|
55
|
+
acc[key] = config.default;
|
|
56
|
+
return acc;
|
|
57
|
+
}, {}) };
|
|
58
|
+
for (const key in props) if (key !== "blendMode" && key !== "opacity" && key !== "visible" && key !== "id" && key !== "maskSource" && key !== "maskType" && key !== "renderOrder" && key !== "transform") {
|
|
59
|
+
const val = toValue(props[key]);
|
|
60
|
+
if (isPropDriver(val)) continue;
|
|
61
|
+
if (val !== Object.entries(componentDefinition.props).reduce((acc, [key$1, config]) => {
|
|
62
|
+
acc[key$1] = config.default;
|
|
63
|
+
return acc;
|
|
64
|
+
}, {})[key]) baseProps[key] = val;
|
|
65
|
+
}
|
|
66
|
+
return baseProps;
|
|
67
|
+
});
|
|
68
|
+
const mapsFromProps = computed(() => {
|
|
69
|
+
const maps = {};
|
|
70
|
+
for (const key of Object.keys(componentDefinition.props)) {
|
|
71
|
+
const val = props[key];
|
|
72
|
+
if (isPropDriver(val)) maps[key] = val;
|
|
73
|
+
}
|
|
74
|
+
return Object.keys(maps).length > 0 ? maps : void 0;
|
|
75
|
+
});
|
|
76
|
+
const shaderColorSpace = inject("shaderColorSpace");
|
|
77
|
+
if (shaderColorSpace) setColorSpaceMode(shaderColorSpace.value);
|
|
78
|
+
const uniforms = createUniformsMap(componentDefinition, shaderReadyProps.value, instanceId);
|
|
79
|
+
const parentId = inject("shaderParentId");
|
|
80
|
+
if (parentId === void 0) throw new Error("Shader components must be used inside an <Shader> component or another shader component");
|
|
81
|
+
const parentRegister = inject("shaderNodeRegister");
|
|
82
|
+
if (parentRegister === void 0) throw new Error("Shader components must be used inside an <Shader> component or another shader component");
|
|
83
|
+
const parentUniformUpdate = inject("shaderUniformUpdate");
|
|
84
|
+
if (parentUniformUpdate === void 0) throw new Error("Shader components require shaderUniformUpdate from parent");
|
|
85
|
+
const parentMetadataUpdate = inject("shaderMetadataUpdate");
|
|
86
|
+
if (parentMetadataUpdate === void 0) throw new Error("Shader components require shaderMetadataUpdate from parent");
|
|
87
|
+
const rendererResetSignal = inject("shaderRendererResetSignal");
|
|
88
|
+
const orderMarker = ref(null);
|
|
89
|
+
const isCapturesDOM = !!componentDefinition.capturesDOM;
|
|
90
|
+
const captureCanvas = ref(null);
|
|
91
|
+
const captureW = ref(typeof window !== "undefined" ? Math.round(window.innerWidth * Math.min(window.devicePixelRatio, 2)) : 0);
|
|
92
|
+
const captureH = ref(typeof window !== "undefined" ? Math.round(window.innerHeight * Math.min(window.devicePixelRatio, 2)) : 0);
|
|
93
|
+
const captureStyle = {
|
|
94
|
+
position: "fixed",
|
|
95
|
+
inset: "0",
|
|
96
|
+
width: "100vw",
|
|
97
|
+
height: "100vh",
|
|
98
|
+
zIndex: "-9999"
|
|
99
|
+
};
|
|
100
|
+
if (isCapturesDOM) {
|
|
101
|
+
const onWinResize = () => {
|
|
102
|
+
const d = Math.min(window.devicePixelRatio, 2);
|
|
103
|
+
captureW.value = Math.round(window.innerWidth * d);
|
|
104
|
+
captureH.value = Math.round(window.innerHeight * d);
|
|
105
|
+
};
|
|
106
|
+
onMounted(() => {
|
|
107
|
+
const d = Math.min(window.devicePixelRatio, 2);
|
|
108
|
+
captureW.value = Math.round(window.innerWidth * d);
|
|
109
|
+
captureH.value = Math.round(window.innerHeight * d);
|
|
110
|
+
window.addEventListener("resize", onWinResize);
|
|
111
|
+
});
|
|
112
|
+
onBeforeUnmount(() => {
|
|
113
|
+
window.removeEventListener("resize", onWinResize);
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
let detectedRenderOrder = void 0;
|
|
117
|
+
const registerWithRenderer = () => {
|
|
118
|
+
parentRegister(instanceId, componentDefinition.fragmentNode, parentId, {
|
|
119
|
+
blendMode: props.blendMode,
|
|
120
|
+
opacity: props.opacity,
|
|
121
|
+
visible: props.visible === false ? false : true,
|
|
122
|
+
id: props.id,
|
|
123
|
+
mask: props.maskSource ? {
|
|
124
|
+
source: props.maskSource,
|
|
125
|
+
type: props.maskType || "alpha"
|
|
126
|
+
} : void 0,
|
|
127
|
+
maps: mapsFromProps.value,
|
|
128
|
+
renderOrder: props.renderOrder ?? detectedRenderOrder,
|
|
129
|
+
transform: effectiveTransform.value
|
|
130
|
+
}, uniforms, componentDefinition, isCapturesDOM ? captureCanvas.value ?? void 0 : void 0);
|
|
131
|
+
};
|
|
132
|
+
onMounted(() => {
|
|
133
|
+
if (props.renderOrder === void 0 && orderMarker.value) {
|
|
134
|
+
const parent = orderMarker.value.parentElement;
|
|
135
|
+
if (parent) {
|
|
136
|
+
const siblings = parent.querySelectorAll(":scope > [data-shader-id]");
|
|
137
|
+
const position = Array.from(siblings).indexOf(orderMarker.value);
|
|
138
|
+
if (position >= 0) {
|
|
139
|
+
detectedRenderOrder = position;
|
|
140
|
+
parentMetadataUpdate(instanceId, { renderOrder: position });
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
const setupUniformWatchers = () => {
|
|
146
|
+
const scope = effectScope();
|
|
147
|
+
scope.run(() => {
|
|
148
|
+
Object.entries(uniforms).forEach(([propName, { uniform, transform }]) => {
|
|
149
|
+
watch(() => props[propName], (newValue) => {
|
|
150
|
+
if (uniform && uniform.value !== void 0 && !isPropDriver(newValue)) parentUniformUpdate(instanceId, propName, newValue);
|
|
151
|
+
}, { deep: true });
|
|
152
|
+
});
|
|
153
|
+
watch(() => [
|
|
154
|
+
props.blendMode,
|
|
155
|
+
props.opacity,
|
|
156
|
+
props.visible,
|
|
157
|
+
props.id,
|
|
158
|
+
props.maskSource,
|
|
159
|
+
props.maskType,
|
|
160
|
+
props.renderOrder,
|
|
161
|
+
props.transform,
|
|
162
|
+
mapsFromProps.value
|
|
163
|
+
], ([blendMode, opacity, visible]) => {
|
|
164
|
+
parentMetadataUpdate(instanceId, {
|
|
165
|
+
blendMode,
|
|
166
|
+
opacity,
|
|
167
|
+
visible: visible === false ? false : true,
|
|
168
|
+
id: props.id,
|
|
169
|
+
mask: props.maskSource ? {
|
|
170
|
+
source: props.maskSource,
|
|
171
|
+
type: props.maskType || "alpha"
|
|
172
|
+
} : void 0,
|
|
173
|
+
maps: mapsFromProps.value,
|
|
174
|
+
renderOrder: props.renderOrder ?? detectedRenderOrder,
|
|
175
|
+
transform: effectiveTransform.value
|
|
176
|
+
});
|
|
177
|
+
}, { deep: true });
|
|
178
|
+
if (rendererResetSignal) watch(() => rendererResetSignal.value, (newValue) => {
|
|
179
|
+
if (newValue > 0) registerWithRenderer();
|
|
180
|
+
}, { immediate: true });
|
|
181
|
+
});
|
|
182
|
+
onBeforeUnmount(() => {
|
|
183
|
+
scope.stop();
|
|
184
|
+
});
|
|
185
|
+
};
|
|
186
|
+
if (isCapturesDOM) onMounted(() => {
|
|
187
|
+
setupUniformWatchers();
|
|
188
|
+
});
|
|
189
|
+
else setupUniformWatchers();
|
|
190
|
+
onBeforeUnmount(() => {
|
|
191
|
+
parentRegister(instanceId, null, null, null, null, null);
|
|
192
|
+
});
|
|
193
|
+
return (_ctx, _cache) => {
|
|
194
|
+
return openBlock(), createElementBlock(Fragment, null, [createElementVNode("span", {
|
|
195
|
+
ref_key: "orderMarker",
|
|
196
|
+
ref: orderMarker,
|
|
197
|
+
style: { "display": "contents" },
|
|
198
|
+
"data-shader-id": unref(instanceId)
|
|
199
|
+
}, [!isCapturesDOM ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("", true)], 8, _hoisted_1), isCapturesDOM ? (openBlock(), createBlock(Teleport, {
|
|
200
|
+
key: 0,
|
|
201
|
+
to: "body"
|
|
202
|
+
}, [createElementVNode("canvas", mergeProps({
|
|
203
|
+
ref_key: "captureCanvas",
|
|
204
|
+
ref: captureCanvas
|
|
205
|
+
}, { "layoutsubtree": "" }, {
|
|
206
|
+
width: captureW.value,
|
|
207
|
+
height: captureH.value,
|
|
208
|
+
style: captureStyle
|
|
209
|
+
}), [renderSlot(_ctx.$slots, "default")], 16, _hoisted_2)])) : createCommentVNode("", true)], 64);
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
export { Exposure_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -33,6 +33,7 @@ import DropShadow_default from "./DropShadow.js";
|
|
|
33
33
|
import Duotone_default from "./Duotone.js";
|
|
34
34
|
import Ellipse_default from "./Ellipse.js";
|
|
35
35
|
import Emboss_default from "./Emboss.js";
|
|
36
|
+
import Exposure_default from "./Exposure.js";
|
|
36
37
|
import FallingLines_default from "./FallingLines.js";
|
|
37
38
|
import FilmGrain_default from "./FilmGrain.js";
|
|
38
39
|
import FloatingParticles_default from "./FloatingParticles.js";
|
|
@@ -98,6 +99,7 @@ import Stripes_default from "./Stripes.js";
|
|
|
98
99
|
import StudioBackground_default from "./StudioBackground.js";
|
|
99
100
|
import SunBurst_default from "./SunBurst.js";
|
|
100
101
|
import Swirl_default from "./Swirl.js";
|
|
102
|
+
import ThinFilm_default from "./ThinFilm.js";
|
|
101
103
|
import TiltShift_default from "./TiltShift.js";
|
|
102
104
|
import Tint_default from "./Tint.js";
|
|
103
105
|
import Trapezoid_default from "./Trapezoid.js";
|
|
@@ -207,6 +209,7 @@ var Preview_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
|
|
|
207
209
|
Duotone: Duotone_default,
|
|
208
210
|
Ellipse: Ellipse_default,
|
|
209
211
|
Emboss: Emboss_default,
|
|
212
|
+
Exposure: Exposure_default,
|
|
210
213
|
FallingLines: FallingLines_default,
|
|
211
214
|
FilmGrain: FilmGrain_default,
|
|
212
215
|
FloatingParticles: FloatingParticles_default,
|
|
@@ -272,6 +275,7 @@ var Preview_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
|
|
|
272
275
|
StudioBackground: StudioBackground_default,
|
|
273
276
|
SunBurst: SunBurst_default,
|
|
274
277
|
Swirl: Swirl_default,
|
|
278
|
+
ThinFilm: ThinFilm_default,
|
|
275
279
|
TiltShift: TiltShift_default,
|
|
276
280
|
Tint: Tint_default,
|
|
277
281
|
Trapezoid: Trapezoid_default,
|
|
@@ -62,7 +62,7 @@ var Shader_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
62
62
|
const startTelemetryWhenReady = () => {
|
|
63
63
|
const checkRendering = () => {
|
|
64
64
|
if (rendererInstance.value.getPerformanceStats().fps > 0) {
|
|
65
|
-
telemetryCollector = startTelemetry(rendererInstance.value, "2.5.
|
|
65
|
+
telemetryCollector = startTelemetry(rendererInstance.value, "2.5.130", props.disableTelemetry, props.isPreview);
|
|
66
66
|
if (telemetryCollector) telemetryCollector.start();
|
|
67
67
|
telemetryStartTimeout = null;
|
|
68
68
|
} else telemetryStartTimeout = setTimeout(checkRendering, 500);
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, effectScope, inject, mergeDefaults, mergeProps, onBeforeUnmount, onMounted, openBlock, provide, ref, renderSlot, toValue, unref, useId, watch } from "vue";
|
|
2
|
+
import { createUniformsMap } from "../core/index.js";
|
|
3
|
+
import { setColorSpaceMode } from "../core/utilities/transformations/index.js";
|
|
4
|
+
import { componentDefinition } from "../core/shaders/ThinFilm/index.js";
|
|
5
|
+
var _hoisted_1 = ["data-shader-id"];
|
|
6
|
+
var _hoisted_2 = ["width", "height"];
|
|
7
|
+
var ThinFilm_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
8
|
+
__name: "ThinFilm",
|
|
9
|
+
props: /* @__PURE__ */ mergeDefaults({
|
|
10
|
+
center: {},
|
|
11
|
+
scale: {},
|
|
12
|
+
intensity: {},
|
|
13
|
+
rimWidth: {},
|
|
14
|
+
edgeSoftness: {},
|
|
15
|
+
thickness: {},
|
|
16
|
+
dispersion: {},
|
|
17
|
+
saturation: {},
|
|
18
|
+
hueShift: {},
|
|
19
|
+
blendMode: {},
|
|
20
|
+
opacity: {},
|
|
21
|
+
visible: { type: Boolean },
|
|
22
|
+
id: {},
|
|
23
|
+
maskSource: {},
|
|
24
|
+
maskType: {},
|
|
25
|
+
renderOrder: {},
|
|
26
|
+
transform: {},
|
|
27
|
+
lightAngle: {},
|
|
28
|
+
speed: {},
|
|
29
|
+
mode: {},
|
|
30
|
+
colorA: {},
|
|
31
|
+
colorB: {},
|
|
32
|
+
colorC: {},
|
|
33
|
+
colorSpace: {},
|
|
34
|
+
shape: {},
|
|
35
|
+
shapeSdfUrl: {},
|
|
36
|
+
shapeType: {}
|
|
37
|
+
}, {
|
|
38
|
+
blendMode: "normal",
|
|
39
|
+
visible: true,
|
|
40
|
+
...Object.entries(componentDefinition.props).reduce((acc, [key, config]) => {
|
|
41
|
+
acc[key] = config.default;
|
|
42
|
+
return acc;
|
|
43
|
+
}, {})
|
|
44
|
+
}),
|
|
45
|
+
setup(__props) {
|
|
46
|
+
let _experimentalWarnedOnce = false;
|
|
47
|
+
if (componentDefinition.experimental && !_experimentalWarnedOnce) {
|
|
48
|
+
_experimentalWarnedOnce = true;
|
|
49
|
+
const _e = componentDefinition.experimental;
|
|
50
|
+
console.info(`%c⚠ [Shaders] ${componentDefinition.name} is experimental: ${_e.message}`, "color: #f59e0b; font-weight: bold");
|
|
51
|
+
}
|
|
52
|
+
function isPropDriver(value) {
|
|
53
|
+
return typeof value === "object" && value !== null && "type" in value && (value.type === "map" || value.type === "mouse" || value.type === "mouse-position" || value.type === "auto-animate");
|
|
54
|
+
}
|
|
55
|
+
const props = __props;
|
|
56
|
+
const instanceId = (props.id ? props.id.replace(/[^a-zA-Z0-9_]/g, "_") : null) || useId().replace(/[^a-zA-Z0-9_]/g, "");
|
|
57
|
+
provide("shaderParentId", instanceId);
|
|
58
|
+
const DEFAULT_TRANSFORM = {
|
|
59
|
+
offsetX: 0,
|
|
60
|
+
offsetY: 0,
|
|
61
|
+
rotation: 0,
|
|
62
|
+
scale: 1,
|
|
63
|
+
anchorX: .5,
|
|
64
|
+
anchorY: .5,
|
|
65
|
+
edges: "transparent"
|
|
66
|
+
};
|
|
67
|
+
const effectiveTransform = computed(() => ({
|
|
68
|
+
...DEFAULT_TRANSFORM,
|
|
69
|
+
...props.transform
|
|
70
|
+
}));
|
|
71
|
+
const shaderReadyProps = computed(() => {
|
|
72
|
+
let baseProps = { ...Object.entries(componentDefinition.props).reduce((acc, [key, config]) => {
|
|
73
|
+
acc[key] = config.default;
|
|
74
|
+
return acc;
|
|
75
|
+
}, {}) };
|
|
76
|
+
for (const key in props) if (key !== "blendMode" && key !== "opacity" && key !== "visible" && key !== "id" && key !== "maskSource" && key !== "maskType" && key !== "renderOrder" && key !== "transform") {
|
|
77
|
+
const val = toValue(props[key]);
|
|
78
|
+
if (isPropDriver(val)) continue;
|
|
79
|
+
if (val !== Object.entries(componentDefinition.props).reduce((acc, [key$1, config]) => {
|
|
80
|
+
acc[key$1] = config.default;
|
|
81
|
+
return acc;
|
|
82
|
+
}, {})[key]) baseProps[key] = val;
|
|
83
|
+
}
|
|
84
|
+
return baseProps;
|
|
85
|
+
});
|
|
86
|
+
const mapsFromProps = computed(() => {
|
|
87
|
+
const maps = {};
|
|
88
|
+
for (const key of Object.keys(componentDefinition.props)) {
|
|
89
|
+
const val = props[key];
|
|
90
|
+
if (isPropDriver(val)) maps[key] = val;
|
|
91
|
+
}
|
|
92
|
+
return Object.keys(maps).length > 0 ? maps : void 0;
|
|
93
|
+
});
|
|
94
|
+
const shaderColorSpace = inject("shaderColorSpace");
|
|
95
|
+
if (shaderColorSpace) setColorSpaceMode(shaderColorSpace.value);
|
|
96
|
+
const uniforms = createUniformsMap(componentDefinition, shaderReadyProps.value, instanceId);
|
|
97
|
+
const parentId = inject("shaderParentId");
|
|
98
|
+
if (parentId === void 0) throw new Error("Shader components must be used inside an <Shader> component or another shader component");
|
|
99
|
+
const parentRegister = inject("shaderNodeRegister");
|
|
100
|
+
if (parentRegister === void 0) throw new Error("Shader components must be used inside an <Shader> component or another shader component");
|
|
101
|
+
const parentUniformUpdate = inject("shaderUniformUpdate");
|
|
102
|
+
if (parentUniformUpdate === void 0) throw new Error("Shader components require shaderUniformUpdate from parent");
|
|
103
|
+
const parentMetadataUpdate = inject("shaderMetadataUpdate");
|
|
104
|
+
if (parentMetadataUpdate === void 0) throw new Error("Shader components require shaderMetadataUpdate from parent");
|
|
105
|
+
const rendererResetSignal = inject("shaderRendererResetSignal");
|
|
106
|
+
const orderMarker = ref(null);
|
|
107
|
+
const isCapturesDOM = !!componentDefinition.capturesDOM;
|
|
108
|
+
const captureCanvas = ref(null);
|
|
109
|
+
const captureW = ref(typeof window !== "undefined" ? Math.round(window.innerWidth * Math.min(window.devicePixelRatio, 2)) : 0);
|
|
110
|
+
const captureH = ref(typeof window !== "undefined" ? Math.round(window.innerHeight * Math.min(window.devicePixelRatio, 2)) : 0);
|
|
111
|
+
const captureStyle = {
|
|
112
|
+
position: "fixed",
|
|
113
|
+
inset: "0",
|
|
114
|
+
width: "100vw",
|
|
115
|
+
height: "100vh",
|
|
116
|
+
zIndex: "-9999"
|
|
117
|
+
};
|
|
118
|
+
if (isCapturesDOM) {
|
|
119
|
+
const onWinResize = () => {
|
|
120
|
+
const d = Math.min(window.devicePixelRatio, 2);
|
|
121
|
+
captureW.value = Math.round(window.innerWidth * d);
|
|
122
|
+
captureH.value = Math.round(window.innerHeight * d);
|
|
123
|
+
};
|
|
124
|
+
onMounted(() => {
|
|
125
|
+
const d = Math.min(window.devicePixelRatio, 2);
|
|
126
|
+
captureW.value = Math.round(window.innerWidth * d);
|
|
127
|
+
captureH.value = Math.round(window.innerHeight * d);
|
|
128
|
+
window.addEventListener("resize", onWinResize);
|
|
129
|
+
});
|
|
130
|
+
onBeforeUnmount(() => {
|
|
131
|
+
window.removeEventListener("resize", onWinResize);
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
let detectedRenderOrder = void 0;
|
|
135
|
+
const registerWithRenderer = () => {
|
|
136
|
+
parentRegister(instanceId, componentDefinition.fragmentNode, parentId, {
|
|
137
|
+
blendMode: props.blendMode,
|
|
138
|
+
opacity: props.opacity,
|
|
139
|
+
visible: props.visible === false ? false : true,
|
|
140
|
+
id: props.id,
|
|
141
|
+
mask: props.maskSource ? {
|
|
142
|
+
source: props.maskSource,
|
|
143
|
+
type: props.maskType || "alpha"
|
|
144
|
+
} : void 0,
|
|
145
|
+
maps: mapsFromProps.value,
|
|
146
|
+
renderOrder: props.renderOrder ?? detectedRenderOrder,
|
|
147
|
+
transform: effectiveTransform.value
|
|
148
|
+
}, uniforms, componentDefinition, isCapturesDOM ? captureCanvas.value ?? void 0 : void 0);
|
|
149
|
+
};
|
|
150
|
+
onMounted(() => {
|
|
151
|
+
if (props.renderOrder === void 0 && orderMarker.value) {
|
|
152
|
+
const parent = orderMarker.value.parentElement;
|
|
153
|
+
if (parent) {
|
|
154
|
+
const siblings = parent.querySelectorAll(":scope > [data-shader-id]");
|
|
155
|
+
const position = Array.from(siblings).indexOf(orderMarker.value);
|
|
156
|
+
if (position >= 0) {
|
|
157
|
+
detectedRenderOrder = position;
|
|
158
|
+
parentMetadataUpdate(instanceId, { renderOrder: position });
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
const setupUniformWatchers = () => {
|
|
164
|
+
const scope = effectScope();
|
|
165
|
+
scope.run(() => {
|
|
166
|
+
Object.entries(uniforms).forEach(([propName, { uniform, transform }]) => {
|
|
167
|
+
watch(() => props[propName], (newValue) => {
|
|
168
|
+
if (uniform && uniform.value !== void 0 && !isPropDriver(newValue)) parentUniformUpdate(instanceId, propName, newValue);
|
|
169
|
+
}, { deep: true });
|
|
170
|
+
});
|
|
171
|
+
watch(() => [
|
|
172
|
+
props.blendMode,
|
|
173
|
+
props.opacity,
|
|
174
|
+
props.visible,
|
|
175
|
+
props.id,
|
|
176
|
+
props.maskSource,
|
|
177
|
+
props.maskType,
|
|
178
|
+
props.renderOrder,
|
|
179
|
+
props.transform,
|
|
180
|
+
mapsFromProps.value
|
|
181
|
+
], ([blendMode, opacity, visible]) => {
|
|
182
|
+
parentMetadataUpdate(instanceId, {
|
|
183
|
+
blendMode,
|
|
184
|
+
opacity,
|
|
185
|
+
visible: visible === false ? false : true,
|
|
186
|
+
id: props.id,
|
|
187
|
+
mask: props.maskSource ? {
|
|
188
|
+
source: props.maskSource,
|
|
189
|
+
type: props.maskType || "alpha"
|
|
190
|
+
} : void 0,
|
|
191
|
+
maps: mapsFromProps.value,
|
|
192
|
+
renderOrder: props.renderOrder ?? detectedRenderOrder,
|
|
193
|
+
transform: effectiveTransform.value
|
|
194
|
+
});
|
|
195
|
+
}, { deep: true });
|
|
196
|
+
if (rendererResetSignal) watch(() => rendererResetSignal.value, (newValue) => {
|
|
197
|
+
if (newValue > 0) registerWithRenderer();
|
|
198
|
+
}, { immediate: true });
|
|
199
|
+
});
|
|
200
|
+
onBeforeUnmount(() => {
|
|
201
|
+
scope.stop();
|
|
202
|
+
});
|
|
203
|
+
};
|
|
204
|
+
if (isCapturesDOM) onMounted(() => {
|
|
205
|
+
setupUniformWatchers();
|
|
206
|
+
});
|
|
207
|
+
else setupUniformWatchers();
|
|
208
|
+
onBeforeUnmount(() => {
|
|
209
|
+
parentRegister(instanceId, null, null, null, null, null);
|
|
210
|
+
});
|
|
211
|
+
return (_ctx, _cache) => {
|
|
212
|
+
return openBlock(), createElementBlock(Fragment, null, [createElementVNode("span", {
|
|
213
|
+
ref_key: "orderMarker",
|
|
214
|
+
ref: orderMarker,
|
|
215
|
+
style: { "display": "contents" },
|
|
216
|
+
"data-shader-id": unref(instanceId)
|
|
217
|
+
}, [!isCapturesDOM ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("", true)], 8, _hoisted_1), isCapturesDOM ? (openBlock(), createBlock(Teleport, {
|
|
218
|
+
key: 0,
|
|
219
|
+
to: "body"
|
|
220
|
+
}, [createElementVNode("canvas", mergeProps({
|
|
221
|
+
ref_key: "captureCanvas",
|
|
222
|
+
ref: captureCanvas
|
|
223
|
+
}, { "layoutsubtree": "" }, {
|
|
224
|
+
width: captureW.value,
|
|
225
|
+
height: captureH.value,
|
|
226
|
+
style: captureStyle
|
|
227
|
+
}), [renderSlot(_ctx.$slots, "default")], 16, _hoisted_2)])) : createCommentVNode("", true)], 64);
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
export { ThinFilm_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { BlendMode, PropDriver, TransformConfig } from '../../core';
|
|
2
|
+
import { ComponentProps } from '../../core/shaders/Exposure';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Define component props including blend mode, opacity, visibility, masking, and transformation
|
|
6
|
+
*/
|
|
7
|
+
interface ExtendedComponentProps extends Partial<ComponentProps> {
|
|
8
|
+
exposure?: ComponentProps['exposure'] | PropDriver;
|
|
9
|
+
blendMode?: BlendMode;
|
|
10
|
+
opacity?: number;
|
|
11
|
+
visible?: boolean;
|
|
12
|
+
id?: string;
|
|
13
|
+
maskSource?: string;
|
|
14
|
+
maskType?: string;
|
|
15
|
+
renderOrder?: number;
|
|
16
|
+
transform?: Partial<TransformConfig>;
|
|
17
|
+
}
|
|
18
|
+
declare function __VLS_template(): {
|
|
19
|
+
default?(_: {}): any;
|
|
20
|
+
};
|
|
21
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ExtendedComponentProps>, {
|
|
22
|
+
blendMode: string;
|
|
23
|
+
visible: boolean;
|
|
24
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ExtendedComponentProps>, {
|
|
25
|
+
blendMode: string;
|
|
26
|
+
visible: boolean;
|
|
27
|
+
}>>> & Readonly<{}>, {
|
|
28
|
+
blendMode: BlendMode;
|
|
29
|
+
visible: boolean;
|
|
30
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
31
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
32
|
+
export default _default;
|
|
33
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
34
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
35
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
36
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
37
|
+
} : {
|
|
38
|
+
type: import('vue').PropType<T[K]>;
|
|
39
|
+
required: true;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
type __VLS_WithDefaults<P, D> = {
|
|
43
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
44
|
+
default: D[K];
|
|
45
|
+
}> : P[K];
|
|
46
|
+
};
|
|
47
|
+
type __VLS_Prettify<T> = {
|
|
48
|
+
[K in keyof T]: T[K];
|
|
49
|
+
} & {};
|
|
50
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
51
|
+
new (): {
|
|
52
|
+
$slots: S;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=Exposure.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Exposure.vue.d.ts","sourceRoot":"","sources":["../../src/components/Exposure.vue"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,SAAS,EAId,KAAK,UAAU,EACf,KAAK,eAAe,EACrB,MAAM,cAAc,CAAA;AAIrB,OAAO,EAAsB,KAAK,cAAc,EAAC,MAAM,uBAAuB,CAAA;AAY9E;;GAEG;AACH,UAAU,sBAAuB,SAAQ,OAAO,CAAC,cAAc,CAAC;IAC9D,QAAQ,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC;IACnD,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CACtC;AAyTD,iBAAS,cAAc;qBAkFO,GAAG;EAGhC;AAeD,QAAA,MAAM,eAAe;;;;;;;eAraP,SAAS;aAEX,OAAO;4EAyajB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AACxG,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAE1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QACxE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KACb,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACT,CAAC;AACN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC;AACxD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
|