shaders 2.2.0 → 2.2.2
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-BJi-Edw-.js → AngularBlur-BTUdXC0g.js} +7 -6
- package/dist/core/{Ascii-B1KHvM1u.js → Ascii-Bu8ii7oo.js} +32 -31
- package/dist/core/Blob-C0G0efjG.js +170 -0
- package/dist/core/{Blur-bz9Ubr0x.js → Blur-BzUO9yxF.js} +14 -13
- package/dist/core/Bulge-BCXYAzig.js +104 -0
- package/dist/core/{CRTScreen-BnfROw0f.js → CRTScreen-cJ3XHrI9.js} +13 -12
- package/dist/core/{ChannelBlur-DhWT-55L.js → ChannelBlur-BEK1qzGn.js} +23 -22
- package/dist/core/{Checkerboard-CgWGd9t7.js → Checkerboard-BPkiSF5I.js} +16 -14
- package/dist/core/{ChromaFlow-DOVrymVB.js → ChromaFlow-AHO3C4o3.js} +18 -17
- package/dist/core/{ChromaticAberration-CyTSXY7j.js → ChromaticAberration-nVg3r1FK.js} +12 -11
- package/dist/core/{Circle-0WHV1HrM.js → Circle-C8ltF4BZ.js} +15 -13
- package/dist/core/{CursorTrail-3zQ5rtjh.js → CursorTrail-BeJGeovB.js} +17 -16
- package/dist/core/DiffuseBlur-BdGvOoBw.js +40 -0
- package/dist/core/{Dither-Cnbknfji.js → Dither-CpN3vGSh.js} +13 -12
- package/dist/core/DotGrid-BFUzeSQw.js +62 -0
- package/dist/core/{Duotone-BI4tJI3k.js → Duotone-_nR_o3-g.js} +8 -7
- package/dist/core/FilmGrain-BAKXXtLg.js +29 -0
- package/dist/core/FloatingParticles-Fv8JIzKk.js +161 -0
- package/dist/core/GlassTiles-5MyBj1ff.js +53 -0
- package/dist/core/{Glow-BD0t9E1L.js → Glow-DvJj7BB7.js} +12 -11
- package/dist/core/{Godrays-CPIAbymT.js → Godrays-cUzAKVXn.js} +24 -22
- package/dist/core/{Grayscale-BtOqK43k.js → Grayscale-oWIF3PV5.js} +3 -2
- package/dist/core/Grid-Bov7AA9m.js +51 -0
- package/dist/core/GridDistortion-CWYom5Dw.js +148 -0
- package/dist/core/Group-CPk-7fiA.js +18 -0
- package/dist/core/{Halftone-B_MuXCD8.js → Halftone-F7fsdu7W.js} +11 -10
- package/dist/core/{HueShift-CKG9M-d2.js → HueShift-CiS4hdtk.js} +3 -2
- package/dist/core/{ImageTexture-B6zFP2fB.js → ImageTexture-B3Q29OHX.js} +24 -22
- package/dist/core/Invert-Cyc4JHWc.js +21 -0
- package/dist/core/{LinearBlur-JFLMQBY4.js → LinearBlur-BTC54qzk.js} +12 -11
- package/dist/core/{LinearGradient-Ztg5Lzwj.js → LinearGradient-LEMeW0KM.js} +18 -16
- package/dist/core/Liquify-D2nzMDzq.js +140 -0
- package/dist/core/Pixelate-irPzmtQm.js +39 -0
- package/dist/core/{PolarCoordinates-qzU8gNXR.js → PolarCoordinates-Ck5ZWrQO.js} +21 -16
- package/dist/core/{Posterize-BkBU8tnN.js → Posterize-DICq_t96.js} +9 -8
- package/dist/core/{ProgressiveBlur-HAQf188T.js → ProgressiveBlur-BuORe3VH.js} +17 -16
- package/dist/core/{RadialGradient-DISqJuTZ.js → RadialGradient-D0cN67jm.js} +17 -15
- package/dist/core/RectangularCoordinates-1LIDaeHR.js +93 -0
- package/dist/core/{Ripples-CX8Qgnog.js → Ripples-DH71sFJc.js} +14 -12
- package/dist/core/{Saturation-DMxPYmIU.js → Saturation-DbSXtSeK.js} +10 -9
- package/dist/core/{SimplexNoise-B5ygfckG.js → SimplexNoise-DPGC2OPJ.js} +14 -12
- package/dist/core/{SineWave-KPFlP3Wk.js → SineWave-CkWtnzHF.js} +16 -14
- package/dist/core/{SolidColor-B8oxlGge.js → SolidColor-DaB-FHNX.js} +8 -6
- package/dist/core/{Spiral-CX22hUJ3.js → Spiral-CcyI8azF.js} +19 -17
- package/dist/core/Strands-Co4fkc05.js +126 -0
- package/dist/core/{Swirl-CIXreSgZ.js → Swirl-BoveqtNV.js} +18 -16
- package/dist/core/{TiltShift-J0UUcoh-.js → TiltShift-D53azmRe.js} +14 -13
- package/dist/core/{Tritone-E9eHvjJV.js → Tritone-Cg1rX-hL.js} +13 -12
- package/dist/core/{Twirl-ClhPpapm.js → Twirl-raO5pe5X.js} +20 -15
- package/dist/core/{Vibrance-CqnE9Zco.js → Vibrance-DtekSkcz.js} +8 -7
- package/dist/core/WaveDistortion-C65qO_cZ.js +133 -0
- package/dist/core/{ZoomBlur-CaGbSDG3.js → ZoomBlur-B97ZjhXe.js} +11 -10
- package/dist/core/{colorMixing-C_ESXyqX.js → colorMixing-DPZ-Td4U.js} +3 -3
- package/dist/core/edges-B-tVdqcI.js +16 -0
- package/dist/core/index.js +1333 -948
- package/dist/core/performanceTracker.d.ts +2 -0
- package/dist/core/performanceTracker.d.ts.map +1 -1
- package/dist/core/renderer.d.ts +12 -0
- package/dist/core/renderer.d.ts.map +1 -1
- package/dist/core/shaderRegistry.d.ts.map +1 -1
- package/dist/core/shaders/AngularBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/AngularBlur/index.js +3 -3
- package/dist/core/shaders/Ascii/index.d.ts.map +1 -1
- package/dist/core/shaders/Ascii/index.js +2 -2
- package/dist/core/shaders/Blob/index.d.ts.map +1 -1
- package/dist/core/shaders/Blob/index.js +5 -5
- package/dist/core/shaders/Blur/index.d.ts.map +1 -1
- package/dist/core/shaders/Blur/index.js +2 -2
- package/dist/core/shaders/Bulge/index.d.ts.map +1 -1
- package/dist/core/shaders/Bulge/index.js +4 -4
- package/dist/core/shaders/CRTScreen/index.d.ts.map +1 -1
- package/dist/core/shaders/CRTScreen/index.js +2 -2
- package/dist/core/shaders/ChannelBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/ChannelBlur/index.js +2 -2
- package/dist/core/shaders/Checkerboard/index.d.ts.map +1 -1
- package/dist/core/shaders/Checkerboard/index.js +4 -4
- package/dist/core/shaders/ChromaFlow/index.d.ts.map +1 -1
- package/dist/core/shaders/ChromaFlow/index.js +3 -3
- package/dist/core/shaders/ChromaticAberration/index.d.ts.map +1 -1
- package/dist/core/shaders/ChromaticAberration/index.js +3 -3
- package/dist/core/shaders/Circle/index.d.ts.map +1 -1
- package/dist/core/shaders/Circle/index.js +3 -3
- package/dist/core/shaders/CursorTrail/index.d.ts.map +1 -1
- package/dist/core/shaders/CursorTrail/index.js +4 -4
- 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 +3 -3
- package/dist/core/shaders/DotGrid/index.d.ts.map +1 -1
- package/dist/core/shaders/DotGrid/index.js +3 -3
- package/dist/core/shaders/Duotone/index.d.ts.map +1 -1
- package/dist/core/shaders/Duotone/index.js +4 -4
- package/dist/core/shaders/FilmGrain/index.d.ts.map +1 -1
- package/dist/core/shaders/FilmGrain/index.js +2 -2
- package/dist/core/shaders/FloatingParticles/index.d.ts.map +1 -1
- package/dist/core/shaders/FloatingParticles/index.js +3 -3
- package/dist/core/shaders/GlassTiles/index.d.ts.map +1 -1
- package/dist/core/shaders/GlassTiles/index.js +2 -2
- 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.d.ts.map +1 -1
- package/dist/core/shaders/Godrays/index.js +3 -3
- package/dist/core/shaders/Grayscale/index.d.ts.map +1 -1
- package/dist/core/shaders/Grayscale/index.js +2 -2
- package/dist/core/shaders/Grid/index.d.ts.map +1 -1
- package/dist/core/shaders/Grid/index.js +3 -3
- package/dist/core/shaders/GridDistortion/index.d.ts.map +1 -1
- package/dist/core/shaders/GridDistortion/index.js +4 -4
- package/dist/core/shaders/Group/index.d.ts.map +1 -1
- package/dist/core/shaders/Group/index.js +2 -2
- package/dist/core/shaders/Halftone/index.d.ts.map +1 -1
- package/dist/core/shaders/Halftone/index.js +3 -3
- package/dist/core/shaders/HueShift/index.d.ts.map +1 -1
- package/dist/core/shaders/HueShift/index.js +2 -2
- package/dist/core/shaders/ImageTexture/index.d.ts +1 -1
- package/dist/core/shaders/ImageTexture/index.d.ts.map +1 -1
- package/dist/core/shaders/ImageTexture/index.js +2 -2
- package/dist/core/shaders/Invert/index.d.ts.map +1 -1
- package/dist/core/shaders/Invert/index.js +2 -2
- package/dist/core/shaders/LinearBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/LinearBlur/index.js +3 -3
- package/dist/core/shaders/LinearGradient/index.d.ts.map +1 -1
- package/dist/core/shaders/LinearGradient/index.js +4 -4
- package/dist/core/shaders/Liquify/index.d.ts.map +1 -1
- package/dist/core/shaders/Liquify/index.js +4 -4
- package/dist/core/shaders/Pixelate/index.d.ts.map +1 -1
- package/dist/core/shaders/Pixelate/index.js +2 -2
- package/dist/core/shaders/PolarCoordinates/index.d.ts.map +1 -1
- package/dist/core/shaders/PolarCoordinates/index.js +4 -4
- package/dist/core/shaders/Posterize/index.d.ts.map +1 -1
- package/dist/core/shaders/Posterize/index.js +2 -2
- package/dist/core/shaders/ProgressiveBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/ProgressiveBlur/index.js +3 -3
- package/dist/core/shaders/RadialGradient/index.d.ts.map +1 -1
- package/dist/core/shaders/RadialGradient/index.js +4 -4
- package/dist/core/shaders/RectangularCoordinates/index.d.ts +38 -0
- package/dist/core/shaders/RectangularCoordinates/index.d.ts.map +1 -0
- package/dist/core/shaders/RectangularCoordinates/index.js +8 -0
- package/dist/core/shaders/Ripples/index.d.ts.map +1 -1
- package/dist/core/shaders/Ripples/index.js +4 -4
- package/dist/core/shaders/Saturation/index.d.ts.map +1 -1
- package/dist/core/shaders/Saturation/index.js +2 -2
- package/dist/core/shaders/SimplexNoise/index.d.ts.map +1 -1
- package/dist/core/shaders/SimplexNoise/index.js +4 -4
- package/dist/core/shaders/SineWave/index.d.ts.map +1 -1
- package/dist/core/shaders/SineWave/index.js +3 -3
- package/dist/core/shaders/SolidColor/index.d.ts.map +1 -1
- package/dist/core/shaders/SolidColor/index.js +3 -3
- package/dist/core/shaders/Spiral/index.d.ts.map +1 -1
- package/dist/core/shaders/Spiral/index.js +4 -4
- package/dist/core/shaders/Strands/index.d.ts.map +1 -1
- package/dist/core/shaders/Strands/index.js +4 -4
- package/dist/core/shaders/Swirl/index.d.ts.map +1 -1
- package/dist/core/shaders/Swirl/index.js +5 -5
- package/dist/core/shaders/TiltShift/index.d.ts.map +1 -1
- package/dist/core/shaders/TiltShift/index.js +3 -3
- package/dist/core/shaders/Tritone/index.d.ts.map +1 -1
- package/dist/core/shaders/Tritone/index.js +4 -4
- package/dist/core/shaders/Twirl/index.d.ts.map +1 -1
- package/dist/core/shaders/Twirl/index.js +4 -4
- package/dist/core/shaders/Vibrance/index.d.ts.map +1 -1
- package/dist/core/shaders/Vibrance/index.js +2 -2
- package/dist/core/shaders/WaveDistortion/index.d.ts.map +1 -1
- package/dist/core/shaders/WaveDistortion/index.js +6 -7
- package/dist/core/shaders/ZoomBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/ZoomBlur/index.js +3 -3
- package/dist/core/telemetry/collector.d.ts.map +1 -1
- package/dist/core/telemetry/index.js +19 -19
- package/dist/core/{three.tsl-CgyjOhns.js → three.tsl-BqgDcRt9.js} +21 -20
- package/dist/core/{time-myrFQH-u.js → time-5uQ65blS.js} +1 -1
- package/dist/core/{transformations-Bs66Qh16.js → transformations-DBjTkQ5b.js} +1 -1
- package/dist/core/types.d.ts +85 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/utilities/edges.d.ts +13 -2
- package/dist/core/utilities/edges.d.ts.map +1 -1
- package/dist/core/utilities/uvTransform.d.ts +20 -0
- package/dist/core/utilities/uvTransform.d.ts.map +1 -1
- package/dist/react/components/RectangularCoordinates.d.ts +31 -0
- package/dist/react/components/RectangularCoordinates.d.ts.map +1 -0
- package/dist/react/index.cjs +233 -233
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +16218 -15498
- package/dist/react/utils/generatePresetCode.cjs +2 -2
- package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/react/utils/generatePresetCode.js +13 -1
- package/dist/registry.d.ts +3 -0
- package/dist/registry.js +376 -87
- package/dist/svelte/components/RectangularCoordinates.svelte.d.ts +19 -0
- package/dist/svelte/index.d.ts +1 -0
- package/dist/svelte/index.js +15766 -15088
- package/dist/svelte/utils/generatePresetCode.js +13 -1
- package/dist/vue/components/RectangularCoordinates.vue.d.ts +57 -0
- package/dist/vue/components/RectangularCoordinates.vue.d.ts.map +1 -0
- package/dist/vue/{generatePresetCode-B6Ks_W3s.js → generatePresetCode-D4V6rBae.js} +13 -1
- package/dist/vue/index.d.ts +1 -0
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/index.js +15240 -14552
- package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/vue/utils/generatePresetCode.js +1 -1
- package/package.json +6 -1
- package/dist/core/Blob-CBASKMfO.js +0 -168
- package/dist/core/Bulge-Ceythf-i.js +0 -99
- package/dist/core/DiffuseBlur-DLIKRsnf.js +0 -39
- package/dist/core/DotGrid-BkItF2C8.js +0 -60
- package/dist/core/FilmGrain-BAZORehh.js +0 -27
- package/dist/core/FloatingParticles-7wvOBUbD.js +0 -158
- package/dist/core/GlassTiles-C0y_PWTa.js +0 -48
- package/dist/core/Grid-Ro0Yi5WY.js +0 -49
- package/dist/core/GridDistortion-CuxRQdzs.js +0 -137
- package/dist/core/Group-DTXP-whY.js +0 -17
- package/dist/core/Invert-Cd7GK1vs.js +0 -20
- package/dist/core/Liquify-rmJGJAdt.js +0 -126
- package/dist/core/Pixelate-BIANS3t9.js +0 -34
- package/dist/core/Strands-Bv7RvyRC.js +0 -124
- package/dist/core/WaveDistortion-gecgVpvO.js +0 -129
- package/dist/core/edges-Cj8yVYgz.js +0 -10
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { k as b, m as R } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
+
R();
|
|
3
|
+
const V = {
|
|
4
|
+
name: "GlassTiles",
|
|
5
|
+
category: "Distortions",
|
|
6
|
+
description: "Refraction-like distortion in a tile grid pattern",
|
|
7
|
+
requiresRTT: !0,
|
|
8
|
+
requiresChild: !0,
|
|
9
|
+
props: {
|
|
10
|
+
intensity: {
|
|
11
|
+
default: 1,
|
|
12
|
+
description: "The intensity of the glass tiles effect",
|
|
13
|
+
ui: {
|
|
14
|
+
type: "range",
|
|
15
|
+
min: 0,
|
|
16
|
+
max: 5,
|
|
17
|
+
step: 0.1,
|
|
18
|
+
label: "Intensity"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
tileCount: {
|
|
22
|
+
default: 100,
|
|
23
|
+
description: "Number of tiles across the shortest dimension",
|
|
24
|
+
ui: {
|
|
25
|
+
type: "range",
|
|
26
|
+
min: 1,
|
|
27
|
+
max: 200,
|
|
28
|
+
step: 1,
|
|
29
|
+
label: "Tile Count"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
uvTransformNode: ({ uv: o, uniforms: s, viewportSize: i }) => {
|
|
34
|
+
const { vec2: r, floor: a, select: l } = b, p = s.intensity.uniform, t = s.tileCount.uniform, e = i.x.div(i.y), n = r(l(e.greaterThanEqual(1), t.mul(e), t), l(e.lessThan(1), t.div(e), t)), c = a(o.mul(n)).div(n), d = o.sub(c), T = r(0.5, 0.5), h = p.mul(0.025), u = d.div(r(1, 1).div(n)).sub(T).mul(h);
|
|
35
|
+
return d.add(u).add(c);
|
|
36
|
+
},
|
|
37
|
+
fragmentNode: ({ uniforms: o, childNode: s, dimensions: i, onCleanup: r }) => {
|
|
38
|
+
const { vec2: a, vec4: l, floor: p, mul: t, div: e, sub: n, add: c, screenUV: d, uniform: T, convertToTexture: h } = b;
|
|
39
|
+
if (!s)
|
|
40
|
+
return console.error("You must pass a child component into the Glass Tiles shader."), l(0);
|
|
41
|
+
const u = h(s);
|
|
42
|
+
r(() => {
|
|
43
|
+
u?.renderTarget?.dispose && u.renderTarget.dispose();
|
|
44
|
+
});
|
|
45
|
+
const m = T(i.width / i.height), g = d, x = o.intensity.uniform, f = o.tileCount.uniform, C = a(m.greaterThanEqual(1).select(t(f, m), f), m.lessThan(1).select(e(f, m), f)), v = e(p(t(g, C)), C), y = n(g, v), U = a(0.5, 0.5), _ = t(x, 0.025), q = c(c(y, t(n(e(y, e(a(1), C)), U), _)), v);
|
|
46
|
+
return l(u.sample(q));
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var N = V;
|
|
50
|
+
export {
|
|
51
|
+
V as n,
|
|
52
|
+
N as t
|
|
53
|
+
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { k as U, m as j } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
+
j();
|
|
3
3
|
const B = {
|
|
4
4
|
name: "Glow",
|
|
5
|
-
category: "
|
|
5
|
+
category: "Stylize",
|
|
6
|
+
description: "Soft glow effect with adjustable intensity",
|
|
6
7
|
requiresRTT: !0,
|
|
7
8
|
requiresChild: !0,
|
|
8
9
|
props: {
|
|
@@ -41,26 +42,26 @@ const B = {
|
|
|
41
42
|
}
|
|
42
43
|
},
|
|
43
44
|
fragmentNode: ({ uniforms: s, childNode: a, onCleanup: g }) => {
|
|
44
|
-
const { vec2: c, vec3: h, vec4: r, float: t, max: d, dot: w, screenUV: f, convertToTexture: b, viewportSize:
|
|
45
|
+
const { vec2: c, vec3: h, vec4: r, float: t, max: d, dot: w, screenUV: f, convertToTexture: b, viewportSize: y, Fn: x } = U;
|
|
45
46
|
if (!a) return r(0, 0, 0, 0);
|
|
46
47
|
const o = b(a);
|
|
47
48
|
g(() => {
|
|
48
49
|
o?.renderTarget?.dispose && o.renderTarget.dispose();
|
|
49
50
|
});
|
|
50
|
-
const u = o.sample(f), v =
|
|
51
|
-
const z = s.size.uniform,
|
|
51
|
+
const u = o.sample(f), v = x(() => {
|
|
52
|
+
const z = s.size.uniform, S = s.threshold.uniform, G = c(1).div(y), n = r(0, 0, 0, 0).toVar(), e = 5;
|
|
52
53
|
for (let i = -e; i <= e; i++) for (let l = -e; l <= e; l++) {
|
|
53
|
-
const C = c(t(i), t(l)).mul(
|
|
54
|
+
const C = c(t(i), t(l)).mul(G).mul(z), V = f.add(C), m = o.sample(V), k = w(m.rgb, h(0.299, 0.587, 0.114)), q = d(t(0), k.sub(S)), R = m.mul(q);
|
|
54
55
|
n.assign(n.add(R));
|
|
55
56
|
}
|
|
56
57
|
const _ = t((e * 2 + 1) * (e * 2 + 1));
|
|
57
58
|
return n.div(_);
|
|
58
|
-
})(), T = s.intensity.uniform,
|
|
59
|
-
return r(u.rgb.add(
|
|
59
|
+
})(), T = s.intensity.uniform, p = v.mul(T);
|
|
60
|
+
return r(u.rgb.add(p.rgb), d(u.a, p.a));
|
|
60
61
|
}
|
|
61
62
|
};
|
|
62
|
-
var
|
|
63
|
+
var E = B;
|
|
63
64
|
export {
|
|
64
65
|
B as n,
|
|
65
|
-
|
|
66
|
+
E as t
|
|
66
67
|
};
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { o as
|
|
3
|
-
|
|
4
|
-
const
|
|
1
|
+
import { k as A, m as E, t as M } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
+
import { o as j, r as _ } from "./transformations-DBjTkQ5b.js";
|
|
3
|
+
E();
|
|
4
|
+
const z = {
|
|
5
5
|
name: "Godrays",
|
|
6
|
-
category: "
|
|
6
|
+
category: "Base Layers",
|
|
7
|
+
description: "Volumetric light rays emanating from a point",
|
|
7
8
|
requiresRTT: !1,
|
|
9
|
+
acceptsUVContext: !0,
|
|
8
10
|
props: {
|
|
9
11
|
center: {
|
|
10
12
|
default: {
|
|
11
13
|
x: 0,
|
|
12
14
|
y: 0
|
|
13
15
|
},
|
|
14
|
-
transform:
|
|
16
|
+
transform: j,
|
|
15
17
|
description: "The center point of the god rays",
|
|
16
18
|
ui: {
|
|
17
19
|
type: "position",
|
|
@@ -81,24 +83,24 @@ const M = {
|
|
|
81
83
|
}
|
|
82
84
|
}
|
|
83
85
|
},
|
|
84
|
-
fragmentNode: ({ uniforms:
|
|
85
|
-
const { vec2:
|
|
86
|
-
const t = n.floor(),
|
|
87
|
-
return m(m(l, r,
|
|
88
|
-
}), f =
|
|
89
|
-
const l =
|
|
86
|
+
fragmentNode: ({ uniforms: e, uvContext: v }) => {
|
|
87
|
+
const { vec2: i, vec4: R, float: a, sin: T, atan2: B, length: D, pow: h, smoothstep: P, mix: m, clamp: x, screenUV: S, time: U, PI: w, Fn: g } = A, F = v ?? S, G = i(e.center.uniform.x, e.center.uniform.y.oneMinus()), d = F.sub(G), C = g(([n]) => {
|
|
88
|
+
const t = n.floor(), s = n.fract(), o = (u) => T(u.x.mul(127.1).add(u.y.mul(311.7))).mul(43758.5453).fract(), l = o(t), r = o(t.add(i(1, 0))), y = o(t.add(i(0, 1))), p = o(t.add(i(1, 1))), c = s.mul(s).mul(s.mul(-2).add(3));
|
|
89
|
+
return m(m(l, r, c.x), m(y, p, c.x), c.y);
|
|
90
|
+
}), f = g(([n, t, s, o]) => {
|
|
91
|
+
const l = B(n.y, n.x), r = i(l.mul(s), t), y = i(l.mod(w.mul(2)).mul(s), t), p = h(C(r), o);
|
|
90
92
|
return m(h(C(y), o), p, P(-0.15, 0.15, n.x));
|
|
91
|
-
}), k =
|
|
92
|
-
const n =
|
|
93
|
-
u.assign(u.mul(f(d, p,
|
|
94
|
-
const
|
|
95
|
-
return
|
|
96
|
-
})(),
|
|
97
|
-
return R(m(
|
|
93
|
+
}), k = g(() => {
|
|
94
|
+
const n = U.mul(e.speed.uniform).mul(0.2), t = D(d), s = a(6.5).mul(M(e.spotty.uniform)), o = a(4).sub(a(3).mul(x(e.intensity.uniform, 0, 1))), l = a(6).mul(e.density.uniform), r = a(0).toVar(), y = t.mul(1).sub(n.mul(3)), p = t.mul(0.5).mul(a(1).add(s)).sub(n.mul(2)), c = l.mul(5), u = f(d, y, c, o).toVar();
|
|
95
|
+
u.assign(u.mul(f(d, p, c.mul(4), o))), r.assign(r.add(u));
|
|
96
|
+
const N = t.mul(1.4).sub(n.mul(2.5)), q = t.mul(0.7).mul(a(1).add(s)).sub(n.mul(1.8)), V = l.mul(4.5), b = f(d, N, V, o).toVar();
|
|
97
|
+
return b.assign(b.mul(f(d, q, V.mul(3.5), o))), r.assign(r.add(b.mul(0.7))), x(r, 0, 1);
|
|
98
|
+
})(), I = e.rayColor.uniform.rgb, L = e.backgroundColor.uniform.rgb;
|
|
99
|
+
return R(m(L, I, k), e.backgroundColor.uniform.a.add(k.mul(e.rayColor.uniform.a)));
|
|
98
100
|
}
|
|
99
101
|
};
|
|
100
|
-
var
|
|
102
|
+
var K = z;
|
|
101
103
|
export {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
+
z as n,
|
|
105
|
+
K as t
|
|
104
106
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { k as o, m as s } from "./three.tsl-BqgDcRt9.js";
|
|
2
2
|
import { t as a } from "./ColorAdjustment-CKwpE_4M.js";
|
|
3
3
|
s();
|
|
4
4
|
const n = {
|
|
5
5
|
name: "Grayscale",
|
|
6
|
-
category: "
|
|
6
|
+
category: "Adjustments",
|
|
7
|
+
description: "Convert colors to black and white",
|
|
7
8
|
requiresChild: !0,
|
|
8
9
|
props: {},
|
|
9
10
|
fragmentNode: ({ childNode: e }) => {
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { k as b, m as T } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
+
import { r as _ } from "./transformations-DBjTkQ5b.js";
|
|
3
|
+
T();
|
|
4
|
+
const C = {
|
|
5
|
+
name: "Grid",
|
|
6
|
+
category: "Base Layers",
|
|
7
|
+
description: "Simple grid lines pattern with adjustable thickness",
|
|
8
|
+
acceptsUVContext: !0,
|
|
9
|
+
props: {
|
|
10
|
+
color: {
|
|
11
|
+
default: "#ffffff",
|
|
12
|
+
transform: _,
|
|
13
|
+
description: "The color of the grid lines",
|
|
14
|
+
ui: {
|
|
15
|
+
type: "color",
|
|
16
|
+
label: "Color"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
cells: {
|
|
20
|
+
default: 10,
|
|
21
|
+
description: "Number of cells along the shortest canvas edge (creates square cells)",
|
|
22
|
+
ui: {
|
|
23
|
+
type: "range",
|
|
24
|
+
min: 1,
|
|
25
|
+
max: 50,
|
|
26
|
+
step: 1,
|
|
27
|
+
label: "Cells"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
thickness: {
|
|
31
|
+
default: 1,
|
|
32
|
+
description: "Thickness of grid lines (normalized, 0.0-1.0)",
|
|
33
|
+
ui: {
|
|
34
|
+
type: "range",
|
|
35
|
+
min: 0,
|
|
36
|
+
max: 5,
|
|
37
|
+
step: 0.1,
|
|
38
|
+
label: "Thickness"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
fragmentNode: ({ uniforms: e, uvContext: l }) => {
|
|
43
|
+
const { vec2: a, vec4: d, fract: m, max: p, screenUV: f, viewportSize: o, fwidth: u, smoothstep: n } = b, i = l ?? f, h = o.x.div(o.y), g = a(i.x.mul(h), i.y.oneMinus()), x = e.cells.uniform, r = g.mul(x), t = m(r), s = e.thickness.uniform.mul(0.01), y = t.x.min(t.x.oneMinus()), k = t.y.min(t.y.oneMinus()), c = u(r), v = p(n(s.add(c.x), s, y), n(s.add(c.y), s, k));
|
|
44
|
+
return d(e.color.uniform.rgb, e.color.uniform.a.mul(v));
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
var V = C;
|
|
48
|
+
export {
|
|
49
|
+
C as n,
|
|
50
|
+
V as t
|
|
51
|
+
};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { O as $, k as B, m as J } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
+
import { t as K } from "./edges-B-tVdqcI.js";
|
|
3
|
+
import { a as Q } from "./transformations-DBjTkQ5b.js";
|
|
4
|
+
import { DataTexture as ee, FloatType as te, LinearFilter as C, RGFormat as ae } from "three";
|
|
5
|
+
J();
|
|
6
|
+
var ie = 20, f = /* @__PURE__ */ new WeakMap(), re = (e) => {
|
|
7
|
+
let t = f.get(e);
|
|
8
|
+
const s = e?.gridSize?.uniform?.value ? Math.max(8, Math.min(128, Math.floor(e.gridSize.uniform.value))) : ie;
|
|
9
|
+
if (t && t.gridSize !== s && (t.texture.dispose(), t = void 0, f.delete(e)), !t) {
|
|
10
|
+
const l = new Float32Array(s * s * 2), n = new ee(l, s, s, ae, te);
|
|
11
|
+
n.magFilter = C, n.minFilter = C, n.needsUpdate = !0, t = {
|
|
12
|
+
texture: n,
|
|
13
|
+
data: l,
|
|
14
|
+
tslNode: $(n),
|
|
15
|
+
gridSize: s
|
|
16
|
+
}, f.set(e, t);
|
|
17
|
+
}
|
|
18
|
+
return t;
|
|
19
|
+
};
|
|
20
|
+
const se = {
|
|
21
|
+
name: "GridDistortion",
|
|
22
|
+
category: "Interactive",
|
|
23
|
+
description: "Interactive grid distortion controlled by mouse position",
|
|
24
|
+
requiresRTT: !0,
|
|
25
|
+
requiresChild: !0,
|
|
26
|
+
props: {
|
|
27
|
+
intensity: {
|
|
28
|
+
default: 1,
|
|
29
|
+
description: "Strength of the distortion effect",
|
|
30
|
+
ui: {
|
|
31
|
+
type: "range",
|
|
32
|
+
min: 0,
|
|
33
|
+
max: 5,
|
|
34
|
+
step: 0.1,
|
|
35
|
+
label: "Intensity"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
swirl: {
|
|
39
|
+
default: 0,
|
|
40
|
+
description: "Amount of swirl motion",
|
|
41
|
+
ui: {
|
|
42
|
+
type: "range",
|
|
43
|
+
min: 0,
|
|
44
|
+
max: 2,
|
|
45
|
+
step: 0.1,
|
|
46
|
+
label: "Swirl"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
decay: {
|
|
50
|
+
default: 3,
|
|
51
|
+
description: "Rate of distortion decay (higher = faster)",
|
|
52
|
+
ui: {
|
|
53
|
+
type: "range",
|
|
54
|
+
min: 0,
|
|
55
|
+
max: 10,
|
|
56
|
+
step: 0.1,
|
|
57
|
+
label: "Decay"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
radius: {
|
|
61
|
+
default: 1,
|
|
62
|
+
description: "Radius of the distortion effect",
|
|
63
|
+
ui: {
|
|
64
|
+
type: "range",
|
|
65
|
+
min: 0,
|
|
66
|
+
max: 3,
|
|
67
|
+
step: 0.01,
|
|
68
|
+
label: "Radius"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
gridSize: {
|
|
72
|
+
default: 20,
|
|
73
|
+
description: "Resolution of the distortion grid (higher = more detailed)",
|
|
74
|
+
ui: {
|
|
75
|
+
type: "range",
|
|
76
|
+
min: 8,
|
|
77
|
+
max: 128,
|
|
78
|
+
step: 1,
|
|
79
|
+
label: "Grid Size"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
edges: {
|
|
83
|
+
default: "stretch",
|
|
84
|
+
description: "How to handle edges when distortion pushes content out of bounds",
|
|
85
|
+
transform: Q,
|
|
86
|
+
ui: {
|
|
87
|
+
type: "select",
|
|
88
|
+
options: [
|
|
89
|
+
{
|
|
90
|
+
label: "Stretch",
|
|
91
|
+
value: "stretch"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
label: "Transparent",
|
|
95
|
+
value: "transparent"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
label: "Mirror",
|
|
99
|
+
value: "mirror"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
label: "Wrap",
|
|
103
|
+
value: "wrap"
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
label: "Edges"
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
fragmentNode: ({ uniforms: e, onBeforeRender: t, childNode: s, onCleanup: l }) => {
|
|
111
|
+
const { vec2: n, vec4: k, float: g, uniform: T, screenUV: w, convertToTexture: H } = B, { texture: z, data: a, tslNode: L, gridSize: d } = re(e), h = T(0), v = T(0);
|
|
112
|
+
let F = 0.5, I = 0.5, R = Date.now();
|
|
113
|
+
if (t(({ pointer: o }) => {
|
|
114
|
+
const G = Date.now(), i = Math.min((G - R) / 1e3, 0.016);
|
|
115
|
+
R = G;
|
|
116
|
+
const V = i > 0 ? (o.x - F) / i : 0, X = i > 0 ? (o.y - I) / i : 0;
|
|
117
|
+
h.value = h.value * 0.85 + V * 0.15, v.value = v.value * 0.85 + X * 0.15;
|
|
118
|
+
const Y = e.decay.uniform.value, q = e.intensity.uniform.value, y = e.radius.uniform.value * 0.05, M = e.swirl.uniform.value;
|
|
119
|
+
for (let u = 0; u < d; u++) for (let m = 0; m < d; m++) {
|
|
120
|
+
const r = (u * d + m) * 2;
|
|
121
|
+
a[r] *= 1 - Y * i, a[r + 1] *= 1 - Y * i;
|
|
122
|
+
const j = (m + 0.5) / d, P = (u + 0.5) / d, S = j - o.x, b = P - o.y, D = Math.sqrt(S * S + b * b);
|
|
123
|
+
if (D < y * 2 && Math.abs(V) + Math.abs(X) > 0.01) {
|
|
124
|
+
const p = Math.exp(-D * D / (y * y));
|
|
125
|
+
if (a[r] += h.value * p * q * i * 0.5, a[r + 1] += v.value * p * q * i * 0.5, M > 0) {
|
|
126
|
+
const A = Math.atan2(b, S) + Math.PI * 0.5;
|
|
127
|
+
a[r] += Math.cos(A) * M * p * i * 2, a[r + 1] += Math.sin(A) * M * p * i * 2;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
a[r] = Math.max(-1, Math.min(1, a[r])), a[r + 1] = Math.max(-1, Math.min(1, a[r + 1]));
|
|
131
|
+
}
|
|
132
|
+
z.needsUpdate = !0, F = o.x, I = o.y;
|
|
133
|
+
}), l(() => {
|
|
134
|
+
z.dispose(), f.delete(e);
|
|
135
|
+
}), !s) return k(0, 0, 0, 0);
|
|
136
|
+
const c = H(s);
|
|
137
|
+
l(() => {
|
|
138
|
+
c?.renderTarget?.dispose && c.renderTarget.dispose();
|
|
139
|
+
});
|
|
140
|
+
const N = e.gridSize.uniform, x = g(1).div(N), O = w.div(x).floor().mul(x).add(x.mul(0.5)), W = L.sample(O).xy, _ = g(0.1), U = g(-0.1), Z = W.clamp(n(U, U), n(_, _)), E = w.sub(Z);
|
|
141
|
+
return K(E, c.sample(E), c, e.edges.uniform);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
var ce = se;
|
|
145
|
+
export {
|
|
146
|
+
se as n,
|
|
147
|
+
ce as t
|
|
148
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { k as r, m as o } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
+
o();
|
|
3
|
+
const i = {
|
|
4
|
+
name: "Group",
|
|
5
|
+
category: "Utilities",
|
|
6
|
+
description: "Container for organizing and composing child effects",
|
|
7
|
+
requiresChild: !0,
|
|
8
|
+
props: {},
|
|
9
|
+
fragmentNode: ({ childNode: e }) => {
|
|
10
|
+
const { vec4: t } = r;
|
|
11
|
+
return e || t(0);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
var s = i;
|
|
15
|
+
export {
|
|
16
|
+
i as n,
|
|
17
|
+
s as t
|
|
18
|
+
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as
|
|
3
|
-
|
|
1
|
+
import { k as V, m as A } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
+
import { n as D } from "./transformations-DBjTkQ5b.js";
|
|
3
|
+
A();
|
|
4
4
|
const F = {
|
|
5
5
|
name: "Halftone",
|
|
6
|
-
category: "
|
|
6
|
+
category: "Stylize",
|
|
7
|
+
description: "Halftone dot pattern effect for printing aesthetics",
|
|
7
8
|
requiresChild: !0,
|
|
8
9
|
props: {
|
|
9
10
|
frequency: {
|
|
@@ -19,7 +20,7 @@ const F = {
|
|
|
19
20
|
},
|
|
20
21
|
angle: {
|
|
21
22
|
default: 45,
|
|
22
|
-
transform:
|
|
23
|
+
transform: D,
|
|
23
24
|
description: "Rotation angle of the pattern (in degrees)",
|
|
24
25
|
ui: {
|
|
25
26
|
type: "range",
|
|
@@ -42,14 +43,14 @@ const F = {
|
|
|
42
43
|
}
|
|
43
44
|
},
|
|
44
45
|
fragmentNode: ({ uniforms: t, childNode: s }) => {
|
|
45
|
-
const { vec2: e, vec3:
|
|
46
|
+
const { vec2: e, vec3: g, vec4: r, sin: h, cos: y, fract: b, length: v, smoothstep: x, dot: n, screenUV: q, viewportSize: a, radians: _ } = V;
|
|
46
47
|
if (!s) return r(0);
|
|
47
|
-
const
|
|
48
|
-
return r(o.rgb.mul(
|
|
48
|
+
const i = q, S = t.frequency.uniform, z = t.angle.uniform, c = t.smoothness.uniform, l = _(z), C = a.x.div(a.y), m = e(i.x.mul(C), i.y), f = y(l), d = h(l), H = b(e(n(m, e(f, d.negate())), n(m, e(d, f))).mul(S)).sub(0.5), o = s, u = n(o.rgb, g(0.299, 0.587, 0.114)).mul(0.7).add(0.15), U = v(H), p = x(u.add(c), u.sub(c), U);
|
|
49
|
+
return r(o.rgb.mul(p), o.a.mul(p));
|
|
49
50
|
}
|
|
50
51
|
};
|
|
51
|
-
var
|
|
52
|
+
var E = F;
|
|
52
53
|
export {
|
|
53
54
|
F as n,
|
|
54
|
-
|
|
55
|
+
E as t
|
|
55
56
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { k as s, m as n } from "./three.tsl-BqgDcRt9.js";
|
|
2
2
|
import { n as i } from "./ColorAdjustment-CKwpE_4M.js";
|
|
3
3
|
n();
|
|
4
4
|
const a = {
|
|
5
5
|
name: "HueShift",
|
|
6
|
-
category: "
|
|
6
|
+
category: "Adjustments",
|
|
7
|
+
description: "Rotate hue around the color wheel",
|
|
7
8
|
requiresChild: !0,
|
|
8
9
|
props: { shift: {
|
|
9
10
|
default: 0,
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
1
|
+
import { A as S, C as oe, G as ae, H as x, L as ne, W as se, b as y, k as ie, m as le } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
+
le();
|
|
3
|
+
ne();
|
|
4
|
+
const ce = {
|
|
5
5
|
name: "ImageTexture",
|
|
6
|
-
category: "
|
|
6
|
+
category: "Base Layers",
|
|
7
|
+
description: "Display an image with customizable object-fit modes",
|
|
8
|
+
acceptsUVContext: !0,
|
|
7
9
|
props: {
|
|
8
10
|
url: {
|
|
9
|
-
default: "https://shaders.com/
|
|
11
|
+
default: "https://shaders.com/sample.jpg",
|
|
10
12
|
description: "Upload an image or provide a URL",
|
|
11
13
|
ui: {
|
|
12
14
|
type: "image-upload",
|
|
@@ -51,12 +53,12 @@ const ie = {
|
|
|
51
53
|
}
|
|
52
54
|
}
|
|
53
55
|
},
|
|
54
|
-
fragmentNode: ({ uniforms: m, onCleanup:
|
|
55
|
-
const { vec2: o, vec4:
|
|
56
|
+
fragmentNode: ({ uniforms: m, onCleanup: _, onBeforeRender: D, uvContext: W }) => {
|
|
57
|
+
const { vec2: o, vec4: A, float: t, texture: H, screenUV: N, viewportSize: c, step: a, min: u, max: z } = ie, B = W ?? N, O = new ae();
|
|
56
58
|
let T = "", r = !1;
|
|
57
|
-
const n = new
|
|
58
|
-
n.colorSpace =
|
|
59
|
-
const $ =
|
|
59
|
+
const n = new se();
|
|
60
|
+
n.colorSpace = x;
|
|
61
|
+
const $ = H(n), s = S(1), f = S(0), w = S(0), V = (e) => {
|
|
60
62
|
if (!(!e || e.trim() === "" || r)) {
|
|
61
63
|
r = !0;
|
|
62
64
|
try {
|
|
@@ -65,12 +67,12 @@ const ie = {
|
|
|
65
67
|
h = new URL(e, window.location.href).href;
|
|
66
68
|
} catch {
|
|
67
69
|
}
|
|
68
|
-
|
|
69
|
-
d.colorSpace =
|
|
70
|
-
const p = d.image, U = p.width || 1, b = p.height || 1,
|
|
70
|
+
O.load(e, (d) => {
|
|
71
|
+
d.colorSpace = x;
|
|
72
|
+
const p = d.image, U = p.width || 1, b = p.height || 1, te = U / b;
|
|
71
73
|
d.dispose(), T = e, requestAnimationFrame(() => {
|
|
72
74
|
const g = n.image;
|
|
73
|
-
g && typeof g == "object" && (g.width !== U || g.height !== b) && n.dispose(), s.value =
|
|
75
|
+
g && typeof g == "object" && (g.width !== U || g.height !== b) && n.dispose(), s.value = te, f.value = U, w.value = b, n.image = p, n.colorSpace = x, n.needsUpdate = !0;
|
|
74
76
|
}), r = !1;
|
|
75
77
|
}, void 0, (d) => {
|
|
76
78
|
const p = !e.startsWith("http://") && !e.startsWith("https://") && !e.startsWith("data:");
|
|
@@ -88,18 +90,18 @@ const ie = {
|
|
|
88
90
|
setTimeout(() => {
|
|
89
91
|
const e = m?.url?.uniform?.value ?? "";
|
|
90
92
|
e && e.trim() !== "" && V(e);
|
|
91
|
-
}, 0),
|
|
93
|
+
}, 0), D(() => {
|
|
92
94
|
const e = m?.url?.uniform?.value ?? "";
|
|
93
95
|
e !== T && !r && V(e);
|
|
94
|
-
}),
|
|
96
|
+
}), _(() => {
|
|
95
97
|
n.dispose();
|
|
96
98
|
});
|
|
97
|
-
const q =
|
|
98
|
-
return
|
|
99
|
+
const q = B, l = c.x.div(c.y), i = m.objectFit.uniform, j = z(l.div(s), t(1)), E = o(s.div(l).mul(j), j), C = u(l.div(s), t(1)), G = o(s.div(l).mul(C), C), k = o(1, 1), F = u(u(l.div(s), t(1)), u(c.x.div(f), c.y.div(w))), M = o(s.div(l).mul(F), F), L = u(c.x.div(f), c.y.div(w)), P = o(s.div(l).mul(L), L), J = a(i, t(0.5)), K = a(t(0.5), i).mul(a(i, t(1.5))), Q = a(t(1.5), i).mul(a(i, t(2.5))), X = a(t(2.5), i).mul(a(i, t(3.5))), Y = a(t(3.5), i), Z = o(0).add(E.mul(J)).add(G.mul(K)).add(k.mul(Q)).add(M.mul(X)).add(P.mul(Y)), R = q.sub(o(0.5)).div(Z).add(o(0.5)), v = o(R.x, t(1).sub(R.y)), I = $.sample(v), ee = y(y(v.x.lessThan(0), v.x.greaterThan(1)), y(v.y.lessThan(0), v.y.greaterThan(1)));
|
|
100
|
+
return A(I.rgb, oe(ee, t(0), I.a));
|
|
99
101
|
}
|
|
100
102
|
};
|
|
101
|
-
var
|
|
103
|
+
var de = ce;
|
|
102
104
|
export {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
+
ce as n,
|
|
106
|
+
de as t
|
|
105
107
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { k as a, m as i } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
+
i();
|
|
3
|
+
const c = {
|
|
4
|
+
name: "Invert",
|
|
5
|
+
category: "Adjustments",
|
|
6
|
+
description: "Invert RGB colors while preserving alpha",
|
|
7
|
+
requiresChild: !0,
|
|
8
|
+
props: {},
|
|
9
|
+
fragmentNode: ({ childNode: r }) => {
|
|
10
|
+
const { vec4: t, vec3: n } = a;
|
|
11
|
+
if (!r)
|
|
12
|
+
return console.error("You must pass a child component into the Invert shader."), t(0);
|
|
13
|
+
const o = r || t(0, 0, 0, 0), e = o.a, s = e.greaterThan(0).select(o.rgb.div(e), n(0, 0, 0));
|
|
14
|
+
return t(n(1, 1, 1).sub(s).mul(e), e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var p = c;
|
|
18
|
+
export {
|
|
19
|
+
c as n,
|
|
20
|
+
p as t
|
|
21
|
+
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as A } from "./transformations-
|
|
1
|
+
import { k as q, m as w } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
+
import { n as A } from "./transformations-DBjTkQ5b.js";
|
|
3
3
|
w();
|
|
4
4
|
const I = {
|
|
5
5
|
name: "LinearBlur",
|
|
6
6
|
category: "Blurs",
|
|
7
|
+
description: "Directional motion blur in a specific angle",
|
|
7
8
|
requiresRTT: !0,
|
|
8
9
|
requiresChild: !0,
|
|
9
10
|
props: {
|
|
@@ -31,26 +32,26 @@ const I = {
|
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
},
|
|
34
|
-
fragmentNode: ({ uniforms:
|
|
35
|
-
const { vec2: l, vec4: u, float: e, screenUV: p, viewportSize: f, sin: g, cos: v, radians:
|
|
35
|
+
fragmentNode: ({ uniforms: s, childNode: a, onCleanup: d }) => {
|
|
36
|
+
const { vec2: l, vec4: u, float: e, screenUV: p, viewportSize: f, sin: g, cos: v, radians: b, Fn: x, convertToTexture: h } = q;
|
|
36
37
|
if (!a) return u(0, 0, 0, 0);
|
|
37
38
|
const t = h(a);
|
|
38
39
|
d(() => {
|
|
39
40
|
t?.renderTarget?.dispose && t.renderTarget.dispose();
|
|
40
41
|
});
|
|
41
|
-
const c =
|
|
42
|
-
return
|
|
43
|
-
const T = p, _ = l(1).div(f),
|
|
42
|
+
const c = b(s.angle.uniform), y = l(v(c), g(c));
|
|
43
|
+
return x(() => {
|
|
44
|
+
const T = p, _ = l(1).div(f), D = y.mul(s.intensity.uniform).mul(_).mul(2), n = u(0).toVar(), r = e(0).toVar();
|
|
44
45
|
for (let i = 0; i < 32; i++) {
|
|
45
|
-
const
|
|
46
|
-
n.assign(n.add(
|
|
46
|
+
const o = e(i).div(e(31)).sub(0.5).mul(2), m = e(1).div(e(2.506628)).mul(e(-0.5).mul(o).mul(o).div(e(0.64)).exp()), V = T.add(D.mul(o.mul(0.5))), B = t.sample(V).mul(m);
|
|
47
|
+
n.assign(n.add(B)), r.assign(r.add(m));
|
|
47
48
|
}
|
|
48
49
|
return n.div(r);
|
|
49
50
|
})();
|
|
50
51
|
}
|
|
51
52
|
};
|
|
52
|
-
var
|
|
53
|
+
var k = I;
|
|
53
54
|
export {
|
|
54
55
|
I as n,
|
|
55
|
-
|
|
56
|
+
k as t
|
|
56
57
|
};
|