shaders 2.3.66 → 2.3.67
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/{Aurora-CYCPE1wp.js → Aurora-NksIvzEl.js} +3 -2
- package/dist/core/{Beam-COjEb2JI.js → Beam-CprkmCUE.js} +3 -2
- package/dist/core/{Blob-jHnoxt2N.js → Blob-Bbq8XbWa.js} +3 -2
- package/dist/core/{Bulge-CsNj4Jew.js → Bulge-iv4gvOrb.js} +3 -2
- package/dist/core/{Checkerboard-DwiW08iJ.js → Checkerboard-DgAStqo1.js} +3 -2
- package/dist/core/{Circle-CUYMdgd5.js → Circle-CNU59YUv.js} +3 -2
- package/dist/core/{ConcentricSpin-DBqXmCjg.js → ConcentricSpin-Dq4fuhxf.js} +3 -2
- package/dist/core/{CursorRipples-JWrDL_dU.js → CursorRipples-CG13qsO5.js} +5 -4
- package/dist/core/{CursorTrail-D2_14ZEz.js → CursorTrail-BBTqzAWC.js} +3 -2
- package/dist/core/{DiffuseBlur-siJmc-84.js → DiffuseBlur-CpB0j4XW.js} +3 -2
- package/dist/core/{Dither-GoyNQ4_v.js → Dither-DO8Q9sfQ.js} +33 -12
- package/dist/core/{Duotone-CRiDL3YN.js → Duotone-CyTYB0rJ.js} +3 -2
- package/dist/core/{FlowField-B-sNApu9.js → FlowField-Ynwwfkic.js} +3 -2
- package/dist/core/{GridDistortion-CKhOZRpM.js → GridDistortion-C_av0CL_.js} +3 -2
- package/dist/core/{Kaleidoscope-B1mL-Yj3.js → Kaleidoscope-BFoudqX3.js} +3 -2
- package/dist/core/{LinearGradient-BP91wtXm.js → LinearGradient-HhfaMKwI.js} +27 -14
- package/dist/core/{Liquify-2u2lkBhB.js → Liquify-Ad7waFTE.js} +3 -2
- package/dist/core/{Mirror-BonA1elw.js → Mirror-BgbXJY0N.js} +3 -2
- package/dist/core/{Perspective-Cwpv4683.js → Perspective-BZnZPXEf.js} +3 -2
- package/dist/core/{Plasma-BU4ujuLB.js → Plasma-BfyFnIWL.js} +3 -2
- package/dist/core/{PolarCoordinates-6BZYZFoj.js → PolarCoordinates-IItXQawD.js} +3 -2
- package/dist/core/{RadialGradient-DauSwpwY.js → RadialGradient-BtLDAPYQ.js} +3 -2
- package/dist/core/{RectangularCoordinates-C5585uvf.js → RectangularCoordinates-DoXEjIhd.js} +3 -2
- package/dist/core/{Ripples-QWGujQgy.js → Ripples-5SBqOFLG.js} +2 -2
- package/dist/core/{Shatter-DRSn9uGZ.js → Shatter-CT5oSWfn.js} +6 -5
- package/dist/core/{SimplexNoise-W0fx_Y5Q.js → SimplexNoise-D9d1EuGu.js} +3 -3
- package/dist/core/{Spiral-DWBdkW7Y.js → Spiral-6tSyCqRu.js} +3 -2
- package/dist/core/{Stretch-CB92XLiC.js → Stretch-CIkhKgUB.js} +3 -2
- package/dist/core/{Stripes-CTmvjI0U.js → Stripes-Bqb8_lUf.js} +3 -2
- package/dist/core/{Swirl-DVaTB8HY.js → Swirl-CzI_Fddg.js} +3 -2
- package/dist/core/{Tritone-BETUi-og.js → Tritone-DMAv26OS.js} +5 -3
- package/dist/core/{Twirl-BUlMUymT.js → Twirl-CFMQvxzf.js} +3 -2
- package/dist/core/{WaveDistortion-D8LOc-Dc.js → WaveDistortion-BlF3UOIL.js} +23 -15
- package/dist/core/{colorMixing-D_wMclqL.js → colorMixing-jSm3tbMv.js} +40 -19
- package/dist/core/edges-CfGcQniB.js +25 -0
- package/dist/core/index.js +13 -3
- package/dist/core/registry.js +35 -35
- package/dist/core/renderer.d.ts.map +1 -1
- package/dist/core/shaders/Aurora/index.d.ts.map +1 -1
- package/dist/core/shaders/Aurora/index.js +2 -2
- 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 +2 -2
- package/dist/core/shaders/Bulge/index.d.ts.map +1 -1
- package/dist/core/shaders/Bulge/index.js +2 -2
- package/dist/core/shaders/Checkerboard/index.d.ts.map +1 -1
- package/dist/core/shaders/Checkerboard/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/ConcentricSpin/index.d.ts.map +1 -1
- package/dist/core/shaders/ConcentricSpin/index.js +2 -2
- package/dist/core/shaders/CursorRipples/index.d.ts.map +1 -1
- package/dist/core/shaders/CursorRipples/index.js +2 -2
- package/dist/core/shaders/CursorTrail/index.d.ts.map +1 -1
- 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 +2 -2
- package/dist/core/shaders/Dither/index.d.ts.map +1 -1
- package/dist/core/shaders/Dither/index.js +1 -1
- package/dist/core/shaders/Duotone/index.d.ts.map +1 -1
- package/dist/core/shaders/Duotone/index.js +2 -2
- package/dist/core/shaders/FlowField/index.d.ts.map +1 -1
- package/dist/core/shaders/FlowField/index.js +2 -2
- package/dist/core/shaders/GridDistortion/index.d.ts.map +1 -1
- package/dist/core/shaders/GridDistortion/index.js +2 -2
- package/dist/core/shaders/Kaleidoscope/index.d.ts.map +1 -1
- package/dist/core/shaders/Kaleidoscope/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 +2 -2
- package/dist/core/shaders/Mirror/index.d.ts.map +1 -1
- package/dist/core/shaders/Mirror/index.js +2 -2
- package/dist/core/shaders/Perspective/index.d.ts.map +1 -1
- package/dist/core/shaders/Perspective/index.js +2 -2
- package/dist/core/shaders/Plasma/index.d.ts.map +1 -1
- package/dist/core/shaders/Plasma/index.js +2 -2
- package/dist/core/shaders/PolarCoordinates/index.d.ts.map +1 -1
- package/dist/core/shaders/PolarCoordinates/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 +2 -2
- package/dist/core/shaders/Ripples/index.js +2 -2
- package/dist/core/shaders/Shatter/index.d.ts.map +1 -1
- package/dist/core/shaders/Shatter/index.js +2 -2
- package/dist/core/shaders/SimplexNoise/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/Stretch/index.d.ts.map +1 -1
- package/dist/core/shaders/Stretch/index.js +2 -2
- package/dist/core/shaders/Stripes/index.d.ts.map +1 -1
- package/dist/core/shaders/Stripes/index.js +2 -2
- package/dist/core/shaders/Swirl/index.d.ts.map +1 -1
- package/dist/core/shaders/Swirl/index.js +2 -2
- package/dist/core/shaders/Tritone/index.d.ts.map +1 -1
- 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 +2 -2
- package/dist/core/shaders/WaveDistortion/index.js +2 -2
- package/dist/core/types.d.ts +2 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/utilities/colorMixing.d.ts +7 -2
- package/dist/core/utilities/colorMixing.d.ts.map +1 -1
- package/dist/core/utilities/edges.d.ts +4 -4
- package/dist/core/utilities/edges.d.ts.map +1 -1
- package/dist/core/utilities/uniforms.d.ts.map +1 -1
- package/dist/registry.js +34 -0
- package/package.json +1 -1
- package/dist/core/edges-Bd7GP4s2.js +0 -16
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as transformColor, l as transformPosition, o as transformColorSpace, t as colorSpaceOptions } from "./transformations-B5lM6fYX.js";
|
|
2
2
|
import { t as createAnimatedTime } from "./time-BZqyVJXt.js";
|
|
3
|
-
import { t as mixColors } from "./colorMixing-
|
|
3
|
+
import { t as mixColors } from "./colorMixing-jSm3tbMv.js";
|
|
4
4
|
import { Fn, clamp, exp, float, fract, mix, mx_noise_float, pow, screenUV, sin, smoothstep, step, vec2, vec3, vec4, viewportSize } from "three/tsl";
|
|
5
5
|
const componentDefinition = {
|
|
6
6
|
name: "Aurora",
|
|
@@ -40,6 +40,7 @@ const componentDefinition = {
|
|
|
40
40
|
colorSpace: {
|
|
41
41
|
default: "linear",
|
|
42
42
|
transform: transformColorSpace,
|
|
43
|
+
compileTime: true,
|
|
43
44
|
description: "Color space for color interpolation",
|
|
44
45
|
ui: {
|
|
45
46
|
type: "select",
|
|
@@ -163,7 +164,7 @@ const componentDefinition = {
|
|
|
163
164
|
const colorA = uniforms.colorA.uniform;
|
|
164
165
|
const colorB = uniforms.colorB.uniform;
|
|
165
166
|
const colorC = uniforms.colorC.uniform;
|
|
166
|
-
const csMode = uniforms.colorSpace.uniform;
|
|
167
|
+
const csMode = uniforms.colorSpace.uniform.value;
|
|
167
168
|
const balanceExp = mix(float(2.5), float(.4), uniforms.balance.uniform.mul(.01));
|
|
168
169
|
const intensity = uniforms.intensity.uniform.mul(.018);
|
|
169
170
|
const curtainCount = uniforms.curtainCount.uniform;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as transformColor, l as transformPosition, o as transformColorSpace, t as colorSpaceOptions } from "./transformations-B5lM6fYX.js";
|
|
2
|
-
import { t as mixColors } from "./colorMixing-
|
|
2
|
+
import { t as mixColors } from "./colorMixing-jSm3tbMv.js";
|
|
3
3
|
import { clamp, float, max, mix, pow, screenUV, smoothstep, sqrt, vec2, vec4, viewportSize } from "three/tsl";
|
|
4
4
|
const componentDefinition = {
|
|
5
5
|
name: "Beam",
|
|
@@ -103,6 +103,7 @@ const componentDefinition = {
|
|
|
103
103
|
colorSpace: {
|
|
104
104
|
default: "linear",
|
|
105
105
|
transform: transformColorSpace,
|
|
106
|
+
compileTime: true,
|
|
106
107
|
description: "Color space for color interpolation",
|
|
107
108
|
ui: {
|
|
108
109
|
type: "select",
|
|
@@ -138,7 +139,7 @@ const componentDefinition = {
|
|
|
138
139
|
const colorT = smoothstep(float(1).sub(softness), float(1).add(softness), normalizedDist);
|
|
139
140
|
const insideCol = uniforms.insideColor.uniform;
|
|
140
141
|
const outsideCol = uniforms.outsideColor.uniform;
|
|
141
|
-
const beamColorRGB = mixColors(insideCol, outsideCol, colorT, uniforms.colorSpace.uniform).rgb;
|
|
142
|
+
const beamColorRGB = mixColors(insideCol, outsideCol, colorT, uniforms.colorSpace.uniform.value).rgb;
|
|
142
143
|
return vec4(beamColorRGB, insideCol.a.add(outsideCol.a).div(float(2)).mul(alpha));
|
|
143
144
|
}
|
|
144
145
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as transformColor, l as transformPosition, o as transformColorSpace, t as colorSpaceOptions } from "./transformations-B5lM6fYX.js";
|
|
2
2
|
import { t as createAnimatedTime } from "./time-BZqyVJXt.js";
|
|
3
|
-
import { t as mixColors } from "./colorMixing-
|
|
3
|
+
import { t as mixColors } from "./colorMixing-jSm3tbMv.js";
|
|
4
4
|
import { dot, float, length, max, normalize, pow, reflect, screenUV, sin, smoothstep, vec2, vec3, vec4, viewportSize } from "three/tsl";
|
|
5
5
|
const componentDefinition = {
|
|
6
6
|
name: "Blob",
|
|
@@ -161,6 +161,7 @@ const componentDefinition = {
|
|
|
161
161
|
colorSpace: {
|
|
162
162
|
default: "linear",
|
|
163
163
|
transform: transformColorSpace,
|
|
164
|
+
compileTime: true,
|
|
164
165
|
description: "Color space for color interpolation",
|
|
165
166
|
ui: {
|
|
166
167
|
type: "select",
|
|
@@ -217,7 +218,7 @@ const componentDefinition = {
|
|
|
217
218
|
const colorNoise1 = sin(posX.add(animTime.mul(float(.4)))).mul(sin(posY.add(animTime.mul(float(.3))))).add(sin(posX.mul(float(.7)).add(posY.mul(float(.8))).add(animTime.mul(float(.2))))).mul(float(.5)).add(float(.5));
|
|
218
219
|
const colorNoise2 = sin(posX.mul(float(1.3)).sub(animTime.mul(float(.5)))).mul(sin(posY.mul(float(1.1)).add(animTime.mul(float(.6))))).add(sin(posX.mul(float(.5)).sub(posY.mul(float(.6)).sub(animTime.mul(float(.3)))))).mul(float(.5)).add(float(.5));
|
|
219
220
|
const combinedNoise = colorNoise1.mul(float(.6)).add(colorNoise2.mul(float(.4)));
|
|
220
|
-
const finalColorRGB = mixColors(colorA, colorB, smoothstep(float(.1), float(.9), combinedNoise), uniforms.colorSpace.uniform).rgb;
|
|
221
|
+
const finalColorRGB = mixColors(colorA, colorB, smoothstep(float(.1), float(.9), combinedNoise), uniforms.colorSpace.uniform.value).rgb;
|
|
221
222
|
const avgAlpha = colorA.a.add(colorB.a).div(float(2));
|
|
222
223
|
const highlightContribution = highlightColor.rgb.mul(finalHighlight);
|
|
223
224
|
return vec4(finalColorRGB.add(highlightContribution), avgAlpha.mul(blobMask));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as applyEdgeHandling } from "./edges-
|
|
1
|
+
import { t as applyEdgeHandling } from "./edges-CfGcQniB.js";
|
|
2
2
|
import { c as transformEdges, l as transformPosition } from "./transformations-B5lM6fYX.js";
|
|
3
3
|
import { t as unpremultiplyAlpha } from "./alpha-Byel9eTg.js";
|
|
4
4
|
import { convertToTexture, float, length, max, screenUV, smoothstep, vec2, vec4, viewportSize } from "three/tsl";
|
|
@@ -62,6 +62,7 @@ const componentDefinition = {
|
|
|
62
62
|
default: "stretch",
|
|
63
63
|
description: "How to handle edges when distortion pushes content out of bounds",
|
|
64
64
|
transform: transformEdges,
|
|
65
|
+
compileTime: true,
|
|
65
66
|
ui: {
|
|
66
67
|
type: "select",
|
|
67
68
|
options: [
|
|
@@ -110,7 +111,7 @@ const componentDefinition = {
|
|
|
110
111
|
const bulgedDelta = delta.mul(scaleFactor);
|
|
111
112
|
const bulgedUV = centerPos.add(bulgedDelta);
|
|
112
113
|
const finalUV = vec2(bulgedUV.x.div(aspect), bulgedUV.y);
|
|
113
|
-
return unpremultiplyAlpha(applyEdgeHandling(finalUV, childTexture.sample(finalUV), childTexture, uniforms.edges.uniform));
|
|
114
|
+
return unpremultiplyAlpha(applyEdgeHandling(finalUV, childTexture.sample(finalUV), childTexture, uniforms.edges.uniform.value));
|
|
114
115
|
}
|
|
115
116
|
};
|
|
116
117
|
var Bulge_default = componentDefinition;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as transformColor, o as transformColorSpace, t as colorSpaceOptions } from "./transformations-B5lM6fYX.js";
|
|
2
|
-
import { t as mixColors } from "./colorMixing-
|
|
2
|
+
import { t as mixColors } from "./colorMixing-jSm3tbMv.js";
|
|
3
3
|
import { float, floor, fract, min, mod, screenUV, smoothstep, vec2, viewportSize } from "three/tsl";
|
|
4
4
|
const componentDefinition = {
|
|
5
5
|
name: "Checkerboard",
|
|
@@ -53,6 +53,7 @@ const componentDefinition = {
|
|
|
53
53
|
colorSpace: {
|
|
54
54
|
default: "linear",
|
|
55
55
|
transform: transformColorSpace,
|
|
56
|
+
compileTime: true,
|
|
56
57
|
description: "Color space for color interpolation",
|
|
57
58
|
ui: {
|
|
58
59
|
type: "select",
|
|
@@ -76,7 +77,7 @@ const componentDefinition = {
|
|
|
76
77
|
const softRange = softness.mul(.5).add(1e-4);
|
|
77
78
|
const edgeBlend = smoothstep(float(0), softRange, distToEdge);
|
|
78
79
|
const blendFactor = checkerValue.mul(edgeBlend).add(float(.5).mul(float(1).sub(edgeBlend)));
|
|
79
|
-
return mixColors(uniforms.colorA.uniform, uniforms.colorB.uniform, blendFactor, uniforms.colorSpace.uniform);
|
|
80
|
+
return mixColors(uniforms.colorA.uniform, uniforms.colorB.uniform, blendFactor, uniforms.colorSpace.uniform.value);
|
|
80
81
|
}
|
|
81
82
|
};
|
|
82
83
|
var Checkerboard_default = componentDefinition;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as transformColor, l as transformPosition, o as transformColorSpace, t as colorSpaceOptions } from "./transformations-B5lM6fYX.js";
|
|
2
|
-
import { t as mixColors } from "./colorMixing-
|
|
2
|
+
import { t as mixColors } from "./colorMixing-jSm3tbMv.js";
|
|
3
3
|
import { float, length, screenUV, smoothstep, vec2, vec4, viewportSize } from "three/tsl";
|
|
4
4
|
var transformStrokePosition = (value) => {
|
|
5
5
|
const mode = {
|
|
@@ -114,6 +114,7 @@ const componentDefinition = {
|
|
|
114
114
|
colorSpace: {
|
|
115
115
|
default: "linear",
|
|
116
116
|
transform: transformColorSpace,
|
|
117
|
+
compileTime: true,
|
|
117
118
|
description: "Color space for blending fill and stroke colors in soft edges",
|
|
118
119
|
ui: {
|
|
119
120
|
type: "select",
|
|
@@ -140,7 +141,7 @@ const componentDefinition = {
|
|
|
140
141
|
const strokeOuter = isInside.select(circleEdge, isCenter.select(circleEdge.add(halfThickness), circleEdge.add(strokeThickness)));
|
|
141
142
|
const overallMask = smoothstep(strokeOuter.sub(edgeSoftness), strokeOuter, distanceFromCenter).oneMinus();
|
|
142
143
|
const strokeBlend = strokeThickness.greaterThan(float(0)).select(smoothstep(strokeInner.sub(edgeSoftness), strokeInner, distanceFromCenter), float(0));
|
|
143
|
-
const blendedColor = mixColors(vec4(uniforms.color.uniform.rgb, uniforms.color.uniform.a), vec4(uniforms.strokeColor.uniform.rgb, uniforms.strokeColor.uniform.a), strokeBlend, uniforms.colorSpace.uniform);
|
|
144
|
+
const blendedColor = mixColors(vec4(uniforms.color.uniform.rgb, uniforms.color.uniform.a), vec4(uniforms.strokeColor.uniform.rgb, uniforms.strokeColor.uniform.a), strokeBlend, uniforms.colorSpace.uniform.value);
|
|
144
145
|
return vec4(blendedColor.xyz, blendedColor.w.mul(overallMask));
|
|
145
146
|
}
|
|
146
147
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as applyEdgeHandling } from "./edges-
|
|
1
|
+
import { t as applyEdgeHandling } from "./edges-CfGcQniB.js";
|
|
2
2
|
import { c as transformEdges, l as transformPosition } from "./transformations-B5lM6fYX.js";
|
|
3
3
|
import { t as createAnimatedTime } from "./time-BZqyVJXt.js";
|
|
4
4
|
import { t as unpremultiplyAlpha } from "./alpha-Byel9eTg.js";
|
|
@@ -86,6 +86,7 @@ const componentDefinition = {
|
|
|
86
86
|
default: "mirror",
|
|
87
87
|
description: "How to handle edges when distortion pushes content out of bounds",
|
|
88
88
|
transform: transformEdges,
|
|
89
|
+
compileTime: true,
|
|
89
90
|
ui: {
|
|
90
91
|
type: "select",
|
|
91
92
|
options: [
|
|
@@ -166,7 +167,7 @@ const componentDefinition = {
|
|
|
166
167
|
const rotX = dx.mul(cosA).sub(dy.mul(sinA));
|
|
167
168
|
const rotY = dx.mul(sinA).add(dy.mul(cosA));
|
|
168
169
|
const distortedUV = vec2(rotX.div(aspect).add(center.x), rotY.add(center.y));
|
|
169
|
-
return unpremultiplyAlpha(applyEdgeHandling(distortedUV, childTexture.sample(distortedUV), childTexture, uniforms.edges.uniform));
|
|
170
|
+
return unpremultiplyAlpha(applyEdgeHandling(distortedUV, childTexture.sample(distortedUV), childTexture, uniforms.edges.uniform.value));
|
|
170
171
|
})();
|
|
171
172
|
}
|
|
172
173
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as applyEdgeHandling } from "./edges-
|
|
1
|
+
import { t as applyEdgeHandling } from "./edges-CfGcQniB.js";
|
|
2
2
|
import { c as transformEdges } from "./transformations-B5lM6fYX.js";
|
|
3
3
|
import { t as unpremultiplyAlpha } from "./alpha-Byel9eTg.js";
|
|
4
4
|
import { DataTexture, FloatType, LinearFilter, RGFormat } from "three";
|
|
@@ -63,6 +63,7 @@ const componentDefinition = {
|
|
|
63
63
|
default: "stretch",
|
|
64
64
|
description: "How to handle edges when distortion pushes content out of bounds",
|
|
65
65
|
transform: transformEdges,
|
|
66
|
+
compileTime: true,
|
|
66
67
|
ui: {
|
|
67
68
|
type: "select",
|
|
68
69
|
options: [
|
|
@@ -168,9 +169,9 @@ const componentDefinition = {
|
|
|
168
169
|
const rUV = screenUV.sub(clampedDisplacement.mul(float(1).add(chromaticScale)));
|
|
169
170
|
const gUV = screenUV.sub(clampedDisplacement);
|
|
170
171
|
const bUV = screenUV.sub(clampedDisplacement.mul(float(1).sub(chromaticScale)));
|
|
171
|
-
const rSample = applyEdgeHandling(rUV, childTexture.sample(rUV), childTexture, uniforms.edges.uniform);
|
|
172
|
-
const gSample = applyEdgeHandling(gUV, childTexture.sample(gUV), childTexture, uniforms.edges.uniform);
|
|
173
|
-
const bSample = applyEdgeHandling(bUV, childTexture.sample(bUV), childTexture, uniforms.edges.uniform);
|
|
172
|
+
const rSample = applyEdgeHandling(rUV, childTexture.sample(rUV), childTexture, uniforms.edges.uniform.value);
|
|
173
|
+
const gSample = applyEdgeHandling(gUV, childTexture.sample(gUV), childTexture, uniforms.edges.uniform.value);
|
|
174
|
+
const bSample = applyEdgeHandling(bUV, childTexture.sample(bUV), childTexture, uniforms.edges.uniform.value);
|
|
174
175
|
return unpremultiplyAlpha(vec4(rSample.r, gSample.g, bSample.b, gSample.a));
|
|
175
176
|
}
|
|
176
177
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as transformColor, o as transformColorSpace, t as colorSpaceOptions } from "./transformations-B5lM6fYX.js";
|
|
2
|
-
import { t as mixColors } from "./colorMixing-
|
|
2
|
+
import { t as mixColors } from "./colorMixing-jSm3tbMv.js";
|
|
3
3
|
import { DataTexture, FloatType, LinearFilter, RGBAFormat } from "three";
|
|
4
4
|
import { float, screenUV, step, texture, vec2, vec4 } from "three/tsl";
|
|
5
5
|
const componentDefinition = {
|
|
@@ -66,6 +66,7 @@ const componentDefinition = {
|
|
|
66
66
|
colorSpace: {
|
|
67
67
|
default: "linear",
|
|
68
68
|
transform: transformColorSpace,
|
|
69
|
+
compileTime: true,
|
|
69
70
|
description: "Color space for color interpolation",
|
|
70
71
|
ui: {
|
|
71
72
|
type: "select",
|
|
@@ -143,7 +144,7 @@ const componentDefinition = {
|
|
|
143
144
|
const circleMask = step(float(.01), trailIntensity);
|
|
144
145
|
const colorA = uniforms.colorA.uniform;
|
|
145
146
|
const colorB = uniforms.colorB.uniform;
|
|
146
|
-
const trailColor = mixColors(colorA, colorB, trailAge, uniforms.colorSpace.uniform);
|
|
147
|
+
const trailColor = mixColors(colorA, colorB, trailAge, uniforms.colorSpace.uniform.value);
|
|
147
148
|
return vec4(trailColor.rgb, trailColor.a.mul(circleMask));
|
|
148
149
|
}
|
|
149
150
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as applyEdgeHandling } from "./edges-
|
|
1
|
+
import { t as applyEdgeHandling } from "./edges-CfGcQniB.js";
|
|
2
2
|
import { c as transformEdges } from "./transformations-B5lM6fYX.js";
|
|
3
3
|
import { t as unpremultiplyAlpha } from "./alpha-Byel9eTg.js";
|
|
4
4
|
import { convertToTexture, dot, fract, screenUV, sin, vec2, vec4, viewportSize } from "three/tsl";
|
|
@@ -25,6 +25,7 @@ const componentDefinition = {
|
|
|
25
25
|
default: "stretch",
|
|
26
26
|
description: "How to handle edges when distortion pushes content out of bounds",
|
|
27
27
|
transform: transformEdges,
|
|
28
|
+
compileTime: true,
|
|
28
29
|
ui: {
|
|
29
30
|
type: "select",
|
|
30
31
|
options: [
|
|
@@ -60,7 +61,7 @@ const componentDefinition = {
|
|
|
60
61
|
const sinVal = sin(dot(uv$1.mul(1e3), vec2(25.9796, 156.466)));
|
|
61
62
|
const offset = fract(vec2(sinVal.mul(43758.5453), sinVal.mul(28461.7231))).mul(2).sub(1).mul(uniforms.intensity.uniform).div(viewportSize);
|
|
62
63
|
const displacedUV = uv$1.add(offset);
|
|
63
|
-
return unpremultiplyAlpha(applyEdgeHandling(displacedUV, childTexture.sample(displacedUV), childTexture, uniforms.edges.uniform));
|
|
64
|
+
return unpremultiplyAlpha(applyEdgeHandling(displacedUV, childTexture.sample(displacedUV), childTexture, uniforms.edges.uniform.value));
|
|
64
65
|
}
|
|
65
66
|
};
|
|
66
67
|
var DiffuseBlur_default = componentDefinition;
|
|
@@ -25,6 +25,7 @@ const componentDefinition = {
|
|
|
25
25
|
pattern: {
|
|
26
26
|
default: "bayer4",
|
|
27
27
|
transform: transformPattern,
|
|
28
|
+
compileTime: true,
|
|
28
29
|
description: "Dithering pattern algorithm",
|
|
29
30
|
ui: {
|
|
30
31
|
type: "select",
|
|
@@ -97,6 +98,7 @@ const componentDefinition = {
|
|
|
97
98
|
colorMode: {
|
|
98
99
|
default: "custom",
|
|
99
100
|
transform: transformColorMode,
|
|
101
|
+
compileTime: true,
|
|
100
102
|
description: "How colors are determined",
|
|
101
103
|
ui: {
|
|
102
104
|
type: "select",
|
|
@@ -192,19 +194,38 @@ const componentDefinition = {
|
|
|
192
194
|
const pixelatedUV = pixelCoord.add(.5).mul(pixelSize).div(viewportSize);
|
|
193
195
|
const sourceColor = unpremultiplyAlpha(childTexture.sample(pixelatedUV));
|
|
194
196
|
const luminance = dot(sourceColor.rgb, vec3(.299, .587, .114)).mul(sourceColor.a);
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
197
|
+
let ditherValue;
|
|
198
|
+
switch (uniforms.pattern.uniform.value) {
|
|
199
|
+
case 0:
|
|
200
|
+
ditherValue = texture(ditherTex).sample(pixelCoord.div(float(DITHER_SIZE))).r;
|
|
201
|
+
break;
|
|
202
|
+
case 1:
|
|
203
|
+
ditherValue = texture(ditherTex).sample(pixelCoord.div(float(DITHER_SIZE))).g;
|
|
204
|
+
break;
|
|
205
|
+
case 2:
|
|
206
|
+
ditherValue = texture(ditherTex).sample(pixelCoord.div(float(DITHER_SIZE))).b;
|
|
207
|
+
break;
|
|
208
|
+
case 3:
|
|
209
|
+
ditherValue = texture(ditherTex).sample(pixelCoord.div(float(DITHER_SIZE))).a;
|
|
210
|
+
break;
|
|
211
|
+
case 4: {
|
|
212
|
+
const blueNoiseCoord = pixelCoord.add(.5);
|
|
213
|
+
ditherValue = fract(float(52.9829189).mul(fract(blueNoiseCoord.x.mul(.06711056).add(blueNoiseCoord.y.mul(.00583715)))));
|
|
214
|
+
break;
|
|
215
|
+
}
|
|
216
|
+
default: ditherValue = fract(sin(dot(pixelCoord, vec2(12.9898, 78.233))).mul(43758.5453));
|
|
217
|
+
}
|
|
201
218
|
const ditherResult = step(float(.5).add(ditherValue.sub(.5).mul(spread)), luminance.add(threshold.sub(.5)));
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
219
|
+
let finalRGB;
|
|
220
|
+
let finalAlpha;
|
|
221
|
+
if (uniforms.colorMode.uniform.value === 0) {
|
|
222
|
+
finalRGB = mix(uniforms.colorA.uniform.rgb, uniforms.colorB.uniform.rgb, ditherResult);
|
|
223
|
+
finalAlpha = mix(uniforms.colorA.uniform.a, uniforms.colorB.uniform.a, ditherResult);
|
|
224
|
+
} else {
|
|
225
|
+
finalRGB = mix(sourceColor.rgb.mul(.3), sourceColor.rgb.mul(1.3).min(vec3(1)), ditherResult);
|
|
226
|
+
finalAlpha = sourceColor.a;
|
|
227
|
+
}
|
|
228
|
+
return vec4(finalRGB, finalAlpha);
|
|
208
229
|
}
|
|
209
230
|
};
|
|
210
231
|
var Dither_default = componentDefinition;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as transformColor, o as transformColorSpace, t as colorSpaceOptions } from "./transformations-B5lM6fYX.js";
|
|
2
2
|
import { t as unpremultiplyAlpha } from "./alpha-Byel9eTg.js";
|
|
3
|
-
import { t as mixColors } from "./colorMixing-
|
|
3
|
+
import { t as mixColors } from "./colorMixing-jSm3tbMv.js";
|
|
4
4
|
import { convertToTexture, dot, screenUV, smoothstep, vec3, vec4 } from "three/tsl";
|
|
5
5
|
const componentDefinition = {
|
|
6
6
|
name: "Duotone",
|
|
@@ -44,6 +44,7 @@ const componentDefinition = {
|
|
|
44
44
|
colorSpace: {
|
|
45
45
|
default: "linear",
|
|
46
46
|
transform: transformColorSpace,
|
|
47
|
+
compileTime: true,
|
|
47
48
|
description: "Color space for color interpolation",
|
|
48
49
|
ui: {
|
|
49
50
|
type: "select",
|
|
@@ -62,7 +63,7 @@ const componentDefinition = {
|
|
|
62
63
|
const inputColor = unpremultiplyAlpha(childTexture.sample(screenUV));
|
|
63
64
|
const luminance = dot(inputColor.rgb, vec3(.299, .587, .114));
|
|
64
65
|
const adjustedLuminance = smoothstep(uniforms.blend.uniform.sub(.5), uniforms.blend.uniform.add(.5), luminance);
|
|
65
|
-
return vec4(mixColors(uniforms.colorA.uniform, uniforms.colorB.uniform, adjustedLuminance, uniforms.colorSpace.uniform).rgb, inputColor.a);
|
|
66
|
+
return vec4(mixColors(uniforms.colorA.uniform, uniforms.colorB.uniform, adjustedLuminance, uniforms.colorSpace.uniform.value).rgb, inputColor.a);
|
|
66
67
|
}
|
|
67
68
|
};
|
|
68
69
|
var Duotone_default = componentDefinition;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as applyEdgeHandling } from "./edges-
|
|
1
|
+
import { t as applyEdgeHandling } from "./edges-CfGcQniB.js";
|
|
2
2
|
import { c as transformEdges } from "./transformations-B5lM6fYX.js";
|
|
3
3
|
import { t as createAnimatedTime } from "./time-BZqyVJXt.js";
|
|
4
4
|
import { t as unpremultiplyAlpha } from "./alpha-Byel9eTg.js";
|
|
@@ -50,6 +50,7 @@ const componentDefinition = {
|
|
|
50
50
|
default: "mirror",
|
|
51
51
|
description: "How to handle edges when distortion pushes content out of bounds",
|
|
52
52
|
transform: transformEdges,
|
|
53
|
+
compileTime: true,
|
|
53
54
|
ui: {
|
|
54
55
|
type: "select",
|
|
55
56
|
options: [
|
|
@@ -101,7 +102,7 @@ const componentDefinition = {
|
|
|
101
102
|
const normalizedFlow = combinedFlow.div(flowLength);
|
|
102
103
|
const finalFlow = vec2(normalizedFlow.x.mul(strength).div(aspect), normalizedFlow.y.mul(strength));
|
|
103
104
|
const distortedUV = vec2(screenUV.x.add(finalFlow.x), screenUV.y.add(finalFlow.y));
|
|
104
|
-
return unpremultiplyAlpha(applyEdgeHandling(distortedUV, childTexture.sample(distortedUV), childTexture, uniforms.edges.uniform));
|
|
105
|
+
return unpremultiplyAlpha(applyEdgeHandling(distortedUV, childTexture.sample(distortedUV), childTexture, uniforms.edges.uniform.value));
|
|
105
106
|
}
|
|
106
107
|
};
|
|
107
108
|
var FlowField_default = componentDefinition;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as applyEdgeHandling } from "./edges-
|
|
1
|
+
import { t as applyEdgeHandling } from "./edges-CfGcQniB.js";
|
|
2
2
|
import { c as transformEdges } from "./transformations-B5lM6fYX.js";
|
|
3
3
|
import { t as unpremultiplyAlpha } from "./alpha-Byel9eTg.js";
|
|
4
4
|
import { DataTexture, FloatType, LinearFilter, RGFormat } from "three";
|
|
@@ -88,6 +88,7 @@ const componentDefinition = {
|
|
|
88
88
|
default: "stretch",
|
|
89
89
|
description: "How to handle edges when distortion pushes content out of bounds",
|
|
90
90
|
transform: transformEdges,
|
|
91
|
+
compileTime: true,
|
|
91
92
|
ui: {
|
|
92
93
|
type: "select",
|
|
93
94
|
options: [
|
|
@@ -175,7 +176,7 @@ const componentDefinition = {
|
|
|
175
176
|
const negMaxDisplacement = float(-.1);
|
|
176
177
|
const clampedDisplacement = displacement.clamp(vec2(negMaxDisplacement, negMaxDisplacement), vec2(maxDisplacement, maxDisplacement));
|
|
177
178
|
const distortedUV = screenUV.sub(clampedDisplacement);
|
|
178
|
-
return unpremultiplyAlpha(applyEdgeHandling(distortedUV, childTexture.sample(distortedUV), childTexture, uniforms.edges.uniform));
|
|
179
|
+
return unpremultiplyAlpha(applyEdgeHandling(distortedUV, childTexture.sample(distortedUV), childTexture, uniforms.edges.uniform.value));
|
|
179
180
|
}
|
|
180
181
|
};
|
|
181
182
|
var GridDistortion_default = componentDefinition;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as applyEdgeHandling } from "./edges-
|
|
1
|
+
import { t as applyEdgeHandling } from "./edges-CfGcQniB.js";
|
|
2
2
|
import { c as transformEdges, l as transformPosition } from "./transformations-B5lM6fYX.js";
|
|
3
3
|
import { t as unpremultiplyAlpha } from "./alpha-Byel9eTg.js";
|
|
4
4
|
import { atan, convertToTexture, cos, float, length, mod, screenUV, sin, vec2, vec4, viewportSize } from "three/tsl";
|
|
@@ -50,6 +50,7 @@ const componentDefinition = {
|
|
|
50
50
|
default: "mirror",
|
|
51
51
|
description: "How to handle edges when distortion pushes content out of bounds",
|
|
52
52
|
transform: transformEdges,
|
|
53
|
+
compileTime: true,
|
|
53
54
|
ui: {
|
|
54
55
|
type: "select",
|
|
55
56
|
options: [
|
|
@@ -95,7 +96,7 @@ const componentDefinition = {
|
|
|
95
96
|
const kaleidoscopeDelta = vec2(cos(finalAngle).mul(radius), sin(finalAngle).mul(radius));
|
|
96
97
|
const kaleidoscopePos = centerPos.add(kaleidoscopeDelta);
|
|
97
98
|
const finalUV = vec2(kaleidoscopePos.x.div(aspect), kaleidoscopePos.y);
|
|
98
|
-
return unpremultiplyAlpha(applyEdgeHandling(finalUV, childTexture.sample(finalUV), childTexture, uniforms.edges.uniform));
|
|
99
|
+
return unpremultiplyAlpha(applyEdgeHandling(finalUV, childTexture.sample(finalUV), childTexture, uniforms.edges.uniform.value));
|
|
99
100
|
}
|
|
100
101
|
};
|
|
101
102
|
var Kaleidoscope_default = componentDefinition;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as transformColor, c as transformEdges, l as transformPosition, o as transformColorSpace, r as transformAngle, t as colorSpaceOptions } from "./transformations-B5lM6fYX.js";
|
|
2
|
-
import { t as mixColors } from "./colorMixing-
|
|
2
|
+
import { t as mixColors } from "./colorMixing-jSm3tbMv.js";
|
|
3
3
|
import { abs, cos, dot, float, fract, length, mod, normalize, radians, screenUV, sin, vec2, vec4, viewportSize } from "three/tsl";
|
|
4
4
|
const componentDefinition = {
|
|
5
5
|
name: "LinearGradient",
|
|
@@ -68,6 +68,7 @@ const componentDefinition = {
|
|
|
68
68
|
edges: {
|
|
69
69
|
default: "stretch",
|
|
70
70
|
transform: transformEdges,
|
|
71
|
+
compileTime: true,
|
|
71
72
|
description: "How to handle areas beyond the gradient endpoints",
|
|
72
73
|
ui: {
|
|
73
74
|
type: "select",
|
|
@@ -96,6 +97,7 @@ const componentDefinition = {
|
|
|
96
97
|
colorSpace: {
|
|
97
98
|
default: "linear",
|
|
98
99
|
transform: transformColorSpace,
|
|
100
|
+
compileTime: true,
|
|
99
101
|
description: "Color space for color interpolation",
|
|
100
102
|
ui: {
|
|
101
103
|
type: "select",
|
|
@@ -122,19 +124,30 @@ const componentDefinition = {
|
|
|
122
124
|
const aspectCorrectedCentered = vec2(centeredUV.x.mul(aspect), centeredUV.y);
|
|
123
125
|
const rotatedCorrected = vec2(aspectCorrectedCentered.x.mul(cosAngle).sub(aspectCorrectedCentered.y.mul(sinAngle)), aspectCorrectedCentered.x.mul(sinAngle).add(aspectCorrectedCentered.y.mul(cosAngle)));
|
|
124
126
|
const t = dot(vec2(rotatedCorrected.x.div(aspect), rotatedCorrected.y).add(midpoint).sub(startPos), gradientDir).div(gradientLength.max(1e-6));
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
127
|
+
const edgeModeValue = uniforms.edges.uniform.value;
|
|
128
|
+
let finalT;
|
|
129
|
+
switch (edgeModeValue) {
|
|
130
|
+
case 1:
|
|
131
|
+
finalT = t;
|
|
132
|
+
break;
|
|
133
|
+
case 2: {
|
|
134
|
+
const mirrorT = mod(abs(t), float(2));
|
|
135
|
+
finalT = mirrorT.greaterThan(float(1)).select(float(2).sub(mirrorT), mirrorT);
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
case 3:
|
|
139
|
+
finalT = fract(t);
|
|
140
|
+
break;
|
|
141
|
+
default: finalT = t.clamp(float(0), float(1));
|
|
142
|
+
}
|
|
143
|
+
const mixedColor = mixColors(uniforms.colorA.uniform, uniforms.colorB.uniform, finalT.clamp(float(0), float(1)), uniforms.colorSpace.uniform.value);
|
|
144
|
+
let finalAlpha;
|
|
145
|
+
if (edgeModeValue === 1) {
|
|
146
|
+
const inBoundsX = t.greaterThanEqual(float(0)).select(float(1), float(0));
|
|
147
|
+
const inBoundsY = t.lessThanEqual(float(1)).select(float(1), float(0));
|
|
148
|
+
const inBounds = inBoundsX.mul(inBoundsY);
|
|
149
|
+
finalAlpha = mixedColor.w.mul(inBounds);
|
|
150
|
+
} else finalAlpha = mixedColor.w;
|
|
138
151
|
return vec4(mixedColor.x, mixedColor.y, mixedColor.z, finalAlpha);
|
|
139
152
|
}
|
|
140
153
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as applyEdgeHandling } from "./edges-
|
|
1
|
+
import { t as applyEdgeHandling } from "./edges-CfGcQniB.js";
|
|
2
2
|
import { c as transformEdges } from "./transformations-B5lM6fYX.js";
|
|
3
3
|
import { t as unpremultiplyAlpha } from "./alpha-Byel9eTg.js";
|
|
4
4
|
import { DataTexture, FloatType, LinearFilter, RGFormat } from "three";
|
|
@@ -70,6 +70,7 @@ const componentDefinition = {
|
|
|
70
70
|
default: "stretch",
|
|
71
71
|
description: "How to handle edges when distortion pushes content out of bounds",
|
|
72
72
|
transform: transformEdges,
|
|
73
|
+
compileTime: true,
|
|
73
74
|
ui: {
|
|
74
75
|
type: "select",
|
|
75
76
|
options: [
|
|
@@ -149,7 +150,7 @@ const componentDefinition = {
|
|
|
149
150
|
const negMaxDisplacement = float(-.2);
|
|
150
151
|
const clampedDisplacement = displacement.clamp(vec2(negMaxDisplacement, negMaxDisplacement), vec2(maxDisplacement, maxDisplacement));
|
|
151
152
|
const distortedUV = screenUV.sub(clampedDisplacement);
|
|
152
|
-
return unpremultiplyAlpha(applyEdgeHandling(distortedUV, childTexture.sample(distortedUV), childTexture, uniforms.edges.uniform));
|
|
153
|
+
return unpremultiplyAlpha(applyEdgeHandling(distortedUV, childTexture.sample(distortedUV), childTexture, uniforms.edges.uniform.value));
|
|
153
154
|
}
|
|
154
155
|
};
|
|
155
156
|
var Liquify_default = componentDefinition;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as applyEdgeHandling } from "./edges-
|
|
1
|
+
import { t as applyEdgeHandling } from "./edges-CfGcQniB.js";
|
|
2
2
|
import { c as transformEdges, l as transformPosition } from "./transformations-B5lM6fYX.js";
|
|
3
3
|
import { t as unpremultiplyAlpha } from "./alpha-Byel9eTg.js";
|
|
4
4
|
import { convertToTexture, cos, mix, screenUV, sin, step, vec2, vec4, viewportSize } from "three/tsl";
|
|
@@ -38,6 +38,7 @@ const componentDefinition = {
|
|
|
38
38
|
default: "mirror",
|
|
39
39
|
description: "How to handle edges when distortion pushes content out of bounds",
|
|
40
40
|
transform: transformEdges,
|
|
41
|
+
compileTime: true,
|
|
41
42
|
ui: {
|
|
42
43
|
type: "select",
|
|
43
44
|
options: [
|
|
@@ -81,7 +82,7 @@ const componentDefinition = {
|
|
|
81
82
|
const mirroredUV = centerPos.add(reflectedDelta);
|
|
82
83
|
const finalMirroredUV = vec2(mirroredUV.x.div(aspect), mirroredUV.y);
|
|
83
84
|
const shouldMirror = step(0, signedDistance);
|
|
84
|
-
return unpremultiplyAlpha(mix(childTexture.sample(screenUV), applyEdgeHandling(finalMirroredUV, childTexture.sample(finalMirroredUV), childTexture, uniforms.edges.uniform), shouldMirror));
|
|
85
|
+
return unpremultiplyAlpha(mix(childTexture.sample(screenUV), applyEdgeHandling(finalMirroredUV, childTexture.sample(finalMirroredUV), childTexture, uniforms.edges.uniform.value), shouldMirror));
|
|
85
86
|
}
|
|
86
87
|
};
|
|
87
88
|
var Mirror_default = componentDefinition;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as applyEdgeHandling } from "./edges-
|
|
1
|
+
import { t as applyEdgeHandling } from "./edges-CfGcQniB.js";
|
|
2
2
|
import { c as transformEdges, l as transformPosition } from "./transformations-B5lM6fYX.js";
|
|
3
3
|
import { t as unpremultiplyAlpha } from "./alpha-Byel9eTg.js";
|
|
4
4
|
import { convertToTexture, cos, float, max, screenUV, sin, tan, vec2, vec4 } from "three/tsl";
|
|
@@ -87,6 +87,7 @@ const componentDefinition = {
|
|
|
87
87
|
default: "transparent",
|
|
88
88
|
description: "How to handle edges",
|
|
89
89
|
transform: transformEdges,
|
|
90
|
+
compileTime: true,
|
|
90
91
|
ui: {
|
|
91
92
|
type: "select",
|
|
92
93
|
options: [
|
|
@@ -138,7 +139,7 @@ const componentDefinition = {
|
|
|
138
139
|
const finalY = afterPanY.div(safeTiltDivisor);
|
|
139
140
|
const offsetPos = vec2(uniforms.offset.uniform.x, uniforms.offset.uniform.y.oneMinus());
|
|
140
141
|
const finalUV = vec2(finalX, finalY).add(centerPos).sub(offsetPos).add(vec2(.5, .5));
|
|
141
|
-
return unpremultiplyAlpha(applyEdgeHandling(finalUV, childTexture.sample(finalUV), childTexture, uniforms.edges.uniform));
|
|
142
|
+
return unpremultiplyAlpha(applyEdgeHandling(finalUV, childTexture.sample(finalUV), childTexture, uniforms.edges.uniform.value));
|
|
142
143
|
}
|
|
143
144
|
};
|
|
144
145
|
var Perspective_default = componentDefinition;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as transformColor, o as transformColorSpace, t as colorSpaceOptions } from "./transformations-B5lM6fYX.js";
|
|
2
2
|
import { t as createAnimatedTime } from "./time-BZqyVJXt.js";
|
|
3
|
-
import { t as mixColors } from "./colorMixing-
|
|
3
|
+
import { t as mixColors } from "./colorMixing-jSm3tbMv.js";
|
|
4
4
|
import { clamp, exp, float, mx_noise_float, pow, screenUV, vec3, vec4, viewportSize } from "three/tsl";
|
|
5
5
|
const componentDefinition = {
|
|
6
6
|
name: "Plasma",
|
|
@@ -102,6 +102,7 @@ const componentDefinition = {
|
|
|
102
102
|
colorSpace: {
|
|
103
103
|
default: "linear",
|
|
104
104
|
transform: transformColorSpace,
|
|
105
|
+
compileTime: true,
|
|
105
106
|
description: "Color space for color interpolation",
|
|
106
107
|
ui: {
|
|
107
108
|
type: "select",
|
|
@@ -128,7 +129,7 @@ const componentDefinition = {
|
|
|
128
129
|
const contrasted = clamp(pow(mx_noise_float(pos.add(vec3(rx, ry, float(0)).mul(warpAmount))).mul(.5).add(.5), float(5).div(intensity)).sub(.5).mul(uniforms.contrast.uniform).add(.5), 0, 1);
|
|
129
130
|
const balanceShift = uniforms.balance.uniform.div(100).sub(.5);
|
|
130
131
|
const balanced = clamp(contrasted.add(balanceShift), 0, 1);
|
|
131
|
-
return vec4(mixColors(uniforms.colorB.uniform, uniforms.colorA.uniform, balanced, uniforms.colorSpace.uniform), 1);
|
|
132
|
+
return vec4(mixColors(uniforms.colorB.uniform, uniforms.colorA.uniform, balanced, uniforms.colorSpace.uniform.value), 1);
|
|
132
133
|
}
|
|
133
134
|
};
|
|
134
135
|
var Plasma_default = componentDefinition;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as applyEdgeHandling } from "./edges-
|
|
1
|
+
import { t as applyEdgeHandling } from "./edges-CfGcQniB.js";
|
|
2
2
|
import { c as transformEdges, l as transformPosition } from "./transformations-B5lM6fYX.js";
|
|
3
3
|
import { t as unpremultiplyAlpha } from "./alpha-Byel9eTg.js";
|
|
4
4
|
import { PI, atan, convertToTexture, length, mix, screenUV, vec2, vec4, viewportSize } from "three/tsl";
|
|
@@ -62,6 +62,7 @@ const componentDefinition = {
|
|
|
62
62
|
default: "transparent",
|
|
63
63
|
description: "How to handle edges when distortion pushes content out of bounds",
|
|
64
64
|
transform: transformEdges,
|
|
65
|
+
compileTime: true,
|
|
65
66
|
ui: {
|
|
66
67
|
type: "select",
|
|
67
68
|
options: [
|
|
@@ -100,7 +101,7 @@ const componentDefinition = {
|
|
|
100
101
|
const normalizedAngle = atan(delta.y, delta.x).add(PI).div(PI.mul(2));
|
|
101
102
|
const r = length(delta);
|
|
102
103
|
const blendedUV = mix(screenUV, vec2(normalizedAngle.mul(uniforms.wrap.uniform), r.mul(uniforms.radius.uniform)), uniforms.intensity.uniform);
|
|
103
|
-
return unpremultiplyAlpha(applyEdgeHandling(blendedUV, childTexture.sample(blendedUV), childTexture, uniforms.edges.uniform));
|
|
104
|
+
return unpremultiplyAlpha(applyEdgeHandling(blendedUV, childTexture.sample(blendedUV), childTexture, uniforms.edges.uniform.value));
|
|
104
105
|
}
|
|
105
106
|
};
|
|
106
107
|
var PolarCoordinates_default = componentDefinition;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as transformColor, l as transformPosition, o as transformColorSpace, t as colorSpaceOptions } from "./transformations-B5lM6fYX.js";
|
|
2
|
-
import { t as mixColors } from "./colorMixing-
|
|
2
|
+
import { t as mixColors } from "./colorMixing-jSm3tbMv.js";
|
|
3
3
|
import { distance, float, screenUV, vec2, viewportSize } from "three/tsl";
|
|
4
4
|
const componentDefinition = {
|
|
5
5
|
name: "RadialGradient",
|
|
@@ -54,6 +54,7 @@ const componentDefinition = {
|
|
|
54
54
|
colorSpace: {
|
|
55
55
|
default: "linear",
|
|
56
56
|
transform: transformColorSpace,
|
|
57
|
+
compileTime: true,
|
|
57
58
|
description: "Color space for color interpolation",
|
|
58
59
|
ui: {
|
|
59
60
|
type: "select",
|
|
@@ -67,7 +68,7 @@ const componentDefinition = {
|
|
|
67
68
|
const uv$1 = screenUV;
|
|
68
69
|
const aspect = viewportSize.x.div(viewportSize.y);
|
|
69
70
|
const t = distance(vec2(uv$1.x.mul(aspect), uv$1.y), vec2(uniforms.center.uniform.x.mul(aspect), uniforms.center.uniform.y.oneMinus())).div(uniforms.radius.uniform).clamp(float(0), float(1));
|
|
70
|
-
return mixColors(uniforms.colorA.uniform, uniforms.colorB.uniform, t, uniforms.colorSpace.uniform);
|
|
71
|
+
return mixColors(uniforms.colorA.uniform, uniforms.colorB.uniform, t, uniforms.colorSpace.uniform.value);
|
|
71
72
|
}
|
|
72
73
|
};
|
|
73
74
|
var RadialGradient_default = componentDefinition;
|