shaders 2.2.9 → 2.2.11
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/index.js +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/react/index.cjs +32 -32
- package/dist/react/index.js +1100 -1072
- package/dist/registry.js +54 -2
- package/dist/svelte/index.js +1626 -1598
- package/dist/vue/index.js +695 -666
- package/package.json +1 -1
- package/dist/core/DiffuseBlur-BdGvOoBw.js +0 -40
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { k as v, m as _ } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
+
import { t as w } from "./edges-B-tVdqcI.js";
|
|
3
|
+
import { a as S } from "./transformations-DBjTkQ5b.js";
|
|
4
|
+
_();
|
|
5
|
+
const z = {
|
|
6
|
+
name: "DiffuseBlur",
|
|
7
|
+
category: "Blurs",
|
|
8
|
+
description: "Grain-like pixel displacement at random",
|
|
9
|
+
requiresRTT: !0,
|
|
10
|
+
requiresChild: !0,
|
|
11
|
+
props: {
|
|
12
|
+
intensity: {
|
|
13
|
+
default: 30,
|
|
14
|
+
description: "Intensity of the diffuse blur effect",
|
|
15
|
+
ui: {
|
|
16
|
+
type: "range",
|
|
17
|
+
min: 0,
|
|
18
|
+
max: 100,
|
|
19
|
+
step: 1,
|
|
20
|
+
label: "Intensity"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
edges: {
|
|
24
|
+
default: "stretch",
|
|
25
|
+
description: "How to handle edges when distortion pushes content out of bounds",
|
|
26
|
+
transform: S,
|
|
27
|
+
ui: {
|
|
28
|
+
type: "select",
|
|
29
|
+
options: [
|
|
30
|
+
{
|
|
31
|
+
label: "Stretch",
|
|
32
|
+
value: "stretch"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
label: "Transparent",
|
|
36
|
+
value: "transparent"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
label: "Mirror",
|
|
40
|
+
value: "mirror"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
label: "Wrap",
|
|
44
|
+
value: "wrap"
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
label: "Edges"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
uvTransformNode: ({ uv: r, uniforms: s, viewportSize: l }) => {
|
|
52
|
+
const { vec2: e, fract: u, sin: d, dot: c } = v, n = (i) => u(d(c(i, e(12.9898, 78.233).mul(2))).mul(43758.5453)), m = e(1).div(l), o = r.mul(1e3), f = n(o), t = n(o.add(e(73.2, 41.9))), a = e(f.mul(2).sub(1), t.mul(2).sub(1)).mul(s.intensity.uniform).mul(m);
|
|
53
|
+
return r.add(a);
|
|
54
|
+
},
|
|
55
|
+
fragmentNode: ({ uniforms: r, childNode: s, onCleanup: l }) => {
|
|
56
|
+
const { vec2: e, vec4: u, screenUV: d, convertToTexture: c, viewportSize: n, fract: m, sin: o, dot: f } = v;
|
|
57
|
+
if (!s) return u(0, 0, 0, 0);
|
|
58
|
+
const t = c(s);
|
|
59
|
+
l(() => {
|
|
60
|
+
t?.renderTarget?.dispose && t.renderTarget.dispose();
|
|
61
|
+
});
|
|
62
|
+
const a = (x) => m(o(f(x, e(12.9898, 78.233).mul(2))).mul(43758.5453)), i = d, b = e(1).div(n), p = i.mul(1e3), g = a(p), y = a(p.add(e(73.2, 41.9))), T = e(g.mul(2).sub(1), y.mul(2).sub(1)).mul(r.intensity.uniform).mul(b), h = i.add(T);
|
|
63
|
+
return w(h, t.sample(h), t, r.edges.uniform);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
var k = z;
|
|
67
|
+
export {
|
|
68
|
+
z as n,
|
|
69
|
+
k as t
|
|
70
|
+
};
|
package/dist/core/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import { n as ht } from "./ChromaticAberration-nVg3r1FK.js";
|
|
|
15
15
|
import { n as pt } from "./Circle-C8ltF4BZ.js";
|
|
16
16
|
import { n as gt } from "./CRTScreen-cJ3XHrI9.js";
|
|
17
17
|
import { n as bt } from "./CursorTrail-BeJGeovB.js";
|
|
18
|
-
import { n as vt } from "./DiffuseBlur-
|
|
18
|
+
import { n as vt } from "./DiffuseBlur-Dq_vFrB1.js";
|
|
19
19
|
import { n as Ct } from "./Dither-CpN3vGSh.js";
|
|
20
20
|
import { n as Rt } from "./DotGrid-BFUzeSQw.js";
|
|
21
21
|
import { n as Tt } from "./Duotone-_nR_o3-g.js";
|
|
@@ -8,6 +8,13 @@ export interface ComponentProps {
|
|
|
8
8
|
* @default 30
|
|
9
9
|
*/
|
|
10
10
|
intensity: number;
|
|
11
|
+
/**
|
|
12
|
+
* How to handle edges when distortion pushes content out of bounds
|
|
13
|
+
*
|
|
14
|
+
* Accepts one of: `"stretch"`, `"transparent"`, `"mirror"`, `"wrap"`.
|
|
15
|
+
* @default "stretch"
|
|
16
|
+
*/
|
|
17
|
+
edges: string;
|
|
11
18
|
}
|
|
12
19
|
export declare const componentDefinition: ComponentDefinition<ComponentProps>;
|
|
13
20
|
export default componentDefinition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/DiffuseBlur/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/DiffuseBlur/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAwC,MAAM,iBAAiB,CAAA;AAO1F,MAAM,WAAW,cAAc;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;CAChB;AAED,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,CAAC,cAAc,CA4HnE,CAAA;AAED,eAAe,mBAAmB,CAAA"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import "../../three.tsl-BqgDcRt9.js";
|
|
2
|
-
import
|
|
2
|
+
import "../../edges-B-tVdqcI.js";
|
|
3
|
+
import "../../transformations-DBjTkQ5b.js";
|
|
4
|
+
import { n as e, t as f } from "../../DiffuseBlur-Dq_vFrB1.js";
|
|
3
5
|
export {
|
|
4
6
|
e as componentDefinition,
|
|
5
7
|
f as default
|