shaders 2.2.10 → 2.2.12
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/DiffuseBlur-Dq_vFrB1.js +70 -0
- package/dist/core/Godrays-D3VnYrAm.js +106 -0
- package/dist/core/Spherize-CqjZj4yV.js +104 -0
- package/dist/core/index.js +127 -125
- package/dist/core/shaderRegistry.d.ts.map +1 -1
- package/dist/core/shaders/DiffuseBlur/index.d.ts +7 -0
- package/dist/core/shaders/DiffuseBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/DiffuseBlur/index.js +3 -1
- package/dist/core/shaders/Godrays/index.d.ts.map +1 -1
- package/dist/core/shaders/Godrays/index.js +1 -1
- 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 +1 -1
- 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 +1 -1
- package/dist/core/shaders/TiltShift/index.js +1 -1
- package/dist/core/shaders/Tritone/index.js +1 -1
- 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/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 +84 -84
- package/dist/react/index.js +10964 -10715
- package/dist/react/utils/generatePresetCode.cjs +1 -1
- package/dist/react/utils/generatePresetCode.js +1 -1
- package/dist/registry.js +220 -2
- 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 +11152 -10944
- 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 +10418 -10187
- package/dist/vue/utils/generatePresetCode.js +1 -1
- package/package.json +6 -1
- package/dist/core/DiffuseBlur-BdGvOoBw.js +0 -40
- package/dist/core/Godrays-cUzAKVXn.js +0 -106
- /package/dist/core/{Spiral-CcyI8azF.js → Spiral-BRrismPI.js} +0 -0
- /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/{Swirl-BpMwkNcm.js → Swirl-PxpHzkdC.js} +0 -0
- /package/dist/core/{TiltShift-D31nakFq.js → TiltShift-DiArippe.js} +0 -0
- /package/dist/core/{Tritone-Dx48G3b1.js → Tritone-KtJgZviA.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.12",
|
|
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,40 +0,0 @@
|
|
|
1
|
-
import { k as R, m as V } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
-
V();
|
|
3
|
-
const k = {
|
|
4
|
-
name: "DiffuseBlur",
|
|
5
|
-
category: "Blurs",
|
|
6
|
-
description: "Soft focus blur using stochastic sampling",
|
|
7
|
-
requiresRTT: !0,
|
|
8
|
-
requiresChild: !0,
|
|
9
|
-
props: { intensity: {
|
|
10
|
-
default: 30,
|
|
11
|
-
description: "Intensity of the diffuse blur effect",
|
|
12
|
-
ui: {
|
|
13
|
-
type: "range",
|
|
14
|
-
min: 0,
|
|
15
|
-
max: 100,
|
|
16
|
-
step: 1,
|
|
17
|
-
label: "Intensity"
|
|
18
|
-
}
|
|
19
|
-
} },
|
|
20
|
-
fragmentNode: ({ uniforms: p, childNode: o, onCleanup: g }) => {
|
|
21
|
-
const { vec2: e, vec4: i, float: s, screenUV: v, convertToTexture: x, viewportSize: h, fract: T, sin: u, cos: y, dot: _, Fn: b } = R;
|
|
22
|
-
if (!o) return i(0, 0, 0, 0);
|
|
23
|
-
const n = x(o);
|
|
24
|
-
return g(() => {
|
|
25
|
-
n?.renderTarget?.dispose && n.renderTarget.dispose();
|
|
26
|
-
}), b(() => {
|
|
27
|
-
const a = v, S = p.intensity.uniform.mul(1), q = e(1).div(h), l = (t) => T(u(_(t, e(12.9898, 78.233).mul(2))).mul(43758.5453)), r = i(0).toVar(), c = 16;
|
|
28
|
-
for (let t = 0; t < c; t++) {
|
|
29
|
-
const d = a.mul(1e3).add(e(s(t * 11.7), s(t * 5.3))), B = l(d), C = l(d.add(e(73.2, 41.9))), f = B.mul(6.28318530718), m = C.sqrt().mul(S), D = e(y(f).mul(m), u(f).mul(m)).mul(q.x), z = a.add(D), I = n.sample(z);
|
|
30
|
-
r.assign(r.add(I));
|
|
31
|
-
}
|
|
32
|
-
return r.div(s(c));
|
|
33
|
-
})();
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
var F = k;
|
|
37
|
-
export {
|
|
38
|
-
k as n,
|
|
39
|
-
F as t
|
|
40
|
-
};
|
|
@@ -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
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|