@tresjs/post-processing 2.1.0 → 2.3.0
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/pmndrs/BloomPmndrs.vue.d.ts +1 -1
- package/dist/core/pmndrs/BrightnessContrastPmndrs.vue.d.ts +20 -0
- package/dist/core/pmndrs/ColorDepthPmndrs.vue.d.ts +20 -0
- package/dist/core/pmndrs/DepthOfFieldPmndrs.vue.d.ts +1 -1
- package/dist/core/pmndrs/DepthPickingPassPmndrs.vue.d.ts +18 -0
- package/dist/core/pmndrs/FishEyePmndrs.vue.d.ts +30 -0
- package/dist/core/pmndrs/GodRaysPmndrs.vue.d.ts +65 -0
- package/dist/core/pmndrs/GridPmndrs.vue.d.ts +20 -0
- package/dist/core/pmndrs/OutlinePmndrs.vue.d.ts +0 -3
- package/dist/core/pmndrs/composables/useEffectPmndrs.d.ts +6 -1
- package/dist/core/pmndrs/custom/fish-eye/index.d.ts +44 -0
- package/dist/core/pmndrs/index.d.ts +7 -1
- package/dist/core/three/composables/useEffect.d.ts +2 -1
- package/dist/tres-post-processing.js +810 -491
- package/dist/tres-post-processing.umd.cjs +38 -16
- package/dist/util/prop.d.ts +1 -1
- package/package.json +6 -4
|
@@ -1,46 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* name: @tresjs/post-processing
|
|
3
|
-
* version: v2.
|
|
3
|
+
* version: v2.3.0
|
|
4
4
|
* (c) 2025
|
|
5
5
|
* description: Post-processing library for TresJS
|
|
6
6
|
* author: Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
9
|
-
import { EffectComposer as
|
|
10
|
-
import { useTresContext as
|
|
11
|
-
import { HalfFloatType as
|
|
12
|
-
import { useDevicePixelRatio as
|
|
13
|
-
|
|
14
|
-
if (!e)
|
|
15
|
-
return;
|
|
16
|
-
const t = Array.isArray(e) ? e : e.match(Oe);
|
|
17
|
-
return t == null ? void 0 : t.reduce((o, a) => o && o[a], r);
|
|
18
|
-
}, xe = (r, e, t) => {
|
|
19
|
-
const o = Array.isArray(e) ? e : e.match(Oe);
|
|
20
|
-
o && o.reduce((a, s, i) => (a[s] === void 0 && (a[s] = {}), i === o.length - 1 && (a[s] = t), a[s]), r);
|
|
21
|
-
}, $ = (r, e) => {
|
|
22
|
-
const t = { ...r };
|
|
23
|
-
return e.forEach((o) => delete t[o]), t;
|
|
24
|
-
}, ee = (r, e, t, o, a = {}) => C(r, (s) => {
|
|
25
|
-
var i;
|
|
26
|
-
if (e.value)
|
|
27
|
-
if (s === void 0) {
|
|
28
|
-
const n = o();
|
|
29
|
-
xe(e.value, t, dt(n, t)), (i = n.dispose) == null || i.call(n);
|
|
30
|
-
} else
|
|
31
|
-
xe(e.value, t, r());
|
|
32
|
-
}, a), g = (r, e, t) => r.map(([o, a]) => ee(
|
|
33
|
-
o,
|
|
34
|
-
e,
|
|
35
|
-
a,
|
|
36
|
-
t
|
|
37
|
-
)), U = (r, e, t) => Object.keys(r).map((o) => ee(
|
|
38
|
-
() => r[o],
|
|
39
|
-
e,
|
|
40
|
-
o,
|
|
41
|
-
t
|
|
42
|
-
));
|
|
43
|
-
class be {
|
|
8
|
+
import { defineComponent as u, shallowRef as W, provide as Be, computed as O, watch as S, onUnmounted as U, renderSlot as Ne, inject as te, watchEffect as x, nextTick as oe, toRaw as ie } from "vue";
|
|
9
|
+
import { EffectComposer as ne, RenderPass as Ie, NormalPass as je, DepthDownsamplingPass as Ve, EffectPass as Ye, BloomEffect as le, DepthOfFieldEffect as ue, GlitchEffect as X, GlitchMode as ke, NoiseEffect as ce, OutlineEffect as de, PixelationEffect as fe, VignetteEffect as he, Effect as q, BlendFunction as Q, ToneMappingEffect as pe, ChromaticAberrationEffect as K, HueSaturationEffect as me, ScanlineEffect as J, ColorAverageEffect as Z, LensDistortionEffect as ge, ShockWaveEffect as ve, TiltShiftEffect as xe, DotScreenEffect as be, SepiaEffect as Se, DepthPickingPass as qe, GodRaysEffect as _, ColorDepthEffect as I, GridEffect as we, BrightnessContrastEffect as Ae } from "postprocessing";
|
|
10
|
+
import { useTresContext as y, useLoop as G, normalizeColor as $ } from "@tresjs/core";
|
|
11
|
+
import { HalfFloatType as T, Uniform as M, Vector2 as d, Vector3 as L, OrthographicCamera as Qe, BufferGeometry as Ke, Float32BufferAttribute as ye, Mesh as Je, ShaderMaterial as A, UniformsUtils as P, WebGLRenderTarget as D, NoBlending as Ze, Clock as _e, Color as k, MathUtils as w, DataTexture as $e, RedFormat as et, FloatType as tt, MeshNormalMaterial as ot, NearestFilter as F, DepthTexture as st, Vector4 as at, RawShaderMaterial as rt, ColorManagement as it, SRGBTransfer as nt, LinearToneMapping as lt, ReinhardToneMapping as ut, CineonToneMapping as ct, ACESFilmicToneMapping as dt, AgXToneMapping as ft, NeutralToneMapping as ht, CustomToneMapping as pt, Texture as Me, LinearFilter as mt, AdditiveBlending as gt, MeshBasicMaterial as vt } from "three";
|
|
12
|
+
import { useDevicePixelRatio as ze } from "@vueuse/core";
|
|
13
|
+
class Te {
|
|
44
14
|
static isWebGL2Available() {
|
|
45
15
|
try {
|
|
46
16
|
const e = document.createElement("canvas");
|
|
@@ -68,9 +38,9 @@ class be {
|
|
|
68
38
|
1: window.WebGLRenderingContext,
|
|
69
39
|
2: window.WebGL2RenderingContext
|
|
70
40
|
};
|
|
71
|
-
let
|
|
72
|
-
const
|
|
73
|
-
return
|
|
41
|
+
let s = 'Your $0 does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#000">$1</a>';
|
|
42
|
+
const a = document.createElement("div");
|
|
43
|
+
return a.id = "webglmessage", a.style.fontFamily = "monospace", a.style.fontSize = "13px", a.style.fontWeight = "normal", a.style.textAlign = "center", a.style.background = "#fff", a.style.color = "#000", a.style.padding = "1.5em", a.style.width = "400px", a.style.margin = "5em auto 0", o[e] ? s = s.replace("$0", "graphics card") : s = s.replace("$0", "browser"), s = s.replace("$1", t[e]), a.innerHTML = s, a;
|
|
74
44
|
}
|
|
75
45
|
// @deprecated, r168
|
|
76
46
|
static isWebGLAvailable() {
|
|
@@ -86,7 +56,7 @@ class be {
|
|
|
86
56
|
return console.warn("getWebGLErrorMessage() has been deprecated and will be removed in r178. Use getWebGL2ErrorMessage() instead."), this.getErrorMessage(1);
|
|
87
57
|
}
|
|
88
58
|
}
|
|
89
|
-
const
|
|
59
|
+
const se = Symbol("effectComposerPmndrs"), Ut = /* @__PURE__ */ u({
|
|
90
60
|
__name: "EffectComposerPmndrs",
|
|
91
61
|
props: {
|
|
92
62
|
enabled: { type: Boolean, default: !0 },
|
|
@@ -96,65 +66,109 @@ const Re = Symbol("effectComposerPmndrs"), Lt = /* @__PURE__ */ c({
|
|
|
96
66
|
resolutionScale: {},
|
|
97
67
|
autoClear: { type: Boolean, default: !0 },
|
|
98
68
|
multisampling: { default: 0 },
|
|
99
|
-
frameBufferType: { default:
|
|
69
|
+
frameBufferType: { default: T }
|
|
100
70
|
},
|
|
101
71
|
emits: ["render"],
|
|
102
72
|
setup(r, { expose: e, emit: t }) {
|
|
103
|
-
const o = r,
|
|
104
|
-
let
|
|
105
|
-
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
normalBuffer:
|
|
73
|
+
const o = r, s = t, { scene: a, camera: i, renderer: n, sizes: l, render: p } = y(), f = W(null);
|
|
74
|
+
let g = null, c = null;
|
|
75
|
+
Be(se, f), e({ composer: f });
|
|
76
|
+
const b = () => {
|
|
77
|
+
f.value && (c = new je(a.value, i.value), c.enabled = !1, f.value.addPass(c), o.resolutionScale !== void 0 && Te.isWebGL2Available() && (g = new Ve({
|
|
78
|
+
normalBuffer: c.texture,
|
|
109
79
|
resolutionScale: o.resolutionScale
|
|
110
|
-
}),
|
|
111
|
-
},
|
|
112
|
-
const
|
|
113
|
-
depthBuffer: o.depthBuffer !== void 0 ? o.depthBuffer :
|
|
114
|
-
stencilBuffer: o.stencilBuffer !== void 0 ? o.stencilBuffer :
|
|
115
|
-
multisampling:
|
|
116
|
-
frameBufferType: o.frameBufferType !== void 0 ? o.frameBufferType :
|
|
80
|
+
}), g.enabled = !1, f.value.addPass(g)));
|
|
81
|
+
}, E = O(() => {
|
|
82
|
+
const v = new ne(), z = {
|
|
83
|
+
depthBuffer: o.depthBuffer !== void 0 ? o.depthBuffer : v.inputBuffer.depthBuffer,
|
|
84
|
+
stencilBuffer: o.stencilBuffer !== void 0 ? o.stencilBuffer : v.inputBuffer.stencilBuffer,
|
|
85
|
+
multisampling: Te.isWebGL2Available() ? o.multisampling !== void 0 ? o.multisampling : v.multisampling : 0,
|
|
86
|
+
frameBufferType: o.frameBufferType !== void 0 ? o.frameBufferType : T
|
|
117
87
|
};
|
|
118
|
-
return
|
|
119
|
-
}),
|
|
120
|
-
var
|
|
121
|
-
!n.value && !
|
|
88
|
+
return v.dispose(), z;
|
|
89
|
+
}), re = () => {
|
|
90
|
+
var v;
|
|
91
|
+
!n.value && !a.value && !i.value || ((v = f.value) == null || v.dispose(), f.value = new ne(n.value, E.value), f.value.addPass(new Ie(a.value, i.value)), o.disableNormalPass || b());
|
|
122
92
|
};
|
|
123
|
-
|
|
124
|
-
!l.width.value || !l.height.value ||
|
|
125
|
-
}),
|
|
126
|
-
!
|
|
93
|
+
S([n, a, i, () => o.disableNormalPass], () => {
|
|
94
|
+
!l.width.value || !l.height.value || re();
|
|
95
|
+
}), S(() => [l.width.value, l.height.value], ([v, z]) => {
|
|
96
|
+
!v && !z || (f.value ? f.value.setSize(v, z) : re());
|
|
127
97
|
}, {
|
|
128
98
|
immediate: !0
|
|
129
99
|
});
|
|
130
|
-
const { render:
|
|
131
|
-
return
|
|
132
|
-
if (o.enabled && n.value &&
|
|
133
|
-
const
|
|
134
|
-
n.value.autoClear = o.autoClear, o.stencilBuffer && !o.autoClear && n.value.clearStencil(),
|
|
100
|
+
const { render: Xe } = G();
|
|
101
|
+
return Xe(() => {
|
|
102
|
+
if (o.enabled && n.value && f.value && l.width.value && l.height.value && p.frames.value > 0) {
|
|
103
|
+
const v = n.value.autoClear;
|
|
104
|
+
n.value.autoClear = o.autoClear, o.stencilBuffer && !o.autoClear && n.value.clearStencil(), f.value.render(), s("render", f.value), n.value.autoClear = v;
|
|
135
105
|
}
|
|
136
|
-
|
|
137
|
-
}),
|
|
138
|
-
var
|
|
139
|
-
(
|
|
140
|
-
}), (
|
|
141
|
-
}
|
|
142
|
-
}), h = (r, e) => {
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
|
|
106
|
+
p.frames.value = p.mode.value === "always" ? 1 : Math.max(0, p.frames.value - 1);
|
|
107
|
+
}), U(() => {
|
|
108
|
+
var v;
|
|
109
|
+
(v = f.value) == null || v.dispose();
|
|
110
|
+
}), (v, z) => Ne(v.$slots, "default");
|
|
111
|
+
}
|
|
112
|
+
}), h = (r, e, t) => {
|
|
113
|
+
const o = te(se), s = W(null), a = W(null), { scene: i, camera: n, invalidate: l } = y();
|
|
114
|
+
S(e, () => l());
|
|
115
|
+
const p = () => {
|
|
116
|
+
var c, b, E;
|
|
117
|
+
s.value && ((c = o == null ? void 0 : o.value) == null || c.removePass(s.value)), (b = a.value) == null || b.dispose(), (E = s.value) == null || E.dispose();
|
|
118
|
+
}, f = (c) => {
|
|
119
|
+
!n.value || !(o != null && o.value) || !i.value || (a.value = r(), s.value = new Ye(n.value, a.value), o.value.addPass(s.value, c));
|
|
120
|
+
};
|
|
121
|
+
t && S(
|
|
122
|
+
() => t.map((c) => e[c]),
|
|
123
|
+
() => {
|
|
124
|
+
var b;
|
|
125
|
+
if (!(o != null && o.value))
|
|
126
|
+
return;
|
|
127
|
+
const c = (b = o.value) == null ? void 0 : b.passes.findIndex((E) => E === s.value);
|
|
128
|
+
~c && (p(), f(c));
|
|
129
|
+
}
|
|
130
|
+
), x(() => {
|
|
131
|
+
!n.value || !(a != null && a.value) || (a.value.mainCamera = n.value);
|
|
146
132
|
});
|
|
147
|
-
const
|
|
148
|
-
!
|
|
133
|
+
const g = x(() => {
|
|
134
|
+
!n.value || !(o != null && o.value) || !i.value || (oe(() => g()), !a.value && f());
|
|
149
135
|
});
|
|
150
|
-
return
|
|
151
|
-
|
|
152
|
-
o.value && ((x = t == null ? void 0 : t.value) == null || x.removePass(o.value)), (u = a.value) == null || u.dispose(), (p = o.value) == null || p.dispose();
|
|
136
|
+
return U(() => {
|
|
137
|
+
p();
|
|
153
138
|
}), {
|
|
154
|
-
pass:
|
|
139
|
+
pass: s,
|
|
155
140
|
effect: a
|
|
156
141
|
};
|
|
157
|
-
},
|
|
142
|
+
}, We = /([^[.\]])+/g, xt = (r, e) => {
|
|
143
|
+
if (!e)
|
|
144
|
+
return;
|
|
145
|
+
const t = Array.isArray(e) ? e : e.match(We);
|
|
146
|
+
return t == null ? void 0 : t.reduce((o, s) => o && o[s], r);
|
|
147
|
+
}, Ce = (r, e, t) => {
|
|
148
|
+
const o = Array.isArray(e) ? e : e.match(We);
|
|
149
|
+
o && o.reduce((s, a, i) => (s[a] === void 0 && (s[a] = {}), i === o.length - 1 && (s[a] = t), s[a]), r);
|
|
150
|
+
}, bt = (r, e) => {
|
|
151
|
+
const t = { ...r };
|
|
152
|
+
return e.forEach((o) => delete t[o]), t;
|
|
153
|
+
}, H = (r, e, t, o, s = {}) => S(r, (a) => {
|
|
154
|
+
var i;
|
|
155
|
+
if (e.value)
|
|
156
|
+
if (a === void 0) {
|
|
157
|
+
const n = o();
|
|
158
|
+
Ce(e.value, t, xt(n, t)), (i = n.dispose) == null || i.call(n);
|
|
159
|
+
} else
|
|
160
|
+
Ce(e.value, t, r());
|
|
161
|
+
}, s), m = (r, e, t) => r.map(([o, s]) => H(
|
|
162
|
+
o,
|
|
163
|
+
e,
|
|
164
|
+
s,
|
|
165
|
+
t
|
|
166
|
+
)), ae = (r, e, t) => Object.keys(r).map((o) => H(
|
|
167
|
+
() => r[o],
|
|
168
|
+
e,
|
|
169
|
+
o,
|
|
170
|
+
t
|
|
171
|
+
)), Gt = /* @__PURE__ */ u({
|
|
158
172
|
__name: "BloomPmndrs",
|
|
159
173
|
props: {
|
|
160
174
|
blendFunction: {},
|
|
@@ -165,21 +179,21 @@ const Re = Symbol("effectComposerPmndrs"), Lt = /* @__PURE__ */ c({
|
|
|
165
179
|
mipmapBlur: { type: Boolean, default: void 0 }
|
|
166
180
|
},
|
|
167
181
|
setup(r, { expose: e }) {
|
|
168
|
-
const t = r, { pass: o, effect:
|
|
169
|
-
return e({ pass: o, effect:
|
|
182
|
+
const t = r, { pass: o, effect: s } = h(() => new le(t), t, ["mipmapBlur"]);
|
|
183
|
+
return e({ pass: o, effect: s }), m(
|
|
170
184
|
[
|
|
171
|
-
|
|
185
|
+
[() => t.blendFunction, "blendMode.blendFunction"],
|
|
172
186
|
[() => t.intensity, "intensity"],
|
|
173
187
|
[() => t.kernelSize, "kernelSize"],
|
|
174
188
|
[() => t.luminanceSmoothing, "luminanceMaterial.smoothing"],
|
|
175
189
|
[() => t.luminanceThreshold, "luminanceMaterial.threshold"]
|
|
176
190
|
],
|
|
177
|
-
|
|
178
|
-
() => new
|
|
191
|
+
s,
|
|
192
|
+
() => new le()
|
|
179
193
|
), () => {
|
|
180
194
|
};
|
|
181
195
|
}
|
|
182
|
-
}),
|
|
196
|
+
}), Ht = /* @__PURE__ */ u({
|
|
183
197
|
__name: "DepthOfFieldPmndrs",
|
|
184
198
|
props: {
|
|
185
199
|
blendFunction: {},
|
|
@@ -193,10 +207,10 @@ const Re = Symbol("effectComposerPmndrs"), Lt = /* @__PURE__ */ c({
|
|
|
193
207
|
resolutionY: {}
|
|
194
208
|
},
|
|
195
209
|
setup(r, { expose: e }) {
|
|
196
|
-
const t = r, { camera: o } =
|
|
197
|
-
return e({ pass:
|
|
210
|
+
const t = r, { camera: o } = y(), { pass: s, effect: a } = h(() => new ue(o.value, t), t);
|
|
211
|
+
return e({ pass: s, effect: a }), m(
|
|
198
212
|
[
|
|
199
|
-
|
|
213
|
+
[() => t.blendFunction, "blendMode.blendFunction"],
|
|
200
214
|
[() => t.worldFocusDistance, "circleOfConfusionMaterial.worldFocusDistance"],
|
|
201
215
|
[() => t.focusDistance, "circleOfConfusionMaterial.focusDistance"],
|
|
202
216
|
[() => t.worldFocusRange, "circleOfConfusionMaterial.worldFocusRange"],
|
|
@@ -206,12 +220,12 @@ const Re = Symbol("effectComposerPmndrs"), Lt = /* @__PURE__ */ c({
|
|
|
206
220
|
[() => t.resolutionX, "resolution.width"],
|
|
207
221
|
[() => t.resolutionY, "resolution.height"]
|
|
208
222
|
],
|
|
209
|
-
|
|
210
|
-
() => new
|
|
223
|
+
a,
|
|
224
|
+
() => new ue()
|
|
211
225
|
), () => {
|
|
212
226
|
};
|
|
213
227
|
}
|
|
214
|
-
}),
|
|
228
|
+
}), Xt = /* @__PURE__ */ u({
|
|
215
229
|
__name: "GlitchPmndrs",
|
|
216
230
|
props: {
|
|
217
231
|
blendFunction: {},
|
|
@@ -227,42 +241,50 @@ const Re = Symbol("effectComposerPmndrs"), Lt = /* @__PURE__ */ c({
|
|
|
227
241
|
dtSize: {}
|
|
228
242
|
},
|
|
229
243
|
setup(r, { expose: e }) {
|
|
230
|
-
const t = r, { pass: o, effect:
|
|
231
|
-
e({ pass: o, effect:
|
|
232
|
-
const { onBeforeRender:
|
|
233
|
-
return
|
|
244
|
+
const t = r, { pass: o, effect: s } = h(() => new X(t), t, ["dtSize"]);
|
|
245
|
+
e({ pass: o, effect: s });
|
|
246
|
+
const { onBeforeRender: a } = G();
|
|
247
|
+
return a(({ invalidate: i }) => i()), x(() => {
|
|
234
248
|
const i = () => {
|
|
235
249
|
if (t.mode !== void 0)
|
|
236
|
-
return t.active === !1 ?
|
|
237
|
-
const n = new
|
|
250
|
+
return t.active === !1 ? ke.DISABLED : t.mode;
|
|
251
|
+
const n = new X(), l = n.mode;
|
|
238
252
|
return n.dispose(), l;
|
|
239
253
|
};
|
|
240
|
-
|
|
241
|
-
}),
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
254
|
+
s.value && (s.value.mode = i());
|
|
255
|
+
}), H(
|
|
256
|
+
() => t.blendFunction,
|
|
257
|
+
s,
|
|
258
|
+
"blendMode.blendFunction",
|
|
259
|
+
() => new X()
|
|
260
|
+
), ae(
|
|
261
|
+
bt(t, ["active", "blendFunction"]),
|
|
262
|
+
s,
|
|
263
|
+
() => new X()
|
|
245
264
|
), () => {
|
|
246
265
|
};
|
|
247
266
|
}
|
|
248
|
-
}),
|
|
267
|
+
}), It = /* @__PURE__ */ u({
|
|
249
268
|
__name: "NoisePmndrs",
|
|
250
269
|
props: {
|
|
251
270
|
premultiply: { type: Boolean, default: void 0 },
|
|
252
271
|
blendFunction: {}
|
|
253
272
|
},
|
|
254
273
|
setup(r, { expose: e }) {
|
|
255
|
-
const t = r, { pass: o, effect:
|
|
256
|
-
e({ pass: o, effect:
|
|
257
|
-
const { onBeforeRender:
|
|
258
|
-
return
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
274
|
+
const t = r, { pass: o, effect: s } = h(() => new ce(t), t);
|
|
275
|
+
e({ pass: o, effect: s });
|
|
276
|
+
const { onBeforeRender: a } = G();
|
|
277
|
+
return a(({ invalidate: i }) => i()), m(
|
|
278
|
+
[
|
|
279
|
+
[() => t.blendFunction, "blendMode.blendFunction"],
|
|
280
|
+
[() => t.premultiply, "premultiply"]
|
|
281
|
+
],
|
|
282
|
+
s,
|
|
283
|
+
() => new ce()
|
|
262
284
|
), () => {
|
|
263
285
|
};
|
|
264
286
|
}
|
|
265
|
-
}),
|
|
287
|
+
}), jt = /* @__PURE__ */ u({
|
|
266
288
|
__name: "OutlinePmndrs",
|
|
267
289
|
props: {
|
|
268
290
|
outlinedObjects: {},
|
|
@@ -282,46 +304,48 @@ const Re = Symbol("effectComposerPmndrs"), Lt = /* @__PURE__ */ c({
|
|
|
282
304
|
visibleEdgeColor: {}
|
|
283
305
|
},
|
|
284
306
|
setup(r, { expose: e }) {
|
|
285
|
-
const t = r, o = (
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
307
|
+
const t = r, o = (p) => p !== void 0 ? $(p).getHex() : void 0, { camera: s, scene: a } = y(), { pass: i, effect: n } = h(
|
|
308
|
+
() => new de(
|
|
309
|
+
a.value,
|
|
310
|
+
s.value,
|
|
311
|
+
{
|
|
312
|
+
blur: t.blur,
|
|
313
|
+
xRay: t.xRay,
|
|
314
|
+
kernelSize: t.kernelSize,
|
|
315
|
+
pulseSpeed: t.pulseSpeed,
|
|
316
|
+
resolutionX: t.resolutionX,
|
|
317
|
+
resolutionY: t.resolutionY,
|
|
318
|
+
patternScale: t.patternScale,
|
|
319
|
+
edgeStrength: t.edgeStrength,
|
|
320
|
+
blendFunction: t.blendFunction,
|
|
321
|
+
multisampling: t.multisampling,
|
|
322
|
+
patternTexture: t.patternTexture,
|
|
323
|
+
resolutionScale: t.resolutionScale,
|
|
324
|
+
hiddenEdgeColor: o(t.hiddenEdgeColor),
|
|
325
|
+
visibleEdgeColor: o(t.visibleEdgeColor)
|
|
326
|
+
// width and height are explicitly omitted, because they are deprecated in postprocessing's OutlineEffect
|
|
327
|
+
}
|
|
328
|
+
),
|
|
329
|
+
t
|
|
330
|
+
);
|
|
331
|
+
e({ pass: i, effect: n }), S(
|
|
332
|
+
[() => t.outlinedObjects, n],
|
|
303
333
|
// watchEffect is intentionally not used here as it would result in an endless loop
|
|
304
334
|
() => {
|
|
305
|
-
var
|
|
306
|
-
(
|
|
335
|
+
var p;
|
|
336
|
+
(p = n.value) == null || p.selection.set(t.outlinedObjects || []);
|
|
307
337
|
},
|
|
308
338
|
{
|
|
309
339
|
immediate: !0
|
|
310
340
|
}
|
|
311
341
|
);
|
|
312
|
-
const
|
|
313
|
-
hiddenEdgeColor: t.hiddenEdgeColor ?
|
|
314
|
-
visibleEdgeColor: t.visibleEdgeColor ?
|
|
342
|
+
const l = O(() => ({
|
|
343
|
+
hiddenEdgeColor: t.hiddenEdgeColor ? $(t.hiddenEdgeColor) : void 0,
|
|
344
|
+
visibleEdgeColor: t.visibleEdgeColor ? $(t.visibleEdgeColor) : void 0
|
|
315
345
|
}));
|
|
316
|
-
return
|
|
346
|
+
return m(
|
|
317
347
|
[
|
|
318
|
-
|
|
319
|
-
resolutionX - has no setter in OutlineEffect
|
|
320
|
-
resolutionY - has no setter in OutlineEffect
|
|
321
|
-
blendFunction - has no setter in OutlineEffect
|
|
322
|
-
patternTexture - different type in constructor and in setter
|
|
323
|
-
resolutionScale - has no setter in OutlineEffect
|
|
324
|
-
*/
|
|
348
|
+
[() => t.blendFunction, "blendMode.blendFunction"],
|
|
325
349
|
[() => t.blur, "blur"],
|
|
326
350
|
[() => t.xRay, "xRay"],
|
|
327
351
|
[() => t.pulseSpeed, "pulseSpeed"],
|
|
@@ -329,29 +353,33 @@ const Re = Symbol("effectComposerPmndrs"), Lt = /* @__PURE__ */ c({
|
|
|
329
353
|
[() => t.edgeStrength, "edgeStrength"],
|
|
330
354
|
[() => t.patternScale, "patternScale"],
|
|
331
355
|
[() => t.multisampling, "multisampling"],
|
|
332
|
-
[() =>
|
|
333
|
-
[() =>
|
|
356
|
+
[() => t.resolutionX, "resolution.width"],
|
|
357
|
+
[() => t.resolutionY, "resolution.height"],
|
|
358
|
+
[() => t.patternTexture, "patternTexture"],
|
|
359
|
+
[() => t.resolutionScale, "resolution.scale"],
|
|
360
|
+
[() => l.value.hiddenEdgeColor, "hiddenEdgeColor"],
|
|
361
|
+
[() => l.value.visibleEdgeColor, "visibleEdgeColor"]
|
|
334
362
|
],
|
|
335
|
-
|
|
336
|
-
() => new
|
|
363
|
+
n,
|
|
364
|
+
() => new de()
|
|
337
365
|
), () => {
|
|
338
366
|
};
|
|
339
367
|
}
|
|
340
|
-
}),
|
|
368
|
+
}), Vt = /* @__PURE__ */ u({
|
|
341
369
|
__name: "PixelationPmndrs",
|
|
342
370
|
props: {
|
|
343
371
|
granularity: {}
|
|
344
372
|
},
|
|
345
373
|
setup(r, { expose: e }) {
|
|
346
|
-
const t = r, { pass: o, effect:
|
|
347
|
-
return e({ pass: o, effect:
|
|
374
|
+
const t = r, { pass: o, effect: s } = h(() => new fe(t.granularity), t);
|
|
375
|
+
return e({ pass: o, effect: s }), ae(
|
|
348
376
|
t,
|
|
349
|
-
|
|
350
|
-
() => new
|
|
377
|
+
s,
|
|
378
|
+
() => new fe()
|
|
351
379
|
), () => {
|
|
352
380
|
};
|
|
353
381
|
}
|
|
354
|
-
}),
|
|
382
|
+
}), Yt = /* @__PURE__ */ u({
|
|
355
383
|
__name: "VignettePmndrs",
|
|
356
384
|
props: {
|
|
357
385
|
technique: {},
|
|
@@ -360,16 +388,21 @@ const Re = Symbol("effectComposerPmndrs"), Lt = /* @__PURE__ */ c({
|
|
|
360
388
|
darkness: {}
|
|
361
389
|
},
|
|
362
390
|
setup(r, { expose: e }) {
|
|
363
|
-
const t = r, { pass: o, effect:
|
|
364
|
-
return e({ pass: o, effect:
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
391
|
+
const t = r, { pass: o, effect: s } = h(() => new he(t), t);
|
|
392
|
+
return e({ pass: o, effect: s }), m(
|
|
393
|
+
[
|
|
394
|
+
[() => t.blendFunction, "blendMode.blendFunction"],
|
|
395
|
+
[() => t.offset, "offset"],
|
|
396
|
+
[() => t.darkness, "darkness"],
|
|
397
|
+
[() => t.technique, "technique"]
|
|
398
|
+
],
|
|
399
|
+
s,
|
|
400
|
+
() => new he()
|
|
368
401
|
), () => {
|
|
369
402
|
};
|
|
370
403
|
}
|
|
371
404
|
});
|
|
372
|
-
class
|
|
405
|
+
class Ee extends q {
|
|
373
406
|
/**
|
|
374
407
|
* Creates a new BarrelBlurEffect instance.
|
|
375
408
|
*
|
|
@@ -379,7 +412,7 @@ class Se extends Z {
|
|
|
379
412
|
* @param {Vector2} [options.offset] - Offset of the barrel distortion center (0 to 1 for both x and y). This allows you to change the position of the distortion effect.
|
|
380
413
|
*
|
|
381
414
|
*/
|
|
382
|
-
constructor({ blendFunction: e =
|
|
415
|
+
constructor({ blendFunction: e = Q.NORMAL, amount: t = 0.15, offset: o = new d(0.5, 0.5) } = {}) {
|
|
383
416
|
super("BarrelBlurEffect", `
|
|
384
417
|
uniform float amount;
|
|
385
418
|
uniform vec2 offset;
|
|
@@ -427,9 +460,9 @@ class Se extends Z {
|
|
|
427
460
|
`, {
|
|
428
461
|
blendFunction: e,
|
|
429
462
|
uniforms: /* @__PURE__ */ new Map([
|
|
430
|
-
["amount", new
|
|
463
|
+
["amount", new M(t)],
|
|
431
464
|
// Uniform controlling the intensity of distortion
|
|
432
|
-
["offset", new
|
|
465
|
+
["offset", new M(o)]
|
|
433
466
|
// Uniform controlling the offset of distortion
|
|
434
467
|
])
|
|
435
468
|
});
|
|
@@ -459,7 +492,7 @@ class Se extends Z {
|
|
|
459
492
|
this.uniforms.get("offset").value = e;
|
|
460
493
|
}
|
|
461
494
|
}
|
|
462
|
-
const
|
|
495
|
+
const kt = /* @__PURE__ */ u({
|
|
463
496
|
__name: "BarrelBlurPmndrs",
|
|
464
497
|
props: {
|
|
465
498
|
blendFunction: {},
|
|
@@ -467,25 +500,25 @@ const Ut = /* @__PURE__ */ c({
|
|
|
467
500
|
offset: {}
|
|
468
501
|
},
|
|
469
502
|
setup(r, { expose: e }) {
|
|
470
|
-
const t = r, { pass: o, effect:
|
|
471
|
-
() => new
|
|
503
|
+
const t = r, { pass: o, effect: s } = h(
|
|
504
|
+
() => new Ee({
|
|
472
505
|
...t,
|
|
473
506
|
offset: Array.isArray(t.offset) ? new d(...t.offset) : t.offset
|
|
474
507
|
}),
|
|
475
508
|
t
|
|
476
509
|
);
|
|
477
|
-
return e({ pass: o, effect:
|
|
510
|
+
return e({ pass: o, effect: s }), m(
|
|
478
511
|
[
|
|
479
512
|
[() => t.blendFunction, "blendMode.blendFunction"],
|
|
480
513
|
[() => t.amount, "amount"],
|
|
481
514
|
[() => t.offset, "offset"]
|
|
482
515
|
],
|
|
483
|
-
|
|
484
|
-
() => new
|
|
516
|
+
s,
|
|
517
|
+
() => new Ee()
|
|
485
518
|
), () => {
|
|
486
519
|
};
|
|
487
520
|
}
|
|
488
|
-
}),
|
|
521
|
+
}), qt = /* @__PURE__ */ u({
|
|
489
522
|
__name: "ToneMappingPmndrs",
|
|
490
523
|
props: {
|
|
491
524
|
mode: {},
|
|
@@ -497,8 +530,8 @@ const Ut = /* @__PURE__ */ c({
|
|
|
497
530
|
whitePoint: {}
|
|
498
531
|
},
|
|
499
532
|
setup(r, { expose: e }) {
|
|
500
|
-
const t = r, { pass: o, effect:
|
|
501
|
-
return e({ pass: o, effect:
|
|
533
|
+
const t = r, { pass: o, effect: s } = h(() => new pe(t), t);
|
|
534
|
+
return e({ pass: o, effect: s }), m(
|
|
502
535
|
[
|
|
503
536
|
[() => t.mode, "mode"],
|
|
504
537
|
[() => t.blendFunction, "blendMode.blendFunction"],
|
|
@@ -508,12 +541,12 @@ const Ut = /* @__PURE__ */ c({
|
|
|
508
541
|
[() => t.minLuminance, "adaptiveLuminanceMaterial.minLuminance"],
|
|
509
542
|
[() => t.whitePoint, "whitePoint"]
|
|
510
543
|
],
|
|
511
|
-
|
|
512
|
-
() => new
|
|
544
|
+
s,
|
|
545
|
+
() => new pe()
|
|
513
546
|
), () => {
|
|
514
547
|
};
|
|
515
548
|
}
|
|
516
|
-
}),
|
|
549
|
+
}), Qt = /* @__PURE__ */ u({
|
|
517
550
|
__name: "ChromaticAberrationPmndrs",
|
|
518
551
|
props: {
|
|
519
552
|
blendFunction: {},
|
|
@@ -522,26 +555,26 @@ const Ut = /* @__PURE__ */ c({
|
|
|
522
555
|
modulationOffset: {}
|
|
523
556
|
},
|
|
524
557
|
setup(r, { expose: e }) {
|
|
525
|
-
const t = r, o = new
|
|
558
|
+
const t = r, o = new K(), { pass: s, effect: a } = h(() => new K({
|
|
526
559
|
...t,
|
|
527
560
|
// Unfortunately, these defaults must be set this way as the type in postprocessing is not correct.
|
|
528
561
|
// The arguments are optional in the actual constructor, but not in the type.
|
|
529
562
|
radialModulation: t.radialModulation ?? o.radialModulation,
|
|
530
563
|
modulationOffset: t.modulationOffset ?? o.modulationOffset
|
|
531
564
|
}), t);
|
|
532
|
-
return o.dispose(), e({ pass:
|
|
565
|
+
return o.dispose(), e({ pass: s, effect: a }), m(
|
|
533
566
|
[
|
|
534
567
|
[() => t.blendFunction, "blendMode.blendFunction"],
|
|
535
568
|
[() => t.offset, "offset"],
|
|
536
569
|
[() => t.radialModulation, "radialModulation"],
|
|
537
570
|
[() => t.modulationOffset, "modulationOffset"]
|
|
538
571
|
],
|
|
539
|
-
|
|
540
|
-
() => new
|
|
572
|
+
a,
|
|
573
|
+
() => new K()
|
|
541
574
|
), () => {
|
|
542
575
|
};
|
|
543
576
|
}
|
|
544
|
-
}),
|
|
577
|
+
}), Kt = /* @__PURE__ */ u({
|
|
545
578
|
__name: "HueSaturationPmndrs",
|
|
546
579
|
props: {
|
|
547
580
|
saturation: {},
|
|
@@ -549,19 +582,19 @@ const Ut = /* @__PURE__ */ c({
|
|
|
549
582
|
blendFunction: {}
|
|
550
583
|
},
|
|
551
584
|
setup(r, { expose: e }) {
|
|
552
|
-
const t = r, { pass: o, effect:
|
|
553
|
-
return e({ pass: o, effect:
|
|
585
|
+
const t = r, { pass: o, effect: s } = h(() => new me(t), t);
|
|
586
|
+
return e({ pass: o, effect: s }), m(
|
|
554
587
|
[
|
|
555
588
|
[() => t.blendFunction, "blendMode.blendFunction"],
|
|
556
589
|
[() => t.hue, "hue"],
|
|
557
590
|
[() => t.saturation, "saturation"]
|
|
558
591
|
],
|
|
559
|
-
|
|
560
|
-
() => new
|
|
592
|
+
s,
|
|
593
|
+
() => new me()
|
|
561
594
|
), () => {
|
|
562
595
|
};
|
|
563
596
|
}
|
|
564
|
-
}),
|
|
597
|
+
}), Jt = /* @__PURE__ */ u({
|
|
565
598
|
__name: "ScanlinePmndrs",
|
|
566
599
|
props: {
|
|
567
600
|
blendFunction: {},
|
|
@@ -570,24 +603,24 @@ const Ut = /* @__PURE__ */ c({
|
|
|
570
603
|
opacity: {}
|
|
571
604
|
},
|
|
572
605
|
setup(r, { expose: e }) {
|
|
573
|
-
const t = r, { pass: o, effect:
|
|
574
|
-
return e({ pass: o, effect:
|
|
606
|
+
const t = r, { pass: o, effect: s } = h(() => new J(t), t);
|
|
607
|
+
return e({ pass: o, effect: s }), m(
|
|
575
608
|
[
|
|
576
609
|
[() => t.blendFunction, "blendMode.blendFunction"],
|
|
577
610
|
[() => t.density, "density"],
|
|
578
611
|
[() => t.scrollSpeed, "scrollSpeed"]
|
|
579
612
|
],
|
|
580
|
-
|
|
581
|
-
() => new
|
|
582
|
-
),
|
|
613
|
+
s,
|
|
614
|
+
() => new J()
|
|
615
|
+
), S(
|
|
583
616
|
[() => t.opacity],
|
|
584
617
|
() => {
|
|
585
|
-
var
|
|
618
|
+
var a, i;
|
|
586
619
|
if (t.opacity !== void 0)
|
|
587
|
-
(
|
|
620
|
+
(a = s.value) == null || a.blendMode.setOpacity(t.opacity);
|
|
588
621
|
else {
|
|
589
|
-
const n = new
|
|
590
|
-
(i =
|
|
622
|
+
const n = new J();
|
|
623
|
+
(i = s.value) == null || i.blendMode.setOpacity(n.blendMode.getOpacity()), n.dispose();
|
|
591
624
|
}
|
|
592
625
|
},
|
|
593
626
|
{
|
|
@@ -596,7 +629,7 @@ const Ut = /* @__PURE__ */ c({
|
|
|
596
629
|
), () => {
|
|
597
630
|
};
|
|
598
631
|
}
|
|
599
|
-
}),
|
|
632
|
+
}), St = `
|
|
600
633
|
uniform float radius;
|
|
601
634
|
uniform int sectorCount;
|
|
602
635
|
|
|
@@ -693,7 +726,7 @@ void mainImage(const in vec4 inputColor, const in vec2 uv, out vec4 outputColor)
|
|
|
693
726
|
outputColor = vec4(finalColor, inputColor.a);
|
|
694
727
|
}
|
|
695
728
|
`;
|
|
696
|
-
class
|
|
729
|
+
class Pe extends q {
|
|
697
730
|
/**
|
|
698
731
|
* Creates a new KuwaharaEffect instance.
|
|
699
732
|
*
|
|
@@ -703,12 +736,12 @@ class Ae extends Z {
|
|
|
703
736
|
* @param {number} [options.sectorCount] - Number of sectors.
|
|
704
737
|
*
|
|
705
738
|
*/
|
|
706
|
-
constructor({ blendFunction: e =
|
|
707
|
-
super("KuwaharaEffect",
|
|
739
|
+
constructor({ blendFunction: e = Q.NORMAL, radius: t = 1, sectorCount: o = 4 } = {}) {
|
|
740
|
+
super("KuwaharaEffect", St, {
|
|
708
741
|
blendFunction: e,
|
|
709
742
|
uniforms: /* @__PURE__ */ new Map([
|
|
710
|
-
["radius", new
|
|
711
|
-
["sectorCount", new
|
|
743
|
+
["radius", new M(t)],
|
|
744
|
+
["sectorCount", new M(o)]
|
|
712
745
|
])
|
|
713
746
|
});
|
|
714
747
|
}
|
|
@@ -737,7 +770,7 @@ class Ae extends Z {
|
|
|
737
770
|
this.uniforms.get("sectorCount").value = e;
|
|
738
771
|
}
|
|
739
772
|
}
|
|
740
|
-
const
|
|
773
|
+
const Zt = /* @__PURE__ */ u({
|
|
741
774
|
__name: "KuwaharaPmndrs",
|
|
742
775
|
props: {
|
|
743
776
|
blendFunction: {},
|
|
@@ -745,50 +778,50 @@ const jt = /* @__PURE__ */ c({
|
|
|
745
778
|
sectorCount: {}
|
|
746
779
|
},
|
|
747
780
|
setup(r, { expose: e }) {
|
|
748
|
-
const t = r, { pass: o, effect:
|
|
749
|
-
() => new
|
|
781
|
+
const t = r, { pass: o, effect: s } = h(
|
|
782
|
+
() => new Pe(t),
|
|
750
783
|
t
|
|
751
784
|
);
|
|
752
|
-
return e({ pass: o, effect:
|
|
785
|
+
return e({ pass: o, effect: s }), m(
|
|
753
786
|
[
|
|
754
787
|
[() => t.blendFunction, "blendMode.blendFunction"],
|
|
755
788
|
[() => t.radius, "radius"],
|
|
756
789
|
[() => t.sectorCount, "sectorCount"]
|
|
757
790
|
],
|
|
758
|
-
|
|
759
|
-
() => new
|
|
791
|
+
s,
|
|
792
|
+
() => new Pe()
|
|
760
793
|
), () => {
|
|
761
794
|
};
|
|
762
795
|
}
|
|
763
|
-
}),
|
|
796
|
+
}), _t = /* @__PURE__ */ u({
|
|
764
797
|
__name: "ColorAveragePmndrs",
|
|
765
798
|
props: {
|
|
766
799
|
blendFunction: {},
|
|
767
800
|
opacity: {}
|
|
768
801
|
},
|
|
769
802
|
setup(r, { expose: e }) {
|
|
770
|
-
const t = r, { pass: o, effect:
|
|
771
|
-
return e({ pass: o, effect:
|
|
803
|
+
const t = r, { pass: o, effect: s } = h(() => new Z(t.blendFunction), t);
|
|
804
|
+
return e({ pass: o, effect: s }), H(
|
|
772
805
|
() => t.blendFunction,
|
|
773
|
-
|
|
806
|
+
s,
|
|
774
807
|
"blendMode.blendFunction",
|
|
775
|
-
() => new
|
|
776
|
-
),
|
|
777
|
-
[
|
|
808
|
+
() => new Z()
|
|
809
|
+
), S(
|
|
810
|
+
[s, () => t.opacity],
|
|
778
811
|
() => {
|
|
779
|
-
var
|
|
780
|
-
if (
|
|
812
|
+
var a, i;
|
|
813
|
+
if (s.value)
|
|
781
814
|
if (t.opacity !== void 0)
|
|
782
|
-
(
|
|
815
|
+
(a = s.value) == null || a.blendMode.setOpacity(t.opacity);
|
|
783
816
|
else {
|
|
784
|
-
const n = new
|
|
785
|
-
(i =
|
|
817
|
+
const n = new Z();
|
|
818
|
+
(i = s.value) == null || i.blendMode.setOpacity(n.blendMode.getOpacity()), n.dispose();
|
|
786
819
|
}
|
|
787
820
|
}
|
|
788
821
|
), () => {
|
|
789
822
|
};
|
|
790
823
|
}
|
|
791
|
-
}),
|
|
824
|
+
}), $t = /* @__PURE__ */ u({
|
|
792
825
|
__name: "LensDistortionPmndrs",
|
|
793
826
|
props: {
|
|
794
827
|
distortion: {},
|
|
@@ -797,8 +830,8 @@ const jt = /* @__PURE__ */ c({
|
|
|
797
830
|
skew: {}
|
|
798
831
|
},
|
|
799
832
|
setup(r, { expose: e }) {
|
|
800
|
-
const t = r, { pass: o, effect:
|
|
801
|
-
() => new
|
|
833
|
+
const t = r, { pass: o, effect: s } = h(
|
|
834
|
+
() => new ge({
|
|
802
835
|
...t,
|
|
803
836
|
distortion: t.distortion ? Array.isArray(t.distortion) ? new d(...t.distortion) : t.distortion : new d(),
|
|
804
837
|
principalPoint: t.principalPoint ? Array.isArray(t.principalPoint) ? new d(...t.principalPoint) : t.principalPoint : new d(),
|
|
@@ -806,14 +839,14 @@ const jt = /* @__PURE__ */ c({
|
|
|
806
839
|
}),
|
|
807
840
|
t
|
|
808
841
|
);
|
|
809
|
-
return e({ pass: o, effect:
|
|
842
|
+
return e({ pass: o, effect: s }), ae(
|
|
810
843
|
t,
|
|
811
|
-
|
|
812
|
-
() => new
|
|
844
|
+
s,
|
|
845
|
+
() => new ge()
|
|
813
846
|
), () => {
|
|
814
847
|
};
|
|
815
848
|
}
|
|
816
|
-
}),
|
|
849
|
+
}), eo = /* @__PURE__ */ u({
|
|
817
850
|
__name: "ShockWavePmndrs",
|
|
818
851
|
props: {
|
|
819
852
|
position: {},
|
|
@@ -823,29 +856,29 @@ const jt = /* @__PURE__ */ c({
|
|
|
823
856
|
waveSize: {}
|
|
824
857
|
},
|
|
825
858
|
setup(r, { expose: e }) {
|
|
826
|
-
const t = r, { camera: o } =
|
|
827
|
-
() => new
|
|
859
|
+
const t = r, { camera: o } = y(), { pass: s, effect: a } = h(
|
|
860
|
+
() => new ve(o.value, Array.isArray(t.position) ? new L(...t.position) : t.position, t),
|
|
828
861
|
t
|
|
829
862
|
);
|
|
830
|
-
return e({ pass:
|
|
863
|
+
return e({ pass: s, effect: a }), S(
|
|
831
864
|
() => t.position,
|
|
832
865
|
(i) => {
|
|
833
|
-
|
|
866
|
+
a.value && (Array.isArray(i) ? a.value.position.set(...i) : i instanceof L && a.value.position.copy(i));
|
|
834
867
|
},
|
|
835
868
|
{ immediate: !0 }
|
|
836
|
-
),
|
|
869
|
+
), m(
|
|
837
870
|
[
|
|
838
871
|
[() => t.amplitude, "amplitude"],
|
|
839
872
|
[() => t.waveSize, "waveSize"],
|
|
840
873
|
[() => t.maxRadius, "maxRadius"],
|
|
841
874
|
[() => t.speed, "speed"]
|
|
842
875
|
],
|
|
843
|
-
|
|
844
|
-
() => new
|
|
876
|
+
a,
|
|
877
|
+
() => new ve()
|
|
845
878
|
), () => {
|
|
846
879
|
};
|
|
847
880
|
}
|
|
848
|
-
}),
|
|
881
|
+
}), to = /* @__PURE__ */ u({
|
|
849
882
|
__name: "TiltShiftPmndrs",
|
|
850
883
|
props: {
|
|
851
884
|
blendFunction: {},
|
|
@@ -859,8 +892,8 @@ const jt = /* @__PURE__ */ c({
|
|
|
859
892
|
resolutionY: {}
|
|
860
893
|
},
|
|
861
894
|
setup(r, { expose: e }) {
|
|
862
|
-
const t = r, { pass: o, effect:
|
|
863
|
-
return e({ pass: o, effect:
|
|
895
|
+
const t = r, { pass: o, effect: s } = h(() => new xe(t), t);
|
|
896
|
+
return e({ pass: o, effect: s }), m(
|
|
864
897
|
[
|
|
865
898
|
[() => t.blendFunction, "blendMode.blendFunction"],
|
|
866
899
|
[() => t.offset, "offset"],
|
|
@@ -872,12 +905,12 @@ const jt = /* @__PURE__ */ c({
|
|
|
872
905
|
[() => t.resolutionX, "resolution.width"],
|
|
873
906
|
[() => t.resolutionY, "resolution.height"]
|
|
874
907
|
],
|
|
875
|
-
|
|
876
|
-
() => new
|
|
908
|
+
s,
|
|
909
|
+
() => new xe()
|
|
877
910
|
), () => {
|
|
878
911
|
};
|
|
879
912
|
}
|
|
880
|
-
}),
|
|
913
|
+
}), oo = /* @__PURE__ */ u({
|
|
881
914
|
__name: "DotScreenPmndrs",
|
|
882
915
|
props: {
|
|
883
916
|
angle: {},
|
|
@@ -885,46 +918,46 @@ const jt = /* @__PURE__ */ c({
|
|
|
885
918
|
blendFunction: {}
|
|
886
919
|
},
|
|
887
920
|
setup(r, { expose: e }) {
|
|
888
|
-
const t = r, { pass: o, effect:
|
|
889
|
-
return e({ pass: o, effect:
|
|
921
|
+
const t = r, { pass: o, effect: s } = h(() => new be(t), t);
|
|
922
|
+
return e({ pass: o, effect: s }), m(
|
|
890
923
|
[
|
|
891
924
|
[() => t.blendFunction, "blendMode.blendFunction"],
|
|
892
925
|
[() => t.angle, "angle"],
|
|
893
926
|
[() => t.scale, "scale"]
|
|
894
927
|
],
|
|
895
|
-
|
|
896
|
-
() => new
|
|
928
|
+
s,
|
|
929
|
+
() => new be()
|
|
897
930
|
), () => {
|
|
898
931
|
};
|
|
899
932
|
}
|
|
900
|
-
}),
|
|
933
|
+
}), so = /* @__PURE__ */ u({
|
|
901
934
|
__name: "SepiaPmndrs",
|
|
902
935
|
props: {
|
|
903
936
|
blendFunction: {},
|
|
904
937
|
intensity: {}
|
|
905
938
|
},
|
|
906
939
|
setup(r, { expose: e }) {
|
|
907
|
-
const t = r, { pass: o, effect:
|
|
908
|
-
return e({ pass: o, effect:
|
|
940
|
+
const t = r, { pass: o, effect: s } = h(() => new Se(t), t);
|
|
941
|
+
return e({ pass: o, effect: s }), m(
|
|
909
942
|
[
|
|
910
943
|
[() => t.blendFunction, "blendMode.blendFunction"],
|
|
911
944
|
[() => t.intensity, "intensity"]
|
|
912
945
|
],
|
|
913
|
-
|
|
914
|
-
() => new
|
|
946
|
+
s,
|
|
947
|
+
() => new Se()
|
|
915
948
|
), () => {
|
|
916
949
|
};
|
|
917
950
|
}
|
|
918
951
|
});
|
|
919
|
-
class
|
|
952
|
+
class De extends q {
|
|
920
953
|
/**
|
|
921
954
|
* Creates a new LinocutEffect instance.
|
|
922
955
|
*
|
|
923
956
|
* @param {LinocutPmndrsProps} [options] - Configuration options for the effect.
|
|
924
957
|
*
|
|
925
958
|
*/
|
|
926
|
-
constructor({ blendFunction: e =
|
|
927
|
-
const i = Array.isArray(
|
|
959
|
+
constructor({ blendFunction: e = Q.NORMAL, scale: t = 0.85, noiseScale: o = 0, center: s = [0.5, 0.5], rotation: a = 0 } = {}) {
|
|
960
|
+
const i = Array.isArray(s) ? new d().fromArray(s) : s;
|
|
928
961
|
super("LinocutEffect", `
|
|
929
962
|
uniform float scale;
|
|
930
963
|
uniform float noiseScale;
|
|
@@ -988,10 +1021,10 @@ class we extends Z {
|
|
|
988
1021
|
`, {
|
|
989
1022
|
blendFunction: e,
|
|
990
1023
|
uniforms: /* @__PURE__ */ new Map([
|
|
991
|
-
["scale", new
|
|
992
|
-
["noiseScale", new
|
|
993
|
-
["center", new
|
|
994
|
-
["rotation", new
|
|
1024
|
+
["scale", new M(t)],
|
|
1025
|
+
["noiseScale", new M(o)],
|
|
1026
|
+
["center", new M(i)],
|
|
1027
|
+
["rotation", new M(a)]
|
|
995
1028
|
])
|
|
996
1029
|
});
|
|
997
1030
|
}
|
|
@@ -1024,7 +1057,7 @@ class we extends Z {
|
|
|
1024
1057
|
this.uniforms.get("rotation").value = e;
|
|
1025
1058
|
}
|
|
1026
1059
|
}
|
|
1027
|
-
const
|
|
1060
|
+
const ao = /* @__PURE__ */ u({
|
|
1028
1061
|
__name: "LinocutPmndrs",
|
|
1029
1062
|
props: {
|
|
1030
1063
|
blendFunction: {},
|
|
@@ -1034,14 +1067,14 @@ const Jt = /* @__PURE__ */ c({
|
|
|
1034
1067
|
rotation: {}
|
|
1035
1068
|
},
|
|
1036
1069
|
setup(r, { expose: e }) {
|
|
1037
|
-
const t = r, { pass: o, effect:
|
|
1038
|
-
() => new
|
|
1070
|
+
const t = r, { pass: o, effect: s } = h(
|
|
1071
|
+
() => new De({
|
|
1039
1072
|
...t,
|
|
1040
1073
|
center: t.center instanceof d ? [t.center.x, t.center.y] : t.center
|
|
1041
1074
|
}),
|
|
1042
1075
|
t
|
|
1043
1076
|
);
|
|
1044
|
-
return e({ pass: o, effect:
|
|
1077
|
+
return e({ pass: o, effect: s }), m(
|
|
1045
1078
|
[
|
|
1046
1079
|
[() => t.blendFunction, "blendMode.blendFunction"],
|
|
1047
1080
|
[() => t.scale, "scale"],
|
|
@@ -1049,12 +1082,276 @@ const Jt = /* @__PURE__ */ c({
|
|
|
1049
1082
|
[() => t.center, "center"],
|
|
1050
1083
|
[() => t.rotation, "rotation"]
|
|
1051
1084
|
],
|
|
1085
|
+
s,
|
|
1086
|
+
() => new De()
|
|
1087
|
+
), () => {
|
|
1088
|
+
};
|
|
1089
|
+
}
|
|
1090
|
+
}), ro = /* @__PURE__ */ u({
|
|
1091
|
+
__name: "DepthPickingPassPmndrs",
|
|
1092
|
+
props: {
|
|
1093
|
+
depthPacking: {},
|
|
1094
|
+
mode: {}
|
|
1095
|
+
},
|
|
1096
|
+
setup(r, { expose: e }) {
|
|
1097
|
+
const t = r, o = te(se), s = new qe(t), a = x(() => {
|
|
1098
|
+
o != null && o.value && (oe(() => a()), o.value.addPass(s));
|
|
1099
|
+
});
|
|
1100
|
+
return U(() => {
|
|
1101
|
+
var i;
|
|
1102
|
+
!(o != null && o.value) || !s || ((i = o == null ? void 0 : o.value) == null || i.removePass(s), s.dispose());
|
|
1103
|
+
}), e({ pass: s }), () => {
|
|
1104
|
+
};
|
|
1105
|
+
}
|
|
1106
|
+
}), io = /* @__PURE__ */ u({
|
|
1107
|
+
__name: "GodRaysPmndrs",
|
|
1108
|
+
props: {
|
|
1109
|
+
blendFunction: {},
|
|
1110
|
+
lightSource: {},
|
|
1111
|
+
opacity: {},
|
|
1112
|
+
density: {},
|
|
1113
|
+
decay: {},
|
|
1114
|
+
kernelSize: {},
|
|
1115
|
+
resolutionScale: {},
|
|
1116
|
+
blur: { type: Boolean },
|
|
1117
|
+
resolutionX: {},
|
|
1118
|
+
resolutionY: {},
|
|
1119
|
+
weight: {},
|
|
1120
|
+
exposure: {},
|
|
1121
|
+
samples: {},
|
|
1122
|
+
clampMax: {}
|
|
1123
|
+
},
|
|
1124
|
+
setup(r, { expose: e }) {
|
|
1125
|
+
const t = r, { camera: o } = y(), { pass: s, effect: a } = h(
|
|
1126
|
+
() => new _(o.value, ie(t.lightSource), t),
|
|
1127
|
+
t
|
|
1128
|
+
);
|
|
1129
|
+
return e({ pass: s, effect: a }), m(
|
|
1130
|
+
[
|
|
1131
|
+
[() => t.blendFunction, "blendMode.blendFunction"],
|
|
1132
|
+
[() => t.density, "godRaysMaterial.density"],
|
|
1133
|
+
[() => t.decay, "godRaysMaterial.decay"],
|
|
1134
|
+
[() => t.weight, "godRaysMaterial.weight"],
|
|
1135
|
+
[() => t.exposure, "godRaysMaterial.exposure"],
|
|
1136
|
+
[() => t.samples, "godRaysMaterial.samples"],
|
|
1137
|
+
[() => t.clampMax, "godRaysMaterial.maxIntensity"],
|
|
1138
|
+
[() => t.resolutionScale, "resolution.scale"],
|
|
1139
|
+
[() => t.resolutionX, "resolution.width"],
|
|
1140
|
+
[() => t.resolutionY, "resolution.height"],
|
|
1141
|
+
[() => t.kernelSize, "kernelSize"],
|
|
1142
|
+
[() => t.blur, "blur"]
|
|
1143
|
+
],
|
|
1052
1144
|
a,
|
|
1145
|
+
() => new _()
|
|
1146
|
+
), S(
|
|
1147
|
+
[() => t.opacity],
|
|
1148
|
+
() => {
|
|
1149
|
+
var i, n;
|
|
1150
|
+
if (t.opacity !== void 0)
|
|
1151
|
+
(i = a.value) == null || i.blendMode.setOpacity(t.opacity);
|
|
1152
|
+
else {
|
|
1153
|
+
const l = new _(o.value, ie(t.lightSource));
|
|
1154
|
+
(n = a.value) == null || n.blendMode.setOpacity(l.blendMode.getOpacity()), l.dispose();
|
|
1155
|
+
}
|
|
1156
|
+
},
|
|
1157
|
+
{
|
|
1158
|
+
immediate: !0
|
|
1159
|
+
}
|
|
1160
|
+
), () => {
|
|
1161
|
+
};
|
|
1162
|
+
}
|
|
1163
|
+
}), no = /* @__PURE__ */ u({
|
|
1164
|
+
__name: "ColorDepthPmndrs",
|
|
1165
|
+
props: {
|
|
1166
|
+
blendFunction: {},
|
|
1167
|
+
bits: {},
|
|
1168
|
+
opacity: {}
|
|
1169
|
+
},
|
|
1170
|
+
setup(r, { expose: e }) {
|
|
1171
|
+
const t = r, { pass: o, effect: s } = h(() => new I(t), t);
|
|
1172
|
+
return e({ pass: o, effect: s }), H(
|
|
1173
|
+
() => t.blendFunction,
|
|
1174
|
+
s,
|
|
1175
|
+
"blendMode.blendFunction",
|
|
1176
|
+
() => new I()
|
|
1177
|
+
), S(
|
|
1178
|
+
[s, () => t.bits],
|
|
1179
|
+
() => {
|
|
1180
|
+
var a, i;
|
|
1181
|
+
if (s.value)
|
|
1182
|
+
if (t.bits !== void 0)
|
|
1183
|
+
(a = s.value) == null || a.setBitDepth(t.bits);
|
|
1184
|
+
else {
|
|
1185
|
+
const n = new I();
|
|
1186
|
+
(i = s.value) == null || i.setBitDepth(n.getBitDepth()), n.dispose();
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
), S(
|
|
1190
|
+
[s, () => t.opacity],
|
|
1191
|
+
() => {
|
|
1192
|
+
var a, i;
|
|
1193
|
+
if (s.value)
|
|
1194
|
+
if (t.opacity !== void 0)
|
|
1195
|
+
(a = s.value) == null || a.blendMode.setOpacity(t.opacity);
|
|
1196
|
+
else {
|
|
1197
|
+
const n = new I();
|
|
1198
|
+
(i = s.value) == null || i.blendMode.setOpacity(n.blendMode.getOpacity()), n.dispose();
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
), () => {
|
|
1202
|
+
};
|
|
1203
|
+
}
|
|
1204
|
+
}), lo = /* @__PURE__ */ u({
|
|
1205
|
+
__name: "GridPmndrs",
|
|
1206
|
+
props: {
|
|
1207
|
+
blendFunction: {},
|
|
1208
|
+
scale: {},
|
|
1209
|
+
lineWidth: {}
|
|
1210
|
+
},
|
|
1211
|
+
setup(r, { expose: e }) {
|
|
1212
|
+
const t = r, { pass: o, effect: s } = h(() => new we(t), t);
|
|
1213
|
+
return e({ pass: o, effect: s }), m(
|
|
1214
|
+
[
|
|
1215
|
+
[() => t.blendFunction, "blendMode.blendFunction"],
|
|
1216
|
+
[() => t.scale, "scale"],
|
|
1217
|
+
[() => t.lineWidth, "lineWidth"]
|
|
1218
|
+
],
|
|
1219
|
+
s,
|
|
1053
1220
|
() => new we()
|
|
1054
1221
|
), () => {
|
|
1055
1222
|
};
|
|
1056
1223
|
}
|
|
1057
|
-
})
|
|
1224
|
+
});
|
|
1225
|
+
class Le extends q {
|
|
1226
|
+
/**
|
|
1227
|
+
* Creates a new FishEyeEffect instance.
|
|
1228
|
+
*
|
|
1229
|
+
* @param {object} [options] - Configuration options for the effect.
|
|
1230
|
+
* @param {BlendFunction} [options.blendFunction] - Blend mode.
|
|
1231
|
+
* @param {Vector2} [options.lensS] - Lens scale.
|
|
1232
|
+
* @param {Vector2} [options.lensF] - Lens factor.
|
|
1233
|
+
* @param {number} [options.scale] - Scale.
|
|
1234
|
+
*
|
|
1235
|
+
*/
|
|
1236
|
+
constructor({ blendFunction: e = Q.NORMAL, lensS: t = new d(1, 1), lensF: o = new d(0, 1), scale: s = 1 } = {}) {
|
|
1237
|
+
super("FishEyeEffect", `
|
|
1238
|
+
uniform vec2 lensS;
|
|
1239
|
+
uniform vec2 lensF;
|
|
1240
|
+
uniform float scale;
|
|
1241
|
+
|
|
1242
|
+
void mainUv(inout vec2 uv) {
|
|
1243
|
+
vec2 newUv = uv * 2.0 - 1.0;
|
|
1244
|
+
newUv.x = newUv.x + ((pow(newUv.y, 2.0) / scale) * newUv.x / scale) * -lensF.x;
|
|
1245
|
+
newUv.y = newUv.y + ((pow(newUv.x, 2.0) / scale) * newUv.y / scale) * -lensF.y;
|
|
1246
|
+
newUv = newUv * lensS;
|
|
1247
|
+
newUv = newUv / scale * 0.5 + 0.5;
|
|
1248
|
+
|
|
1249
|
+
uv = newUv;
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
void mainImage(const in vec4 inputColor, const in vec2 uv, out vec4 outputColor) {
|
|
1253
|
+
outputColor = vec4(inputColor.rgb, inputColor.a); // Preserves original alpha
|
|
1254
|
+
}
|
|
1255
|
+
`, {
|
|
1256
|
+
blendFunction: e,
|
|
1257
|
+
uniforms: /* @__PURE__ */ new Map([
|
|
1258
|
+
["lensS", new M(t)],
|
|
1259
|
+
["lensF", new M(o)],
|
|
1260
|
+
["scale", new M(s)]
|
|
1261
|
+
])
|
|
1262
|
+
});
|
|
1263
|
+
}
|
|
1264
|
+
/**
|
|
1265
|
+
* The lensS.
|
|
1266
|
+
*
|
|
1267
|
+
* @type {Vector2}
|
|
1268
|
+
*/
|
|
1269
|
+
get lensS() {
|
|
1270
|
+
var e;
|
|
1271
|
+
return (e = this.uniforms.get("lensS")) == null ? void 0 : e.value;
|
|
1272
|
+
}
|
|
1273
|
+
set lensS(e) {
|
|
1274
|
+
this.uniforms.get("lensS").value = e;
|
|
1275
|
+
}
|
|
1276
|
+
/**
|
|
1277
|
+
* The lensF.
|
|
1278
|
+
*
|
|
1279
|
+
* @type {Vector2}
|
|
1280
|
+
*/
|
|
1281
|
+
get lensF() {
|
|
1282
|
+
var e;
|
|
1283
|
+
return (e = this.uniforms.get("lensF")) == null ? void 0 : e.value;
|
|
1284
|
+
}
|
|
1285
|
+
set lensF(e) {
|
|
1286
|
+
this.uniforms.get("lensF").value = e;
|
|
1287
|
+
}
|
|
1288
|
+
/**
|
|
1289
|
+
* The scale.
|
|
1290
|
+
*
|
|
1291
|
+
* @type {number}
|
|
1292
|
+
*/
|
|
1293
|
+
get scale() {
|
|
1294
|
+
var e;
|
|
1295
|
+
return (e = this.uniforms.get("scale")) == null ? void 0 : e.value;
|
|
1296
|
+
}
|
|
1297
|
+
set scale(e) {
|
|
1298
|
+
this.uniforms.get("scale").value = e;
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
const uo = /* @__PURE__ */ u({
|
|
1302
|
+
__name: "FishEyePmndrs",
|
|
1303
|
+
props: {
|
|
1304
|
+
blendFunction: {},
|
|
1305
|
+
lensS: {},
|
|
1306
|
+
lensF: {},
|
|
1307
|
+
scale: {}
|
|
1308
|
+
},
|
|
1309
|
+
setup(r, { expose: e }) {
|
|
1310
|
+
const t = r, o = O(
|
|
1311
|
+
() => Array.isArray(t.lensS) ? new d(...t.lensS) : t.lensS
|
|
1312
|
+
), s = O(
|
|
1313
|
+
() => Array.isArray(t.lensF) ? new d(...t.lensF) : t.lensF
|
|
1314
|
+
), { pass: a, effect: i } = h(
|
|
1315
|
+
() => new Le({
|
|
1316
|
+
...t,
|
|
1317
|
+
lensS: o.value,
|
|
1318
|
+
lensF: s.value
|
|
1319
|
+
}),
|
|
1320
|
+
t
|
|
1321
|
+
);
|
|
1322
|
+
return e({ pass: a, effect: i }), m(
|
|
1323
|
+
[
|
|
1324
|
+
[() => t.blendFunction, "blendMode.blendFunction"],
|
|
1325
|
+
[() => o.value, "lensS"],
|
|
1326
|
+
[() => s.value, "lensF"],
|
|
1327
|
+
[() => t.scale, "scale"]
|
|
1328
|
+
],
|
|
1329
|
+
i,
|
|
1330
|
+
() => new Le()
|
|
1331
|
+
), () => {
|
|
1332
|
+
};
|
|
1333
|
+
}
|
|
1334
|
+
}), co = /* @__PURE__ */ u({
|
|
1335
|
+
__name: "BrightnessContrastPmndrs",
|
|
1336
|
+
props: {
|
|
1337
|
+
blendFunction: {},
|
|
1338
|
+
brightness: {},
|
|
1339
|
+
contrast: {}
|
|
1340
|
+
},
|
|
1341
|
+
setup(r, { expose: e }) {
|
|
1342
|
+
const t = r, { pass: o, effect: s } = h(() => new Ae(t), t);
|
|
1343
|
+
return e({ pass: o, effect: s }), m(
|
|
1344
|
+
[
|
|
1345
|
+
[() => t.blendFunction, "blendMode.blendFunction"],
|
|
1346
|
+
[() => t.brightness, "brightness"],
|
|
1347
|
+
[() => t.contrast, "contrast"]
|
|
1348
|
+
],
|
|
1349
|
+
s,
|
|
1350
|
+
() => new Ae()
|
|
1351
|
+
), () => {
|
|
1352
|
+
};
|
|
1353
|
+
}
|
|
1354
|
+
}), Ue = {
|
|
1058
1355
|
name: "CopyShader",
|
|
1059
1356
|
uniforms: {
|
|
1060
1357
|
tDiffuse: { value: null },
|
|
@@ -1092,7 +1389,7 @@ const Jt = /* @__PURE__ */ c({
|
|
|
1092
1389
|
}`
|
|
1093
1390
|
)
|
|
1094
1391
|
};
|
|
1095
|
-
class
|
|
1392
|
+
class C {
|
|
1096
1393
|
constructor() {
|
|
1097
1394
|
this.isPass = !0, this.enabled = !0, this.needsSwap = !0, this.clear = !1, this.renderToScreen = !1;
|
|
1098
1395
|
}
|
|
@@ -1104,22 +1401,22 @@ class T {
|
|
|
1104
1401
|
dispose() {
|
|
1105
1402
|
}
|
|
1106
1403
|
}
|
|
1107
|
-
const
|
|
1108
|
-
class
|
|
1404
|
+
const wt = new Qe(-1, 1, 1, -1, 0, 1);
|
|
1405
|
+
class At extends Ke {
|
|
1109
1406
|
constructor() {
|
|
1110
|
-
super(), this.setAttribute("position", new
|
|
1407
|
+
super(), this.setAttribute("position", new ye([-1, 3, 0, -1, -1, 0, 3, -1, 0], 3)), this.setAttribute("uv", new ye([0, 2, 0, 0, 2, 0], 2));
|
|
1111
1408
|
}
|
|
1112
1409
|
}
|
|
1113
|
-
const
|
|
1114
|
-
class
|
|
1410
|
+
const yt = new At();
|
|
1411
|
+
class R {
|
|
1115
1412
|
constructor(e) {
|
|
1116
|
-
this._mesh = new
|
|
1413
|
+
this._mesh = new Je(yt, e);
|
|
1117
1414
|
}
|
|
1118
1415
|
dispose() {
|
|
1119
1416
|
this._mesh.geometry.dispose();
|
|
1120
1417
|
}
|
|
1121
1418
|
render(e) {
|
|
1122
|
-
e.render(this._mesh,
|
|
1419
|
+
e.render(this._mesh, wt);
|
|
1123
1420
|
}
|
|
1124
1421
|
get material() {
|
|
1125
1422
|
return this._mesh.material;
|
|
@@ -1128,15 +1425,15 @@ class L {
|
|
|
1128
1425
|
this._mesh.material = e;
|
|
1129
1426
|
}
|
|
1130
1427
|
}
|
|
1131
|
-
class
|
|
1428
|
+
class Mt extends C {
|
|
1132
1429
|
constructor(e, t) {
|
|
1133
|
-
super(), this.textureID = t !== void 0 ? t : "tDiffuse", e instanceof
|
|
1430
|
+
super(), this.textureID = t !== void 0 ? t : "tDiffuse", e instanceof A ? (this.uniforms = e.uniforms, this.material = e) : e && (this.uniforms = P.clone(e.uniforms), this.material = new A({
|
|
1134
1431
|
name: e.name !== void 0 ? e.name : "unspecified",
|
|
1135
1432
|
defines: Object.assign({}, e.defines),
|
|
1136
1433
|
uniforms: this.uniforms,
|
|
1137
1434
|
vertexShader: e.vertexShader,
|
|
1138
1435
|
fragmentShader: e.fragmentShader
|
|
1139
|
-
})), this.fsQuad = new
|
|
1436
|
+
})), this.fsQuad = new R(this.material);
|
|
1140
1437
|
}
|
|
1141
1438
|
render(e, t, o) {
|
|
1142
1439
|
this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = o.texture), this.fsQuad.material = this.material, this.renderToScreen ? (e.setRenderTarget(null), this.fsQuad.render(e)) : (e.setRenderTarget(t), this.clear && e.clear(e.autoClearColor, e.autoClearDepth, e.autoClearStencil), this.fsQuad.render(e));
|
|
@@ -1145,18 +1442,18 @@ class gt extends T {
|
|
|
1145
1442
|
this.material.dispose(), this.fsQuad.dispose();
|
|
1146
1443
|
}
|
|
1147
1444
|
}
|
|
1148
|
-
class
|
|
1445
|
+
class Oe extends C {
|
|
1149
1446
|
constructor(e, t) {
|
|
1150
1447
|
super(), this.scene = e, this.camera = t, this.clear = !0, this.needsSwap = !1, this.inverse = !1;
|
|
1151
1448
|
}
|
|
1152
1449
|
render(e, t, o) {
|
|
1153
|
-
const
|
|
1154
|
-
|
|
1450
|
+
const s = e.getContext(), a = e.state;
|
|
1451
|
+
a.buffers.color.setMask(!1), a.buffers.depth.setMask(!1), a.buffers.color.setLocked(!0), a.buffers.depth.setLocked(!0);
|
|
1155
1452
|
let i, n;
|
|
1156
|
-
this.inverse ? (i = 0, n = 1) : (i = 1, n = 0),
|
|
1453
|
+
this.inverse ? (i = 0, n = 1) : (i = 1, n = 0), a.buffers.stencil.setTest(!0), a.buffers.stencil.setOp(s.REPLACE, s.REPLACE, s.REPLACE), a.buffers.stencil.setFunc(s.ALWAYS, i, 4294967295), a.buffers.stencil.setClear(n), a.buffers.stencil.setLocked(!0), e.setRenderTarget(o), this.clear && e.clear(), e.render(this.scene, this.camera), e.setRenderTarget(t), this.clear && e.clear(), e.render(this.scene, this.camera), a.buffers.color.setLocked(!1), a.buffers.depth.setLocked(!1), a.buffers.color.setMask(!0), a.buffers.depth.setMask(!0), a.buffers.stencil.setLocked(!1), a.buffers.stencil.setFunc(s.EQUAL, 1, 4294967295), a.buffers.stencil.setOp(s.KEEP, s.KEEP, s.KEEP), a.buffers.stencil.setLocked(!0);
|
|
1157
1454
|
}
|
|
1158
1455
|
}
|
|
1159
|
-
class
|
|
1456
|
+
class Tt extends C {
|
|
1160
1457
|
constructor() {
|
|
1161
1458
|
super(), this.needsSwap = !1;
|
|
1162
1459
|
}
|
|
@@ -1164,14 +1461,14 @@ class vt extends T {
|
|
|
1164
1461
|
e.state.buffers.stencil.setLocked(!1), e.state.buffers.stencil.setTest(!1);
|
|
1165
1462
|
}
|
|
1166
1463
|
}
|
|
1167
|
-
class
|
|
1464
|
+
class Ct {
|
|
1168
1465
|
constructor(e, t) {
|
|
1169
1466
|
if (this.renderer = e, this._pixelRatio = e.getPixelRatio(), t === void 0) {
|
|
1170
1467
|
const o = e.getSize(new d());
|
|
1171
|
-
this._width = o.width, this._height = o.height, t = new D(this._width * this._pixelRatio, this._height * this._pixelRatio, { type:
|
|
1468
|
+
this._width = o.width, this._height = o.height, t = new D(this._width * this._pixelRatio, this._height * this._pixelRatio, { type: T }), t.texture.name = "EffectComposer.rt1";
|
|
1172
1469
|
} else
|
|
1173
1470
|
this._width = t.width, this._height = t.height;
|
|
1174
|
-
this.renderTarget1 = t, this.renderTarget2 = t.clone(), this.renderTarget2.texture.name = "EffectComposer.rt2", this.writeBuffer = this.renderTarget1, this.readBuffer = this.renderTarget2, this.renderToScreen = !0, this.passes = [], this.copyPass = new
|
|
1471
|
+
this.renderTarget1 = t, this.renderTarget2 = t.clone(), this.renderTarget2.texture.name = "EffectComposer.rt2", this.writeBuffer = this.renderTarget1, this.readBuffer = this.renderTarget2, this.renderToScreen = !0, this.passes = [], this.copyPass = new Mt(Ue), this.copyPass.material.blending = Ze, this.clock = new _e();
|
|
1175
1472
|
}
|
|
1176
1473
|
swapBuffers() {
|
|
1177
1474
|
const e = this.readBuffer;
|
|
@@ -1197,17 +1494,17 @@ class xt {
|
|
|
1197
1494
|
e === void 0 && (e = this.clock.getDelta());
|
|
1198
1495
|
const t = this.renderer.getRenderTarget();
|
|
1199
1496
|
let o = !1;
|
|
1200
|
-
for (let
|
|
1201
|
-
const i = this.passes[
|
|
1497
|
+
for (let s = 0, a = this.passes.length; s < a; s++) {
|
|
1498
|
+
const i = this.passes[s];
|
|
1202
1499
|
if (i.enabled !== !1) {
|
|
1203
|
-
if (i.renderToScreen = this.renderToScreen && this.isLastEnabledPass(
|
|
1500
|
+
if (i.renderToScreen = this.renderToScreen && this.isLastEnabledPass(s), i.render(this.renderer, this.writeBuffer, this.readBuffer, e, o), i.needsSwap) {
|
|
1204
1501
|
if (o) {
|
|
1205
1502
|
const n = this.renderer.getContext(), l = this.renderer.state.buffers.stencil;
|
|
1206
1503
|
l.setFunc(n.NOTEQUAL, 1, 4294967295), this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e), l.setFunc(n.EQUAL, 1, 4294967295);
|
|
1207
1504
|
}
|
|
1208
1505
|
this.swapBuffers();
|
|
1209
1506
|
}
|
|
1210
|
-
|
|
1507
|
+
Oe !== void 0 && (i instanceof Oe ? o = !0 : i instanceof Tt && (o = !1));
|
|
1211
1508
|
}
|
|
1212
1509
|
}
|
|
1213
1510
|
this.renderer.setRenderTarget(t);
|
|
@@ -1221,10 +1518,10 @@ class xt {
|
|
|
1221
1518
|
}
|
|
1222
1519
|
setSize(e, t) {
|
|
1223
1520
|
this._width = e, this._height = t;
|
|
1224
|
-
const o = this._width * this._pixelRatio,
|
|
1225
|
-
this.renderTarget1.setSize(o,
|
|
1226
|
-
for (let
|
|
1227
|
-
this.passes[
|
|
1521
|
+
const o = this._width * this._pixelRatio, s = this._height * this._pixelRatio;
|
|
1522
|
+
this.renderTarget1.setSize(o, s), this.renderTarget2.setSize(o, s);
|
|
1523
|
+
for (let a = 0; a < this.passes.length; a++)
|
|
1524
|
+
this.passes[a].setSize(o, s);
|
|
1228
1525
|
}
|
|
1229
1526
|
setPixelRatio(e) {
|
|
1230
1527
|
this._pixelRatio = e, this.setSize(this._width, this._height);
|
|
@@ -1233,61 +1530,73 @@ class xt {
|
|
|
1233
1530
|
this.renderTarget1.dispose(), this.renderTarget2.dispose(), this.copyPass.dispose();
|
|
1234
1531
|
}
|
|
1235
1532
|
}
|
|
1236
|
-
class
|
|
1237
|
-
constructor(e, t, o = null,
|
|
1238
|
-
super(), this.scene = e, this.camera = t, this.overrideMaterial = o, this.clearColor =
|
|
1533
|
+
class Et extends C {
|
|
1534
|
+
constructor(e, t, o = null, s = null, a = null) {
|
|
1535
|
+
super(), this.scene = e, this.camera = t, this.overrideMaterial = o, this.clearColor = s, this.clearAlpha = a, this.clear = !0, this.clearDepth = !1, this.needsSwap = !1, this._oldClearColor = new k();
|
|
1239
1536
|
}
|
|
1240
1537
|
render(e, t, o) {
|
|
1241
|
-
const
|
|
1538
|
+
const s = e.autoClear;
|
|
1242
1539
|
e.autoClear = !1;
|
|
1243
|
-
let
|
|
1244
|
-
this.overrideMaterial !== null && (i = this.scene.overrideMaterial, this.scene.overrideMaterial = this.overrideMaterial), this.clearColor !== null && (e.getClearColor(this._oldClearColor), e.setClearColor(this.clearColor, e.getClearAlpha())), this.clearAlpha !== null && (
|
|
1540
|
+
let a, i;
|
|
1541
|
+
this.overrideMaterial !== null && (i = this.scene.overrideMaterial, this.scene.overrideMaterial = this.overrideMaterial), this.clearColor !== null && (e.getClearColor(this._oldClearColor), e.setClearColor(this.clearColor, e.getClearAlpha())), this.clearAlpha !== null && (a = e.getClearAlpha(), e.setClearAlpha(this.clearAlpha)), this.clearDepth == !0 && e.clearDepth(), e.setRenderTarget(this.renderToScreen ? null : o), this.clear === !0 && e.clear(e.autoClearColor, e.autoClearDepth, e.autoClearStencil), e.render(this.scene, this.camera), this.clearColor !== null && e.setClearColor(this._oldClearColor), this.clearAlpha !== null && e.setClearAlpha(a), this.overrideMaterial !== null && (this.scene.overrideMaterial = i), e.autoClear = s;
|
|
1245
1542
|
}
|
|
1246
1543
|
}
|
|
1247
|
-
const
|
|
1544
|
+
const Ge = Symbol("effectComposerThree"), fo = /* @__PURE__ */ u({
|
|
1248
1545
|
__name: "EffectComposer",
|
|
1249
1546
|
props: {
|
|
1250
1547
|
enabled: { type: Boolean, default: !0 },
|
|
1251
1548
|
withoutRenderPass: { type: Boolean }
|
|
1252
1549
|
},
|
|
1253
1550
|
setup(r, { expose: e }) {
|
|
1254
|
-
const t = r, o =
|
|
1255
|
-
|
|
1256
|
-
const { renderer:
|
|
1257
|
-
|
|
1258
|
-
var
|
|
1259
|
-
(
|
|
1260
|
-
}),
|
|
1261
|
-
var
|
|
1262
|
-
const { width:
|
|
1263
|
-
|
|
1551
|
+
const t = r, o = W(null);
|
|
1552
|
+
Be(Ge, o), e({ composer: o });
|
|
1553
|
+
const { renderer: s, sizes: a, scene: i, camera: n, render: l } = y();
|
|
1554
|
+
x(() => {
|
|
1555
|
+
var c;
|
|
1556
|
+
(c = o.value) == null || c.dispose(), o.value = new Ct(s.value);
|
|
1557
|
+
}), x(() => {
|
|
1558
|
+
var E;
|
|
1559
|
+
const { width: c, height: b } = a;
|
|
1560
|
+
b.value && c.value && ((E = o.value) == null || E.setSize(c.value, b.value));
|
|
1264
1561
|
});
|
|
1265
|
-
const { pixelRatio:
|
|
1266
|
-
|
|
1267
|
-
var
|
|
1268
|
-
(
|
|
1269
|
-
}), t.withoutRenderPass ||
|
|
1270
|
-
n.value && i.value && o.value && o.value.addPass(new
|
|
1562
|
+
const { pixelRatio: f } = ze();
|
|
1563
|
+
x(() => {
|
|
1564
|
+
var c;
|
|
1565
|
+
(c = o.value) == null || c.setPixelRatio(f.value);
|
|
1566
|
+
}), t.withoutRenderPass || x(() => {
|
|
1567
|
+
n.value && i.value && o.value && o.value.addPass(new Et(i.value, n.value));
|
|
1271
1568
|
});
|
|
1272
|
-
const { render:
|
|
1273
|
-
return
|
|
1569
|
+
const { render: g } = G();
|
|
1570
|
+
return g(() => {
|
|
1274
1571
|
l.frames.value > 0 && o.value && t.enabled && o.value.render(), l.frames.value = l.mode.value === "always" ? 1 : Math.max(0, l.frames.value - 1);
|
|
1275
|
-
}),
|
|
1276
|
-
var
|
|
1277
|
-
(
|
|
1278
|
-
}), (
|
|
1279
|
-
}
|
|
1280
|
-
}),
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
const
|
|
1284
|
-
|
|
1572
|
+
}), U(() => {
|
|
1573
|
+
var c;
|
|
1574
|
+
(c = o.value) == null || c.dispose();
|
|
1575
|
+
}), (c, b) => Ne(c.$slots, "default");
|
|
1576
|
+
}
|
|
1577
|
+
}), N = (r, e, t) => {
|
|
1578
|
+
if (!e && t)
|
|
1579
|
+
throw new Error("passDependencies is required when dependencyFieldsTriggeringRecreation is provided");
|
|
1580
|
+
const o = te(Ge), s = W(r()), { sizes: a, invalidate: i } = y();
|
|
1581
|
+
e && S(e, () => i());
|
|
1582
|
+
const n = () => {
|
|
1583
|
+
var p;
|
|
1584
|
+
(p = o == null ? void 0 : o.value) == null || p.removePass(s.value), s.value.dispose();
|
|
1585
|
+
}, l = x(() => {
|
|
1586
|
+
!(o != null && o.value) || !a.height.value || !a.width.value || (o.value.addPass(s.value), oe(() => l()));
|
|
1285
1587
|
});
|
|
1286
|
-
return
|
|
1287
|
-
|
|
1288
|
-
(
|
|
1289
|
-
|
|
1290
|
-
|
|
1588
|
+
return t && S(
|
|
1589
|
+
() => t.map((p) => e == null ? void 0 : e[p]),
|
|
1590
|
+
() => {
|
|
1591
|
+
if (!(o != null && o.value))
|
|
1592
|
+
return;
|
|
1593
|
+
const p = o.value.passes.findIndex((f) => f === s.value);
|
|
1594
|
+
~p && (n(), s.value = r(), o.value.insertPass(s.value, p));
|
|
1595
|
+
}
|
|
1596
|
+
), U(() => {
|
|
1597
|
+
n();
|
|
1598
|
+
}), { pass: s };
|
|
1599
|
+
}, Pt = {
|
|
1291
1600
|
uniforms: {
|
|
1292
1601
|
tDiffuse: { value: null },
|
|
1293
1602
|
//diffuse texture
|
|
@@ -1382,53 +1691,53 @@ const Ne = Symbol("effectComposerThree"), Zt = /* @__PURE__ */ c({
|
|
|
1382
1691
|
}`
|
|
1383
1692
|
)
|
|
1384
1693
|
};
|
|
1385
|
-
class
|
|
1694
|
+
class Re extends C {
|
|
1386
1695
|
constructor(e = 64) {
|
|
1387
1696
|
super();
|
|
1388
|
-
const t =
|
|
1389
|
-
this.uniforms =
|
|
1697
|
+
const t = Pt;
|
|
1698
|
+
this.uniforms = P.clone(t.uniforms), this.heightMap = this.generateHeightmap(e), this.uniforms.tDisp.value = this.heightMap, this.material = new A({
|
|
1390
1699
|
uniforms: this.uniforms,
|
|
1391
1700
|
vertexShader: t.vertexShader,
|
|
1392
1701
|
fragmentShader: t.fragmentShader
|
|
1393
|
-
}), this.fsQuad = new
|
|
1702
|
+
}), this.fsQuad = new R(this.material), this.goWild = !1, this.curF = 0, this.generateTrigger();
|
|
1394
1703
|
}
|
|
1395
1704
|
render(e, t, o) {
|
|
1396
|
-
this.uniforms.tDiffuse.value = o.texture, this.uniforms.seed.value = Math.random(), this.uniforms.byp.value = 0, this.curF % this.randX == 0 || this.goWild == !0 ? (this.uniforms.amount.value = Math.random() / 30, this.uniforms.angle.value =
|
|
1705
|
+
this.uniforms.tDiffuse.value = o.texture, this.uniforms.seed.value = Math.random(), this.uniforms.byp.value = 0, this.curF % this.randX == 0 || this.goWild == !0 ? (this.uniforms.amount.value = Math.random() / 30, this.uniforms.angle.value = w.randFloat(-Math.PI, Math.PI), this.uniforms.seed_x.value = w.randFloat(-1, 1), this.uniforms.seed_y.value = w.randFloat(-1, 1), this.uniforms.distortion_x.value = w.randFloat(0, 1), this.uniforms.distortion_y.value = w.randFloat(0, 1), this.curF = 0, this.generateTrigger()) : this.curF % this.randX < this.randX / 5 ? (this.uniforms.amount.value = Math.random() / 90, this.uniforms.angle.value = w.randFloat(-Math.PI, Math.PI), this.uniforms.distortion_x.value = w.randFloat(0, 1), this.uniforms.distortion_y.value = w.randFloat(0, 1), this.uniforms.seed_x.value = w.randFloat(-0.3, 0.3), this.uniforms.seed_y.value = w.randFloat(-0.3, 0.3)) : this.goWild == !1 && (this.uniforms.byp.value = 1), this.curF++, this.renderToScreen ? (e.setRenderTarget(null), this.fsQuad.render(e)) : (e.setRenderTarget(t), this.clear && e.clear(), this.fsQuad.render(e));
|
|
1397
1706
|
}
|
|
1398
1707
|
generateTrigger() {
|
|
1399
|
-
this.randX =
|
|
1708
|
+
this.randX = w.randInt(120, 240);
|
|
1400
1709
|
}
|
|
1401
1710
|
generateHeightmap(e) {
|
|
1402
1711
|
const t = new Float32Array(e * e), o = e * e;
|
|
1403
|
-
for (let
|
|
1404
|
-
const i =
|
|
1405
|
-
t[
|
|
1712
|
+
for (let a = 0; a < o; a++) {
|
|
1713
|
+
const i = w.randFloat(0, 1);
|
|
1714
|
+
t[a] = i;
|
|
1406
1715
|
}
|
|
1407
|
-
const
|
|
1408
|
-
return
|
|
1716
|
+
const s = new $e(t, e, e, et, tt);
|
|
1717
|
+
return s.needsUpdate = !0, s;
|
|
1409
1718
|
}
|
|
1410
1719
|
dispose() {
|
|
1411
1720
|
this.material.dispose(), this.heightMap.dispose(), this.fsQuad.dispose();
|
|
1412
1721
|
}
|
|
1413
1722
|
}
|
|
1414
|
-
const
|
|
1723
|
+
const ho = /* @__PURE__ */ u({
|
|
1415
1724
|
__name: "Glitch",
|
|
1416
1725
|
props: {
|
|
1417
1726
|
dtSize: {},
|
|
1418
1727
|
goWild: { type: Boolean }
|
|
1419
1728
|
},
|
|
1420
1729
|
setup(r, { expose: e }) {
|
|
1421
|
-
const t = r, { pass: o } =
|
|
1730
|
+
const t = r, { pass: o } = N(() => new Re(t.dtSize), t, ["dtSize"]);
|
|
1422
1731
|
e({ pass: o });
|
|
1423
|
-
const { onBeforeRender:
|
|
1424
|
-
return
|
|
1732
|
+
const { onBeforeRender: s } = G();
|
|
1733
|
+
return s(({ invalidate: a }) => a()), m(
|
|
1425
1734
|
[[() => t.goWild, "goWild"]],
|
|
1426
1735
|
o,
|
|
1427
|
-
() => new
|
|
1736
|
+
() => new Re()
|
|
1428
1737
|
), () => {
|
|
1429
1738
|
};
|
|
1430
1739
|
}
|
|
1431
|
-
}),
|
|
1740
|
+
}), Y = {
|
|
1432
1741
|
name: "HalftoneShader",
|
|
1433
1742
|
uniforms: {
|
|
1434
1743
|
tDiffuse: { value: null },
|
|
@@ -1732,16 +2041,16 @@ const _t = /* @__PURE__ */ c({
|
|
|
1732
2041
|
}`
|
|
1733
2042
|
)
|
|
1734
2043
|
};
|
|
1735
|
-
class
|
|
2044
|
+
class Dt extends C {
|
|
1736
2045
|
constructor(e, t, o) {
|
|
1737
|
-
super(), this.uniforms =
|
|
2046
|
+
super(), this.uniforms = P.clone(Y.uniforms), this.material = new A({
|
|
1738
2047
|
uniforms: this.uniforms,
|
|
1739
|
-
fragmentShader:
|
|
1740
|
-
vertexShader:
|
|
2048
|
+
fragmentShader: Y.fragmentShader,
|
|
2049
|
+
vertexShader: Y.vertexShader
|
|
1741
2050
|
}), this.uniforms.width.value = e, this.uniforms.height.value = t;
|
|
1742
|
-
for (const
|
|
1743
|
-
o.hasOwnProperty(
|
|
1744
|
-
this.fsQuad = new
|
|
2051
|
+
for (const s in o)
|
|
2052
|
+
o.hasOwnProperty(s) && this.uniforms.hasOwnProperty(s) && (this.uniforms[s].value = o[s]);
|
|
2053
|
+
this.fsQuad = new R(this.material);
|
|
1745
2054
|
}
|
|
1746
2055
|
render(e, t, o) {
|
|
1747
2056
|
this.material.uniforms.tDiffuse.value = o.texture, this.renderToScreen ? (e.setRenderTarget(null), this.fsQuad.render(e)) : (e.setRenderTarget(t), this.clear && e.clear(), this.fsQuad.render(e));
|
|
@@ -1753,7 +2062,7 @@ class At extends T {
|
|
|
1753
2062
|
this.material.dispose(), this.fsQuad.dispose();
|
|
1754
2063
|
}
|
|
1755
2064
|
}
|
|
1756
|
-
const
|
|
2065
|
+
const po = /* @__PURE__ */ u({
|
|
1757
2066
|
__name: "Halftone",
|
|
1758
2067
|
props: {
|
|
1759
2068
|
shape: {},
|
|
@@ -1767,36 +2076,36 @@ const $t = /* @__PURE__ */ c({
|
|
|
1767
2076
|
blendingMode: {}
|
|
1768
2077
|
},
|
|
1769
2078
|
setup(r, { expose: e }) {
|
|
1770
|
-
const t = r, { sizes: o } =
|
|
2079
|
+
const t = r, { sizes: o } = y(), s = O(
|
|
1771
2080
|
() => Object.fromEntries(
|
|
1772
2081
|
Object.entries(t).filter(([i, n]) => n !== void 0)
|
|
1773
2082
|
)
|
|
1774
|
-
), { pass:
|
|
2083
|
+
), { pass: a } = N(() => new Dt(
|
|
1775
2084
|
o.width.value,
|
|
1776
2085
|
o.height.value,
|
|
1777
|
-
|
|
2086
|
+
s.value
|
|
1778
2087
|
), t);
|
|
1779
|
-
return e({ pass:
|
|
1780
|
-
|
|
1781
|
-
}),
|
|
2088
|
+
return e({ pass: a }), x(() => {
|
|
2089
|
+
a.value.setSize(o.width.value, o.height.value);
|
|
2090
|
+
}), x(() => {
|
|
1782
2091
|
Object.entries(t).forEach(([i, n]) => {
|
|
1783
|
-
i in
|
|
2092
|
+
i in a.value.uniforms && (a.value.uniforms[i].value = n ?? Y.uniforms[i].value);
|
|
1784
2093
|
});
|
|
1785
2094
|
}), () => {
|
|
1786
2095
|
};
|
|
1787
2096
|
}
|
|
1788
2097
|
});
|
|
1789
|
-
class
|
|
1790
|
-
constructor(e, t, o,
|
|
1791
|
-
super(), this.pixelSize = e, this.resolution = new d(), this.renderResolution = new d(), this.pixelatedMaterial = this.createPixelatedMaterial(), this.normalMaterial = new
|
|
2098
|
+
class Fe extends C {
|
|
2099
|
+
constructor(e, t, o, s = {}) {
|
|
2100
|
+
super(), this.pixelSize = e, this.resolution = new d(), this.renderResolution = new d(), this.pixelatedMaterial = this.createPixelatedMaterial(), this.normalMaterial = new ot(), this.fsQuad = new R(this.pixelatedMaterial), this.scene = t, this.camera = o, this.normalEdgeStrength = s.normalEdgeStrength || 0.3, this.depthEdgeStrength = s.depthEdgeStrength || 0.4, this.beautyRenderTarget = new D(), this.beautyRenderTarget.texture.minFilter = F, this.beautyRenderTarget.texture.magFilter = F, this.beautyRenderTarget.texture.type = T, this.beautyRenderTarget.depthTexture = new st(), this.normalRenderTarget = new D(), this.normalRenderTarget.texture.minFilter = F, this.normalRenderTarget.texture.magFilter = F, this.normalRenderTarget.texture.type = T;
|
|
1792
2101
|
}
|
|
1793
2102
|
dispose() {
|
|
1794
2103
|
this.beautyRenderTarget.dispose(), this.normalRenderTarget.dispose(), this.pixelatedMaterial.dispose(), this.normalMaterial.dispose(), this.fsQuad.dispose();
|
|
1795
2104
|
}
|
|
1796
2105
|
setSize(e, t) {
|
|
1797
2106
|
this.resolution.set(e, t), this.renderResolution.set(e / this.pixelSize | 0, t / this.pixelSize | 0);
|
|
1798
|
-
const { x: o, y:
|
|
1799
|
-
this.beautyRenderTarget.setSize(o,
|
|
2107
|
+
const { x: o, y: s } = this.renderResolution;
|
|
2108
|
+
this.beautyRenderTarget.setSize(o, s), this.normalRenderTarget.setSize(o, s), this.fsQuad.material.uniforms.resolution.value.set(o, s, 1 / o, 1 / s);
|
|
1800
2109
|
}
|
|
1801
2110
|
setPixelSize(e) {
|
|
1802
2111
|
this.pixelSize = e, this.setSize(this.resolution.x, this.resolution.y);
|
|
@@ -1804,17 +2113,17 @@ class Me extends T {
|
|
|
1804
2113
|
render(e, t) {
|
|
1805
2114
|
const o = this.fsQuad.material.uniforms;
|
|
1806
2115
|
o.normalEdgeStrength.value = this.normalEdgeStrength, o.depthEdgeStrength.value = this.depthEdgeStrength, e.setRenderTarget(this.beautyRenderTarget), e.render(this.scene, this.camera);
|
|
1807
|
-
const
|
|
1808
|
-
e.setRenderTarget(this.normalRenderTarget), this.scene.overrideMaterial = this.normalMaterial, e.render(this.scene, this.camera), this.scene.overrideMaterial =
|
|
2116
|
+
const s = this.scene.overrideMaterial;
|
|
2117
|
+
e.setRenderTarget(this.normalRenderTarget), this.scene.overrideMaterial = this.normalMaterial, e.render(this.scene, this.camera), this.scene.overrideMaterial = s, o.tDiffuse.value = this.beautyRenderTarget.texture, o.tDepth.value = this.beautyRenderTarget.depthTexture, o.tNormal.value = this.normalRenderTarget.texture, this.renderToScreen ? e.setRenderTarget(null) : (e.setRenderTarget(t), this.clear && e.clear()), this.fsQuad.render(e);
|
|
1809
2118
|
}
|
|
1810
2119
|
createPixelatedMaterial() {
|
|
1811
|
-
return new
|
|
2120
|
+
return new A({
|
|
1812
2121
|
uniforms: {
|
|
1813
2122
|
tDiffuse: { value: null },
|
|
1814
2123
|
tDepth: { value: null },
|
|
1815
2124
|
tNormal: { value: null },
|
|
1816
2125
|
resolution: {
|
|
1817
|
-
value: new
|
|
2126
|
+
value: new at(
|
|
1818
2127
|
this.renderResolution.x,
|
|
1819
2128
|
this.renderResolution.y,
|
|
1820
2129
|
1 / this.renderResolution.x,
|
|
@@ -1933,7 +2242,7 @@ class Me extends T {
|
|
|
1933
2242
|
});
|
|
1934
2243
|
}
|
|
1935
2244
|
}
|
|
1936
|
-
const
|
|
2245
|
+
const mo = /* @__PURE__ */ u({
|
|
1937
2246
|
__name: "Pixelation",
|
|
1938
2247
|
props: {
|
|
1939
2248
|
pixelSize: {},
|
|
@@ -1941,20 +2250,20 @@ const eo = /* @__PURE__ */ c({
|
|
|
1941
2250
|
normalEdgeStrength: {}
|
|
1942
2251
|
},
|
|
1943
2252
|
setup(r, { expose: e }) {
|
|
1944
|
-
const t = r, { scene: o, camera:
|
|
1945
|
-
return e({ pass:
|
|
1946
|
-
|
|
1947
|
-
}),
|
|
2253
|
+
const t = r, { scene: o, camera: s } = y(), { pass: a } = N(() => new Fe(t.pixelSize, o.value, s.value), t);
|
|
2254
|
+
return e({ pass: a }), x(() => {
|
|
2255
|
+
a.value.setPixelSize(t.pixelSize);
|
|
2256
|
+
}), m(
|
|
1948
2257
|
[
|
|
1949
2258
|
[() => t.depthEdgeStrength, "depthEdgeStrength"],
|
|
1950
2259
|
[() => t.normalEdgeStrength, "normalEdgeStrength"]
|
|
1951
2260
|
],
|
|
1952
|
-
|
|
1953
|
-
() => new
|
|
2261
|
+
a,
|
|
2262
|
+
() => new Fe(1, o.value, s.value)
|
|
1954
2263
|
), () => {
|
|
1955
2264
|
};
|
|
1956
2265
|
}
|
|
1957
|
-
}),
|
|
2266
|
+
}), Lt = {
|
|
1958
2267
|
name: "OutputShader",
|
|
1959
2268
|
uniforms: {
|
|
1960
2269
|
tDiffuse: { value: null },
|
|
@@ -1983,7 +2292,7 @@ const eo = /* @__PURE__ */ c({
|
|
|
1983
2292
|
fragmentShader: (
|
|
1984
2293
|
/* glsl */
|
|
1985
2294
|
`
|
|
1986
|
-
|
|
2295
|
+
|
|
1987
2296
|
precision highp float;
|
|
1988
2297
|
|
|
1989
2298
|
uniform sampler2D tDiffuse;
|
|
@@ -2023,6 +2332,10 @@ const eo = /* @__PURE__ */ c({
|
|
|
2023
2332
|
|
|
2024
2333
|
gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb );
|
|
2025
2334
|
|
|
2335
|
+
#elif defined( CUSTOM_TONE_MAPPING )
|
|
2336
|
+
|
|
2337
|
+
gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb );
|
|
2338
|
+
|
|
2026
2339
|
#endif
|
|
2027
2340
|
|
|
2028
2341
|
// color space
|
|
@@ -2036,32 +2349,32 @@ const eo = /* @__PURE__ */ c({
|
|
|
2036
2349
|
}`
|
|
2037
2350
|
)
|
|
2038
2351
|
};
|
|
2039
|
-
class
|
|
2352
|
+
class Ot extends C {
|
|
2040
2353
|
constructor() {
|
|
2041
2354
|
super();
|
|
2042
|
-
const e =
|
|
2043
|
-
this.uniforms =
|
|
2355
|
+
const e = Lt;
|
|
2356
|
+
this.uniforms = P.clone(e.uniforms), this.material = new rt({
|
|
2044
2357
|
name: e.name,
|
|
2045
2358
|
uniforms: this.uniforms,
|
|
2046
2359
|
vertexShader: e.vertexShader,
|
|
2047
2360
|
fragmentShader: e.fragmentShader
|
|
2048
|
-
}), this.fsQuad = new
|
|
2361
|
+
}), this.fsQuad = new R(this.material), this._outputColorSpace = null, this._toneMapping = null;
|
|
2049
2362
|
}
|
|
2050
2363
|
render(e, t, o) {
|
|
2051
|
-
this.uniforms.tDiffuse.value = o.texture, this.uniforms.toneMappingExposure.value = e.toneMappingExposure, (this._outputColorSpace !== e.outputColorSpace || this._toneMapping !== e.toneMapping) && (this._outputColorSpace = e.outputColorSpace, this._toneMapping = e.toneMapping, this.material.defines = {},
|
|
2364
|
+
this.uniforms.tDiffuse.value = o.texture, this.uniforms.toneMappingExposure.value = e.toneMappingExposure, (this._outputColorSpace !== e.outputColorSpace || this._toneMapping !== e.toneMapping) && (this._outputColorSpace = e.outputColorSpace, this._toneMapping = e.toneMapping, this.material.defines = {}, it.getTransfer(this._outputColorSpace) === nt && (this.material.defines.SRGB_TRANSFER = ""), this._toneMapping === lt ? this.material.defines.LINEAR_TONE_MAPPING = "" : this._toneMapping === ut ? this.material.defines.REINHARD_TONE_MAPPING = "" : this._toneMapping === ct ? this.material.defines.CINEON_TONE_MAPPING = "" : this._toneMapping === dt ? this.material.defines.ACES_FILMIC_TONE_MAPPING = "" : this._toneMapping === ft ? this.material.defines.AGX_TONE_MAPPING = "" : this._toneMapping === ht ? this.material.defines.NEUTRAL_TONE_MAPPING = "" : this._toneMapping === pt && (this.material.defines.CUSTOM_TONE_MAPPING = ""), this.material.needsUpdate = !0), this.renderToScreen === !0 ? (e.setRenderTarget(null), this.fsQuad.render(e)) : (e.setRenderTarget(t), this.clear && e.clear(e.autoClearColor, e.autoClearDepth, e.autoClearStencil), this.fsQuad.render(e));
|
|
2052
2365
|
}
|
|
2053
2366
|
dispose() {
|
|
2054
2367
|
this.material.dispose(), this.fsQuad.dispose();
|
|
2055
2368
|
}
|
|
2056
2369
|
}
|
|
2057
|
-
const
|
|
2370
|
+
const go = /* @__PURE__ */ u({
|
|
2058
2371
|
__name: "Output",
|
|
2059
2372
|
setup(r, { expose: e }) {
|
|
2060
|
-
const { pass: t } =
|
|
2373
|
+
const { pass: t } = N(() => new Ot());
|
|
2061
2374
|
return e({ pass: t }), () => {
|
|
2062
2375
|
};
|
|
2063
2376
|
}
|
|
2064
|
-
}),
|
|
2377
|
+
}), j = {
|
|
2065
2378
|
name: "SMAAEdgesShader",
|
|
2066
2379
|
defines: {
|
|
2067
2380
|
SMAA_THRESHOLD: "0.1"
|
|
@@ -2162,7 +2475,7 @@ const to = /* @__PURE__ */ c({
|
|
|
2162
2475
|
|
|
2163
2476
|
}`
|
|
2164
2477
|
)
|
|
2165
|
-
},
|
|
2478
|
+
}, V = {
|
|
2166
2479
|
name: "SMAAWeightsShader",
|
|
2167
2480
|
defines: {
|
|
2168
2481
|
SMAA_MAX_SEARCH_STEPS: "8",
|
|
@@ -2412,7 +2725,7 @@ const to = /* @__PURE__ */ c({
|
|
|
2412
2725
|
|
|
2413
2726
|
}`
|
|
2414
2727
|
)
|
|
2415
|
-
},
|
|
2728
|
+
}, ee = {
|
|
2416
2729
|
name: "SMAABlendShader",
|
|
2417
2730
|
uniforms: {
|
|
2418
2731
|
tDiffuse: { value: null },
|
|
@@ -2502,37 +2815,37 @@ const to = /* @__PURE__ */ c({
|
|
|
2502
2815
|
}`
|
|
2503
2816
|
)
|
|
2504
2817
|
};
|
|
2505
|
-
class
|
|
2818
|
+
class Rt extends C {
|
|
2506
2819
|
constructor(e, t) {
|
|
2507
2820
|
super(), this.edgesRT = new D(e, t, {
|
|
2508
2821
|
depthBuffer: !1,
|
|
2509
|
-
type:
|
|
2822
|
+
type: T
|
|
2510
2823
|
}), this.edgesRT.texture.name = "SMAAPass.edges", this.weightsRT = new D(e, t, {
|
|
2511
2824
|
depthBuffer: !1,
|
|
2512
|
-
type:
|
|
2825
|
+
type: T
|
|
2513
2826
|
}), this.weightsRT.texture.name = "SMAAPass.weights";
|
|
2514
|
-
const o = this,
|
|
2515
|
-
|
|
2827
|
+
const o = this, s = new Image();
|
|
2828
|
+
s.src = this.getAreaTexture(), s.onload = function() {
|
|
2516
2829
|
o.areaTexture.needsUpdate = !0;
|
|
2517
|
-
}, this.areaTexture = new
|
|
2518
|
-
const
|
|
2519
|
-
|
|
2830
|
+
}, this.areaTexture = new Me(), this.areaTexture.name = "SMAAPass.area", this.areaTexture.image = s, this.areaTexture.minFilter = mt, this.areaTexture.generateMipmaps = !1, this.areaTexture.flipY = !1;
|
|
2831
|
+
const a = new Image();
|
|
2832
|
+
a.src = this.getSearchTexture(), a.onload = function() {
|
|
2520
2833
|
o.searchTexture.needsUpdate = !0;
|
|
2521
|
-
}, this.searchTexture = new
|
|
2522
|
-
defines: Object.assign({},
|
|
2834
|
+
}, this.searchTexture = new Me(), this.searchTexture.name = "SMAAPass.search", this.searchTexture.image = a, this.searchTexture.magFilter = F, this.searchTexture.minFilter = F, this.searchTexture.generateMipmaps = !1, this.searchTexture.flipY = !1, this.uniformsEdges = P.clone(j.uniforms), this.uniformsEdges.resolution.value.set(1 / e, 1 / t), this.materialEdges = new A({
|
|
2835
|
+
defines: Object.assign({}, j.defines),
|
|
2523
2836
|
uniforms: this.uniformsEdges,
|
|
2524
|
-
vertexShader:
|
|
2525
|
-
fragmentShader:
|
|
2526
|
-
}), this.uniformsWeights =
|
|
2527
|
-
defines: Object.assign({},
|
|
2837
|
+
vertexShader: j.vertexShader,
|
|
2838
|
+
fragmentShader: j.fragmentShader
|
|
2839
|
+
}), this.uniformsWeights = P.clone(V.uniforms), this.uniformsWeights.resolution.value.set(1 / e, 1 / t), this.uniformsWeights.tDiffuse.value = this.edgesRT.texture, this.uniformsWeights.tArea.value = this.areaTexture, this.uniformsWeights.tSearch.value = this.searchTexture, this.materialWeights = new A({
|
|
2840
|
+
defines: Object.assign({}, V.defines),
|
|
2528
2841
|
uniforms: this.uniformsWeights,
|
|
2529
|
-
vertexShader:
|
|
2530
|
-
fragmentShader:
|
|
2531
|
-
}), this.uniformsBlend =
|
|
2842
|
+
vertexShader: V.vertexShader,
|
|
2843
|
+
fragmentShader: V.fragmentShader
|
|
2844
|
+
}), this.uniformsBlend = P.clone(ee.uniforms), this.uniformsBlend.resolution.value.set(1 / e, 1 / t), this.uniformsBlend.tDiffuse.value = this.weightsRT.texture, this.materialBlend = new A({
|
|
2532
2845
|
uniforms: this.uniformsBlend,
|
|
2533
|
-
vertexShader:
|
|
2534
|
-
fragmentShader:
|
|
2535
|
-
}), this.fsQuad = new
|
|
2846
|
+
vertexShader: ee.vertexShader,
|
|
2847
|
+
fragmentShader: ee.fragmentShader
|
|
2848
|
+
}), this.fsQuad = new R(null);
|
|
2536
2849
|
}
|
|
2537
2850
|
render(e, t, o) {
|
|
2538
2851
|
this.uniformsEdges.tDiffuse.value = o.texture, this.fsQuad.material = this.materialEdges, e.setRenderTarget(this.edgesRT), this.clear && e.clear(), this.fsQuad.render(e), this.fsQuad.material = this.materialWeights, e.setRenderTarget(this.weightsRT), this.clear && e.clear(), this.fsQuad.render(e), this.uniformsBlend.tColor.value = o.texture, this.fsQuad.material = this.materialBlend, this.renderToScreen ? (e.setRenderTarget(null), this.fsQuad.render(e)) : (e.setRenderTarget(t), this.clear && e.clear(), this.fsQuad.render(e));
|
|
@@ -2550,27 +2863,27 @@ class yt extends T {
|
|
|
2550
2863
|
this.edgesRT.dispose(), this.weightsRT.dispose(), this.areaTexture.dispose(), this.searchTexture.dispose(), this.materialEdges.dispose(), this.materialWeights.dispose(), this.materialBlend.dispose(), this.fsQuad.dispose();
|
|
2551
2864
|
}
|
|
2552
2865
|
}
|
|
2553
|
-
const
|
|
2866
|
+
const vo = /* @__PURE__ */ u({
|
|
2554
2867
|
__name: "SMAA",
|
|
2555
2868
|
props: {
|
|
2556
2869
|
width: {},
|
|
2557
2870
|
height: {}
|
|
2558
2871
|
},
|
|
2559
2872
|
setup(r, { expose: e }) {
|
|
2560
|
-
const t = r, { sizes: o } =
|
|
2561
|
-
return e({ pass: n }),
|
|
2562
|
-
n.value.setSize(
|
|
2873
|
+
const t = r, { sizes: o } = y(), { pixelRatio: s } = ze(), a = O(() => t.width ?? o.width.value * s.value), i = O(() => t.height ?? o.height.value * s.value), { pass: n } = N(() => new Rt(a.value, i.value), t);
|
|
2874
|
+
return e({ pass: n }), x(() => {
|
|
2875
|
+
n.value.setSize(a.value, i.value);
|
|
2563
2876
|
}), () => {
|
|
2564
2877
|
};
|
|
2565
2878
|
}
|
|
2566
|
-
}),
|
|
2879
|
+
}), He = {
|
|
2567
2880
|
name: "LuminosityHighPassShader",
|
|
2568
2881
|
shaderID: "luminosityHighPass",
|
|
2569
2882
|
uniforms: {
|
|
2570
2883
|
tDiffuse: { value: null },
|
|
2571
2884
|
luminosityThreshold: { value: 1 },
|
|
2572
2885
|
smoothWidth: { value: 1 },
|
|
2573
|
-
defaultColor: { value: new
|
|
2886
|
+
defaultColor: { value: new k(0) },
|
|
2574
2887
|
defaultOpacity: { value: 0 }
|
|
2575
2888
|
},
|
|
2576
2889
|
vertexShader: (
|
|
@@ -2614,40 +2927,40 @@ const oo = /* @__PURE__ */ c({
|
|
|
2614
2927
|
}`
|
|
2615
2928
|
)
|
|
2616
2929
|
};
|
|
2617
|
-
class
|
|
2618
|
-
constructor(e, t, o,
|
|
2619
|
-
super(), this.strength = t !== void 0 ? t : 1, this.radius = o, this.threshold =
|
|
2620
|
-
let
|
|
2621
|
-
this.renderTargetBright = new D(
|
|
2622
|
-
for (let
|
|
2623
|
-
const
|
|
2624
|
-
|
|
2625
|
-
const
|
|
2626
|
-
|
|
2930
|
+
class B extends C {
|
|
2931
|
+
constructor(e, t, o, s) {
|
|
2932
|
+
super(), this.strength = t !== void 0 ? t : 1, this.radius = o, this.threshold = s, this.resolution = e !== void 0 ? new d(e.x, e.y) : new d(256, 256), this.clearColor = new k(0, 0, 0), this.renderTargetsHorizontal = [], this.renderTargetsVertical = [], this.nMips = 5;
|
|
2933
|
+
let a = Math.round(this.resolution.x / 2), i = Math.round(this.resolution.y / 2);
|
|
2934
|
+
this.renderTargetBright = new D(a, i, { type: T }), this.renderTargetBright.texture.name = "UnrealBloomPass.bright", this.renderTargetBright.texture.generateMipmaps = !1;
|
|
2935
|
+
for (let g = 0; g < this.nMips; g++) {
|
|
2936
|
+
const c = new D(a, i, { type: T });
|
|
2937
|
+
c.texture.name = "UnrealBloomPass.h" + g, c.texture.generateMipmaps = !1, this.renderTargetsHorizontal.push(c);
|
|
2938
|
+
const b = new D(a, i, { type: T });
|
|
2939
|
+
b.texture.name = "UnrealBloomPass.v" + g, b.texture.generateMipmaps = !1, this.renderTargetsVertical.push(b), a = Math.round(a / 2), i = Math.round(i / 2);
|
|
2627
2940
|
}
|
|
2628
|
-
const n =
|
|
2629
|
-
this.highPassUniforms =
|
|
2941
|
+
const n = He;
|
|
2942
|
+
this.highPassUniforms = P.clone(n.uniforms), this.highPassUniforms.luminosityThreshold.value = s, this.highPassUniforms.smoothWidth.value = 0.01, this.materialHighPassFilter = new A({
|
|
2630
2943
|
uniforms: this.highPassUniforms,
|
|
2631
2944
|
vertexShader: n.vertexShader,
|
|
2632
2945
|
fragmentShader: n.fragmentShader
|
|
2633
2946
|
}), this.separableBlurMaterials = [];
|
|
2634
2947
|
const l = [3, 5, 7, 9, 11];
|
|
2635
|
-
|
|
2636
|
-
for (let
|
|
2637
|
-
this.separableBlurMaterials.push(this.getSeparableBlurMaterial(l[
|
|
2948
|
+
a = Math.round(this.resolution.x / 2), i = Math.round(this.resolution.y / 2);
|
|
2949
|
+
for (let g = 0; g < this.nMips; g++)
|
|
2950
|
+
this.separableBlurMaterials.push(this.getSeparableBlurMaterial(l[g])), this.separableBlurMaterials[g].uniforms.invSize.value = new d(1 / a, 1 / i), a = Math.round(a / 2), i = Math.round(i / 2);
|
|
2638
2951
|
this.compositeMaterial = this.getCompositeMaterial(this.nMips), this.compositeMaterial.uniforms.blurTexture1.value = this.renderTargetsVertical[0].texture, this.compositeMaterial.uniforms.blurTexture2.value = this.renderTargetsVertical[1].texture, this.compositeMaterial.uniforms.blurTexture3.value = this.renderTargetsVertical[2].texture, this.compositeMaterial.uniforms.blurTexture4.value = this.renderTargetsVertical[3].texture, this.compositeMaterial.uniforms.blurTexture5.value = this.renderTargetsVertical[4].texture, this.compositeMaterial.uniforms.bloomStrength.value = t, this.compositeMaterial.uniforms.bloomRadius.value = 0.1;
|
|
2639
|
-
const
|
|
2640
|
-
this.compositeMaterial.uniforms.bloomFactors.value =
|
|
2641
|
-
const
|
|
2642
|
-
this.copyUniforms =
|
|
2952
|
+
const p = [1, 0.8, 0.6, 0.4, 0.2];
|
|
2953
|
+
this.compositeMaterial.uniforms.bloomFactors.value = p, this.bloomTintColors = [new L(1, 1, 1), new L(1, 1, 1), new L(1, 1, 1), new L(1, 1, 1), new L(1, 1, 1)], this.compositeMaterial.uniforms.bloomTintColors.value = this.bloomTintColors;
|
|
2954
|
+
const f = Ue;
|
|
2955
|
+
this.copyUniforms = P.clone(f.uniforms), this.blendMaterial = new A({
|
|
2643
2956
|
uniforms: this.copyUniforms,
|
|
2644
|
-
vertexShader:
|
|
2645
|
-
fragmentShader:
|
|
2646
|
-
blending:
|
|
2957
|
+
vertexShader: f.vertexShader,
|
|
2958
|
+
fragmentShader: f.fragmentShader,
|
|
2959
|
+
blending: gt,
|
|
2647
2960
|
depthTest: !1,
|
|
2648
2961
|
depthWrite: !1,
|
|
2649
2962
|
transparent: !0
|
|
2650
|
-
}), this.enabled = !0, this.needsSwap = !1, this._oldClearColor = new
|
|
2963
|
+
}), this.enabled = !0, this.needsSwap = !1, this._oldClearColor = new k(), this.oldClearAlpha = 1, this.basic = new vt(), this.fsQuad = new R(null);
|
|
2651
2964
|
}
|
|
2652
2965
|
dispose() {
|
|
2653
2966
|
for (let e = 0; e < this.renderTargetsHorizontal.length; e++)
|
|
@@ -2660,25 +2973,25 @@ class R extends T {
|
|
|
2660
2973
|
this.compositeMaterial.dispose(), this.blendMaterial.dispose(), this.basic.dispose(), this.fsQuad.dispose();
|
|
2661
2974
|
}
|
|
2662
2975
|
setSize(e, t) {
|
|
2663
|
-
let o = Math.round(e / 2),
|
|
2664
|
-
this.renderTargetBright.setSize(o,
|
|
2665
|
-
for (let
|
|
2666
|
-
this.renderTargetsHorizontal[
|
|
2976
|
+
let o = Math.round(e / 2), s = Math.round(t / 2);
|
|
2977
|
+
this.renderTargetBright.setSize(o, s);
|
|
2978
|
+
for (let a = 0; a < this.nMips; a++)
|
|
2979
|
+
this.renderTargetsHorizontal[a].setSize(o, s), this.renderTargetsVertical[a].setSize(o, s), this.separableBlurMaterials[a].uniforms.invSize.value = new d(1 / o, 1 / s), o = Math.round(o / 2), s = Math.round(s / 2);
|
|
2667
2980
|
}
|
|
2668
|
-
render(e, t, o,
|
|
2981
|
+
render(e, t, o, s, a) {
|
|
2669
2982
|
e.getClearColor(this._oldClearColor), this.oldClearAlpha = e.getClearAlpha();
|
|
2670
2983
|
const i = e.autoClear;
|
|
2671
|
-
e.autoClear = !1, e.setClearColor(this.clearColor, 0),
|
|
2984
|
+
e.autoClear = !1, e.setClearColor(this.clearColor, 0), a && e.state.buffers.stencil.setTest(!1), this.renderToScreen && (this.fsQuad.material = this.basic, this.basic.map = o.texture, e.setRenderTarget(null), e.clear(), this.fsQuad.render(e)), this.highPassUniforms.tDiffuse.value = o.texture, this.highPassUniforms.luminosityThreshold.value = this.threshold, this.fsQuad.material = this.materialHighPassFilter, e.setRenderTarget(this.renderTargetBright), e.clear(), this.fsQuad.render(e);
|
|
2672
2985
|
let n = this.renderTargetBright;
|
|
2673
2986
|
for (let l = 0; l < this.nMips; l++)
|
|
2674
|
-
this.fsQuad.material = this.separableBlurMaterials[l], this.separableBlurMaterials[l].uniforms.colorTexture.value = n.texture, this.separableBlurMaterials[l].uniforms.direction.value =
|
|
2675
|
-
this.fsQuad.material = this.compositeMaterial, this.compositeMaterial.uniforms.bloomStrength.value = this.strength, this.compositeMaterial.uniforms.bloomRadius.value = this.radius, this.compositeMaterial.uniforms.bloomTintColors.value = this.bloomTintColors, e.setRenderTarget(this.renderTargetsHorizontal[0]), e.clear(), this.fsQuad.render(e), this.fsQuad.material = this.blendMaterial, this.copyUniforms.tDiffuse.value = this.renderTargetsHorizontal[0].texture,
|
|
2987
|
+
this.fsQuad.material = this.separableBlurMaterials[l], this.separableBlurMaterials[l].uniforms.colorTexture.value = n.texture, this.separableBlurMaterials[l].uniforms.direction.value = B.BlurDirectionX, e.setRenderTarget(this.renderTargetsHorizontal[l]), e.clear(), this.fsQuad.render(e), this.separableBlurMaterials[l].uniforms.colorTexture.value = this.renderTargetsHorizontal[l].texture, this.separableBlurMaterials[l].uniforms.direction.value = B.BlurDirectionY, e.setRenderTarget(this.renderTargetsVertical[l]), e.clear(), this.fsQuad.render(e), n = this.renderTargetsVertical[l];
|
|
2988
|
+
this.fsQuad.material = this.compositeMaterial, this.compositeMaterial.uniforms.bloomStrength.value = this.strength, this.compositeMaterial.uniforms.bloomRadius.value = this.radius, this.compositeMaterial.uniforms.bloomTintColors.value = this.bloomTintColors, e.setRenderTarget(this.renderTargetsHorizontal[0]), e.clear(), this.fsQuad.render(e), this.fsQuad.material = this.blendMaterial, this.copyUniforms.tDiffuse.value = this.renderTargetsHorizontal[0].texture, a && e.state.buffers.stencil.setTest(!0), this.renderToScreen ? (e.setRenderTarget(null), this.fsQuad.render(e)) : (e.setRenderTarget(o), this.fsQuad.render(e)), e.setClearColor(this._oldClearColor, this.oldClearAlpha), e.autoClear = i;
|
|
2676
2989
|
}
|
|
2677
2990
|
getSeparableBlurMaterial(e) {
|
|
2678
2991
|
const t = [];
|
|
2679
2992
|
for (let o = 0; o < e; o++)
|
|
2680
2993
|
t.push(0.39894 * Math.exp(-0.5 * o * o / (e * e)) / e);
|
|
2681
|
-
return new
|
|
2994
|
+
return new A({
|
|
2682
2995
|
defines: {
|
|
2683
2996
|
KERNEL_RADIUS: e
|
|
2684
2997
|
},
|
|
@@ -2719,7 +3032,7 @@ class R extends T {
|
|
|
2719
3032
|
});
|
|
2720
3033
|
}
|
|
2721
3034
|
getCompositeMaterial(e) {
|
|
2722
|
-
return new
|
|
3035
|
+
return new A({
|
|
2723
3036
|
defines: {
|
|
2724
3037
|
NUM_MIPS: e
|
|
2725
3038
|
},
|
|
@@ -2765,9 +3078,9 @@ class R extends T {
|
|
|
2765
3078
|
});
|
|
2766
3079
|
}
|
|
2767
3080
|
}
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
const
|
|
3081
|
+
B.BlurDirectionX = new d(1, 0);
|
|
3082
|
+
B.BlurDirectionY = new d(0, 1);
|
|
3083
|
+
const xo = /* @__PURE__ */ u({
|
|
2771
3084
|
__name: "UnrealBloom",
|
|
2772
3085
|
props: {
|
|
2773
3086
|
radius: { default: 0 },
|
|
@@ -2775,54 +3088,60 @@ const ao = /* @__PURE__ */ c({
|
|
|
2775
3088
|
threshold: { default: 0 }
|
|
2776
3089
|
},
|
|
2777
3090
|
setup(r, { expose: e }) {
|
|
2778
|
-
const t = r, { sizes: o } =
|
|
3091
|
+
const t = r, { sizes: o } = y(), { pass: s } = N(() => new B(
|
|
2779
3092
|
new d(o.width.value, o.height.value),
|
|
2780
3093
|
t.radius,
|
|
2781
3094
|
t.strength,
|
|
2782
3095
|
t.threshold
|
|
2783
3096
|
), t);
|
|
2784
|
-
return e({ pass:
|
|
2785
|
-
var
|
|
2786
|
-
|
|
2787
|
-
}),
|
|
2788
|
-
var
|
|
2789
|
-
|
|
2790
|
-
}),
|
|
2791
|
-
var
|
|
2792
|
-
|
|
3097
|
+
return e({ pass: s }), x(() => {
|
|
3098
|
+
var a;
|
|
3099
|
+
s.value.radius = t.radius ?? ((a = s.value.getCompositeMaterial().uniforms.bloomRadius) == null ? void 0 : a.value) ?? 0.1;
|
|
3100
|
+
}), x(() => {
|
|
3101
|
+
var a;
|
|
3102
|
+
s.value.strength = t.strength ?? ((a = s.value.getCompositeMaterial().uniforms.bloomStrength) == null ? void 0 : a.value) ?? 1;
|
|
3103
|
+
}), x(() => {
|
|
3104
|
+
var a;
|
|
3105
|
+
s.value.threshold = t.threshold ?? ((a = He.uniforms.luminosityThreshold) == null ? void 0 : a.value) ?? 1;
|
|
2793
3106
|
}), () => {
|
|
2794
3107
|
};
|
|
2795
3108
|
}
|
|
2796
3109
|
});
|
|
2797
3110
|
export {
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
It as
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
3111
|
+
kt as BarrelBlurPmndrs,
|
|
3112
|
+
Gt as BloomPmndrs,
|
|
3113
|
+
co as BrightnessContrastPmndrs,
|
|
3114
|
+
Qt as ChromaticAberrationPmndrs,
|
|
3115
|
+
_t as ColorAveragePmndrs,
|
|
3116
|
+
no as ColorDepthPmndrs,
|
|
3117
|
+
Ht as DepthOfFieldPmndrs,
|
|
3118
|
+
ro as DepthPickingPassPmndrs,
|
|
3119
|
+
oo as DotScreenPmndrs,
|
|
3120
|
+
fo as EffectComposer,
|
|
3121
|
+
Ut as EffectComposerPmndrs,
|
|
3122
|
+
uo as FishEyePmndrs,
|
|
3123
|
+
ho as Glitch,
|
|
3124
|
+
Xt as GlitchPmndrs,
|
|
3125
|
+
io as GodRaysPmndrs,
|
|
3126
|
+
lo as GridPmndrs,
|
|
3127
|
+
po as Halftone,
|
|
3128
|
+
Kt as HueSaturationPmndrs,
|
|
3129
|
+
Zt as KuwaharaPmndrs,
|
|
3130
|
+
$t as LensDistortionPmndrs,
|
|
3131
|
+
ao as LinocutPmndrs,
|
|
3132
|
+
It as NoisePmndrs,
|
|
3133
|
+
jt as OutlinePmndrs,
|
|
3134
|
+
go as Output,
|
|
3135
|
+
mo as Pixelation,
|
|
3136
|
+
Vt as PixelationPmndrs,
|
|
3137
|
+
vo as SMAA,
|
|
3138
|
+
Jt as ScanlinePmndrs,
|
|
3139
|
+
so as SepiaPmndrs,
|
|
3140
|
+
eo as ShockWavePmndrs,
|
|
3141
|
+
to as TiltShiftPmndrs,
|
|
3142
|
+
qt as ToneMappingPmndrs,
|
|
3143
|
+
xo as UnrealBloom,
|
|
3144
|
+
Yt as VignettePmndrs,
|
|
3145
|
+
N as useEffect,
|
|
2827
3146
|
h as useEffectPmndrs
|
|
2828
3147
|
};
|