shaders 2.2.29 → 2.2.31
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-DKFExWUF.js → AngularBlur-CuwAjUOA.js} +1 -1
- package/dist/core/{Ascii-BRApYlD4.js → Ascii-Dxk6VaBp.js} +30 -7
- package/dist/core/{Beam-DU7wxmIh.js → Beam-CbG4MkLo.js} +3 -4
- package/dist/core/{Blob-nssNzEgN.js → Blob-C_fYRjJF.js} +4 -5
- package/dist/core/{Bulge-Dm02_fG6.js → Bulge-C8-_hIFp.js} +2 -21
- package/dist/core/{Checkerboard-SKsXoUXE.js → Checkerboard-D_H3XYbF.js} +3 -4
- package/dist/core/{ChromaFlow-VpfgLFbs.js → ChromaFlow-DhzC_8Ne.js} +19 -17
- package/dist/core/{ChromaticAberration-CaCyXMyE.js → ChromaticAberration-hi7WGiVk.js} +1 -1
- package/dist/core/{Circle-BHnAmzVb.js → Circle-DI0gXpyD.js} +3 -4
- package/dist/core/{CursorTrail-CfVWIKok.js → CursorTrail-B9EQ9FsP.js} +1 -1
- package/dist/core/{DiffuseBlur-GWPb8Zht.js → DiffuseBlur-Cg7AsB3W.js} +2 -13
- package/dist/core/{Dither-BNEeyo0u.js → Dither-Bb5rLGEI.js} +1 -1
- package/dist/core/{DotGrid-CRRS6nbt.js → DotGrid-B2DXsjFE.js} +3 -4
- package/dist/core/{Duotone-5gKND3an.js → Duotone-CRwhugbV.js} +1 -1
- package/dist/core/{FilmGrain-osBGk_b9.js → FilmGrain-CY4ZO9UI.js} +2 -3
- package/dist/core/{FloatingParticles-CULOurGT.js → FloatingParticles-BduIDXKd.js} +3 -4
- package/dist/core/{GlassTiles-CA90XrNT.js → GlassTiles-uW7j91uC.js} +1 -13
- package/dist/core/{Godrays-BQsDwU26.js → Godrays-ChqiT2zn.js} +3 -4
- package/dist/core/{Grid-CWHxwO7R.js → Grid-DazyiX15.js} +3 -4
- package/dist/core/{GridDistortion-CZB9w-rv.js → GridDistortion-CYQUwuXw.js} +2 -2
- package/dist/core/{Halftone-MMcLMRpL.js → Halftone-Ddrldk6b.js} +1 -1
- package/dist/core/{ImageTexture-D9OMwqAs.js → ImageTexture-D0xwHmkW.js} +2 -3
- package/dist/core/{LinearBlur-B-Ikurxt.js → LinearBlur-cYfqaOhb.js} +1 -1
- package/dist/core/{LinearGradient-DV6UkhZk.js → LinearGradient-B6ySxWpU.js} +3 -4
- package/dist/core/{Liquify-W8UQNeEM.js → Liquify-yoKWSK0F.js} +2 -8
- package/dist/core/{Pixelate-_pyYeLRP.js → Pixelate-BmE_Zryn.js} +0 -4
- package/dist/core/{PolarCoordinates-D63xm0oJ.js → PolarCoordinates-PLyS00-P.js} +2 -11
- package/dist/core/{ProgressiveBlur-G-s-o9ic.js → ProgressiveBlur-XD4ivmMn.js} +1 -1
- package/dist/core/{RadialGradient-BGVqSwh0.js → RadialGradient-pwKyDUBu.js} +3 -4
- package/dist/core/{RectangularCoordinates-DyHBo456.js → RectangularCoordinates-Dq2JrmOX.js} +2 -11
- package/dist/core/{Ripples-2FGWCZlp.js → Ripples-Ot1rx8kL.js} +4 -5
- package/dist/core/{SimplexNoise-B6dtUCmn.js → SimplexNoise-BfilWh05.js} +4 -5
- package/dist/core/{SineWave-BtPf6-2H.js → SineWave-DRqL-jda.js} +3 -4
- package/dist/core/{SolidColor-CETl1cEr.js → SolidColor-B62ZBRlK.js} +1 -2
- package/dist/core/{Spherize-BwvUcorJ.js → Spherize-DDP0_5VP.js} +1 -1
- package/dist/core/{Spiral-DmJWmUmr.js → Spiral-Cx7Z8gLc.js} +3 -4
- package/dist/core/{Strands-CV1oCmHx.js → Strands-C9FBVtDe.js} +4 -5
- package/dist/core/{Stretch-pl-Cn2F8.js → Stretch-BCpOO3q6.js} +2 -21
- package/dist/core/{Swirl-D65vXLDw.js → Swirl-KUjGnUAM.js} +4 -5
- package/dist/core/{TiltShift-CFcK6Hzg.js → TiltShift-CvKqM1xk.js} +1 -1
- package/dist/core/{Tritone-EmnjV2rX.js → Tritone-BeEJj4U0.js} +1 -1
- package/dist/core/{Twirl-HSMyRx5I.js → Twirl-EJ3aS_lo.js} +2 -12
- package/dist/core/{WaveDistortion-DG8GO_l8.js → WaveDistortion-BOWBSWEU.js} +2 -24
- package/dist/core/{ZoomBlur-C01oGwwG.js → ZoomBlur-gB0BxldE.js} +1 -1
- package/dist/core/{edges-Djr_12SL.js → edges-Bd7GP4s2.js} +1 -10
- package/dist/core/index.js +198 -653
- package/dist/core/performanceTracker.d.ts +7 -1
- package/dist/core/performanceTracker.d.ts.map +1 -1
- package/dist/core/renderer.d.ts +0 -21
- package/dist/core/renderer.d.ts.map +1 -1
- package/dist/core/shaders/AngularBlur/index.js +2 -2
- package/dist/core/shaders/Ascii/index.d.ts.map +1 -1
- package/dist/core/shaders/Ascii/index.js +1 -1
- package/dist/core/shaders/Beam/index.d.ts.map +1 -1
- package/dist/core/shaders/Beam/index.js +2 -2
- package/dist/core/shaders/Blob/index.d.ts.map +1 -1
- package/dist/core/shaders/Blob/index.js +3 -3
- package/dist/core/shaders/Bulge/index.d.ts.map +1 -1
- package/dist/core/shaders/Bulge/index.js +3 -3
- package/dist/core/shaders/Checkerboard/index.d.ts.map +1 -1
- package/dist/core/shaders/Checkerboard/index.js +2 -2
- package/dist/core/shaders/ChromaFlow/index.d.ts.map +1 -1
- package/dist/core/shaders/ChromaFlow/index.js +2 -2
- package/dist/core/shaders/ChromaticAberration/index.js +2 -2
- package/dist/core/shaders/Circle/index.d.ts.map +1 -1
- package/dist/core/shaders/Circle/index.js +2 -2
- package/dist/core/shaders/CursorTrail/index.js +2 -2
- package/dist/core/shaders/DiffuseBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/DiffuseBlur/index.js +3 -3
- package/dist/core/shaders/Dither/index.js +2 -2
- package/dist/core/shaders/DotGrid/index.d.ts.map +1 -1
- package/dist/core/shaders/DotGrid/index.js +2 -2
- package/dist/core/shaders/Duotone/index.js +2 -2
- package/dist/core/shaders/FilmGrain/index.d.ts.map +1 -1
- package/dist/core/shaders/FilmGrain/index.js +1 -1
- package/dist/core/shaders/FloatingParticles/index.d.ts.map +1 -1
- package/dist/core/shaders/FloatingParticles/index.js +2 -2
- package/dist/core/shaders/GlassTiles/index.d.ts.map +1 -1
- package/dist/core/shaders/GlassTiles/index.js +1 -1
- package/dist/core/shaders/Godrays/index.d.ts.map +1 -1
- package/dist/core/shaders/Godrays/index.js +2 -2
- package/dist/core/shaders/Grid/index.d.ts.map +1 -1
- package/dist/core/shaders/Grid/index.js +2 -2
- package/dist/core/shaders/GridDistortion/index.js +3 -3
- package/dist/core/shaders/Halftone/index.js +2 -2
- package/dist/core/shaders/ImageTexture/index.d.ts.map +1 -1
- package/dist/core/shaders/ImageTexture/index.js +1 -1
- package/dist/core/shaders/LinearBlur/index.js +2 -2
- package/dist/core/shaders/LinearGradient/index.d.ts.map +1 -1
- package/dist/core/shaders/LinearGradient/index.js +2 -2
- package/dist/core/shaders/Liquify/index.d.ts.map +1 -1
- package/dist/core/shaders/Liquify/index.js +3 -3
- package/dist/core/shaders/Pixelate/index.d.ts.map +1 -1
- package/dist/core/shaders/Pixelate/index.js +1 -1
- package/dist/core/shaders/PolarCoordinates/index.d.ts.map +1 -1
- package/dist/core/shaders/PolarCoordinates/index.js +3 -3
- package/dist/core/shaders/ProgressiveBlur/index.js +2 -2
- package/dist/core/shaders/RadialGradient/index.d.ts.map +1 -1
- package/dist/core/shaders/RadialGradient/index.js +2 -2
- package/dist/core/shaders/RectangularCoordinates/index.d.ts.map +1 -1
- package/dist/core/shaders/RectangularCoordinates/index.js +3 -3
- package/dist/core/shaders/Ripples/index.d.ts.map +1 -1
- package/dist/core/shaders/Ripples/index.js +3 -3
- package/dist/core/shaders/SimplexNoise/index.d.ts.map +1 -1
- package/dist/core/shaders/SimplexNoise/index.js +3 -3
- package/dist/core/shaders/SineWave/index.d.ts.map +1 -1
- package/dist/core/shaders/SineWave/index.js +2 -2
- package/dist/core/shaders/SolidColor/index.d.ts.map +1 -1
- package/dist/core/shaders/SolidColor/index.js +2 -2
- package/dist/core/shaders/Spherize/index.js +2 -2
- package/dist/core/shaders/Spiral/index.d.ts.map +1 -1
- package/dist/core/shaders/Spiral/index.js +2 -2
- package/dist/core/shaders/Strands/index.d.ts.map +1 -1
- package/dist/core/shaders/Strands/index.js +3 -3
- package/dist/core/shaders/Stretch/index.d.ts.map +1 -1
- package/dist/core/shaders/Stretch/index.js +3 -3
- package/dist/core/shaders/Swirl/index.d.ts.map +1 -1
- 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 +2 -2
- package/dist/core/shaders/Twirl/index.d.ts.map +1 -1
- package/dist/core/shaders/Twirl/index.js +3 -3
- package/dist/core/shaders/WaveDistortion/index.d.ts.map +1 -1
- package/dist/core/shaders/WaveDistortion/index.js +3 -3
- package/dist/core/shaders/ZoomBlur/index.js +2 -2
- package/dist/core/{transformations-Dv5JW9ck.js → transformations-YbhRK-rd.js} +51 -1
- package/dist/core/types.d.ts +0 -81
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/utilities/transformations.d.ts +17 -0
- package/dist/core/utilities/transformations.d.ts.map +1 -1
- package/dist/core/utilities/uniforms.d.ts.map +1 -1
- package/dist/registry.js +0 -19
- package/package.json +1 -1
- /package/dist/core/{time-CTJvRUZ4.js → time-DgRTVr2F.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as applyEdgeHandling } from "./edges-
|
|
2
|
-
import {
|
|
1
|
+
import { t as applyEdgeHandling } from "./edges-Bd7GP4s2.js";
|
|
2
|
+
import { o as transformEdges, s as transformPosition } from "./transformations-YbhRK-rd.js";
|
|
3
3
|
import { PI, convertToTexture, cos, mix, screenUV, sin, vec2, vec4, viewportSize } from "three/tsl";
|
|
4
4
|
const componentDefinition = {
|
|
5
5
|
name: "RectangularCoordinates",
|
|
@@ -70,15 +70,6 @@ const componentDefinition = {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
|
-
uvTransformNode: ({ uv: uv$1, uniforms, viewportSize: viewportSize$1 }) => {
|
|
74
|
-
const theta = uv$1.x.mul(PI.mul(2)).sub(PI);
|
|
75
|
-
const r = uv$1.y.mul(uniforms.scale.uniform);
|
|
76
|
-
const rectX = r.mul(cos(theta));
|
|
77
|
-
const rectY = r.mul(sin(theta));
|
|
78
|
-
const aspect = viewportSize$1.x.div(viewportSize$1.y);
|
|
79
|
-
const centerPos = vec2(uniforms.center.uniform.x, uniforms.center.uniform.y.oneMinus());
|
|
80
|
-
return mix(uv$1, vec2(rectX.div(aspect).add(centerPos.x), rectY.add(centerPos.y)), uniforms.intensity.uniform);
|
|
81
|
-
},
|
|
82
73
|
fragmentNode: ({ uniforms, childNode, onCleanup }) => {
|
|
83
74
|
if (!childNode) return vec4(0, 0, 0, 0);
|
|
84
75
|
const childTexture = convertToTexture(childNode);
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { r as transformColor, s as transformPosition } from "./transformations-YbhRK-rd.js";
|
|
2
|
+
import { t as createAnimatedTime } from "./time-DgRTVr2F.js";
|
|
3
3
|
import { t as mixColors } from "./colorMixing-CZPFmiT4.js";
|
|
4
4
|
import { distance, float, screenUV, sin, smoothstep, vec2, viewportSize } from "three/tsl";
|
|
5
5
|
const componentDefinition = {
|
|
6
6
|
name: "Ripples",
|
|
7
7
|
category: "Base Layers",
|
|
8
8
|
description: "Concentric animated ripples emanating from a point",
|
|
9
|
-
acceptsUVContext: true,
|
|
10
9
|
props: {
|
|
11
10
|
center: {
|
|
12
11
|
default: {
|
|
@@ -95,8 +94,8 @@ const componentDefinition = {
|
|
|
95
94
|
}
|
|
96
95
|
},
|
|
97
96
|
fragmentNode: (params) => {
|
|
98
|
-
const { uniforms
|
|
99
|
-
const uv$1 =
|
|
97
|
+
const { uniforms } = params;
|
|
98
|
+
const uv$1 = screenUV;
|
|
100
99
|
const center = uniforms.center.uniform;
|
|
101
100
|
const colorA = uniforms.colorA.uniform;
|
|
102
101
|
const colorB = uniforms.colorB.uniform;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { r as transformColor } from "./transformations-YbhRK-rd.js";
|
|
2
|
+
import { t as createAnimatedTime } from "./time-DgRTVr2F.js";
|
|
3
3
|
import { t as mixColors } from "./colorMixing-CZPFmiT4.js";
|
|
4
4
|
import { clamp, exp, float, mx_noise_float, screenUV, vec2, vec3, viewportSize } from "three/tsl";
|
|
5
5
|
const componentDefinition = {
|
|
6
6
|
name: "SimplexNoise",
|
|
7
7
|
category: "Base Layers",
|
|
8
8
|
description: "Organic noise with animated movement",
|
|
9
|
-
acceptsUVContext: true,
|
|
10
9
|
props: {
|
|
11
10
|
colorA: {
|
|
12
11
|
default: "#ffffff",
|
|
@@ -83,8 +82,8 @@ const componentDefinition = {
|
|
|
83
82
|
}
|
|
84
83
|
},
|
|
85
84
|
fragmentNode: (params) => {
|
|
86
|
-
const { uniforms
|
|
87
|
-
const uv$1 =
|
|
85
|
+
const { uniforms } = params;
|
|
86
|
+
const uv$1 = screenUV;
|
|
88
87
|
const aspect = viewportSize.x.div(viewportSize.y);
|
|
89
88
|
const aspectCorrectedUV = vec2(uv$1.x.mul(aspect), uv$1.y);
|
|
90
89
|
const animTime = createAnimatedTime(params, uniforms.speed);
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { n as transformAngle,
|
|
1
|
+
import { n as transformAngle, r as transformColor, s as transformPosition } from "./transformations-YbhRK-rd.js";
|
|
2
2
|
import { PI, abs, cos, radians, screenUV, sin, smoothstep, time, vec2, vec4, viewportSize } from "three/tsl";
|
|
3
3
|
const componentDefinition = {
|
|
4
4
|
name: "SineWave",
|
|
5
5
|
category: "Base Layers",
|
|
6
6
|
description: "Animated wave with thickness and softness",
|
|
7
|
-
acceptsUVContext: true,
|
|
8
7
|
props: {
|
|
9
8
|
color: {
|
|
10
9
|
default: "#ffffff",
|
|
@@ -95,8 +94,8 @@ const componentDefinition = {
|
|
|
95
94
|
}
|
|
96
95
|
}
|
|
97
96
|
},
|
|
98
|
-
fragmentNode: ({ uniforms
|
|
99
|
-
const uv$1 =
|
|
97
|
+
fragmentNode: ({ uniforms }) => {
|
|
98
|
+
const uv$1 = screenUV;
|
|
100
99
|
const aspect = viewportSize.x.div(viewportSize.y);
|
|
101
100
|
const aspectCorrectedUV = vec2(uv$1.x.mul(aspect), uv$1.y);
|
|
102
101
|
const centerPos = vec2(uniforms.position.uniform.x.mul(aspect), uniforms.position.uniform.y.oneMinus());
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { r as transformColor } from "./transformations-
|
|
1
|
+
import { r as transformColor } from "./transformations-YbhRK-rd.js";
|
|
2
2
|
const componentDefinition = {
|
|
3
3
|
name: "SolidColor",
|
|
4
4
|
category: "Base Layers",
|
|
5
5
|
description: "Fill the canvas with a single solid color",
|
|
6
|
-
acceptsUVContext: true,
|
|
7
6
|
props: { color: {
|
|
8
7
|
default: "#5b18ca",
|
|
9
8
|
transform: transformColor,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as transformColor, s as transformPosition } from "./transformations-YbhRK-rd.js";
|
|
2
2
|
import { convertToTexture, dot, float, max, normalize, pow, screenUV, smoothstep, sqrt, vec2, vec3, vec4, viewportSize } from "three/tsl";
|
|
3
3
|
const componentDefinition = {
|
|
4
4
|
name: "Spherize",
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { i as transformColorSpace,
|
|
1
|
+
import { i as transformColorSpace, r as transformColor, s as transformPosition, t as colorSpaceOptions } from "./transformations-YbhRK-rd.js";
|
|
2
2
|
import { t as mixColors } from "./colorMixing-CZPFmiT4.js";
|
|
3
3
|
import { abs, atan, clamp, float, fract, fwidth, length, mix, screenUV, smoothstep, time, vec2, vec4, viewportSize } from "three/tsl";
|
|
4
4
|
const componentDefinition = {
|
|
5
5
|
name: "Spiral",
|
|
6
6
|
category: "Base Layers",
|
|
7
7
|
description: "Rotating spiral pattern with animated movement",
|
|
8
|
-
acceptsUVContext: true,
|
|
9
8
|
props: {
|
|
10
9
|
colorA: {
|
|
11
10
|
default: "#000000",
|
|
@@ -103,8 +102,8 @@ const componentDefinition = {
|
|
|
103
102
|
}
|
|
104
103
|
}
|
|
105
104
|
},
|
|
106
|
-
fragmentNode: ({ uniforms
|
|
107
|
-
const baseUV =
|
|
105
|
+
fragmentNode: ({ uniforms }) => {
|
|
106
|
+
const baseUV = screenUV;
|
|
108
107
|
const aspect = viewportSize.x.div(viewportSize.y);
|
|
109
108
|
const aspectCorrectedUV = vec2(baseUV.x.mul(aspect), baseUV.y);
|
|
110
109
|
const centerPos = vec2(uniforms.center.uniform.x.mul(aspect), uniforms.center.uniform.y.oneMinus());
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { r as transformColor, s as transformPosition } from "./transformations-YbhRK-rd.js";
|
|
2
|
+
import { t as createAnimatedTime } from "./time-DgRTVr2F.js";
|
|
3
3
|
import { Fn, abs, cos, float, max, mix, screenUV, smoothstep, vec2, vec4, viewportSize } from "three/tsl";
|
|
4
4
|
const componentDefinition = {
|
|
5
5
|
name: "Strands",
|
|
@@ -7,7 +7,6 @@ const componentDefinition = {
|
|
|
7
7
|
description: "Procedural wavy strands with layered animation",
|
|
8
8
|
requiresRTT: false,
|
|
9
9
|
requiresChild: false,
|
|
10
|
-
acceptsUVContext: true,
|
|
11
10
|
props: {
|
|
12
11
|
speed: {
|
|
13
12
|
default: .5,
|
|
@@ -107,8 +106,8 @@ const componentDefinition = {
|
|
|
107
106
|
}
|
|
108
107
|
},
|
|
109
108
|
fragmentNode: (params) => {
|
|
110
|
-
const { uniforms
|
|
111
|
-
const baseUV =
|
|
109
|
+
const { uniforms } = params;
|
|
110
|
+
const baseUV = screenUV;
|
|
112
111
|
const t = createAnimatedTime(params, uniforms.speed);
|
|
113
112
|
const random = Fn(([time$1]) => {
|
|
114
113
|
return cos(time$1).add(cos(time$1.mul(1.2).add(1.6))).add(cos(time$1.mul(1.4).add(1.5))).div(3);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as applyEdgeHandling } from "./edges-
|
|
2
|
-
import {
|
|
1
|
+
import { t as applyEdgeHandling } from "./edges-Bd7GP4s2.js";
|
|
2
|
+
import { o as transformEdges, s as transformPosition } from "./transformations-YbhRK-rd.js";
|
|
3
3
|
import { clamp, convertToTexture, cos, float, mix, screenUV, sin, vec2, vec4, viewportSize } from "three/tsl";
|
|
4
4
|
const componentDefinition = {
|
|
5
5
|
name: "Stretch",
|
|
@@ -81,25 +81,6 @@ const componentDefinition = {
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
},
|
|
84
|
-
uvTransformNode: ({ uv: uv$1, uniforms, viewportSize: viewportSize$1 }) => {
|
|
85
|
-
const aspect = viewportSize$1.x.div(viewportSize$1.y);
|
|
86
|
-
const aspectCorrectedUV = vec2(uv$1.x.mul(aspect), uv$1.y);
|
|
87
|
-
const centerPos = vec2(uniforms.center.uniform.x.mul(aspect), uniforms.center.uniform.y.oneMinus());
|
|
88
|
-
const delta = aspectCorrectedUV.sub(centerPos);
|
|
89
|
-
const angleRad = uniforms.angle.uniform.mul(Math.PI / 180);
|
|
90
|
-
const directionVector = vec2(cos(angleRad), sin(angleRad));
|
|
91
|
-
const projection = delta.dot(directionVector);
|
|
92
|
-
const perpendicular = delta.sub(directionVector.mul(projection));
|
|
93
|
-
const falloffAmount = uniforms.falloff.uniform;
|
|
94
|
-
const transitionWidth = mix(float(.001), float(75), falloffAmount);
|
|
95
|
-
const effectMask = clamp(projection.div(transitionWidth), float(0), float(1));
|
|
96
|
-
const scaledStrength = uniforms.strength.uniform.mul(float(100));
|
|
97
|
-
const stretchFactor = float(1).add(scaledStrength.mul(effectMask));
|
|
98
|
-
const finalProjection = projection.div(stretchFactor);
|
|
99
|
-
const stretchedDelta = directionVector.mul(finalProjection).add(perpendicular);
|
|
100
|
-
const stretchedUV = centerPos.add(stretchedDelta);
|
|
101
|
-
return vec2(stretchedUV.x.div(aspect), stretchedUV.y);
|
|
102
|
-
},
|
|
103
84
|
fragmentNode: ({ uniforms, childNode, onCleanup }) => {
|
|
104
85
|
if (!childNode) return vec4(0, 0, 0, 0);
|
|
105
86
|
const childTexture = convertToTexture(childNode);
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import {
|
|
1
|
+
import { i as transformColorSpace, r as transformColor, t as colorSpaceOptions } from "./transformations-YbhRK-rd.js";
|
|
2
|
+
import { t as createAnimatedTime } from "./time-DgRTVr2F.js";
|
|
3
3
|
import { t as mixColors } from "./colorMixing-CZPFmiT4.js";
|
|
4
4
|
import { cos, float, screenUV, sin, smoothstep, vec2, vec4 } from "three/tsl";
|
|
5
5
|
const componentDefinition = {
|
|
6
6
|
name: "Swirl",
|
|
7
7
|
category: "Base Layers",
|
|
8
8
|
description: "Flowing swirl pattern with multi-layered noise",
|
|
9
|
-
acceptsUVContext: true,
|
|
10
9
|
props: {
|
|
11
10
|
colorA: {
|
|
12
11
|
default: "#1275d8",
|
|
@@ -137,8 +136,8 @@ const componentDefinition = {
|
|
|
137
136
|
}
|
|
138
137
|
},
|
|
139
138
|
fragmentNode: (params) => {
|
|
140
|
-
const { uniforms
|
|
141
|
-
const uvCoords =
|
|
139
|
+
const { uniforms } = params;
|
|
140
|
+
const uvCoords = screenUV;
|
|
142
141
|
const t = createAnimatedTime(params, uniforms.speed);
|
|
143
142
|
const detail = uniforms.detail.uniform;
|
|
144
143
|
const scaleCoarse = float(.02);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as transformAngle,
|
|
1
|
+
import { n as transformAngle, s as transformPosition } from "./transformations-YbhRK-rd.js";
|
|
2
2
|
import { Fn, abs, convertToTexture, cos, dot, float, mix, radians, screenUV, sin, smoothstep, vec2, vec4, viewportSize } from "three/tsl";
|
|
3
3
|
const componentDefinition = {
|
|
4
4
|
name: "TiltShift",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as transformColorSpace, r as transformColor, t as colorSpaceOptions } from "./transformations-
|
|
1
|
+
import { i as transformColorSpace, r as transformColor, t as colorSpaceOptions } from "./transformations-YbhRK-rd.js";
|
|
2
2
|
import { t as mixColors } from "./colorMixing-CZPFmiT4.js";
|
|
3
3
|
import { convertToTexture, dot, screenUV, smoothstep, vec3, vec4 } from "three/tsl";
|
|
4
4
|
const componentDefinition = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as applyEdgeHandling } from "./edges-
|
|
2
|
-
import {
|
|
1
|
+
import { t as applyEdgeHandling } from "./edges-Bd7GP4s2.js";
|
|
2
|
+
import { o as transformEdges, s as transformPosition } from "./transformations-YbhRK-rd.js";
|
|
3
3
|
import { convertToTexture, cos, length, screenUV, sin, vec2, vec4 } from "three/tsl";
|
|
4
4
|
const componentDefinition = {
|
|
5
5
|
name: "Twirl",
|
|
@@ -59,16 +59,6 @@ const componentDefinition = {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
|
-
uvTransformNode: ({ uv: uv$1, uniforms }) => {
|
|
63
|
-
const centerPos = vec2(uniforms.center.uniform.x, uniforms.center.uniform.y.oneMinus());
|
|
64
|
-
const delta = uv$1.sub(centerPos);
|
|
65
|
-
const angle = uniforms.intensity.uniform.mul(length(delta));
|
|
66
|
-
const cosAngle = cos(angle);
|
|
67
|
-
const sinAngle = sin(angle);
|
|
68
|
-
const rotatedX = cosAngle.mul(delta.x).sub(sinAngle.mul(delta.y));
|
|
69
|
-
const rotatedY = sinAngle.mul(delta.x).add(cosAngle.mul(delta.y));
|
|
70
|
-
return vec2(rotatedX.add(centerPos.x), rotatedY.add(centerPos.y));
|
|
71
|
-
},
|
|
72
62
|
fragmentNode: ({ uniforms, childNode, onCleanup }) => {
|
|
73
63
|
if (!childNode) {
|
|
74
64
|
console.error("You must pass a child component into the Twirl shader.");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as applyEdgeHandling } from "./edges-
|
|
2
|
-
import {
|
|
1
|
+
import { t as applyEdgeHandling } from "./edges-Bd7GP4s2.js";
|
|
2
|
+
import { o as transformEdges } from "./transformations-YbhRK-rd.js";
|
|
3
3
|
import { PI, abs, convertToTexture, cos, float, fract, screenUV, sin, step, time, vec2, vec4 } from "three/tsl";
|
|
4
4
|
const componentDefinition = {
|
|
5
5
|
name: "WaveDistortion",
|
|
@@ -114,28 +114,6 @@ const componentDefinition = {
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
},
|
|
117
|
-
uvTransformNode: ({ uv: uv$1, uniforms }) => {
|
|
118
|
-
const t = time.mul(uniforms.speed.uniform).mul(.5);
|
|
119
|
-
const angleRad = uniforms.angle.uniform.mul(PI).div(180);
|
|
120
|
-
const cosAngle = cos(angleRad);
|
|
121
|
-
const sinAngle = sin(angleRad);
|
|
122
|
-
const centeredUV = uv$1.sub(vec2(.5, .5));
|
|
123
|
-
const phase = vec2(centeredUV.x.mul(cosAngle).sub(centeredUV.y.mul(sinAngle)), centeredUV.x.mul(sinAngle).add(centeredUV.y.mul(cosAngle))).add(vec2(.5, .5)).y.mul(uniforms.frequency.uniform).mul(PI.mul(2)).add(t);
|
|
124
|
-
const normalizedPhase = fract(phase.div(PI.mul(2)));
|
|
125
|
-
const sineWave = sin(phase);
|
|
126
|
-
const triangleWave = abs(normalizedPhase.mul(2).sub(1)).mul(2).sub(1);
|
|
127
|
-
const squareWave = step(float(.5), normalizedPhase).mul(2).sub(1);
|
|
128
|
-
const sawtoothWave = normalizedPhase.mul(2).sub(1);
|
|
129
|
-
const waveTypeValue = uniforms.waveType.uniform;
|
|
130
|
-
const isSine = step(waveTypeValue, float(.5));
|
|
131
|
-
const isTriangle = step(float(.5), waveTypeValue).mul(step(waveTypeValue, float(1.5)));
|
|
132
|
-
const isSquare = step(float(1.5), waveTypeValue).mul(step(waveTypeValue, float(2.5)));
|
|
133
|
-
const isSawtooth = step(float(2.5), waveTypeValue);
|
|
134
|
-
const displacement = sineWave.mul(isSine).add(triangleWave.mul(isTriangle)).add(squareWave.mul(isSquare)).add(sawtoothWave.mul(isSawtooth)).mul(uniforms.strength.uniform).mul(.5);
|
|
135
|
-
const displacementX = displacement.mul(cosAngle);
|
|
136
|
-
const displacementY = displacement.mul(sinAngle);
|
|
137
|
-
return vec2(uv$1.x.add(displacementX), uv$1.y.add(displacementY));
|
|
138
|
-
},
|
|
139
117
|
fragmentNode: (params) => {
|
|
140
118
|
const { uniforms, childNode, onCleanup } = params;
|
|
141
119
|
if (!childNode) return vec4(0, 0, 0, 0);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { s as transformPosition } from "./transformations-YbhRK-rd.js";
|
|
2
2
|
import { Fn, convertToTexture, float, screenUV, vec2, vec4 } from "three/tsl";
|
|
3
3
|
const componentDefinition = {
|
|
4
4
|
name: "ZoomBlur",
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
import { abs, float, fract, mod, select, step, vec2, vec4 } from "three/tsl";
|
|
2
|
-
const applyEdgeToUV = (uv$1, edgeModeUniform) => {
|
|
3
|
-
const stretchedUV = uv$1.clamp(vec2(0, 0), vec2(1, 1));
|
|
4
|
-
const transparentUV = uv$1;
|
|
5
|
-
const mirrorX = mod(abs(uv$1.x), float(2));
|
|
6
|
-
const mirrorY = mod(abs(uv$1.y), float(2));
|
|
7
|
-
const mirroredUV = vec2(select(step(float(1), mirrorX), float(2).sub(mirrorX), mirrorX), select(step(float(1), mirrorY), float(2).sub(mirrorY), mirrorY));
|
|
8
|
-
const wrappedUV = fract(uv$1);
|
|
9
|
-
return select(step(float(.5), edgeModeUniform), select(step(float(1.5), edgeModeUniform), select(step(float(2.5), edgeModeUniform), wrappedUV, mirroredUV), transparentUV), stretchedUV);
|
|
10
|
-
};
|
|
11
2
|
const applyEdgeHandling = (distortedUV, sampledColor, childTexture, edgeModeUniform) => {
|
|
12
3
|
const inBoundsX = step(float(0), distortedUV.x).mul(step(distortedUV.x, float(1)));
|
|
13
4
|
const inBoundsY = step(float(0), distortedUV.y).mul(step(distortedUV.y, float(1)));
|
|
@@ -22,4 +13,4 @@ const applyEdgeHandling = (distortedUV, sampledColor, childTexture, edgeModeUnif
|
|
|
22
13
|
const wrapColor = childTexture.sample(wrappedUV);
|
|
23
14
|
return select(step(float(.5), edgeModeUniform), select(step(float(1.5), edgeModeUniform), select(step(float(2.5), edgeModeUniform), wrapColor, mirrorColor), transparentColor), sampledColor);
|
|
24
15
|
};
|
|
25
|
-
export {
|
|
16
|
+
export { applyEdgeHandling as t };
|