shaders 2.2.11 → 2.2.14
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/{Blob-C0G0efjG.js → Blob-CzWSpVTR.js} +1 -1
- package/dist/core/{Checkerboard-BPkiSF5I.js → Checkerboard-B8CnUlbi.js} +1 -1
- package/dist/core/{CursorTrail-BeJGeovB.js → CursorTrail-BcaRHjU5.js} +1 -1
- package/dist/core/{Duotone-_nR_o3-g.js → Duotone-DGNEAlye.js} +1 -1
- package/dist/core/Godrays-D3VnYrAm.js +106 -0
- package/dist/core/{LinearGradient-LEMeW0KM.js → LinearGradient-DPe-Z-lw.js} +1 -1
- package/dist/core/{RadialGradient-D0cN67jm.js → RadialGradient-CbaCbOJj.js} +1 -1
- package/dist/core/{Ripples-DH71sFJc.js → Ripples-0Ufm3-fY.js} +9 -8
- package/dist/core/{SimplexNoise-DPGC2OPJ.js → SimplexNoise-BKB94dhx.js} +7 -6
- package/dist/core/Spherize-CqjZj4yV.js +104 -0
- package/dist/core/{Spiral-CcyI8azF.js → Spiral-BkzSmPUL.js} +1 -1
- package/dist/core/{Swirl-BpMwkNcm.js → Swirl-BHn9Ji7_.js} +1 -1
- package/dist/core/{Tritone-Dx48G3b1.js → Tritone-DrzxJUaq.js} +1 -1
- package/dist/core/colorMixing-C-FChLp0.js +22 -0
- package/dist/core/index.js +135 -133
- package/dist/core/shaderRegistry.d.ts.map +1 -1
- package/dist/core/shaders/Blob/index.js +2 -2
- package/dist/core/shaders/Checkerboard/index.js +2 -2
- package/dist/core/shaders/CursorTrail/index.js +2 -2
- package/dist/core/shaders/Duotone/index.js +2 -2
- package/dist/core/shaders/Godrays/index.d.ts.map +1 -1
- package/dist/core/shaders/Godrays/index.js +1 -1
- package/dist/core/shaders/LinearGradient/index.js +2 -2
- package/dist/core/shaders/RadialGradient/index.js +2 -2
- package/dist/core/shaders/Ripples/index.d.ts.map +1 -1
- package/dist/core/shaders/Ripples/index.js +4 -3
- package/dist/core/shaders/SimplexNoise/index.d.ts.map +1 -1
- package/dist/core/shaders/SimplexNoise/index.js +4 -3
- package/dist/core/shaders/Spherize/index.d.ts +62 -0
- package/dist/core/shaders/Spherize/index.d.ts.map +1 -0
- package/dist/core/shaders/Spherize/index.js +7 -0
- package/dist/core/shaders/Spiral/index.js +2 -2
- package/dist/core/shaders/Strands/index.js +1 -1
- package/dist/core/shaders/Stretch/index.js +1 -1
- package/dist/core/shaders/Swirl/index.js +2 -2
- package/dist/core/shaders/TiltShift/index.js +1 -1
- package/dist/core/shaders/Tritone/index.js +2 -2
- package/dist/core/shaders/Twirl/index.js +1 -1
- package/dist/core/shaders/Vibrance/index.js +1 -1
- package/dist/core/shaders/WaveDistortion/index.js +1 -1
- package/dist/core/shaders/ZoomBlur/index.js +1 -1
- package/dist/core/utilities/colorMixing.d.ts.map +1 -1
- package/dist/react/{generatePresetCode-CbulNGo3.js → generatePresetCode-BXrrE8g5.js} +9 -4
- package/dist/react/{generatePresetCode-ClK4i9O1.cjs → generatePresetCode-DWBlTzlt.cjs} +2 -2
- package/dist/react/index.cjs +71 -71
- package/dist/react/index.js +9016 -8795
- package/dist/react/utils/generatePresetCode.cjs +1 -1
- package/dist/react/utils/generatePresetCode.js +1 -1
- package/dist/registry.js +166 -0
- package/dist/svelte/components/Spherize.svelte.d.ts +19 -0
- package/dist/svelte/{generatePresetCode-CbulNGo3.js → generatePresetCode-BXrrE8g5.js} +9 -4
- package/dist/svelte/index.d.ts +1 -0
- package/dist/svelte/index.js +8244 -8064
- package/dist/svelte/utils/generatePresetCode.js +1 -1
- package/dist/vue/{generatePresetCode-Baa8DyZE.js → generatePresetCode-nej_B_Ke.js} +30 -25
- package/dist/vue/index.js +7848 -7646
- package/dist/vue/utils/generatePresetCode.js +1 -1
- package/package.json +6 -1
- package/dist/core/Godrays-cUzAKVXn.js +0 -106
- package/dist/core/colorMixing-DPZ-Td4U.js +0 -22
- /package/dist/core/{Strands-Co4fkc05.js → Strands-DyrV6zDO.js} +0 -0
- /package/dist/core/{Stretch-C8iYAgNS.js → Stretch-DeBlJ-NH.js} +0 -0
- /package/dist/core/{TiltShift-D31nakFq.js → TiltShift-DiArippe.js} +0 -0
- /package/dist/core/{Twirl-ng6pwyl2.js → Twirl-C6xj1p52.js} +0 -0
- /package/dist/core/{Vibrance-D0ArL0qp.js → Vibrance-C6lNgpWH.js} +0 -0
- /package/dist/core/{WaveDistortion-DGKrpUdb.js → WaveDistortion-DcXxPZ2w.js} +0 -0
- /package/dist/core/{ZoomBlur-uQyy5yko.js → ZoomBlur-_feIVJs6.js} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shaders",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.14",
|
|
4
4
|
"description": "Declarative shader components for Vue, React, and Svelte",
|
|
5
5
|
"author": "Simon Le Marchant<https://github.com/marchantweb>",
|
|
6
6
|
"homepage": "https://shaders.com/",
|
|
@@ -324,6 +324,11 @@
|
|
|
324
324
|
"types": "./dist/core/shaders/Stretch/index.d.ts",
|
|
325
325
|
"import": "./dist/core/shaders/Stretch/index.js",
|
|
326
326
|
"require": "./dist/core/shaders/Stretch/index.js"
|
|
327
|
+
},
|
|
328
|
+
"./core/Spherize": {
|
|
329
|
+
"types": "./dist/core/shaders/Spherize/index.d.ts",
|
|
330
|
+
"import": "./dist/core/shaders/Spherize/index.js",
|
|
331
|
+
"require": "./dist/core/shaders/Spherize/index.js"
|
|
327
332
|
}
|
|
328
333
|
},
|
|
329
334
|
"files": [
|
|
@@ -1,106 +0,0 @@
|
|
|
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
|
-
name: "Godrays",
|
|
6
|
-
category: "Base Layers",
|
|
7
|
-
description: "Volumetric light rays emanating from a point",
|
|
8
|
-
requiresRTT: !1,
|
|
9
|
-
acceptsUVContext: !0,
|
|
10
|
-
props: {
|
|
11
|
-
center: {
|
|
12
|
-
default: {
|
|
13
|
-
x: 0,
|
|
14
|
-
y: 0
|
|
15
|
-
},
|
|
16
|
-
transform: j,
|
|
17
|
-
description: "The center point of the god rays",
|
|
18
|
-
ui: {
|
|
19
|
-
type: "position",
|
|
20
|
-
label: "Center"
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
density: {
|
|
24
|
-
default: 0.3,
|
|
25
|
-
description: "Frequency of ray sectors",
|
|
26
|
-
ui: {
|
|
27
|
-
type: "range",
|
|
28
|
-
min: 0,
|
|
29
|
-
max: 1,
|
|
30
|
-
step: 0.01,
|
|
31
|
-
label: "Density"
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
intensity: {
|
|
35
|
-
default: 0.8,
|
|
36
|
-
description: "Ray visibility within sectors",
|
|
37
|
-
ui: {
|
|
38
|
-
type: "range",
|
|
39
|
-
min: 0,
|
|
40
|
-
max: 1,
|
|
41
|
-
step: 0.01,
|
|
42
|
-
label: "Intensity"
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
spotty: {
|
|
46
|
-
default: 1,
|
|
47
|
-
description: "Density of spots on rays (higher = more spots)",
|
|
48
|
-
ui: {
|
|
49
|
-
type: "range",
|
|
50
|
-
min: 0,
|
|
51
|
-
max: 1,
|
|
52
|
-
step: 0.01,
|
|
53
|
-
label: "Spotty"
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
speed: {
|
|
57
|
-
default: 0.5,
|
|
58
|
-
description: "Animation speed of the rays",
|
|
59
|
-
ui: {
|
|
60
|
-
type: "range",
|
|
61
|
-
min: 0,
|
|
62
|
-
max: 2,
|
|
63
|
-
step: 0.01,
|
|
64
|
-
label: "Speed"
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
rayColor: {
|
|
68
|
-
default: "#4283fb",
|
|
69
|
-
transform: _,
|
|
70
|
-
description: "Color of the light rays",
|
|
71
|
-
ui: {
|
|
72
|
-
type: "color",
|
|
73
|
-
label: "Ray Color"
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
backgroundColor: {
|
|
77
|
-
default: "transparent",
|
|
78
|
-
transform: _,
|
|
79
|
-
description: "Background color",
|
|
80
|
-
ui: {
|
|
81
|
-
type: "color",
|
|
82
|
-
label: "Background Color"
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
},
|
|
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);
|
|
92
|
-
return m(h(C(y), o), p, P(-0.15, 0.15, n.x));
|
|
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)));
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
var K = z;
|
|
103
|
-
export {
|
|
104
|
-
z as n,
|
|
105
|
-
K as t
|
|
106
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { k as L, m as f } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
-
f();
|
|
3
|
-
var { vec3: o, vec4: C, float: d, pow: r, sqrt: E, atan: G, cos: p, sin: A, mix: b } = L, h = (u) => o(u.x.mul(1.2249401).sub(u.y.mul(0.2249404)).sub(u.z.mul(0)), u.x.mul(-0.0420569).add(u.y.mul(1.0420571)).add(u.z.mul(0)), u.x.mul(-0.0196376).sub(u.y.mul(0.0786361)).add(u.z.mul(1.0982735))), i = (u) => o(u.x.mul(0.8224621).add(u.y.mul(0.177538)).add(u.z.mul(0)), u.x.mul(0.0331941).add(u.y.mul(0.9668058)).add(u.z.mul(0)), u.x.mul(0.0170826).add(u.y.mul(0.0723974)).add(u.z.mul(0.9105199))), _ = (u) => {
|
|
4
|
-
const m = u.x, l = u.y, s = u.z, c = m.mul(0.4122214708).add(l.mul(0.5363325363)).add(s.mul(0.0514459929)), e = m.mul(0.2119034982).add(l.mul(0.6806995451).add(s.mul(0.1073969566))), x = m.mul(0.0883024619).add(l.mul(0.2817188376)).add(s.mul(0.6299787005)), t = r(c, d(1 / 3)), a = r(e, d(1 / 3)), n = r(x, d(1 / 3));
|
|
5
|
-
return o(t.mul(0.2104542553).add(a.mul(0.793617785)).sub(n.mul(0.0040720468)), t.mul(1.9779984951).sub(a.mul(2.428592205)).add(n.mul(0.4505937099)), t.mul(0.0259040371).add(a.mul(0.7827717662)).sub(n.mul(0.808675766)));
|
|
6
|
-
}, v = (u) => {
|
|
7
|
-
const m = u.x, l = u.y, s = u.z, c = m.add(l.mul(0.3963377774)).add(s.mul(0.2158037573)), e = m.sub(l.mul(0.1055613458)).sub(s.mul(0.0638541728)), x = m.sub(l.mul(0.0894841775)).sub(s.mul(1.291485548)), t = r(c, d(3)), a = r(e, d(3)), n = r(x, d(3));
|
|
8
|
-
return o(t.mul(4.0767416621).sub(a.mul(3.3077115913)).add(n.mul(0.2309699292)), t.mul(-1.2684380046).add(a.mul(2.6097574011)).sub(n.mul(0.3413193965)), t.mul(-0.0041960863).sub(a.mul(0.7034186147)).add(n.mul(1.707614701)));
|
|
9
|
-
}, T = (u) => {
|
|
10
|
-
const m = u.x, l = u.y, s = u.z;
|
|
11
|
-
return o(m, E(l.mul(l).add(s.mul(s))), G(s, l));
|
|
12
|
-
}, H = (u) => {
|
|
13
|
-
const m = u.x, l = u.y, s = u.z;
|
|
14
|
-
return o(m, l.mul(p(s)), l.mul(A(s)));
|
|
15
|
-
};
|
|
16
|
-
const P = (u, m, l, s) => {
|
|
17
|
-
const c = o(u.x, u.y, u.z), e = o(m.x, m.y, m.z), x = u.w, t = m.w, a = b(c, e, l), n = h(c), R = h(e), z = _(n), k = _(R), O = i(v(H(b(T(z), T(k), l)))), q = i(v(b(z, k, l))), w = s.greaterThanEqual(d(0.5)), y = s.greaterThanEqual(d(1.5)).select(q, w.select(O, a)), B = b(x, t, l);
|
|
18
|
-
return C(y.x, y.y, y.z, B);
|
|
19
|
-
};
|
|
20
|
-
export {
|
|
21
|
-
P as t
|
|
22
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|