@tomorrowevening/hermes 0.1.7 → 0.1.8
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/hermes.cjs.js +58 -58
- package/dist/hermes.es.js +390 -387
- package/package.json +1 -1
- package/types/utils/three.d.ts +1 -1
package/dist/hermes.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { types as le, getProject as lx } from "@theatre/core";
|
|
2
|
-
import { Texture as Ph, OrthographicCamera as Fh, Scene as Pm, MeshBasicMaterial as Tn, BufferGeometry as Sn, Float32BufferAttribute as yn, Mesh as Y, LinearSRGBColorSpace as Fa, ObjectLoader as cx, AnimationMixer as hx, AnimationClip as ux, WebGLRenderTarget as Fm, RGBAFormat as dx, EventDispatcher as Dm, RepeatWrapping as Ud, Color as wn, ColorManagement as ir, FrontSide as px, BackSide as Om, DoubleSide as xu, ZeroFactor as
|
|
2
|
+
import { Texture as Ph, OrthographicCamera as Fh, Scene as Pm, MeshBasicMaterial as Tn, BufferGeometry as Sn, Float32BufferAttribute as yn, Mesh as Y, LinearSRGBColorSpace as Fa, ObjectLoader as cx, AnimationMixer as hx, AnimationClip as ux, WebGLRenderTarget as Fm, RGBAFormat as dx, EventDispatcher as Dm, RepeatWrapping as Ud, Color as wn, ColorManagement as ir, FrontSide as px, BackSide as Om, DoubleSide as xu, ZeroFactor as Bm, OneFactor as Im, SrcColorFactor as Lm, OneMinusSrcColorFactor as Um, SrcAlphaFactor as km, OneMinusSrcAlphaFactor as zm, DstAlphaFactor as Gm, OneMinusDstAlphaFactor as Vm, DstColorFactor as Hm, OneMinusDstColorFactor as $m, SrcAlphaSaturateFactor as fx, ConstantColorFactor as Wm, OneMinusConstantColorFactor as jm, ConstantAlphaFactor as qm, OneMinusConstantAlphaFactor as Ym, AddEquation as mx, SubtractEquation as gx, ReverseSubtractEquation as yx, MinEquation as xx, MaxEquation as _x, NoBlending as bx, NormalBlending as Tx, AdditiveBlending as Sx, SubtractiveBlending as vx, MultiplyBlending as wx, CustomBlending as Ex, Line as Us, LineBasicMaterial as _u, Controls as Xm, Vector3 as Z, MOUSE as ur, TOUCH as nr, Quaternion as es, Spherical as Dh, Vector2 as xt, Ray as Cx, Plane as Mx, MathUtils as Ax, ShaderMaterial as Zm, GLSL3 as Rx, PlaneGeometry as Km, Raycaster as Da, Object3D as Tr, CylinderGeometry as zt, BoxGeometry as St, OctahedronGeometry as Ja, TorusGeometry as Ur, SphereGeometry as Qm, Euler as Jm, Matrix4 as Nl, CatmullRomCurve3 as kd, Group as Nx, AxesHelper as Px, MeshDepthMaterial as Fx, MeshNormalMaterial as Dx, Sphere as Ox, Box3 as Bx, Vector4 as Ix, WebGLRenderer as pa, PerspectiveCamera as zd, CameraHelper as Lx, SkinnedMesh as Ux, SpotLightHelper as kx, PointLightHelper as zx, HemisphereLightHelper as Gx, DirectionalLightHelper as Vx, Clock as Hx, SkeletonHelper as $x, SRGBColorSpace as Gd, NoToneMapping as Vd, NoColorSpace as Wx, LinearToneMapping as jx, ReinhardToneMapping as qx, CineonToneMapping as Yx, ACESFilmicToneMapping as Xx, AgXToneMapping as Zx, NeutralToneMapping as Kx, CustomToneMapping as Qx } from "three";
|
|
3
3
|
import eg, { useState as Ne, useRef as Ve, useEffect as Pr, useMemo as va, Component as Ha, createRef as Ri, forwardRef as Jx } from "react";
|
|
4
4
|
const al = () => {
|
|
5
5
|
}, cP = () => {
|
|
@@ -169,7 +169,7 @@ const a_ = ({ mobileTiers: a = [0, 15, 30, 60], desktopTiers: e = [0, 15, 30, 60
|
|
|
169
169
|
let X, [we, , , , ue] = $ > 1 ? W.map((be) => [be, n_(q, be[2])]).sort(([, be], [, lt]) => be - lt)[0][0] : W[0], ye = Number.MAX_VALUE;
|
|
170
170
|
const { devicePixelRatio: se } = window, Ee = c.width * se * c.height * se;
|
|
171
171
|
for (const be of ue) {
|
|
172
|
-
const [lt, Ut] = be,
|
|
172
|
+
const [lt, Ut] = be, Ir = lt * Ut, Rn = Math.abs(Ee - Ir);
|
|
173
173
|
Rn < ye && (ye = Rn, X = be);
|
|
174
174
|
}
|
|
175
175
|
if (!X) return;
|
|
@@ -614,13 +614,13 @@ const Yd = (a) => {
|
|
|
614
614
|
a.dispose !== void 0 && a.dispose();
|
|
615
615
|
}
|
|
616
616
|
};
|
|
617
|
-
let
|
|
617
|
+
let Bh = 0;
|
|
618
618
|
const Xd = () => {
|
|
619
|
-
|
|
620
|
-
},
|
|
619
|
+
Bh = 0;
|
|
620
|
+
}, Ih = (a) => {
|
|
621
621
|
if (!a) return;
|
|
622
622
|
let e = a.name.replaceAll(" ", "").replaceAll("/", ".");
|
|
623
|
-
if (e.length === 0 && (e = `obj_${
|
|
623
|
+
if (e.length === 0 && (e = `obj_${Bh}`, Bh++), a.parent !== null && a.parent.uuid.length > 0 && (e = `${a.parent.uuid}.${e}`), a.uuid = e, a.isMesh !== void 0) {
|
|
624
624
|
const t = a;
|
|
625
625
|
if (Array.isArray(t.material))
|
|
626
626
|
t.material.forEach((s, i) => {
|
|
@@ -631,7 +631,7 @@ const Xd = () => {
|
|
|
631
631
|
s.uuid = `${e}.material`;
|
|
632
632
|
}
|
|
633
633
|
}
|
|
634
|
-
a.children.forEach((t) =>
|
|
634
|
+
a.children.forEach((t) => Ih(t));
|
|
635
635
|
};
|
|
636
636
|
class xn {
|
|
637
637
|
static renderer;
|
|
@@ -644,7 +644,7 @@ class xn {
|
|
|
644
644
|
static width = 100;
|
|
645
645
|
static height = 100;
|
|
646
646
|
static init() {
|
|
647
|
-
this.inited || (this.canvas = document.createElement("canvas"), this.canvas.width = this.width, this.canvas.height = this.height, this.context = this.canvas.getContext("2d"), this.inited = !0);
|
|
647
|
+
this.inited || (typeof document < "u" ? this.canvas = document.createElement("canvas") : this.canvas = new OffscreenCanvas(this.width, this.height), this.canvas.width = this.width, this.canvas.height = this.height, this.context = this.canvas.getContext("2d"), this.inited = !0);
|
|
648
648
|
}
|
|
649
649
|
static renderToBlob(e) {
|
|
650
650
|
this.init();
|
|
@@ -653,12 +653,15 @@ class xn {
|
|
|
653
653
|
this.context.clearRect(0, 0, this.width, this.height);
|
|
654
654
|
const i = e.image;
|
|
655
655
|
if (i != null && i.width > 0) {
|
|
656
|
-
this.canvas.title = e.sourceFile;
|
|
656
|
+
this.canvas instanceof HTMLCanvasElement && (this.canvas.title = e.sourceFile);
|
|
657
657
|
const n = this.canvas.width / i.width, r = this.renderToCanvas(e);
|
|
658
658
|
this.context.drawImage(r, 0, 0, i.width * n, i.height * n);
|
|
659
659
|
}
|
|
660
660
|
}
|
|
661
|
-
return e.repeat.copy(t), e.offset.copy(s), this.canvas.toDataURL("image/png")
|
|
661
|
+
return e.repeat.copy(t), e.offset.copy(s), this.canvas instanceof HTMLCanvasElement ? this.canvas.toDataURL("image/png") : this.canvas.convertToBlob({ type: "image/png" }).then((i) => new Promise((n) => {
|
|
662
|
+
const r = new FileReader();
|
|
663
|
+
r.onload = () => n(r.result), r.readAsDataURL(i);
|
|
664
|
+
}));
|
|
662
665
|
}
|
|
663
666
|
static renderToCanvas(e) {
|
|
664
667
|
if (this.material === null) {
|
|
@@ -674,7 +677,7 @@ class xn {
|
|
|
674
677
|
const t = this.renderer.outputColorSpace, s = e.colorSpace;
|
|
675
678
|
this.renderer.outputColorSpace = Fa, e.colorSpace = Fa, this.material.map = e, this.renderer.render(this.scene, this.camera), this.renderer.outputColorSpace = t, e.colorSpace = s;
|
|
676
679
|
}
|
|
677
|
-
return this.renderer.domElement;
|
|
680
|
+
return this.renderer.domElement instanceof HTMLCanvasElement ? this.renderer.domElement : this.canvas;
|
|
678
681
|
}
|
|
679
682
|
}
|
|
680
683
|
function _P(a) {
|
|
@@ -1901,7 +1904,7 @@ class RP extends ig {
|
|
|
1901
1904
|
// Scenes
|
|
1902
1905
|
addScene(e) {
|
|
1903
1906
|
if (e === void 0 || (this.scenes.set(e.name, e), !this.debug)) return;
|
|
1904
|
-
Xd(),
|
|
1907
|
+
Xd(), Ih(e);
|
|
1905
1908
|
const t = sr(e);
|
|
1906
1909
|
this.send({
|
|
1907
1910
|
event: "addScene",
|
|
@@ -1941,7 +1944,7 @@ class RP extends ig {
|
|
|
1941
1944
|
}
|
|
1942
1945
|
setScene(e) {
|
|
1943
1946
|
if (e === void 0 || (this.scene = e, !this.debug)) return;
|
|
1944
|
-
this.renderer !== void 0 && (xn.renderer = this.renderer), Xd(),
|
|
1947
|
+
this.renderer !== void 0 && (xn.renderer = this.renderer), Xd(), Ih(e);
|
|
1945
1948
|
const t = sr(e);
|
|
1946
1949
|
this.send({
|
|
1947
1950
|
event: "setScene",
|
|
@@ -2094,7 +2097,7 @@ var zr = {};
|
|
|
2094
2097
|
* LICENSE file in the root directory of this source tree.
|
|
2095
2098
|
*/
|
|
2096
2099
|
var Kd;
|
|
2097
|
-
function
|
|
2100
|
+
function B_() {
|
|
2098
2101
|
return Kd || (Kd = 1, process.env.NODE_ENV !== "production" && function() {
|
|
2099
2102
|
var a = eg, e = Symbol.for("react.element"), t = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), n = Symbol.for("react.profiler"), r = Symbol.for("react.provider"), o = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), u = Symbol.for("react.memo"), d = Symbol.for("react.lazy"), p = Symbol.for("react.offscreen"), f = Symbol.iterator, m = "@@iterator";
|
|
2100
2103
|
function y(S) {
|
|
@@ -2247,7 +2250,7 @@ function I_() {
|
|
|
2247
2250
|
X < 0 && x("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
2248
2251
|
}
|
|
2249
2252
|
}
|
|
2250
|
-
var
|
|
2253
|
+
var Ir = g.ReactCurrentDispatcher, Rn;
|
|
2251
2254
|
function Xa(S, z, j) {
|
|
2252
2255
|
{
|
|
2253
2256
|
if (Rn === void 0)
|
|
@@ -2279,7 +2282,7 @@ function I_() {
|
|
|
2279
2282
|
var Me = Error.prepareStackTrace;
|
|
2280
2283
|
Error.prepareStackTrace = void 0;
|
|
2281
2284
|
var Oe;
|
|
2282
|
-
Oe =
|
|
2285
|
+
Oe = Ir.current, Ir.current = null, lt();
|
|
2283
2286
|
try {
|
|
2284
2287
|
if (z) {
|
|
2285
2288
|
var xe = function() {
|
|
@@ -2332,7 +2335,7 @@ function I_() {
|
|
|
2332
2335
|
}
|
|
2333
2336
|
}
|
|
2334
2337
|
} finally {
|
|
2335
|
-
Ql = !1,
|
|
2338
|
+
Ql = !1, Ir.current = Oe, Ut(), Error.prepareStackTrace = Me;
|
|
2336
2339
|
}
|
|
2337
2340
|
var Pn = S ? S.displayName || S.name : "", ji = Pn ? Xa(Pn) : "";
|
|
2338
2341
|
return typeof S == "function" && Za.set(S, ji), ji;
|
|
@@ -2572,7 +2575,7 @@ Check the top-level render call using <` + j + ">.");
|
|
|
2572
2575
|
S && S._owner && S._owner !== ec.current && (ee = " It was passed a child from " + $(S._owner.type) + "."), Nn(S), x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', j, ee), Nn(null);
|
|
2573
2576
|
}
|
|
2574
2577
|
}
|
|
2575
|
-
function
|
|
2578
|
+
function Bd(S, z) {
|
|
2576
2579
|
{
|
|
2577
2580
|
if (typeof S != "object")
|
|
2578
2581
|
return;
|
|
@@ -2628,7 +2631,7 @@ Check the top-level render call using <` + j + ">.");
|
|
|
2628
2631
|
S.ref !== null && (Nn(S), x("Invalid attribute `ref` supplied to `React.Fragment`."), Nn(null));
|
|
2629
2632
|
}
|
|
2630
2633
|
}
|
|
2631
|
-
var
|
|
2634
|
+
var Id = {};
|
|
2632
2635
|
function Ld(S, z, j, ee, Me, Oe) {
|
|
2633
2636
|
{
|
|
2634
2637
|
var xe = k(S);
|
|
@@ -2649,25 +2652,25 @@ Check the top-level render call using <` + j + ">.");
|
|
|
2649
2652
|
if (ee)
|
|
2650
2653
|
if (Jl(rs)) {
|
|
2651
2654
|
for (var Pn = 0; Pn < rs.length; Pn++)
|
|
2652
|
-
|
|
2655
|
+
Bd(rs[Pn], S);
|
|
2653
2656
|
Object.freeze && Object.freeze(rs);
|
|
2654
2657
|
} else
|
|
2655
2658
|
x("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
2656
2659
|
else
|
|
2657
|
-
|
|
2660
|
+
Bd(rs, S);
|
|
2658
2661
|
}
|
|
2659
2662
|
if (Lr.call(z, "key")) {
|
|
2660
2663
|
var ji = $(S), kt = Object.keys(z).filter(function(ox) {
|
|
2661
2664
|
return ox !== "key";
|
|
2662
2665
|
}), ic = kt.length > 0 ? "{key: someKey, " + kt.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
2663
|
-
if (!
|
|
2666
|
+
if (!Id[ji + ic]) {
|
|
2664
2667
|
var ax = kt.length > 0 ? "{" + kt.join(": ..., ") + ": ...}" : "{}";
|
|
2665
2668
|
x(`A props object containing a "key" prop is being spread into JSX:
|
|
2666
2669
|
let props = %s;
|
|
2667
2670
|
<%s {...props} />
|
|
2668
2671
|
React keys must be passed directly to JSX without using spread:
|
|
2669
2672
|
let props = %s;
|
|
2670
|
-
<%s key={someKey} {...props} />`, ic, ji, ax, ji),
|
|
2673
|
+
<%s key={someKey} {...props} />`, ic, ji, ax, ji), Id[ji + ic] = !0;
|
|
2671
2674
|
}
|
|
2672
2675
|
}
|
|
2673
2676
|
return S === s ? tx(Je) : ex(Je), Je;
|
|
@@ -2684,10 +2687,10 @@ React keys must be passed directly to JSX without using spread:
|
|
|
2684
2687
|
}()), zr;
|
|
2685
2688
|
}
|
|
2686
2689
|
var Qd;
|
|
2687
|
-
function
|
|
2688
|
-
return Qd || (Qd = 1, process.env.NODE_ENV === "production" ? to.exports = O_() : to.exports =
|
|
2690
|
+
function I_() {
|
|
2691
|
+
return Qd || (Qd = 1, process.env.NODE_ENV === "production" ? to.exports = O_() : to.exports = B_()), to.exports;
|
|
2689
2692
|
}
|
|
2690
|
-
var C =
|
|
2693
|
+
var C = I_();
|
|
2691
2694
|
function rg(a) {
|
|
2692
2695
|
return a.title.search("<") > -1 ? /* @__PURE__ */ C.jsx("button", { className: "svg", dangerouslySetInnerHTML: { __html: a.title } }) : /* @__PURE__ */ C.jsx("button", { children: a.title });
|
|
2693
2696
|
}
|
|
@@ -4012,11 +4015,11 @@ const lb = [
|
|
|
4012
4015
|
], ub = [
|
|
4013
4016
|
{
|
|
4014
4017
|
title: "Zero",
|
|
4015
|
-
value:
|
|
4018
|
+
value: Bm
|
|
4016
4019
|
},
|
|
4017
4020
|
{
|
|
4018
4021
|
title: "One",
|
|
4019
|
-
value:
|
|
4022
|
+
value: Im
|
|
4020
4023
|
},
|
|
4021
4024
|
{
|
|
4022
4025
|
title: "Src Color",
|
|
@@ -4073,11 +4076,11 @@ const lb = [
|
|
|
4073
4076
|
], db = [
|
|
4074
4077
|
{
|
|
4075
4078
|
title: "Zero",
|
|
4076
|
-
value:
|
|
4079
|
+
value: Bm
|
|
4077
4080
|
},
|
|
4078
4081
|
{
|
|
4079
4082
|
title: "One",
|
|
4080
|
-
value:
|
|
4083
|
+
value: Im
|
|
4081
4084
|
},
|
|
4082
4085
|
{
|
|
4083
4086
|
title: "Src Color",
|
|
@@ -5121,7 +5124,7 @@ class Rs {
|
|
|
5121
5124
|
return t.delete(e[e.length - 1]);
|
|
5122
5125
|
}
|
|
5123
5126
|
}
|
|
5124
|
-
const cg = "177", wb = 0, Eb = 1, Cb = 2, Mb = 0, Ab = 1, Xo = 3, ni = 0, jt = 1, dr = 2, vr = 0, ri = 1, hl = 2, ul = 3, dl = 4, Ea = 5, Cs = 100, hg = 101, ug = 102, Rb = 103, Nb = 104, Ni = 200, dg = 201, pg = 202, fg = 203, pl = 204, fl = 205, mg = 206, gg = 207, yg = 208, xg = 209, _g = 210, bg = 0, Tg = 1, Sg = 2, ml = 3, vg = 4, wg = 5, Eg = 6, Cg = 7, Fl = 0, Pb = 1, Fb = 2, pr = 0, Db = 1, Ob = 2,
|
|
5127
|
+
const cg = "177", wb = 0, Eb = 1, Cb = 2, Mb = 0, Ab = 1, Xo = 3, ni = 0, jt = 1, dr = 2, vr = 0, ri = 1, hl = 2, ul = 3, dl = 4, Ea = 5, Cs = 100, hg = 101, ug = 102, Rb = 103, Nb = 104, Ni = 200, dg = 201, pg = 202, fg = 203, pl = 204, fl = 205, mg = 206, gg = 207, yg = 208, xg = 209, _g = 210, bg = 0, Tg = 1, Sg = 2, ml = 3, vg = 4, wg = 5, Eg = 6, Cg = 7, Fl = 0, Pb = 1, Fb = 2, pr = 0, Db = 1, Ob = 2, Bb = 3, Ib = 4, Lb = 6, Ub = 7, Su = 300, Ba = 301, gl = 302, vu = 303, wu = 304, kh = 306, wr = 1e3, Ii = 1001, Er = 1002, dt = 1003, Mg = 1004, Ia = 1005, ns = 1006, zh = 1007, ai = 1008, Ot = 1009, Ca = 1010, Ma = 1011, rr = 1012, Pt = 1013, Ke = 1014, is = 1015, hs = 1016, kb = 1017, zb = 1018, Ui = 1020, Ag = 35902, Gb = 1021, Eu = 1022, us = 1023, Vs = 1026, oi = 1027, Cu = 1028, Mu = 1029, gn = 1030, Au = 1031, Vb = 1032, Ru = 1033, lc = 33776, Zo = 33777, Ko = 33778, Qo = 33779, rp = 35840, ap = 35841, op = 35842, lp = 35843, cp = 36196, Gh = 37492, Vh = 37496, Hh = 37808, $h = 37809, Wh = 37810, jh = 37811, qh = 37812, Yh = 37813, Xh = 37814, Zh = 37815, Kh = 37816, Qh = 37817, Jh = 37818, eu = 37819, tu = 37820, su = 37821, cc = 36492, Hb = 36283, hp = 36284, up = 36285, dp = 36286, ki = 0, $b = 1, di = "", ts = "srgb", fr = "srgb-linear", yl = "linear", te = "srgb", Wb = 0, ln = 7680, jb = 7681, qb = 7682, Yb = 7683, Xb = 34055, Zb = 34056, Kb = 5386, Qb = 512, Jb = 513, eT = 514, tT = 515, sT = 516, iT = 517, nT = 518, iu = 519, Rg = 512, Nu = 513, Ng = 514, Pg = 515, Fg = 516, Dg = 517, Og = 518, Bg = 519, xl = 35044, ar = 35048, Ht = 2e3, zi = 2001;
|
|
5125
5128
|
class Yt {
|
|
5126
5129
|
/**
|
|
5127
5130
|
* Constructs a new 3x3 matrix. The arguments are supposed to be
|
|
@@ -5493,7 +5496,7 @@ class Yt {
|
|
|
5493
5496
|
}
|
|
5494
5497
|
}
|
|
5495
5498
|
const hc = /* @__PURE__ */ new Yt();
|
|
5496
|
-
function
|
|
5499
|
+
function Ig(a) {
|
|
5497
5500
|
for (let e = a.length - 1; e >= 0; --e)
|
|
5498
5501
|
if (a[e] >= 65535) return !0;
|
|
5499
5502
|
return !1;
|
|
@@ -7712,7 +7715,7 @@ class Le {
|
|
|
7712
7715
|
* @return {Matrix4} A reference to this matrix.
|
|
7713
7716
|
*/
|
|
7714
7717
|
extractRotation(e) {
|
|
7715
|
-
const t = this.elements, s = e.elements, i = 1 /
|
|
7718
|
+
const t = this.elements, s = e.elements, i = 1 / Bn.setFromMatrixColumn(e, 0).length(), n = 1 / Bn.setFromMatrixColumn(e, 1).length(), r = 1 / Bn.setFromMatrixColumn(e, 2).length();
|
|
7716
7719
|
return t[0] = s[0] * i, t[1] = s[1] * i, t[2] = s[2] * i, t[3] = 0, t[4] = s[4] * n, t[5] = s[5] * n, t[6] = s[6] * n, t[7] = 0, t[8] = s[8] * r, t[9] = s[9] * r, t[10] = s[10] * r, t[11] = 0, t[12] = 0, t[13] = 0, t[14] = 0, t[15] = 1, this;
|
|
7717
7720
|
}
|
|
7718
7721
|
/**
|
|
@@ -8126,8 +8129,8 @@ class Le {
|
|
|
8126
8129
|
*/
|
|
8127
8130
|
decompose(e, t, s) {
|
|
8128
8131
|
const i = this.elements;
|
|
8129
|
-
let n =
|
|
8130
|
-
const r =
|
|
8132
|
+
let n = Bn.set(i[0], i[1], i[2]).length();
|
|
8133
|
+
const r = Bn.set(i[4], i[5], i[6]).length(), o = Bn.set(i[8], i[9], i[10]).length();
|
|
8131
8134
|
this.determinant() < 0 && (n = -n), e.x = i[12], e.y = i[13], e.z = i[14], xs.copy(this);
|
|
8132
8135
|
const c = 1 / n, h = 1 / r, u = 1 / o;
|
|
8133
8136
|
return xs.elements[0] *= c, xs.elements[1] *= c, xs.elements[2] *= c, xs.elements[4] *= h, xs.elements[5] *= h, xs.elements[6] *= h, xs.elements[8] *= u, xs.elements[9] *= u, xs.elements[10] *= u, t.setFromRotationMatrix(xs), s.x = n, s.y = r, s.z = o, this;
|
|
@@ -8217,7 +8220,7 @@ class Le {
|
|
|
8217
8220
|
return e[t] = s[0], e[t + 1] = s[1], e[t + 2] = s[2], e[t + 3] = s[3], e[t + 4] = s[4], e[t + 5] = s[5], e[t + 6] = s[6], e[t + 7] = s[7], e[t + 8] = s[8], e[t + 9] = s[9], e[t + 10] = s[10], e[t + 11] = s[11], e[t + 12] = s[12], e[t + 13] = s[13], e[t + 14] = s[14], e[t + 15] = s[15], e;
|
|
8218
8221
|
}
|
|
8219
8222
|
}
|
|
8220
|
-
const
|
|
8223
|
+
const Bn = /* @__PURE__ */ new R(), xs = /* @__PURE__ */ new Le(), oT = /* @__PURE__ */ new R(0, 0, 0), lT = /* @__PURE__ */ new R(1, 1, 1), bi = /* @__PURE__ */ new R(), io = /* @__PURE__ */ new R(), Xt = /* @__PURE__ */ new R();
|
|
8221
8224
|
class ce {
|
|
8222
8225
|
/**
|
|
8223
8226
|
* Constructs a new 2D vector.
|
|
@@ -10263,7 +10266,7 @@ class Hg extends ps {
|
|
|
10263
10266
|
return e *= this.itemSize, this.normalized && (t = ae(t, this.array), s = ae(s, this.array), i = ae(i, this.array), n = ae(n, this.array)), this.array[e + 0] = Zt(t), this.array[e + 1] = Zt(s), this.array[e + 2] = Zt(i), this.array[e + 3] = Zt(n), this;
|
|
10264
10267
|
}
|
|
10265
10268
|
}
|
|
10266
|
-
class
|
|
10269
|
+
class Bt extends ps {
|
|
10267
10270
|
/**
|
|
10268
10271
|
* Constructs a new buffer attribute.
|
|
10269
10272
|
*
|
|
@@ -10293,7 +10296,7 @@ function xp(a) {
|
|
|
10293
10296
|
e.push(l, c, c, h, h, l);
|
|
10294
10297
|
}
|
|
10295
10298
|
}
|
|
10296
|
-
const i = new (
|
|
10299
|
+
const i = new (Ig(e) ? Vg : Gg)(e, 1);
|
|
10297
10300
|
return i.version = $g(a), i;
|
|
10298
10301
|
}
|
|
10299
10302
|
class vT extends Hi {
|
|
@@ -11221,7 +11224,7 @@ class gs {
|
|
|
11221
11224
|
}
|
|
11222
11225
|
}
|
|
11223
11226
|
gs.DEFAULT_ORDER = "XYZ";
|
|
11224
|
-
class
|
|
11227
|
+
class BT {
|
|
11225
11228
|
/**
|
|
11226
11229
|
* Constructs a new layers instance, with membership
|
|
11227
11230
|
* initially set to layer `0`.
|
|
@@ -11293,14 +11296,14 @@ class IT {
|
|
|
11293
11296
|
return (this.mask & (1 << e | 0)) !== 0;
|
|
11294
11297
|
}
|
|
11295
11298
|
}
|
|
11296
|
-
let
|
|
11297
|
-
const vp = /* @__PURE__ */ new R(),
|
|
11299
|
+
let IT = 0;
|
|
11300
|
+
const vp = /* @__PURE__ */ new R(), In = /* @__PURE__ */ new Fr(), Ys = /* @__PURE__ */ new Le(), ao = /* @__PURE__ */ new R(), Hr = /* @__PURE__ */ new R(), LT = /* @__PURE__ */ new R(), UT = /* @__PURE__ */ new Fr(), wp = /* @__PURE__ */ new R(1, 0, 0), Ep = /* @__PURE__ */ new R(0, 1, 0), Cp = /* @__PURE__ */ new R(0, 0, 1), Mp = { type: "added" }, kT = { type: "removed" }, Ln = { type: "childadded", child: null }, fc = { type: "childremoved", child: null };
|
|
11298
11301
|
class pt extends En {
|
|
11299
11302
|
/**
|
|
11300
11303
|
* Constructs a new 3D object.
|
|
11301
11304
|
*/
|
|
11302
11305
|
constructor() {
|
|
11303
|
-
super(), this.isObject3D = !0, Object.defineProperty(this, "id", { value:
|
|
11306
|
+
super(), this.isObject3D = !0, Object.defineProperty(this, "id", { value: IT++ }), this.uuid = ii(), this.name = "", this.type = "Object3D", this.parent = null, this.children = [], this.up = pt.DEFAULT_UP.clone();
|
|
11304
11307
|
const e = new R(), t = new gs(), s = new Fr(), i = new R(1, 1, 1);
|
|
11305
11308
|
function n() {
|
|
11306
11309
|
s.setFromEuler(t, !1);
|
|
@@ -11374,7 +11377,7 @@ class pt extends En {
|
|
|
11374
11377
|
normalMatrix: {
|
|
11375
11378
|
value: new Yt()
|
|
11376
11379
|
}
|
|
11377
|
-
}), this.matrix = new Le(), this.matrixWorld = new Le(), this.matrixAutoUpdate = pt.DEFAULT_MATRIX_AUTO_UPDATE, this.matrixWorldAutoUpdate = pt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE, this.matrixWorldNeedsUpdate = !1, this.layers = new
|
|
11380
|
+
}), this.matrix = new Le(), this.matrixWorld = new Le(), this.matrixAutoUpdate = pt.DEFAULT_MATRIX_AUTO_UPDATE, this.matrixWorldAutoUpdate = pt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE, this.matrixWorldNeedsUpdate = !1, this.layers = new BT(), this.visible = !0, this.castShadow = !1, this.receiveShadow = !1, this.frustumCulled = !0, this.renderOrder = 0, this.animations = [], this.customDepthMaterial = void 0, this.customDistanceMaterial = void 0, this.userData = {};
|
|
11378
11381
|
}
|
|
11379
11382
|
/**
|
|
11380
11383
|
* A callback that is executed immediately before a 3D object is rendered to a shadow map.
|
|
@@ -11486,7 +11489,7 @@ class pt extends En {
|
|
|
11486
11489
|
* @return {Object3D} A reference to this instance.
|
|
11487
11490
|
*/
|
|
11488
11491
|
rotateOnAxis(e, t) {
|
|
11489
|
-
return
|
|
11492
|
+
return In.setFromAxisAngle(e, t), this.quaternion.multiply(In), this;
|
|
11490
11493
|
}
|
|
11491
11494
|
/**
|
|
11492
11495
|
* Rotates the 3D object along an axis in world space.
|
|
@@ -11496,7 +11499,7 @@ class pt extends En {
|
|
|
11496
11499
|
* @return {Object3D} A reference to this instance.
|
|
11497
11500
|
*/
|
|
11498
11501
|
rotateOnWorldAxis(e, t) {
|
|
11499
|
-
return
|
|
11502
|
+
return In.setFromAxisAngle(e, t), this.quaternion.premultiply(In), this;
|
|
11500
11503
|
}
|
|
11501
11504
|
/**
|
|
11502
11505
|
* Rotates the 3D object around its X axis in local space.
|
|
@@ -11592,7 +11595,7 @@ class pt extends En {
|
|
|
11592
11595
|
lookAt(e, t, s) {
|
|
11593
11596
|
e.isVector3 ? ao.copy(e) : ao.set(e, t, s);
|
|
11594
11597
|
const i = this.parent;
|
|
11595
|
-
this.updateWorldMatrix(!0, !1), Hr.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ? Ys.lookAt(Hr, ao, this.up) : Ys.lookAt(ao, Hr, this.up), this.quaternion.setFromRotationMatrix(Ys), i && (Ys.extractRotation(i.matrixWorld),
|
|
11598
|
+
this.updateWorldMatrix(!0, !1), Hr.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ? Ys.lookAt(Hr, ao, this.up) : Ys.lookAt(ao, Hr, this.up), this.quaternion.setFromRotationMatrix(Ys), i && (Ys.extractRotation(i.matrixWorld), In.setFromRotationMatrix(Ys), this.quaternion.premultiply(In.invert()));
|
|
11596
11599
|
}
|
|
11597
11600
|
/**
|
|
11598
11601
|
* Adds the given 3D object as a child to this 3D object. An arbitrary number of
|
|
@@ -12184,7 +12187,7 @@ class Ct extends En {
|
|
|
12184
12187
|
* @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.
|
|
12185
12188
|
* @param {string} [colorSpace=NoColorSpace] - The color space.
|
|
12186
12189
|
*/
|
|
12187
|
-
constructor(e = Ct.DEFAULT_IMAGE, t = Ct.DEFAULT_MAPPING, s =
|
|
12190
|
+
constructor(e = Ct.DEFAULT_IMAGE, t = Ct.DEFAULT_MAPPING, s = Ii, i = Ii, n = ns, r = ai, o = us, l = Ot, c = Ct.DEFAULT_ANISOTROPY, h = di) {
|
|
12188
12191
|
super(), this.isTexture = !0, Object.defineProperty(this, "id", { value: WT++ }), this.uuid = ii(), this.name = "", this.source = new Ou(e), this.mipmaps = [], this.mapping = t, this.channel = 0, this.wrapS = s, this.wrapT = i, this.magFilter = n, this.minFilter = r, this.anisotropy = c, this.format = o, this.internalFormat = null, this.type = l, this.offset = new ce(0, 0), this.repeat = new ce(1, 1), this.center = new ce(0, 0), this.rotation = 0, this.matrixAutoUpdate = !0, this.matrix = new Yt(), this.generateMipmaps = !0, this.premultiplyAlpha = !1, this.flipY = !0, this.unpackAlignment = 4, this.colorSpace = h, this.userData = {}, this.updateRanges = [], this.version = 0, this.onUpdate = null, this.renderTarget = null, this.isRenderTargetTexture = !1, this.isArrayTexture = !!(e && e.depth && e.depth > 1), this.pmremVersion = 0;
|
|
12189
12192
|
}
|
|
12190
12193
|
/**
|
|
@@ -12337,7 +12340,7 @@ class Ct extends En {
|
|
|
12337
12340
|
case wr:
|
|
12338
12341
|
e.x = e.x - Math.floor(e.x);
|
|
12339
12342
|
break;
|
|
12340
|
-
case
|
|
12343
|
+
case Ii:
|
|
12341
12344
|
e.x = e.x < 0 ? 0 : 1;
|
|
12342
12345
|
break;
|
|
12343
12346
|
case Er:
|
|
@@ -12349,7 +12352,7 @@ class Ct extends En {
|
|
|
12349
12352
|
case wr:
|
|
12350
12353
|
e.y = e.y - Math.floor(e.y);
|
|
12351
12354
|
break;
|
|
12352
|
-
case
|
|
12355
|
+
case Ii:
|
|
12353
12356
|
e.y = e.y < 0 ? 0 : 1;
|
|
12354
12357
|
break;
|
|
12355
12358
|
case Er:
|
|
@@ -12552,7 +12555,7 @@ class qT extends Hi {
|
|
|
12552
12555
|
this.has(e) === !0 && (this.backend.destroySampler(e), this.backend.destroyTexture(e), this.delete(e), this.info.memory.textures--);
|
|
12553
12556
|
}
|
|
12554
12557
|
}
|
|
12555
|
-
class
|
|
12558
|
+
class Bu extends ve {
|
|
12556
12559
|
/**
|
|
12557
12560
|
* Constructs a new four-component color.
|
|
12558
12561
|
* You can also pass a single THREE.Color, hex or
|
|
@@ -13344,7 +13347,7 @@ class eS extends rt {
|
|
|
13344
13347
|
return `${e.getType(i)}( ${c.join(", ")} )`;
|
|
13345
13348
|
}
|
|
13346
13349
|
}
|
|
13347
|
-
class
|
|
13350
|
+
class Iu extends re {
|
|
13348
13351
|
static get type() {
|
|
13349
13352
|
return "InputNode";
|
|
13350
13353
|
}
|
|
@@ -13395,7 +13398,7 @@ class Bu extends re {
|
|
|
13395
13398
|
}
|
|
13396
13399
|
}
|
|
13397
13400
|
const Pp = /float|u?int/;
|
|
13398
|
-
class gi extends
|
|
13401
|
+
class gi extends Iu {
|
|
13399
13402
|
static get type() {
|
|
13400
13403
|
return "ConstNode";
|
|
13401
13404
|
}
|
|
@@ -13455,7 +13458,7 @@ function D(a, e) {
|
|
|
13455
13458
|
const Yg = (a) => a.replace(/r|s/g, "x").replace(/g|t/g, "y").replace(/b|p/g, "z").replace(/a|q/g, "w"), Fp = (a) => Yg(a).split("").sort().join(""), Xg = {
|
|
13456
13459
|
setup(a, e) {
|
|
13457
13460
|
const t = e.shift();
|
|
13458
|
-
return a(
|
|
13461
|
+
return a(Il(t), ...e);
|
|
13459
13462
|
},
|
|
13460
13463
|
get(a, e, t) {
|
|
13461
13464
|
if (typeof e == "string" && a[e] === void 0) {
|
|
@@ -13500,7 +13503,7 @@ const Yg = (a) => a.replace(/r|s/g, "x").replace(/g|t/g, "y").replace(/b|p/g, "z
|
|
|
13500
13503
|
if (e === null && (t === "float" || t === "boolean") || t && t !== "shader" && t !== "string")
|
|
13501
13504
|
return U(ru(a, e));
|
|
13502
13505
|
if (t === "shader")
|
|
13503
|
-
return
|
|
13506
|
+
return I(a);
|
|
13504
13507
|
}
|
|
13505
13508
|
return a;
|
|
13506
13509
|
}, iS = function(a, e = null) {
|
|
@@ -13574,7 +13577,7 @@ class lS extends re {
|
|
|
13574
13577
|
return this.layout = e, this;
|
|
13575
13578
|
}
|
|
13576
13579
|
call(e = null) {
|
|
13577
|
-
return
|
|
13580
|
+
return Il(e), U(new oS(this, e));
|
|
13578
13581
|
}
|
|
13579
13582
|
setup() {
|
|
13580
13583
|
return this.call();
|
|
@@ -13589,7 +13592,7 @@ for (const a of uS) ku.set(a, new gi(a, "int"));
|
|
|
13589
13592
|
const Ol = new Map([...ku].map((a) => new gi(a.value)));
|
|
13590
13593
|
for (const a of Zg) Ol.set(a, new gi(a));
|
|
13591
13594
|
for (const a of Zg) Ol.set(-a, new gi(-a));
|
|
13592
|
-
const
|
|
13595
|
+
const Bl = { bool: Lu, uint: Uu, ints: ku, float: Ol }, Op = new Map([...Lu, ...Ol]), ru = (a, e) => Op.has(a) ? Op.get(a) : a.isNode === !0 ? a : new gi(a, e), dS = (a) => {
|
|
13593
13596
|
try {
|
|
13594
13597
|
return a.getNodeType();
|
|
13595
13598
|
} catch {
|
|
@@ -13606,21 +13609,21 @@ const Il = { bool: Lu, uint: Uu, ints: ku, float: Ol }, Op = new Map([...Lu, ...
|
|
|
13606
13609
|
const s = t.map((i) => ru(i));
|
|
13607
13610
|
return U(new KT(s, a));
|
|
13608
13611
|
};
|
|
13609
|
-
},
|
|
13612
|
+
}, Bp = (a) => typeof a == "object" && a !== null ? a.value : a, pS = (a) => a != null ? a.nodeType || a.convertTo || (typeof a == "string" ? a : null) : null;
|
|
13610
13613
|
function ga(a, e) {
|
|
13611
13614
|
return new Proxy(new lS(a, e), Xg);
|
|
13612
13615
|
}
|
|
13613
13616
|
const U = (a, e = null) => (
|
|
13614
13617
|
/* new */
|
|
13615
13618
|
sS(a, e)
|
|
13616
|
-
),
|
|
13619
|
+
), Il = (a, e = null) => new iS(a, e), gr = (a, e = null) => new nS(a, e), L = (...a) => new rS(...a), G = (...a) => new aS(...a);
|
|
13617
13620
|
let fS = 0;
|
|
13618
|
-
const
|
|
13621
|
+
const I = (a, e = null) => {
|
|
13619
13622
|
let t = null;
|
|
13620
13623
|
e !== null && (typeof e == "object" ? t = e.return : (typeof e == "string" ? t = e : console.error("THREE.TSL: Invalid layout type."), e = null));
|
|
13621
13624
|
const s = new ga(a, t), i = (...n) => {
|
|
13622
13625
|
let r;
|
|
13623
|
-
|
|
13626
|
+
Il(n), n[0] && (n[0].isNode || Object.getPrototypeOf(n[0]) !== Object.prototype) ? r = [...n] : r = n[0];
|
|
13624
13627
|
const l = s.call(r);
|
|
13625
13628
|
return t === "void" && l.toStack(), l;
|
|
13626
13629
|
};
|
|
@@ -13648,7 +13651,7 @@ function Qg(a) {
|
|
|
13648
13651
|
return Cr && Cr.add(a), a;
|
|
13649
13652
|
}
|
|
13650
13653
|
D("toStack", Qg);
|
|
13651
|
-
const mS = new at("color"), O = new at("float",
|
|
13654
|
+
const mS = new at("color"), O = new at("float", Bl.float), ze = new at("int", Bl.ints), gS = new at("uint", Bl.uint), zu = new at("bool", Bl.bool), V = new at("vec2"), Js = new at("ivec2"), yS = new at("uvec2"), xS = new at("bvec2"), B = new at("vec3"), _S = new at("ivec3"), bS = new at("uvec3"), TS = new at("bvec3"), ne = new at("vec4"), SS = new at("ivec4"), vS = new at("uvec4"), wS = new at("bvec4"), Gu = new at("mat2"), It = new at("mat3"), yr = new at("mat4");
|
|
13652
13655
|
D("toColor", mS);
|
|
13653
13656
|
D("toFloat", O);
|
|
13654
13657
|
D("toInt", ze);
|
|
@@ -13658,7 +13661,7 @@ D("toVec2", V);
|
|
|
13658
13661
|
D("toIVec2", Js);
|
|
13659
13662
|
D("toUVec2", yS);
|
|
13660
13663
|
D("toBVec2", xS);
|
|
13661
|
-
D("toVec3",
|
|
13664
|
+
D("toVec3", B);
|
|
13662
13665
|
D("toIVec3", _S);
|
|
13663
13666
|
D("toUVec3", bS);
|
|
13664
13667
|
D("toBVec3", TS);
|
|
@@ -13667,7 +13670,7 @@ D("toIVec4", SS);
|
|
|
13667
13670
|
D("toUVec4", vS);
|
|
13668
13671
|
D("toBVec4", wS);
|
|
13669
13672
|
D("toMat2", Gu);
|
|
13670
|
-
D("toMat3",
|
|
13673
|
+
D("toMat3", It);
|
|
13671
13674
|
D("toMat4", yr);
|
|
13672
13675
|
const ES = /* @__PURE__ */ L($a).setParameterLength(2), CS = (a, e) => U(new qg(U(a), e));
|
|
13673
13676
|
D("element", ES);
|
|
@@ -13738,7 +13741,7 @@ class MS extends rt {
|
|
|
13738
13741
|
}
|
|
13739
13742
|
const AS = /* @__PURE__ */ L(MS).setParameterLength(2);
|
|
13740
13743
|
D("assign", AS);
|
|
13741
|
-
class
|
|
13744
|
+
class Ip extends rt {
|
|
13742
13745
|
static get type() {
|
|
13743
13746
|
return "ArrayNode";
|
|
13744
13747
|
}
|
|
@@ -13785,10 +13788,10 @@ const RS = (...a) => {
|
|
|
13785
13788
|
let e;
|
|
13786
13789
|
if (a.length === 1) {
|
|
13787
13790
|
const t = a[0];
|
|
13788
|
-
e = new
|
|
13791
|
+
e = new Ip(null, t.length, t);
|
|
13789
13792
|
} else {
|
|
13790
13793
|
const t = a[0], s = a[1];
|
|
13791
|
-
e = new
|
|
13794
|
+
e = new Ip(t, s);
|
|
13792
13795
|
}
|
|
13793
13796
|
return U(e);
|
|
13794
13797
|
};
|
|
@@ -13815,7 +13818,7 @@ class Jg extends re {
|
|
|
13815
13818
|
}
|
|
13816
13819
|
}
|
|
13817
13820
|
const NS = (a) => new Jg(a), Vu = (a, e = 0) => new Jg(a, !0, e), PS = /* @__PURE__ */ Vu("frame"), K = /* @__PURE__ */ Vu("render"), ey = /* @__PURE__ */ NS("object");
|
|
13818
|
-
class Wa extends
|
|
13821
|
+
class Wa extends Iu {
|
|
13819
13822
|
static get type() {
|
|
13820
13823
|
return "UniformNode";
|
|
13821
13824
|
}
|
|
@@ -13961,7 +13964,7 @@ class FS extends rt {
|
|
|
13961
13964
|
return `${s.build(e, "property")}( ${t.join(", ")} )`;
|
|
13962
13965
|
}
|
|
13963
13966
|
}
|
|
13964
|
-
const DS = (a, ...e) => (e = e.length > 1 || e[0] && e[0].isNode === !0 ? gr(e) :
|
|
13967
|
+
const DS = (a, ...e) => (e = e.length > 1 || e[0] && e[0].isNode === !0 ? gr(e) : Il(e[0]), U(new FS(U(a), e)));
|
|
13965
13968
|
D("call", DS);
|
|
13966
13969
|
const OS = {
|
|
13967
13970
|
"==": "equal",
|
|
@@ -14073,10 +14076,10 @@ class je extends rt {
|
|
|
14073
14076
|
super.deserialize(e), this.op = e.op;
|
|
14074
14077
|
}
|
|
14075
14078
|
}
|
|
14076
|
-
const Lt = /* @__PURE__ */ L(je, "+").setParameterLength(2, 1 / 0).setName("add"), Ft = /* @__PURE__ */ L(je, "-").setParameterLength(2, 1 / 0).setName("sub"), fe = /* @__PURE__ */ L(je, "*").setParameterLength(2, 1 / 0).setName("mul"), $s = /* @__PURE__ */ L(je, "/").setParameterLength(2, 1 / 0).setName("div"), Ll = /* @__PURE__ */ L(je, "%").setParameterLength(2).setName("mod"), ly = /* @__PURE__ */ L(je, "==").setParameterLength(2).setName("equal"),
|
|
14079
|
+
const Lt = /* @__PURE__ */ L(je, "+").setParameterLength(2, 1 / 0).setName("add"), Ft = /* @__PURE__ */ L(je, "-").setParameterLength(2, 1 / 0).setName("sub"), fe = /* @__PURE__ */ L(je, "*").setParameterLength(2, 1 / 0).setName("mul"), $s = /* @__PURE__ */ L(je, "/").setParameterLength(2, 1 / 0).setName("div"), Ll = /* @__PURE__ */ L(je, "%").setParameterLength(2).setName("mod"), ly = /* @__PURE__ */ L(je, "==").setParameterLength(2).setName("equal"), BS = /* @__PURE__ */ L(je, "!=").setParameterLength(2).setName("notEqual"), IS = /* @__PURE__ */ L(je, "<").setParameterLength(2).setName("lessThan"), LS = /* @__PURE__ */ L(je, ">").setParameterLength(2).setName("greaterThan"), US = /* @__PURE__ */ L(je, "<=").setParameterLength(2).setName("lessThanEqual"), kS = /* @__PURE__ */ L(je, ">=").setParameterLength(2).setName("greaterThanEqual"), zS = /* @__PURE__ */ L(je, "&&").setParameterLength(2, 1 / 0).setName("and"), GS = /* @__PURE__ */ L(je, "||").setParameterLength(2, 1 / 0).setName("or"), VS = /* @__PURE__ */ L(je, "!").setParameterLength(1).setName("not"), HS = /* @__PURE__ */ L(je, "^^").setParameterLength(2).setName("xor"), $S = /* @__PURE__ */ L(je, "&").setParameterLength(2).setName("bitAnd"), WS = /* @__PURE__ */ L(je, "~").setParameterLength(2).setName("bitNot"), jS = /* @__PURE__ */ L(je, "|").setParameterLength(2).setName("bitOr"), qS = /* @__PURE__ */ L(je, "^").setParameterLength(2).setName("bitXor"), YS = /* @__PURE__ */ L(je, "<<").setParameterLength(2).setName("shiftLeft"), XS = /* @__PURE__ */ L(je, ">>").setParameterLength(2).setName("shiftRight"), ZS = I(([a]) => (a.addAssign(1), a)), KS = I(([a]) => (a.subAssign(1), a)), QS = /* @__PURE__ */ I(([a]) => {
|
|
14077
14080
|
const e = ze(a).toConst();
|
|
14078
14081
|
return a.addAssign(1), e;
|
|
14079
|
-
}), JS = /* @__PURE__ */
|
|
14082
|
+
}), JS = /* @__PURE__ */ I(([a]) => {
|
|
14080
14083
|
const e = ze(a).toConst();
|
|
14081
14084
|
return a.subAssign(1), e;
|
|
14082
14085
|
});
|
|
@@ -14086,8 +14089,8 @@ D("mul", fe);
|
|
|
14086
14089
|
D("div", $s);
|
|
14087
14090
|
D("mod", Ll);
|
|
14088
14091
|
D("equal", ly);
|
|
14089
|
-
D("notEqual",
|
|
14090
|
-
D("lessThan",
|
|
14092
|
+
D("notEqual", BS);
|
|
14093
|
+
D("lessThan", IS);
|
|
14091
14094
|
D("greaterThan", LS);
|
|
14092
14095
|
D("lessThanEqual", US);
|
|
14093
14096
|
D("greaterThanEqual", kS);
|
|
@@ -14160,7 +14163,7 @@ class M extends rt {
|
|
|
14160
14163
|
n = cs(Ft(t, s));
|
|
14161
14164
|
else if (i === M.TRANSFORM_DIRECTION) {
|
|
14162
14165
|
let r = t, o = s;
|
|
14163
|
-
e.isMatrix(r.getNodeType(e)) ? o = ne(
|
|
14166
|
+
e.isMatrix(r.getNodeType(e)) ? o = ne(B(o), 0) : r = ne(B(r), 0);
|
|
14164
14167
|
const l = fe(r, o).xyz;
|
|
14165
14168
|
n = ka(l);
|
|
14166
14169
|
}
|
|
@@ -14251,7 +14254,7 @@ M.CLAMP = "clamp";
|
|
|
14251
14254
|
M.REFRACT = "refract";
|
|
14252
14255
|
M.SMOOTHSTEP = "smoothstep";
|
|
14253
14256
|
M.FACEFORWARD = "faceforward";
|
|
14254
|
-
const sv = /* @__PURE__ */ O(1e-6), iv = /* @__PURE__ */ O(Math.PI), nv = /* @__PURE__ */ L(M, M.ALL).setParameterLength(1), rv = /* @__PURE__ */ L(M, M.ANY).setParameterLength(1), av = /* @__PURE__ */ L(M, M.RADIANS).setParameterLength(1), ov = /* @__PURE__ */ L(M, M.DEGREES).setParameterLength(1), cy = /* @__PURE__ */ L(M, M.EXP).setParameterLength(1), Ua = /* @__PURE__ */ L(M, M.EXP2).setParameterLength(1), hy = /* @__PURE__ */ L(M, M.LOG).setParameterLength(1), ci = /* @__PURE__ */ L(M, M.LOG2).setParameterLength(1), Wu = /* @__PURE__ */ L(M, M.SQRT).setParameterLength(1), lv = /* @__PURE__ */ L(M, M.INVERSE_SQRT).setParameterLength(1), bn = /* @__PURE__ */ L(M, M.FLOOR).setParameterLength(1), ju = /* @__PURE__ */ L(M, M.CEIL).setParameterLength(1), ka = /* @__PURE__ */ L(M, M.NORMALIZE).setParameterLength(1), $i = /* @__PURE__ */ L(M, M.FRACT).setParameterLength(1), Es = /* @__PURE__ */ L(M, M.SIN).setParameterLength(1), Pi = /* @__PURE__ */ L(M, M.COS).setParameterLength(1), cv = /* @__PURE__ */ L(M, M.TAN).setParameterLength(1), hv = /* @__PURE__ */ L(M, M.ASIN).setParameterLength(1), uy = /* @__PURE__ */ L(M, M.ACOS).setParameterLength(1), dy = /* @__PURE__ */ L(M, M.ATAN).setParameterLength(1, 2), cs = /* @__PURE__ */ L(M, M.ABS).setParameterLength(1), Ml = /* @__PURE__ */ L(M, M.SIGN).setParameterLength(1), hi = /* @__PURE__ */ L(M, M.LENGTH).setParameterLength(1), uv = /* @__PURE__ */ L(M, M.NEGATE).setParameterLength(1), dv = /* @__PURE__ */ L(M, M.ONE_MINUS).setParameterLength(1), py = /* @__PURE__ */ L(M, M.DFDX).setParameterLength(1), fy = /* @__PURE__ */ L(M, M.DFDY).setParameterLength(1), pv = /* @__PURE__ */ L(M, M.ROUND).setParameterLength(1), fv = /* @__PURE__ */ L(M, M.RECIPROCAL).setParameterLength(1), mv = /* @__PURE__ */ L(M, M.TRUNC).setParameterLength(1), gv = /* @__PURE__ */ L(M, M.FWIDTH).setParameterLength(1), yv = /* @__PURE__ */ L(M, M.TRANSPOSE).setParameterLength(1), xv = (a, e) => (console.warn('THREE.TSL: "equals" is deprecated. Use "equal" inside a vector instead, like: "bvec*( equal( ... ) )"'), ly(a, e)), Mr = /* @__PURE__ */ L(M, M.MIN).setParameterLength(2, 1 / 0), Mt = /* @__PURE__ */ L(M, M.MAX).setParameterLength(2, 1 / 0), my = /* @__PURE__ */ L(M, M.STEP).setParameterLength(2), _v = /* @__PURE__ */ L(M, M.REFLECT).setParameterLength(2), bv = /* @__PURE__ */ L(M, M.DISTANCE).setParameterLength(2), Tv = /* @__PURE__ */ L(M, M.DIFFERENCE).setParameterLength(2), qu = /* @__PURE__ */ L(M, M.DOT).setParameterLength(2), gy = /* @__PURE__ */ L(M, M.CROSS).setParameterLength(2), Ul = /* @__PURE__ */ L(M, M.POW).setParameterLength(2), yy = /* @__PURE__ */ L(M, M.POW, 2).setParameterLength(1), Sv = /* @__PURE__ */ L(M, M.POW, 3).setParameterLength(1), vv = /* @__PURE__ */ L(M, M.POW, 4).setParameterLength(1), wv = /* @__PURE__ */ L(M, M.TRANSFORM_DIRECTION).setParameterLength(2), Ev = (a) => fe(Ml(a), Ul(cs(a), 1 / 3)), xy = (a) => qu(a, a), He = /* @__PURE__ */ L(M, M.MIX).setParameterLength(3), fi = (a, e = 0, t = 1) => U(new M(M.CLAMP, U(a), U(e), U(t))), _y = (a) => fi(a), by = /* @__PURE__ */ L(M, M.REFRACT).setParameterLength(3), Gi = /* @__PURE__ */ L(M, M.SMOOTHSTEP).setParameterLength(3), Cv = /* @__PURE__ */ L(M, M.FACEFORWARD).setParameterLength(3), Mv = /* @__PURE__ */
|
|
14257
|
+
const sv = /* @__PURE__ */ O(1e-6), iv = /* @__PURE__ */ O(Math.PI), nv = /* @__PURE__ */ L(M, M.ALL).setParameterLength(1), rv = /* @__PURE__ */ L(M, M.ANY).setParameterLength(1), av = /* @__PURE__ */ L(M, M.RADIANS).setParameterLength(1), ov = /* @__PURE__ */ L(M, M.DEGREES).setParameterLength(1), cy = /* @__PURE__ */ L(M, M.EXP).setParameterLength(1), Ua = /* @__PURE__ */ L(M, M.EXP2).setParameterLength(1), hy = /* @__PURE__ */ L(M, M.LOG).setParameterLength(1), ci = /* @__PURE__ */ L(M, M.LOG2).setParameterLength(1), Wu = /* @__PURE__ */ L(M, M.SQRT).setParameterLength(1), lv = /* @__PURE__ */ L(M, M.INVERSE_SQRT).setParameterLength(1), bn = /* @__PURE__ */ L(M, M.FLOOR).setParameterLength(1), ju = /* @__PURE__ */ L(M, M.CEIL).setParameterLength(1), ka = /* @__PURE__ */ L(M, M.NORMALIZE).setParameterLength(1), $i = /* @__PURE__ */ L(M, M.FRACT).setParameterLength(1), Es = /* @__PURE__ */ L(M, M.SIN).setParameterLength(1), Pi = /* @__PURE__ */ L(M, M.COS).setParameterLength(1), cv = /* @__PURE__ */ L(M, M.TAN).setParameterLength(1), hv = /* @__PURE__ */ L(M, M.ASIN).setParameterLength(1), uy = /* @__PURE__ */ L(M, M.ACOS).setParameterLength(1), dy = /* @__PURE__ */ L(M, M.ATAN).setParameterLength(1, 2), cs = /* @__PURE__ */ L(M, M.ABS).setParameterLength(1), Ml = /* @__PURE__ */ L(M, M.SIGN).setParameterLength(1), hi = /* @__PURE__ */ L(M, M.LENGTH).setParameterLength(1), uv = /* @__PURE__ */ L(M, M.NEGATE).setParameterLength(1), dv = /* @__PURE__ */ L(M, M.ONE_MINUS).setParameterLength(1), py = /* @__PURE__ */ L(M, M.DFDX).setParameterLength(1), fy = /* @__PURE__ */ L(M, M.DFDY).setParameterLength(1), pv = /* @__PURE__ */ L(M, M.ROUND).setParameterLength(1), fv = /* @__PURE__ */ L(M, M.RECIPROCAL).setParameterLength(1), mv = /* @__PURE__ */ L(M, M.TRUNC).setParameterLength(1), gv = /* @__PURE__ */ L(M, M.FWIDTH).setParameterLength(1), yv = /* @__PURE__ */ L(M, M.TRANSPOSE).setParameterLength(1), xv = (a, e) => (console.warn('THREE.TSL: "equals" is deprecated. Use "equal" inside a vector instead, like: "bvec*( equal( ... ) )"'), ly(a, e)), Mr = /* @__PURE__ */ L(M, M.MIN).setParameterLength(2, 1 / 0), Mt = /* @__PURE__ */ L(M, M.MAX).setParameterLength(2, 1 / 0), my = /* @__PURE__ */ L(M, M.STEP).setParameterLength(2), _v = /* @__PURE__ */ L(M, M.REFLECT).setParameterLength(2), bv = /* @__PURE__ */ L(M, M.DISTANCE).setParameterLength(2), Tv = /* @__PURE__ */ L(M, M.DIFFERENCE).setParameterLength(2), qu = /* @__PURE__ */ L(M, M.DOT).setParameterLength(2), gy = /* @__PURE__ */ L(M, M.CROSS).setParameterLength(2), Ul = /* @__PURE__ */ L(M, M.POW).setParameterLength(2), yy = /* @__PURE__ */ L(M, M.POW, 2).setParameterLength(1), Sv = /* @__PURE__ */ L(M, M.POW, 3).setParameterLength(1), vv = /* @__PURE__ */ L(M, M.POW, 4).setParameterLength(1), wv = /* @__PURE__ */ L(M, M.TRANSFORM_DIRECTION).setParameterLength(2), Ev = (a) => fe(Ml(a), Ul(cs(a), 1 / 3)), xy = (a) => qu(a, a), He = /* @__PURE__ */ L(M, M.MIX).setParameterLength(3), fi = (a, e = 0, t = 1) => U(new M(M.CLAMP, U(a), U(e), U(t))), _y = (a) => fi(a), by = /* @__PURE__ */ L(M, M.REFRACT).setParameterLength(3), Gi = /* @__PURE__ */ L(M, M.SMOOTHSTEP).setParameterLength(3), Cv = /* @__PURE__ */ L(M, M.FACEFORWARD).setParameterLength(3), Mv = /* @__PURE__ */ I(([a]) => {
|
|
14255
14258
|
const s = 43758.5453, i = qu(a.xy, V(12.9898, 78.233)), n = Ll(i, iv);
|
|
14256
14259
|
return $i(Es(n).mul(s));
|
|
14257
14260
|
}), Av = (a, e, t) => He(e, t, a), Rv = (a, e, t) => Gi(e, t, a), Nv = (a, e) => (console.warn('THREE.TSL: "atan2" is overloaded. Use "atan" instead.'), dy(a, e));
|
|
@@ -14472,11 +14475,11 @@ class tl extends re {
|
|
|
14472
14475
|
return e.addLineFlowCode(`${p} = ${h}`, this), d;
|
|
14473
14476
|
}
|
|
14474
14477
|
}
|
|
14475
|
-
const Xu = /* @__PURE__ */ L(tl), Ov = (a, e = null) => Xu(a, e).toStack(),
|
|
14478
|
+
const Xu = /* @__PURE__ */ L(tl), Ov = (a, e = null) => Xu(a, e).toStack(), Bv = (a, e = null) => Xu(a, e, !0).toStack();
|
|
14476
14479
|
D("toVar", Ov);
|
|
14477
|
-
D("toConst",
|
|
14478
|
-
const
|
|
14479
|
-
D("temp",
|
|
14480
|
+
D("toConst", Bv);
|
|
14481
|
+
const Iv = (a) => (console.warn('TSL: "temp( node )" is deprecated. Use "Var( node )" or "node.toVar()" instead.'), Xu(a));
|
|
14482
|
+
D("temp", Iv);
|
|
14480
14483
|
class Lv extends re {
|
|
14481
14484
|
static get type() {
|
|
14482
14485
|
return "VaryingNode";
|
|
@@ -14541,7 +14544,7 @@ D("toVarying", Ns);
|
|
|
14541
14544
|
D("toVertexStage", Uv);
|
|
14542
14545
|
D("varying", (...a) => (console.warn("THREE.TSL: .varying() has been renamed to .toVarying()."), Ns(...a)));
|
|
14543
14546
|
D("vertexStage", (...a) => (console.warn("THREE.TSL: .vertexStage() has been renamed to .toVertexStage()."), Ns(...a)));
|
|
14544
|
-
const kv = /* @__PURE__ */
|
|
14547
|
+
const kv = /* @__PURE__ */ I(([a]) => {
|
|
14545
14548
|
const e = a.mul(0.9478672986).add(0.0521327014).pow(2.4), t = a.mul(0.0773993808), s = a.lessThanEqual(0.04045);
|
|
14546
14549
|
return He(e, t, s);
|
|
14547
14550
|
}).setLayout({
|
|
@@ -14550,7 +14553,7 @@ const kv = /* @__PURE__ */ B(([a]) => {
|
|
|
14550
14553
|
inputs: [
|
|
14551
14554
|
{ name: "color", type: "vec3" }
|
|
14552
14555
|
]
|
|
14553
|
-
}), zv = /* @__PURE__ */
|
|
14556
|
+
}), zv = /* @__PURE__ */ I(([a]) => {
|
|
14554
14557
|
const e = a.pow(0.41666).mul(1.055).sub(0.055), t = a.mul(12.92), s = a.lessThanEqual(31308e-7);
|
|
14555
14558
|
return He(e, t, s);
|
|
14556
14559
|
}).setLayout({
|
|
@@ -14590,7 +14593,7 @@ class Sy extends rt {
|
|
|
14590
14593
|
const { colorNode: t } = this, s = this.resolveColorSpace(e, this.source), i = this.resolveColorSpace(e, this.target);
|
|
14591
14594
|
let n = t;
|
|
14592
14595
|
return ke.enabled === !1 || s === i || !s || !i || (ke.getTransfer(s) === te && (n = ne(kv(n.rgb), n.a)), ke.getPrimaries(s) !== ke.getPrimaries(i) && (n = ne(
|
|
14593
|
-
|
|
14596
|
+
It(ke._getMatrix(new Yt(), s, i)).mul(n.rgb),
|
|
14594
14597
|
n.a
|
|
14595
14598
|
)), ke.getTransfer(i) === te && (n = ne(zv(n.rgb), n.a))), n;
|
|
14596
14599
|
}
|
|
@@ -15181,7 +15184,7 @@ class wy {
|
|
|
15181
15184
|
};
|
|
15182
15185
|
}
|
|
15183
15186
|
}
|
|
15184
|
-
class Zv extends
|
|
15187
|
+
class Zv extends Iu {
|
|
15185
15188
|
static get type() {
|
|
15186
15189
|
return "BufferAttributeNode";
|
|
15187
15190
|
}
|
|
@@ -15808,7 +15811,7 @@ class mw extends re {
|
|
|
15808
15811
|
const i = e.addStack();
|
|
15809
15812
|
t.returnsNode = this.params[this.params.length - 1](s, e), t.stackNode = i;
|
|
15810
15813
|
const n = this.params[0];
|
|
15811
|
-
return n.isNode !== !0 && typeof n.update == "function" && (t.updateNode =
|
|
15814
|
+
return n.isNode !== !0 && typeof n.update == "function" && (t.updateNode = I(this.params[0].update)(s)), e.removeStack(), t;
|
|
15812
15815
|
}
|
|
15813
15816
|
/**
|
|
15814
15817
|
* This method is overwritten since the node type is inferred based on the loop configuration.
|
|
@@ -16763,7 +16766,7 @@ class Tw extends re {
|
|
|
16763
16766
|
return this.name;
|
|
16764
16767
|
}
|
|
16765
16768
|
}
|
|
16766
|
-
const zl = L(Tw).setParameterLength(1), Ry = /* @__PURE__ */ Q(0, "uint").label("u_cameraIndex").setGroup(Vu("cameraIndex")).toVarying("v_cameraIndex"), dn = /* @__PURE__ */ Q("float").label("cameraNear").setGroup(K).onRenderUpdate(({ camera: a }) => a.near), pn = /* @__PURE__ */ Q("float").label("cameraFar").setGroup(K).onRenderUpdate(({ camera: a }) => a.far), td = /* @__PURE__ */
|
|
16769
|
+
const zl = L(Tw).setParameterLength(1), Ry = /* @__PURE__ */ Q(0, "uint").label("u_cameraIndex").setGroup(Vu("cameraIndex")).toVarying("v_cameraIndex"), dn = /* @__PURE__ */ Q("float").label("cameraNear").setGroup(K).onRenderUpdate(({ camera: a }) => a.near), pn = /* @__PURE__ */ Q("float").label("cameraFar").setGroup(K).onRenderUpdate(({ camera: a }) => a.far), td = /* @__PURE__ */ I(({ camera: a }) => {
|
|
16767
16770
|
let e;
|
|
16768
16771
|
if (a.isArrayCamera && a.cameras.length > 0) {
|
|
16769
16772
|
const t = [];
|
|
@@ -16773,7 +16776,7 @@ const zl = L(Tw).setParameterLength(1), Ry = /* @__PURE__ */ Q(0, "uint").label(
|
|
|
16773
16776
|
} else
|
|
16774
16777
|
e = Q("mat4").label("cameraProjectionMatrix").setGroup(K).onRenderUpdate(({ camera: t }) => t.projectionMatrix);
|
|
16775
16778
|
return e;
|
|
16776
|
-
}).once()(), yi = /* @__PURE__ */
|
|
16779
|
+
}).once()(), yi = /* @__PURE__ */ I(({ camera: a }) => {
|
|
16777
16780
|
let e;
|
|
16778
16781
|
if (a.isArrayCamera && a.cameras.length > 0) {
|
|
16779
16782
|
const t = [];
|
|
@@ -16812,10 +16815,10 @@ ys.POSITION;
|
|
|
16812
16815
|
ys.SCALE;
|
|
16813
16816
|
ys.VIEW_POSITION;
|
|
16814
16817
|
ys.RADIUS;
|
|
16815
|
-
const vw = /* @__PURE__ */ Q(new Yt()).onObjectUpdate(({ object: a }, e) => e.value.getNormalMatrix(a.matrixWorld)), Gl = /* @__PURE__ */
|
|
16818
|
+
const vw = /* @__PURE__ */ Q(new Yt()).onObjectUpdate(({ object: a }, e) => e.value.getNormalMatrix(a.matrixWorld)), Gl = /* @__PURE__ */ I((a) => a.renderer.overrideNodes.modelViewMatrix || ww).once()().toVar("modelViewMatrix"), ww = /* @__PURE__ */ yi.mul(vn), Vp = /* @__PURE__ */ I((a) => (a.context.isHighPrecisionModelViewMatrix = !0, Q("mat4").onObjectUpdate(({ object: e, camera: t }) => e.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, e.matrixWorld)))).once()().toVar("highpModelViewMatrix"), Hp = /* @__PURE__ */ I((a) => {
|
|
16816
16819
|
const e = a.context.isHighPrecisionModelViewMatrix;
|
|
16817
16820
|
return Q("mat3").onObjectUpdate(({ object: t, camera: s }) => (e !== !0 && t.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse, t.matrixWorld), t.normalMatrix.getNormalMatrix(t.modelViewMatrix)));
|
|
16818
|
-
}).once()().toVar("highpModelNormalViewMatrix"), Vl = /* @__PURE__ */ Vi("position", "vec3"), wt = /* @__PURE__ */ Vl.toVarying("positionLocal"), $p = /* @__PURE__ */ Vl.toVarying("positionPrevious"), za = /* @__PURE__ */
|
|
16821
|
+
}).once()().toVar("highpModelNormalViewMatrix"), Vl = /* @__PURE__ */ Vi("position", "vec3"), wt = /* @__PURE__ */ Vl.toVarying("positionLocal"), $p = /* @__PURE__ */ Vl.toVarying("positionPrevious"), za = /* @__PURE__ */ I((a) => vn.mul(wt).xyz.toVarying(a.getNamespace("v_positionWorld")), "vec3").once("POSITION")(), Ny = /* @__PURE__ */ I((a) => wt.transformDirection(vn).toVarying(a.getNamespace("v_positionWorldDirection")).normalize().toVar("positionWorldDirection"), "vec3").once("POSITION")(), it = /* @__PURE__ */ I((a) => a.context.setupPositionView().toVarying(a.getNamespace("v_positionView")), "vec3").once("POSITION")(), Ye = /* @__PURE__ */ it.negate().toVarying("v_positionViewDirection").normalize().toVar("positionViewDirection");
|
|
16819
16822
|
class Ew extends rt {
|
|
16820
16823
|
static get type() {
|
|
16821
16824
|
return "EquirectUVNode";
|
|
@@ -16849,22 +16852,22 @@ class Cw extends re {
|
|
|
16849
16852
|
return t.coordinateSystem === Ht && s.side === jt ? "false" : e.getFrontFacing();
|
|
16850
16853
|
}
|
|
16851
16854
|
}
|
|
16852
|
-
const Mw = /* @__PURE__ */ G(Cw), Hl = /* @__PURE__ */ O(Mw).mul(2).sub(1), Fy = /* @__PURE__ */ Vi("normal", "vec3"), Ws = /* @__PURE__ */
|
|
16855
|
+
const Mw = /* @__PURE__ */ G(Cw), Hl = /* @__PURE__ */ O(Mw).mul(2).sub(1), Fy = /* @__PURE__ */ Vi("normal", "vec3"), Ws = /* @__PURE__ */ I((a) => a.geometry.hasAttribute("normal") === !1 ? (console.warn('THREE.TSL: Vertex attribute "normal" not found on geometry.'), B(0, 1, 0)) : Fy, "vec3").once()().toVar("normalLocal"), Aw = /* @__PURE__ */ it.dFdx().cross(it.dFdy()).normalize().toVar("normalFlat"), js = /* @__PURE__ */ I((a) => {
|
|
16853
16856
|
let e;
|
|
16854
16857
|
return a.material.flatShading === !0 ? e = Aw : e = Ns(Dy(Ws), "v_normalView").normalize(), e;
|
|
16855
|
-
}, "vec3").once()().toVar("normalView"), sd = /* @__PURE__ */
|
|
16858
|
+
}, "vec3").once()().toVar("normalView"), sd = /* @__PURE__ */ I((a) => {
|
|
16856
16859
|
let e = js.transformDirection(yi);
|
|
16857
16860
|
return a.material.flatShading !== !0 && (e = Ns(e, "v_normalWorld")), e;
|
|
16858
|
-
}, "vec3").once()().normalize().toVar("normalWorld"), st = /* @__PURE__ */
|
|
16861
|
+
}, "vec3").once()().normalize().toVar("normalWorld"), st = /* @__PURE__ */ I((a) => {
|
|
16859
16862
|
let e = a.context.setupNormal().context({ getUV: null });
|
|
16860
16863
|
return a.material.flatShading !== !0 && (e = e.mul(Hl)), e;
|
|
16861
|
-
}, "vec3").once()().toVar("transformedNormalView"), id = /* @__PURE__ */ st.transformDirection(yi).toVar("transformedNormalWorld"), ya = /* @__PURE__ */
|
|
16864
|
+
}, "vec3").once()().toVar("transformedNormalView"), id = /* @__PURE__ */ st.transformDirection(yi).toVar("transformedNormalWorld"), ya = /* @__PURE__ */ I((a) => {
|
|
16862
16865
|
let e = a.context.setupClearcoatNormal().context({ getUV: null });
|
|
16863
16866
|
return a.material.flatShading !== !0 && (e = e.mul(Hl)), e;
|
|
16864
|
-
}, "vec3").once()().toVar("transformedClearcoatNormalView"), Rw = /* @__PURE__ */
|
|
16865
|
-
const t =
|
|
16867
|
+
}, "vec3").once()().toVar("transformedClearcoatNormalView"), Rw = /* @__PURE__ */ I(([a, e = vn]) => {
|
|
16868
|
+
const t = It(e), s = a.div(B(t[0].dot(t[0]), t[1].dot(t[1]), t[2].dot(t[2])));
|
|
16866
16869
|
return t.mul(s).xyz;
|
|
16867
|
-
}), Dy = /* @__PURE__ */
|
|
16870
|
+
}), Dy = /* @__PURE__ */ I(([a], e) => {
|
|
16868
16871
|
const t = e.renderer.overrideNodes.modelNormalViewMatrix;
|
|
16869
16872
|
if (t !== null)
|
|
16870
16873
|
return t.transformDirection(a);
|
|
@@ -16882,7 +16885,7 @@ class Nw extends rt {
|
|
|
16882
16885
|
super("vec2");
|
|
16883
16886
|
}
|
|
16884
16887
|
setup() {
|
|
16885
|
-
const e =
|
|
16888
|
+
const e = B(Ye.z, 0, Ye.x.negate()).normalize(), t = Ye.cross(e);
|
|
16886
16889
|
return V(e.dot(st), t.dot(st)).mul(0.495).add(0.5);
|
|
16887
16890
|
}
|
|
16888
16891
|
}
|
|
@@ -16926,7 +16929,7 @@ class Fw extends Wa {
|
|
|
16926
16929
|
}
|
|
16927
16930
|
}
|
|
16928
16931
|
const Dw = /* @__PURE__ */ L(Fw).setParameterLength(1), Ow = (a) => U(a).mul(0.5).add(0.5);
|
|
16929
|
-
class
|
|
16932
|
+
class Bw extends rt {
|
|
16930
16933
|
static get type() {
|
|
16931
16934
|
return "RotateNode";
|
|
16932
16935
|
}
|
|
@@ -16965,7 +16968,7 @@ class Iw extends rt {
|
|
|
16965
16968
|
}
|
|
16966
16969
|
}
|
|
16967
16970
|
}
|
|
16968
|
-
const Oy = /* @__PURE__ */ L(
|
|
16971
|
+
const Oy = /* @__PURE__ */ L(Bw).setParameterLength(2);
|
|
16969
16972
|
let qr, Yr;
|
|
16970
16973
|
class tt extends re {
|
|
16971
16974
|
static get type() {
|
|
@@ -17031,7 +17034,7 @@ const _r = /* @__PURE__ */ G(tt, tt.UV), hu = /* @__PURE__ */ G(tt, tt.SIZE), $l
|
|
|
17031
17034
|
Ra.zw;
|
|
17032
17035
|
Ra.xy;
|
|
17033
17036
|
const qa = (a = 0) => Vi("uv" + (a > 0 ? a : ""), "vec2");
|
|
17034
|
-
class
|
|
17037
|
+
class Iw extends re {
|
|
17035
17038
|
static get type() {
|
|
17036
17039
|
return "TextureSizeNode";
|
|
17037
17040
|
}
|
|
@@ -17049,7 +17052,7 @@ class Bw extends re {
|
|
|
17049
17052
|
return e.format(`${e.getMethod("textureDimensions")}( ${s}, ${i} )`, this.getNodeType(e), t);
|
|
17050
17053
|
}
|
|
17051
17054
|
}
|
|
17052
|
-
const br = /* @__PURE__ */ L(
|
|
17055
|
+
const br = /* @__PURE__ */ L(Iw).setParameterLength(1, 2), By = /* @__PURE__ */ new Ct();
|
|
17053
17056
|
class Or extends Wa {
|
|
17054
17057
|
static get type() {
|
|
17055
17058
|
return "TextureNode";
|
|
@@ -17062,7 +17065,7 @@ class Or extends Wa {
|
|
|
17062
17065
|
* @param {?Node<int>} [levelNode=null] - The level node.
|
|
17063
17066
|
* @param {?Node<float>} [biasNode=null] - The bias node.
|
|
17064
17067
|
*/
|
|
17065
|
-
constructor(e =
|
|
17068
|
+
constructor(e = By, t = null, s = null, i = null) {
|
|
17066
17069
|
super(e), this.isTextureNode = !0, this.uvNode = t, this.levelNode = s, this.biasNode = i, this.compareNode = null, this.depthNode = null, this.gradNode = null, this.sampler = !0, this.updateMatrix = !1, this.updateType = he.NONE, this.referenceNode = null, this._value = e, this._matrixUniform = null, this.setUpdateMatrix(t === null);
|
|
17067
17070
|
}
|
|
17068
17071
|
set value(e) {
|
|
@@ -17127,7 +17130,7 @@ class Or extends Wa {
|
|
|
17127
17130
|
* @return {Node} The transformed uv node.
|
|
17128
17131
|
*/
|
|
17129
17132
|
getTransformedUV(e) {
|
|
17130
|
-
return this._matrixUniform === null && (this._matrixUniform = Q(this.value.matrix)), this._matrixUniform.mul(
|
|
17133
|
+
return this._matrixUniform === null && (this._matrixUniform = Q(this.value.matrix)), this._matrixUniform.mul(B(e, 1)).xy;
|
|
17131
17134
|
}
|
|
17132
17135
|
/**
|
|
17133
17136
|
* Defines whether the uv transformation matrix should automatically be updated or not.
|
|
@@ -17355,7 +17358,7 @@ class Or extends Wa {
|
|
|
17355
17358
|
return e.sampler = this.sampler, e.depthNode = this.depthNode, e.compareNode = this.compareNode, e.gradNode = this.gradNode, e;
|
|
17356
17359
|
}
|
|
17357
17360
|
}
|
|
17358
|
-
const Lw = /* @__PURE__ */ L(Or).setParameterLength(1, 4).setName("texture"), _e = (a =
|
|
17361
|
+
const Lw = /* @__PURE__ */ L(Or).setParameterLength(1, 4).setName("texture"), _e = (a = By, e = null, t = null, s = null) => {
|
|
17359
17362
|
let i;
|
|
17360
17363
|
return a && a.isTextureNode === !0 ? (i = U(a.clone()), i.referenceNode = a.getSelf(), e !== null && (i.uvNode = U(e)), t !== null && (i.levelNode = U(t)), s !== null && (i.biasNode = U(s))) : i = Lw(a, e, t, s), i;
|
|
17361
17364
|
}, vs = (...a) => _e(...a).setSampler(!1);
|
|
@@ -17371,7 +17374,7 @@ class Uw extends Ct {
|
|
|
17371
17374
|
}
|
|
17372
17375
|
}
|
|
17373
17376
|
const Xr = /* @__PURE__ */ new ce();
|
|
17374
|
-
class
|
|
17377
|
+
class Iy extends Or {
|
|
17375
17378
|
static get type() {
|
|
17376
17379
|
return "ViewportTextureNode";
|
|
17377
17380
|
}
|
|
@@ -17398,9 +17401,9 @@ class By extends Or {
|
|
|
17398
17401
|
return e.generateMipmaps = this.generateMipmaps, e;
|
|
17399
17402
|
}
|
|
17400
17403
|
}
|
|
17401
|
-
const Ly = /* @__PURE__ */ L(
|
|
17404
|
+
const Ly = /* @__PURE__ */ L(Iy, null, null, { generateMipmaps: !0 }).setParameterLength(0, 3);
|
|
17402
17405
|
let Sc = null;
|
|
17403
|
-
class kw extends
|
|
17406
|
+
class kw extends Iy {
|
|
17404
17407
|
static get type() {
|
|
17405
17408
|
return "ViewportDepthTextureNode";
|
|
17406
17409
|
}
|
|
@@ -18017,7 +18020,7 @@ class Wl extends Ct {
|
|
|
18017
18020
|
* @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.
|
|
18018
18021
|
* @param {string} [colorSpace=NoColorSpace] - The color space value.
|
|
18019
18022
|
*/
|
|
18020
|
-
constructor(e = [], t =
|
|
18023
|
+
constructor(e = [], t = Ba, s, i, n, r, o, l, c, h) {
|
|
18021
18024
|
super(e, t, s, i, n, r, o, l, c, h), this.isCubeTexture = !0, this.flipY = !1;
|
|
18022
18025
|
}
|
|
18023
18026
|
/**
|
|
@@ -18064,7 +18067,7 @@ class Jw extends Or {
|
|
|
18064
18067
|
*/
|
|
18065
18068
|
getDefaultUV() {
|
|
18066
18069
|
const e = this.value;
|
|
18067
|
-
return e.mapping ===
|
|
18070
|
+
return e.mapping === Ba ? Zw : e.mapping === gl ? Kw : (console.error('THREE.CubeTextureNode: Mapping "%s" not supported.', e.mapping), B(0, 0, 0));
|
|
18068
18071
|
}
|
|
18069
18072
|
/**
|
|
18070
18073
|
* Overwritten with an empty implementation since the `updateMatrix` flag is ignored
|
|
@@ -18085,7 +18088,7 @@ class Jw extends Or {
|
|
|
18085
18088
|
*/
|
|
18086
18089
|
setupUV(e, t) {
|
|
18087
18090
|
const s = this.value;
|
|
18088
|
-
return (e.renderer.coordinateSystem === zi || !s.isRenderTargetTexture) && (t =
|
|
18091
|
+
return (e.renderer.coordinateSystem === zi || !s.isRenderTargetTexture) && (t = B(t.x.negate(), t.yz)), Vy.mul(t);
|
|
18089
18092
|
}
|
|
18090
18093
|
/**
|
|
18091
18094
|
* Generates the uv code snippet.
|
|
@@ -18242,7 +18245,7 @@ class nd extends re {
|
|
|
18242
18245
|
Array.isArray(e) ? this.node.array = e : this.node.value = e;
|
|
18243
18246
|
}
|
|
18244
18247
|
}
|
|
18245
|
-
const
|
|
18248
|
+
const Ie = (a, e, t) => U(new nd(a, e, t)), jp = (a, e, t, s) => U(new nd(a, e, s, t));
|
|
18246
18249
|
class sE extends nd {
|
|
18247
18250
|
static get type() {
|
|
18248
18251
|
return "MaterialReferenceNode";
|
|
@@ -18269,13 +18272,13 @@ class sE extends nd {
|
|
|
18269
18272
|
return this.reference = this.material !== null ? this.material : e.material, this.reference;
|
|
18270
18273
|
}
|
|
18271
18274
|
}
|
|
18272
|
-
const Oi = (a, e, t = null) => U(new sE(a, e, t)), Hy = /* @__PURE__ */
|
|
18275
|
+
const Oi = (a, e, t = null) => U(new sE(a, e, t)), Hy = /* @__PURE__ */ I((a) => (a.geometry.hasAttribute("tangent") === !1 && a.geometry.computeTangents(), Vi("tangent", "vec4")))(), rd = /* @__PURE__ */ Hy.xyz.toVar("tangentLocal"), $y = /* @__PURE__ */ Gl.mul(ne(rd, 0)).xyz.toVarying("v_tangentView").normalize().toVar("tangentView"), iE = /* @__PURE__ */ I(([a, e], t) => {
|
|
18273
18276
|
let s = a.mul(Hy.w).xyz;
|
|
18274
18277
|
return t.material.flatShading !== !0 && (s = Ns(s, e)), s;
|
|
18275
|
-
}).once(), nE = iE(js.cross($y), "v_bitangentView").normalize().toVar("bitangentView"), xa = /* @__PURE__ */
|
|
18278
|
+
}).once(), nE = iE(js.cross($y), "v_bitangentView").normalize().toVar("bitangentView"), xa = /* @__PURE__ */ It($y, nE, js), rE = /* @__PURE__ */ (() => {
|
|
18276
18279
|
let a = xr.cross(Ye);
|
|
18277
18280
|
return a = a.cross(xr).normalize(), a = He(a, st, cn.mul(ti.oneMinus()).oneMinus().pow2().pow2()).normalize(), a;
|
|
18278
|
-
})(), aE = /* @__PURE__ */
|
|
18281
|
+
})(), aE = /* @__PURE__ */ I((a) => {
|
|
18279
18282
|
const { eye_pos: e, surf_norm: t, mapN: s, uv: i } = a, n = e.dFdx(), r = e.dFdy(), o = i.dFdx(), l = i.dFdy(), c = t, h = r.cross(c), u = c.cross(n), d = h.mul(o.x).add(u.mul(l.x)), p = h.mul(o.y).add(u.mul(l.y)), f = d.dot(d).max(p.dot(p)), m = Hl.mul(f.inverseSqrt());
|
|
18280
18283
|
return Lt(d.mul(s.x, m), p.mul(s.y, m), c.mul(s.z)).normalize();
|
|
18281
18284
|
});
|
|
@@ -18295,7 +18298,7 @@ class oE extends rt {
|
|
|
18295
18298
|
setup(e) {
|
|
18296
18299
|
const { normalMapType: t, scaleNode: s } = this;
|
|
18297
18300
|
let i = this.node.mul(2).sub(1);
|
|
18298
|
-
s !== null && (i =
|
|
18301
|
+
s !== null && (i = B(i.xy.mul(s), i.z));
|
|
18299
18302
|
let n = null;
|
|
18300
18303
|
return t === $b ? n = Dy(i) : t === ki && (e.hasGeometryAttribute("tangent") === !0 ? n = xa.mul(i).normalize() : n = aE({
|
|
18301
18304
|
eye_pos: it,
|
|
@@ -18305,13 +18308,13 @@ class oE extends rt {
|
|
|
18305
18308
|
})), n;
|
|
18306
18309
|
}
|
|
18307
18310
|
}
|
|
18308
|
-
const qp = /* @__PURE__ */ L(oE).setParameterLength(1, 2), lE =
|
|
18311
|
+
const qp = /* @__PURE__ */ L(oE).setParameterLength(1, 2), lE = I(({ textureNode: a, bumpScale: e }) => {
|
|
18309
18312
|
const t = (i) => a.cache().context({ getUV: (n) => i(n.uvNode || qa()), forceUVContext: !0 }), s = O(t((i) => i));
|
|
18310
18313
|
return V(
|
|
18311
18314
|
O(t((i) => i.add(i.dFdx()))).sub(s),
|
|
18312
18315
|
O(t((i) => i.add(i.dFdy()))).sub(s)
|
|
18313
18316
|
).mul(e);
|
|
18314
|
-
}), cE =
|
|
18317
|
+
}), cE = I((a) => {
|
|
18315
18318
|
const { surf_pos: e, surf_norm: t, dHdxy: s } = a, i = e.dFdx().normalize(), n = e.dFdy().normalize(), r = t, o = n.cross(r), l = r.cross(i), c = i.dot(o).mul(Hl), h = c.sign().mul(s.x.mul(o).add(s.y.mul(l)));
|
|
18316
18319
|
return c.abs().mul(t).sub(h).normalize();
|
|
18317
18320
|
});
|
|
@@ -18399,7 +18402,7 @@ class F extends re {
|
|
|
18399
18402
|
const t = e.context.material, s = this.scope;
|
|
18400
18403
|
let i = null;
|
|
18401
18404
|
if (s === F.COLOR) {
|
|
18402
|
-
const n = t.color !== void 0 ? this.getColor(s) :
|
|
18405
|
+
const n = t.color !== void 0 ? this.getColor(s) : B();
|
|
18403
18406
|
t.map && t.map.isTexture === !0 ? i = n.mul(this.getTexture("map")) : i = n;
|
|
18404
18407
|
} else if (s === F.OPACITY) {
|
|
18405
18408
|
const n = this.getFloat(s);
|
|
@@ -18444,9 +18447,9 @@ class F extends re {
|
|
|
18444
18447
|
} else
|
|
18445
18448
|
i = Zr;
|
|
18446
18449
|
else if (s === F.IRIDESCENCE_THICKNESS) {
|
|
18447
|
-
const n =
|
|
18450
|
+
const n = Ie("1", "float", t.iridescenceThicknessRange);
|
|
18448
18451
|
if (t.iridescenceThicknessMap) {
|
|
18449
|
-
const r =
|
|
18452
|
+
const r = Ie("0", "float", t.iridescenceThicknessRange);
|
|
18450
18453
|
i = n.sub(r).mul(this.getTexture(s).g).add(r);
|
|
18451
18454
|
} else
|
|
18452
18455
|
i = n;
|
|
@@ -18508,13 +18511,13 @@ F.POINT_SIZE = "size";
|
|
|
18508
18511
|
F.DISPERSION = "dispersion";
|
|
18509
18512
|
F.LIGHT_MAP = "light";
|
|
18510
18513
|
F.AO = "ao";
|
|
18511
|
-
const dE = /* @__PURE__ */ G(F, F.ALPHA_TEST), pE = /* @__PURE__ */ G(F, F.COLOR), fE = /* @__PURE__ */ G(F, F.SHININESS), mE = /* @__PURE__ */ G(F, F.EMISSIVE), Wy = /* @__PURE__ */ G(F, F.OPACITY), gE = /* @__PURE__ */ G(F, F.SPECULAR), Xp = /* @__PURE__ */ G(F, F.SPECULAR_INTENSITY), yE = /* @__PURE__ */ G(F, F.SPECULAR_COLOR), nl = /* @__PURE__ */ G(F, F.SPECULAR_STRENGTH), Cc = /* @__PURE__ */ G(F, F.REFLECTIVITY), xE = /* @__PURE__ */ G(F, F.ROUGHNESS), _E = /* @__PURE__ */ G(F, F.METALNESS), bE = /* @__PURE__ */ G(F, F.NORMAL), TE = /* @__PURE__ */ G(F, F.CLEARCOAT), SE = /* @__PURE__ */ G(F, F.CLEARCOAT_ROUGHNESS), vE = /* @__PURE__ */ G(F, F.CLEARCOAT_NORMAL), wE = /* @__PURE__ */ G(F, F.ROTATION), EE = /* @__PURE__ */ G(F, F.SHEEN), CE = /* @__PURE__ */ G(F, F.SHEEN_ROUGHNESS), ME = /* @__PURE__ */ G(F, F.ANISOTROPY), AE = /* @__PURE__ */ G(F, F.IRIDESCENCE), RE = /* @__PURE__ */ G(F, F.IRIDESCENCE_IOR), NE = /* @__PURE__ */ G(F, F.IRIDESCENCE_THICKNESS), PE = /* @__PURE__ */ G(F, F.TRANSMISSION), FE = /* @__PURE__ */ G(F, F.THICKNESS), DE = /* @__PURE__ */ G(F, F.IOR), OE = /* @__PURE__ */ G(F, F.ATTENUATION_DISTANCE),
|
|
18514
|
+
const dE = /* @__PURE__ */ G(F, F.ALPHA_TEST), pE = /* @__PURE__ */ G(F, F.COLOR), fE = /* @__PURE__ */ G(F, F.SHININESS), mE = /* @__PURE__ */ G(F, F.EMISSIVE), Wy = /* @__PURE__ */ G(F, F.OPACITY), gE = /* @__PURE__ */ G(F, F.SPECULAR), Xp = /* @__PURE__ */ G(F, F.SPECULAR_INTENSITY), yE = /* @__PURE__ */ G(F, F.SPECULAR_COLOR), nl = /* @__PURE__ */ G(F, F.SPECULAR_STRENGTH), Cc = /* @__PURE__ */ G(F, F.REFLECTIVITY), xE = /* @__PURE__ */ G(F, F.ROUGHNESS), _E = /* @__PURE__ */ G(F, F.METALNESS), bE = /* @__PURE__ */ G(F, F.NORMAL), TE = /* @__PURE__ */ G(F, F.CLEARCOAT), SE = /* @__PURE__ */ G(F, F.CLEARCOAT_ROUGHNESS), vE = /* @__PURE__ */ G(F, F.CLEARCOAT_NORMAL), wE = /* @__PURE__ */ G(F, F.ROTATION), EE = /* @__PURE__ */ G(F, F.SHEEN), CE = /* @__PURE__ */ G(F, F.SHEEN_ROUGHNESS), ME = /* @__PURE__ */ G(F, F.ANISOTROPY), AE = /* @__PURE__ */ G(F, F.IRIDESCENCE), RE = /* @__PURE__ */ G(F, F.IRIDESCENCE_IOR), NE = /* @__PURE__ */ G(F, F.IRIDESCENCE_THICKNESS), PE = /* @__PURE__ */ G(F, F.TRANSMISSION), FE = /* @__PURE__ */ G(F, F.THICKNESS), DE = /* @__PURE__ */ G(F, F.IOR), OE = /* @__PURE__ */ G(F, F.ATTENUATION_DISTANCE), BE = /* @__PURE__ */ G(F, F.ATTENUATION_COLOR), IE = /* @__PURE__ */ G(F, F.LINE_SCALE), LE = /* @__PURE__ */ G(F, F.LINE_DASH_SIZE), UE = /* @__PURE__ */ G(F, F.LINE_GAP_SIZE);
|
|
18512
18515
|
F.LINE_WIDTH;
|
|
18513
18516
|
const kE = /* @__PURE__ */ G(F, F.LINE_DASH_OFFSET), zE = /* @__PURE__ */ G(F, F.POINT_SIZE), GE = /* @__PURE__ */ G(F, F.DISPERSION), jy = /* @__PURE__ */ G(F, F.LIGHT_MAP), VE = /* @__PURE__ */ G(F, F.AO), Zr = /* @__PURE__ */ Q(new ce()).onReference(function(a) {
|
|
18514
18517
|
return a.material;
|
|
18515
18518
|
}).onRenderUpdate(function({ material: a }) {
|
|
18516
18519
|
this.value.set(a.anisotropy * Math.cos(a.anisotropyRotation), a.anisotropy * Math.sin(a.anisotropyRotation));
|
|
18517
|
-
}), qy = /* @__PURE__ */
|
|
18520
|
+
}), qy = /* @__PURE__ */ I((a) => a.context.setupModelViewProjection(), "vec4").once()().toVarying("v_modelViewProjection");
|
|
18518
18521
|
class HE extends wy {
|
|
18519
18522
|
/**
|
|
18520
18523
|
* Constructs a new instanced interleaved buffer.
|
|
@@ -18601,7 +18604,7 @@ class WE extends re {
|
|
|
18601
18604
|
}
|
|
18602
18605
|
if (i && r === null) {
|
|
18603
18606
|
const l = new $E(i.array, 3), c = i.usage === ar ? zp : kp;
|
|
18604
|
-
this.bufferColor = l, r =
|
|
18607
|
+
this.bufferColor = l, r = B(c(l, "vec3", 3, 0)), this.instanceColorNode = r;
|
|
18605
18608
|
}
|
|
18606
18609
|
const o = n.mul(wt).xyz;
|
|
18607
18610
|
if (wt.assign(o), e.hasGeometryAttribute("normal")) {
|
|
@@ -18655,7 +18658,7 @@ class YE extends re {
|
|
|
18655
18658
|
*/
|
|
18656
18659
|
setup(e) {
|
|
18657
18660
|
this.batchingIdNode === null && (e.getDrawIndex() === null ? this.batchingIdNode = ed : this.batchingIdNode = dw);
|
|
18658
|
-
const s =
|
|
18661
|
+
const s = I(([f]) => {
|
|
18659
18662
|
const m = ze(br(vs(this.batchMesh._indirectTexture), 0).x), y = ze(f).mod(m), g = ze(f).div(m);
|
|
18660
18663
|
return vs(this.batchMesh._indirectTexture, Js(y, g)).x;
|
|
18661
18664
|
}).setLayout({
|
|
@@ -18671,7 +18674,7 @@ class YE extends re {
|
|
|
18671
18674
|
vs(i, Js(o.add(3), l))
|
|
18672
18675
|
), h = this.batchMesh._colorsTexture;
|
|
18673
18676
|
if (h !== null) {
|
|
18674
|
-
const m =
|
|
18677
|
+
const m = I(([y]) => {
|
|
18675
18678
|
const g = ze(br(vs(h), 0).x), x = y, _ = x.mod(g), b = x.div(g);
|
|
18676
18679
|
return vs(h, Js(_, b)).rgb;
|
|
18677
18680
|
}).setLayout({
|
|
@@ -18683,9 +18686,9 @@ class YE extends re {
|
|
|
18683
18686
|
})(s);
|
|
18684
18687
|
vl("vec3", "vBatchColor").assign(m);
|
|
18685
18688
|
}
|
|
18686
|
-
const u =
|
|
18689
|
+
const u = It(c);
|
|
18687
18690
|
wt.assign(c.mul(wt));
|
|
18688
|
-
const d = Ws.div(
|
|
18691
|
+
const d = Ws.div(B(u[0].dot(u[0]), u[1].dot(u[1]), u[2].dot(u[2]))), p = u.mul(d).xyz;
|
|
18689
18692
|
Ws.assign(p), e.hasGeometryAttribute("tangent") && rd.mulAssign(u);
|
|
18690
18693
|
}
|
|
18691
18694
|
}
|
|
@@ -18700,7 +18703,7 @@ class ZE extends re {
|
|
|
18700
18703
|
* @param {SkinnedMesh} skinnedMesh - The skinned mesh.
|
|
18701
18704
|
*/
|
|
18702
18705
|
constructor(e) {
|
|
18703
|
-
super("void"), this.skinnedMesh = e, this.updateType = he.OBJECT, this.skinIndexNode = Vi("skinIndex", "uvec4"), this.skinWeightNode = Vi("skinWeight", "vec4"), this.bindMatrixNode =
|
|
18706
|
+
super("void"), this.skinnedMesh = e, this.updateType = he.OBJECT, this.skinIndexNode = Vi("skinIndex", "uvec4"), this.skinWeightNode = Vi("skinWeight", "vec4"), this.bindMatrixNode = Ie("bindMatrix", "mat4"), this.bindMatrixInverseNode = Ie("bindMatrixInverse", "mat4"), this.boneMatricesNode = jp("skeleton.boneMatrices", "mat4", e.skeleton.bones.length), this.positionNode = wt, this.toPositionNode = wt, this.previousBoneMatricesNode = null;
|
|
18704
18707
|
}
|
|
18705
18708
|
/**
|
|
18706
18709
|
* Transforms the given vertex position via skinning.
|
|
@@ -18803,7 +18806,7 @@ class QE extends Ct {
|
|
|
18803
18806
|
* @param {number} [depth=1] - The depth of the texture.
|
|
18804
18807
|
*/
|
|
18805
18808
|
constructor(e = null, t = 1, s = 1, i = 1) {
|
|
18806
|
-
super(null), this.isDataArrayTexture = !0, this.image = { data: e, width: t, height: s, depth: i }, this.magFilter = dt, this.minFilter = dt, this.wrapR =
|
|
18809
|
+
super(null), this.isDataArrayTexture = !0, this.image = { data: e, width: t, height: s, depth: i }, this.magFilter = dt, this.minFilter = dt, this.wrapR = Ii, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1, this.layerUpdates = /* @__PURE__ */ new Set();
|
|
18807
18810
|
}
|
|
18808
18811
|
/**
|
|
18809
18812
|
* Describes that a specific layer of the texture needs to be updated.
|
|
@@ -18824,7 +18827,7 @@ class QE extends Ct {
|
|
|
18824
18827
|
this.layerUpdates.clear();
|
|
18825
18828
|
}
|
|
18826
18829
|
}
|
|
18827
|
-
const Mc = /* @__PURE__ */ new WeakMap(), Kt = /* @__PURE__ */ new ge(), Kp = /* @__PURE__ */
|
|
18830
|
+
const Mc = /* @__PURE__ */ new WeakMap(), Kt = /* @__PURE__ */ new ge(), Kp = /* @__PURE__ */ I(({ bufferMap: a, influence: e, stride: t, width: s, depth: i, offset: n }) => {
|
|
18828
18831
|
const r = ze(uw).mul(t).add(n), o = r.div(s), l = r.sub(o.mul(s));
|
|
18829
18832
|
return vs(a, Js(l, o)).depth(i).xyz.mul(e);
|
|
18830
18833
|
});
|
|
@@ -18884,7 +18887,7 @@ class eC extends re {
|
|
|
18884
18887
|
const h = ze(c.width);
|
|
18885
18888
|
Ms(r, ({ i: u }) => {
|
|
18886
18889
|
const d = O(0).toVar();
|
|
18887
|
-
this.mesh.count > 1 && this.mesh.morphTexture !== null && this.mesh.morphTexture !== void 0 ? d.assign(vs(this.mesh.morphTexture, Js(ze(u).add(1), ze(ed))).r) : d.assign(
|
|
18890
|
+
this.mesh.count > 1 && this.mesh.morphTexture !== null && this.mesh.morphTexture !== void 0 ? d.assign(vs(this.mesh.morphTexture, Js(ze(u).add(1), ze(ed))).r) : d.assign(Ie("morphTargetInfluences", "float").element(u).toVar()), Qe(d.notEqual(0), () => {
|
|
18888
18891
|
s === !0 && wt.addAssign(Kp({
|
|
18889
18892
|
bufferMap: o,
|
|
18890
18893
|
influence: d,
|
|
@@ -18914,7 +18917,7 @@ class eC extends re {
|
|
|
18914
18917
|
}
|
|
18915
18918
|
}
|
|
18916
18919
|
const tC = /* @__PURE__ */ L(eC).setParameterLength(1);
|
|
18917
|
-
class
|
|
18920
|
+
class Br extends re {
|
|
18918
18921
|
static get type() {
|
|
18919
18922
|
return "LightingNode";
|
|
18920
18923
|
}
|
|
@@ -18925,7 +18928,7 @@ class Ir extends re {
|
|
|
18925
18928
|
super("vec3"), this.isLightingNode = !0;
|
|
18926
18929
|
}
|
|
18927
18930
|
}
|
|
18928
|
-
class sC extends
|
|
18931
|
+
class sC extends Br {
|
|
18929
18932
|
static get type() {
|
|
18930
18933
|
return "AONode";
|
|
18931
18934
|
}
|
|
@@ -18970,16 +18973,16 @@ class iC extends Ty {
|
|
|
18970
18973
|
* }} The lighting context object.
|
|
18971
18974
|
*/
|
|
18972
18975
|
getContext() {
|
|
18973
|
-
const { backdropNode: e, backdropAlphaNode: t } = this, s =
|
|
18976
|
+
const { backdropNode: e, backdropAlphaNode: t } = this, s = B().toVar("directDiffuse"), i = B().toVar("directSpecular"), n = B().toVar("indirectDiffuse"), r = B().toVar("indirectSpecular"), o = {
|
|
18974
18977
|
directDiffuse: s,
|
|
18975
18978
|
directSpecular: i,
|
|
18976
18979
|
indirectDiffuse: n,
|
|
18977
18980
|
indirectSpecular: r
|
|
18978
18981
|
};
|
|
18979
18982
|
return {
|
|
18980
|
-
radiance:
|
|
18981
|
-
irradiance:
|
|
18982
|
-
iblIrradiance:
|
|
18983
|
+
radiance: B().toVar("radiance"),
|
|
18984
|
+
irradiance: B().toVar("irradiance"),
|
|
18985
|
+
iblIrradiance: B().toVar("iblIrradiance"),
|
|
18983
18986
|
ambientOcclusion: O(1).toVar("ambientOcclusion"),
|
|
18984
18987
|
reflectedLight: o,
|
|
18985
18988
|
backdrop: e,
|
|
@@ -18991,7 +18994,7 @@ class iC extends Ty {
|
|
|
18991
18994
|
}
|
|
18992
18995
|
}
|
|
18993
18996
|
const nC = /* @__PURE__ */ L(iC);
|
|
18994
|
-
class rC extends
|
|
18997
|
+
class rC extends Br {
|
|
18995
18998
|
static get type() {
|
|
18996
18999
|
return "IrradianceNode";
|
|
18997
19000
|
}
|
|
@@ -19039,7 +19042,7 @@ class fs extends re {
|
|
|
19039
19042
|
* @return {Node} The result node.
|
|
19040
19043
|
*/
|
|
19041
19044
|
setupAlphaToCoverage(e, t) {
|
|
19042
|
-
return
|
|
19045
|
+
return I(() => {
|
|
19043
19046
|
const s = O().toVar("distanceToPlane"), i = O().toVar("distanceToGradient"), n = O(1).toVar("clipOpacity"), r = t.length;
|
|
19044
19047
|
if (this.hardwareClipping === !1 && r > 0) {
|
|
19045
19048
|
const l = Gs(t);
|
|
@@ -19067,7 +19070,7 @@ class fs extends re {
|
|
|
19067
19070
|
* @return {Node} The result node.
|
|
19068
19071
|
*/
|
|
19069
19072
|
setupDefault(e, t) {
|
|
19070
|
-
return
|
|
19073
|
+
return I(() => {
|
|
19071
19074
|
const s = t.length;
|
|
19072
19075
|
if (this.hardwareClipping === !1 && s > 0) {
|
|
19073
19076
|
const n = Gs(t);
|
|
@@ -19095,7 +19098,7 @@ class fs extends re {
|
|
|
19095
19098
|
*/
|
|
19096
19099
|
setupHardwareClipping(e, t) {
|
|
19097
19100
|
const s = e.length;
|
|
19098
|
-
return t.enableHardwareClipping(s),
|
|
19101
|
+
return t.enableHardwareClipping(s), I(() => {
|
|
19099
19102
|
const i = Gs(e), n = zl(t.getClipDistance());
|
|
19100
19103
|
Ms(s, ({ i: r }) => {
|
|
19101
19104
|
const o = i.element(r), l = it.dot(o.xyz).sub(o.w).negate();
|
|
@@ -19333,7 +19336,7 @@ class hC {
|
|
|
19333
19336
|
return i || n ? !1 : this.equals(e) !== !0;
|
|
19334
19337
|
}
|
|
19335
19338
|
}
|
|
19336
|
-
const uC = 0.05, Qp = /* @__PURE__ */
|
|
19339
|
+
const uC = 0.05, Qp = /* @__PURE__ */ I(([a]) => $i(fe(1e4, Es(fe(17, a.x).add(fe(0.1, a.y)))).mul(Lt(0.1, cs(Es(fe(13, a.y).add(a.x))))))), Jp = /* @__PURE__ */ I(([a]) => Qp(V(Qp(a.xy), a.z))), dC = /* @__PURE__ */ I(([a]) => {
|
|
19337
19340
|
const e = Mt(
|
|
19338
19341
|
hi(py(a.xyz)),
|
|
19339
19342
|
hi(fy(a.xyz))
|
|
@@ -19343,7 +19346,7 @@ const uC = 0.05, Qp = /* @__PURE__ */ B(([a]) => $i(fe(1e4, Es(fe(17, a.x).add(f
|
|
|
19343
19346
|
), i = V(
|
|
19344
19347
|
Jp(bn(s.x.mul(a.xyz))),
|
|
19345
19348
|
Jp(bn(s.y.mul(a.xyz)))
|
|
19346
|
-
), n = $i(ci(t)), r = Lt(fe(n.oneMinus(), i.x), fe(n, i.y)), o = Mr(n, n.oneMinus()), l =
|
|
19349
|
+
), n = $i(ci(t)), r = Lt(fe(n.oneMinus(), i.x), fe(n, i.y)), o = Mr(n, n.oneMinus()), l = B(
|
|
19347
19350
|
r.mul(r).div(fe(2, o).mul(Ft(1, o))),
|
|
19348
19351
|
r.sub(fe(0.5, o)).div(Ft(1, o)),
|
|
19349
19352
|
Ft(1, Ft(1, r).mul(Ft(1, r)).div(fe(2, o).mul(Ft(1, o))))
|
|
@@ -19585,7 +19588,7 @@ class nt extends qt {
|
|
|
19585
19588
|
* @return {Node<vec3>} The outgoing light node.
|
|
19586
19589
|
*/
|
|
19587
19590
|
setupOutgoingLight() {
|
|
19588
|
-
return this.lights === !0 ?
|
|
19591
|
+
return this.lights === !0 ? B(0) : Se.rgb;
|
|
19589
19592
|
}
|
|
19590
19593
|
/**
|
|
19591
19594
|
* Setups the normal node from the material.
|
|
@@ -19593,7 +19596,7 @@ class nt extends qt {
|
|
|
19593
19596
|
* @return {Node<vec3>} The normal node.
|
|
19594
19597
|
*/
|
|
19595
19598
|
setupNormal() {
|
|
19596
|
-
return this.normalNode ?
|
|
19599
|
+
return this.normalNode ? B(this.normalNode) : bE;
|
|
19597
19600
|
}
|
|
19598
19601
|
/**
|
|
19599
19602
|
* Setups the environment node from the material.
|
|
@@ -19654,8 +19657,8 @@ class nt extends qt {
|
|
|
19654
19657
|
if (o && o.getScope().hasLights) {
|
|
19655
19658
|
const c = this.setupLightingModel(e) || null;
|
|
19656
19659
|
l = nC(o, c, s, i);
|
|
19657
|
-
} else s !== null && (l =
|
|
19658
|
-
return (n && n.isNode === !0 || t.emissive && t.emissive.isColor === !0) && (Lp.assign(
|
|
19660
|
+
} else s !== null && (l = B(i !== null ? He(l, s, i) : s));
|
|
19661
|
+
return (n && n.isNode === !0 || t.emissive && t.emissive.isColor === !0) && (Lp.assign(B(n || mE)), l = l.add(Lp)), l;
|
|
19659
19662
|
}
|
|
19660
19663
|
/**
|
|
19661
19664
|
* Setup the fog.
|
|
@@ -19759,7 +19762,7 @@ class xi extends En {
|
|
|
19759
19762
|
* @return {BufferGeometry} A reference to this instance.
|
|
19760
19763
|
*/
|
|
19761
19764
|
setIndex(e) {
|
|
19762
|
-
return Array.isArray(e) ? this.index = new (
|
|
19765
|
+
return Array.isArray(e) ? this.index = new (Ig(e) ? Vg : Gg)(e, 1) : this.index = e, this;
|
|
19763
19766
|
}
|
|
19764
19767
|
/**
|
|
19765
19768
|
* Sets the given indirect attribute to this geometry.
|
|
@@ -19970,7 +19973,7 @@ class xi extends En {
|
|
|
19970
19973
|
const r = e[i];
|
|
19971
19974
|
s.push(r.x, r.y, r.z || 0);
|
|
19972
19975
|
}
|
|
19973
|
-
this.setAttribute("position", new
|
|
19976
|
+
this.setAttribute("position", new Bt(s, 3));
|
|
19974
19977
|
} else {
|
|
19975
19978
|
const s = Math.min(e.length, t.count);
|
|
19976
19979
|
for (let i = 0; i < s; i++) {
|
|
@@ -20524,7 +20527,7 @@ class gC {
|
|
|
20524
20527
|
return new this.constructor().copy(this);
|
|
20525
20528
|
}
|
|
20526
20529
|
}
|
|
20527
|
-
const bs = /* @__PURE__ */ new R(), Ks = /* @__PURE__ */ new R(), Fc = /* @__PURE__ */ new R(), Qs = /* @__PURE__ */ new R(), Hn = /* @__PURE__ */ new R(), $n = /* @__PURE__ */ new R(), ef = /* @__PURE__ */ new R(), Dc = /* @__PURE__ */ new R(), Oc = /* @__PURE__ */ new R(),
|
|
20530
|
+
const bs = /* @__PURE__ */ new R(), Ks = /* @__PURE__ */ new R(), Fc = /* @__PURE__ */ new R(), Qs = /* @__PURE__ */ new R(), Hn = /* @__PURE__ */ new R(), $n = /* @__PURE__ */ new R(), ef = /* @__PURE__ */ new R(), Dc = /* @__PURE__ */ new R(), Oc = /* @__PURE__ */ new R(), Bc = /* @__PURE__ */ new R(), Ic = /* @__PURE__ */ new ge(), Lc = /* @__PURE__ */ new ge(), Uc = /* @__PURE__ */ new ge();
|
|
20528
20531
|
class As {
|
|
20529
20532
|
/**
|
|
20530
20533
|
* Constructs a new triangle.
|
|
@@ -20612,7 +20615,7 @@ class As {
|
|
|
20612
20615
|
* @return {Vector3} The interpolated attribute value.
|
|
20613
20616
|
*/
|
|
20614
20617
|
static getInterpolatedAttribute(e, t, s, i, n, r) {
|
|
20615
|
-
return
|
|
20618
|
+
return Ic.setScalar(0), Lc.setScalar(0), Uc.setScalar(0), Ic.fromBufferAttribute(e, t), Lc.fromBufferAttribute(e, s), Uc.fromBufferAttribute(e, i), r.setScalar(0), r.addScaledVector(Ic, n.x), r.addScaledVector(Lc, n.y), r.addScaledVector(Uc, n.z), r;
|
|
20616
20619
|
}
|
|
20617
20620
|
/**
|
|
20618
20621
|
* Returns `true` if the triangle is oriented towards the given direction.
|
|
@@ -20788,8 +20791,8 @@ class As {
|
|
|
20788
20791
|
const d = l * u - h * c;
|
|
20789
20792
|
if (d <= 0 && l >= 0 && h <= 0)
|
|
20790
20793
|
return r = l / (l - h), t.copy(s).addScaledVector(Hn, r);
|
|
20791
|
-
|
|
20792
|
-
const p = Hn.dot(
|
|
20794
|
+
Bc.subVectors(e, n);
|
|
20795
|
+
const p = Hn.dot(Bc), f = $n.dot(Bc);
|
|
20793
20796
|
if (f >= 0 && p <= f)
|
|
20794
20797
|
return t.copy(n);
|
|
20795
20798
|
const m = p * c - l * f;
|
|
@@ -20811,7 +20814,7 @@ class As {
|
|
|
20811
20814
|
return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c);
|
|
20812
20815
|
}
|
|
20813
20816
|
}
|
|
20814
|
-
class
|
|
20817
|
+
class Bi extends qt {
|
|
20815
20818
|
/**
|
|
20816
20819
|
* Constructs a new mesh basic material.
|
|
20817
20820
|
*
|
|
@@ -20836,7 +20839,7 @@ class mi extends pt {
|
|
|
20836
20839
|
* @param {BufferGeometry} [geometry] - The mesh geometry.
|
|
20837
20840
|
* @param {Material|Array<Material>} [material] - The mesh material.
|
|
20838
20841
|
*/
|
|
20839
|
-
constructor(e = new xi(), t = new
|
|
20842
|
+
constructor(e = new xi(), t = new Bi()) {
|
|
20840
20843
|
super(), this.isMesh = !0, this.type = "Mesh", this.geometry = e, this.material = t, this.morphTargetDictionary = void 0, this.morphTargetInfluences = void 0, this.count = 1, this.updateMorphTargets();
|
|
20841
20844
|
}
|
|
20842
20845
|
copy(e, t) {
|
|
@@ -21030,7 +21033,7 @@ class xC extends xi {
|
|
|
21030
21033
|
constructor(e = !1) {
|
|
21031
21034
|
super();
|
|
21032
21035
|
const t = e === !1 ? [0, -1, 0, 1, 2, 1] : [0, 2, 0, 0, 2, 0];
|
|
21033
|
-
this.setAttribute("position", new
|
|
21036
|
+
this.setAttribute("position", new Bt([-1, 3, 0, -1, -1, 0, 3, -1, 0], 3)), this.setAttribute("uv", new Bt(t, 2));
|
|
21034
21037
|
}
|
|
21035
21038
|
}
|
|
21036
21039
|
const _C = /* @__PURE__ */ new xC();
|
|
@@ -21065,7 +21068,7 @@ class od extends mi {
|
|
|
21065
21068
|
const jl = 1 / 6, Yy = (a) => fe(jl, fe(a, fe(a, a.negate().add(3)).sub(3)).add(1)), uu = (a) => fe(jl, fe(a, fe(a, fe(3, a).sub(6))).add(4)), Xy = (a) => fe(jl, fe(a, fe(a, fe(-3, a).add(3)).add(3)).add(1)), du = (a) => fe(jl, Ul(a, 3)), rf = (a) => Yy(a).add(uu(a)), af = (a) => Xy(a).add(du(a)), of = (a) => Lt(-1, uu(a).div(Yy(a).add(uu(a)))), lf = (a) => Lt(1, du(a).div(Xy(a).add(du(a)))), cf = (a, e, t) => {
|
|
21066
21069
|
const s = a.uvNode, i = fe(s, e.zw).add(0.5), n = bn(i), r = $i(i), o = rf(r.x), l = af(r.x), c = of(r.x), h = lf(r.x), u = of(r.y), d = lf(r.y), p = V(n.x.add(c), n.y.add(u)).sub(0.5).mul(e.xy), f = V(n.x.add(h), n.y.add(u)).sub(0.5).mul(e.xy), m = V(n.x.add(c), n.y.add(d)).sub(0.5).mul(e.xy), y = V(n.x.add(h), n.y.add(d)).sub(0.5).mul(e.xy), g = rf(r.y).mul(Lt(o.mul(a.sample(p).level(t)), l.mul(a.sample(f).level(t)))), x = af(r.y).mul(Lt(o.mul(a.sample(m).level(t)), l.mul(a.sample(y).level(t))));
|
|
21067
21070
|
return g.add(x);
|
|
21068
|
-
}, bC = /* @__PURE__ */
|
|
21071
|
+
}, bC = /* @__PURE__ */ I(([a, e = O(3)]) => {
|
|
21069
21072
|
const t = V(a.size(ze(e))), s = V(a.size(ze(e.add(1)))), i = $s(1, t), n = $s(1, s), r = cf(a, ne(i, t), bn(e)), o = cf(a, ne(n, s), ju(e));
|
|
21070
21073
|
return $i(e).mix(r, o);
|
|
21071
21074
|
}), Qr = /* @__PURE__ */ new gs(), Gc = /* @__PURE__ */ new Le();
|
|
@@ -21092,7 +21095,7 @@ class Wt extends re {
|
|
|
21092
21095
|
setup(e) {
|
|
21093
21096
|
const t = this.scope, s = this.scene !== null ? this.scene : e.scene;
|
|
21094
21097
|
let i;
|
|
21095
|
-
return t === Wt.BACKGROUND_BLURRINESS ? i =
|
|
21098
|
+
return t === Wt.BACKGROUND_BLURRINESS ? i = Ie("backgroundBlurriness", "float", s) : t === Wt.BACKGROUND_INTENSITY ? i = Ie("backgroundIntensity", "float", s) : t === Wt.BACKGROUND_ROTATION ? i = Q("mat4").label("backgroundRotation").setGroup(K).onRenderUpdate(() => {
|
|
21096
21099
|
const n = s.background;
|
|
21097
21100
|
return n !== null && n.isTexture && n.mapping !== Su ? (Qr.copy(s.backgroundRotation), Qr.x *= -1, Qr.y *= -1, Qr.z *= -1, Gc.makeRotationFromEuler(Qr)) : Gc.identity(), Gc;
|
|
21098
21101
|
}) : console.error("THREE.SceneNode: Unknown scope:", t), i;
|
|
@@ -21101,23 +21104,23 @@ class Wt extends re {
|
|
|
21101
21104
|
Wt.BACKGROUND_BLURRINESS = "backgroundBlurriness";
|
|
21102
21105
|
Wt.BACKGROUND_INTENSITY = "backgroundIntensity";
|
|
21103
21106
|
Wt.BACKGROUND_ROTATION = "backgroundRotation";
|
|
21104
|
-
const TC = /* @__PURE__ */ G(Wt, Wt.BACKGROUND_BLURRINESS), hf = /* @__PURE__ */ G(Wt, Wt.BACKGROUND_INTENSITY), SC = /* @__PURE__ */ G(Wt, Wt.BACKGROUND_ROTATION), vC =
|
|
21105
|
-
const s =
|
|
21107
|
+
const TC = /* @__PURE__ */ G(Wt, Wt.BACKGROUND_BLURRINESS), hf = /* @__PURE__ */ G(Wt, Wt.BACKGROUND_INTENSITY), SC = /* @__PURE__ */ G(Wt, Wt.BACKGROUND_ROTATION), vC = I(({ texture: a, uv: e }) => {
|
|
21108
|
+
const s = B().toVar();
|
|
21106
21109
|
return Qe(e.x.lessThan(1e-4), () => {
|
|
21107
|
-
s.assign(
|
|
21110
|
+
s.assign(B(1, 0, 0));
|
|
21108
21111
|
}).ElseIf(e.y.lessThan(1e-4), () => {
|
|
21109
|
-
s.assign(
|
|
21112
|
+
s.assign(B(0, 1, 0));
|
|
21110
21113
|
}).ElseIf(e.z.lessThan(1e-4), () => {
|
|
21111
|
-
s.assign(
|
|
21114
|
+
s.assign(B(0, 0, 1));
|
|
21112
21115
|
}).ElseIf(e.x.greaterThan(1 - 1e-4), () => {
|
|
21113
|
-
s.assign(
|
|
21116
|
+
s.assign(B(-1, 0, 0));
|
|
21114
21117
|
}).ElseIf(e.y.greaterThan(1 - 1e-4), () => {
|
|
21115
|
-
s.assign(
|
|
21118
|
+
s.assign(B(0, -1, 0));
|
|
21116
21119
|
}).ElseIf(e.z.greaterThan(1 - 1e-4), () => {
|
|
21117
|
-
s.assign(
|
|
21120
|
+
s.assign(B(0, 0, -1));
|
|
21118
21121
|
}).Else(() => {
|
|
21119
|
-
const n = a.sample(e.add(
|
|
21120
|
-
s.assign(
|
|
21122
|
+
const n = a.sample(e.add(B(-0.01, 0, 0))).r.sub(a.sample(e.add(B(0.01, 0, 0))).r), r = a.sample(e.add(B(0, -0.01, 0))).r.sub(a.sample(e.add(B(0, 0.01, 0))).r), o = a.sample(e.add(B(0, 0, -0.01))).r.sub(a.sample(e.add(B(0, 0, 0.01))).r);
|
|
21123
|
+
s.assign(B(n, r, o));
|
|
21121
21124
|
}), s.normalize();
|
|
21122
21125
|
});
|
|
21123
21126
|
class wC extends Or {
|
|
@@ -21150,7 +21153,7 @@ class wC extends Or {
|
|
|
21150
21153
|
* @return {Node<vec3>} The default uv node.
|
|
21151
21154
|
*/
|
|
21152
21155
|
getDefaultUV() {
|
|
21153
|
-
return
|
|
21156
|
+
return B(0.5, 0.5, 0.5);
|
|
21154
21157
|
}
|
|
21155
21158
|
/**
|
|
21156
21159
|
* Overwritten with an empty implementation since the `updateMatrix` flag is ignored
|
|
@@ -21426,21 +21429,21 @@ class ql extends rt {
|
|
|
21426
21429
|
}
|
|
21427
21430
|
ql.COLOR = "color";
|
|
21428
21431
|
ql.DEPTH = "depth";
|
|
21429
|
-
const MC = /* @__PURE__ */
|
|
21432
|
+
const MC = /* @__PURE__ */ I(([a, e]) => a.mul(e).clamp()).setLayout({
|
|
21430
21433
|
name: "linearToneMapping",
|
|
21431
21434
|
type: "vec3",
|
|
21432
21435
|
inputs: [
|
|
21433
21436
|
{ name: "color", type: "vec3" },
|
|
21434
21437
|
{ name: "exposure", type: "float" }
|
|
21435
21438
|
]
|
|
21436
|
-
}), AC = /* @__PURE__ */
|
|
21439
|
+
}), AC = /* @__PURE__ */ I(([a, e]) => (a = a.mul(e), a.div(a.add(1)).clamp())).setLayout({
|
|
21437
21440
|
name: "reinhardToneMapping",
|
|
21438
21441
|
type: "vec3",
|
|
21439
21442
|
inputs: [
|
|
21440
21443
|
{ name: "color", type: "vec3" },
|
|
21441
21444
|
{ name: "exposure", type: "float" }
|
|
21442
21445
|
]
|
|
21443
|
-
}), RC = /* @__PURE__ */
|
|
21446
|
+
}), RC = /* @__PURE__ */ I(([a, e]) => {
|
|
21444
21447
|
a = a.mul(e), a = a.sub(4e-3).max(0);
|
|
21445
21448
|
const t = a.mul(a.mul(6.2).add(0.5)), s = a.mul(a.mul(6.2).add(1.7)).add(0.06);
|
|
21446
21449
|
return t.div(s).pow(2.2);
|
|
@@ -21451,11 +21454,11 @@ const MC = /* @__PURE__ */ B(([a, e]) => a.mul(e).clamp()).setLayout({
|
|
|
21451
21454
|
{ name: "color", type: "vec3" },
|
|
21452
21455
|
{ name: "exposure", type: "float" }
|
|
21453
21456
|
]
|
|
21454
|
-
}), NC = /* @__PURE__ */
|
|
21457
|
+
}), NC = /* @__PURE__ */ I(([a]) => {
|
|
21455
21458
|
const e = a.mul(a.add(0.0245786)).sub(90537e-9), t = a.mul(a.add(0.432951).mul(0.983729)).add(0.238081);
|
|
21456
21459
|
return e.div(t);
|
|
21457
|
-
}), PC = /* @__PURE__ */
|
|
21458
|
-
const t =
|
|
21460
|
+
}), PC = /* @__PURE__ */ I(([a, e]) => {
|
|
21461
|
+
const t = It(
|
|
21459
21462
|
0.59719,
|
|
21460
21463
|
0.35458,
|
|
21461
21464
|
0.04823,
|
|
@@ -21465,7 +21468,7 @@ const MC = /* @__PURE__ */ B(([a, e]) => a.mul(e).clamp()).setLayout({
|
|
|
21465
21468
|
0.0284,
|
|
21466
21469
|
0.13383,
|
|
21467
21470
|
0.83777
|
|
21468
|
-
), s =
|
|
21471
|
+
), s = It(
|
|
21469
21472
|
1.60475,
|
|
21470
21473
|
-0.53108,
|
|
21471
21474
|
-0.07367,
|
|
@@ -21484,12 +21487,12 @@ const MC = /* @__PURE__ */ B(([a, e]) => a.mul(e).clamp()).setLayout({
|
|
|
21484
21487
|
{ name: "color", type: "vec3" },
|
|
21485
21488
|
{ name: "exposure", type: "float" }
|
|
21486
21489
|
]
|
|
21487
|
-
}), FC = /* @__PURE__ */
|
|
21488
|
-
const e =
|
|
21490
|
+
}), FC = /* @__PURE__ */ It(B(1.6605, -0.1246, -0.0182), B(-0.5876, 1.1329, -0.1006), B(-0.0728, -83e-4, 1.1187)), DC = /* @__PURE__ */ It(B(0.6274, 0.0691, 0.0164), B(0.3293, 0.9195, 0.088), B(0.0433, 0.0113, 0.8956)), OC = /* @__PURE__ */ I(([a]) => {
|
|
21491
|
+
const e = B(a).toVar(), t = B(e.mul(e)).toVar(), s = B(t.mul(t)).toVar();
|
|
21489
21492
|
return O(15.5).mul(s.mul(t)).sub(fe(40.14, s.mul(e))).add(fe(31.96, s).sub(fe(6.868, t.mul(e))).add(fe(0.4298, t).add(fe(0.1191, e).sub(232e-5))));
|
|
21490
|
-
}),
|
|
21491
|
-
const t =
|
|
21492
|
-
return t.mulAssign(e), t.assign(DC.mul(t)), t.assign(s.mul(t)), t.assign(Mt(t, 1e-10)), t.assign(ci(t)), t.assign(t.sub(n).div(r.sub(n))), t.assign(fi(t, 0, 1)), t.assign(OC(t)), t.assign(i.mul(t)), t.assign(Ul(Mt(
|
|
21493
|
+
}), BC = /* @__PURE__ */ I(([a, e]) => {
|
|
21494
|
+
const t = B(a).toVar(), s = It(B(0.856627153315983, 0.137318972929847, 0.11189821299995), B(0.0951212405381588, 0.761241990602591, 0.0767994186031903), B(0.0482516061458583, 0.101439036467562, 0.811302368396859)), i = It(B(1.1271005818144368, -0.1413297634984383, -0.14132976349843826), B(-0.11060664309660323, 1.157823702216272, -0.11060664309660294), B(-0.016493938717834573, -0.016493938717834257, 1.2519364065950405)), n = O(-12.47393), r = O(4.026069);
|
|
21495
|
+
return t.mulAssign(e), t.assign(DC.mul(t)), t.assign(s.mul(t)), t.assign(Mt(t, 1e-10)), t.assign(ci(t)), t.assign(t.sub(n).div(r.sub(n))), t.assign(fi(t, 0, 1)), t.assign(OC(t)), t.assign(i.mul(t)), t.assign(Ul(Mt(B(0), t), B(2.2))), t.assign(FC.mul(t)), t.assign(fi(t, 0, 1)), t;
|
|
21493
21496
|
}).setLayout({
|
|
21494
21497
|
name: "agxToneMapping",
|
|
21495
21498
|
type: "vec3",
|
|
@@ -21497,7 +21500,7 @@ const MC = /* @__PURE__ */ B(([a, e]) => a.mul(e).clamp()).setLayout({
|
|
|
21497
21500
|
{ name: "color", type: "vec3" },
|
|
21498
21501
|
{ name: "exposure", type: "float" }
|
|
21499
21502
|
]
|
|
21500
|
-
}),
|
|
21503
|
+
}), IC = /* @__PURE__ */ I(([a, e]) => {
|
|
21501
21504
|
const t = O(0.76), s = O(0.15);
|
|
21502
21505
|
a = a.mul(e);
|
|
21503
21506
|
const i = Mr(a.r, Mr(a.g, a.b)), n = Et(i.lessThan(0.08), i.sub(fe(6.25, i.mul(i))), 0.04);
|
|
@@ -21507,7 +21510,7 @@ const MC = /* @__PURE__ */ B(([a, e]) => a.mul(e).clamp()).setLayout({
|
|
|
21507
21510
|
const o = Ft(1, t), l = Ft(1, o.mul(o).div(r.add(o.sub(t))));
|
|
21508
21511
|
a.mulAssign(l.div(r));
|
|
21509
21512
|
const c = Ft(1, $s(1, s.mul(r.sub(l)).add(1)));
|
|
21510
|
-
return He(a,
|
|
21513
|
+
return He(a, B(l), c);
|
|
21511
21514
|
}).setLayout({
|
|
21512
21515
|
name: "neutralToneMapping",
|
|
21513
21516
|
type: "vec3",
|
|
@@ -21613,13 +21616,13 @@ function Zy(a) {
|
|
|
21613
21616
|
const t = a.context.getViewZ;
|
|
21614
21617
|
return t !== void 0 && (e = t(this)), (e || it.z).negate();
|
|
21615
21618
|
}
|
|
21616
|
-
const UC =
|
|
21619
|
+
const UC = I(([a, e], t) => {
|
|
21617
21620
|
const s = Zy(t);
|
|
21618
21621
|
return Gi(a, e, s);
|
|
21619
|
-
}), kC =
|
|
21622
|
+
}), kC = I(([a], e) => {
|
|
21620
21623
|
const t = Zy(e);
|
|
21621
21624
|
return a.mul(a, t, t).negate().exp().oneMinus();
|
|
21622
|
-
}), df =
|
|
21625
|
+
}), df = I(([a, e]) => ne(e.toFloat().mix(Aa.rgb, a.toVec3()), Aa.a));
|
|
21623
21626
|
class zC extends re {
|
|
21624
21627
|
/**
|
|
21625
21628
|
* Constructs a new barrier node.
|
|
@@ -21731,7 +21734,7 @@ class t0 extends re {
|
|
|
21731
21734
|
* Constructs a new lights node.
|
|
21732
21735
|
*/
|
|
21733
21736
|
constructor() {
|
|
21734
|
-
super("vec3"), this.totalDiffuseNode =
|
|
21737
|
+
super("vec3"), this.totalDiffuseNode = B().toVar(), this.totalSpecularNode = B().toVar(), this.outgoingLightNode = B().toVar(), this._lights = [], this._lightNodes = null, this._lightNodesHash = null, this.global = !0;
|
|
21735
21738
|
}
|
|
21736
21739
|
/**
|
|
21737
21740
|
* Overwrites the default {@link Node#customCacheKey} implementation by including
|
|
@@ -21855,7 +21858,7 @@ class t0 extends re {
|
|
|
21855
21858
|
r.nodes = c.nodes, n.start(e);
|
|
21856
21859
|
const { backdrop: h, backdropAlpha: u } = i, { directDiffuse: d, directSpecular: p, indirectDiffuse: f, indirectSpecular: m } = i.reflectedLight;
|
|
21857
21860
|
let y = d.add(f);
|
|
21858
|
-
h !== null && (u !== null ? y =
|
|
21861
|
+
h !== null && (u !== null ? y = B(u.mix(y, h)) : y = B(h), i.material.transparent = !0), o.assign(y), l.assign(p.add(m)), s.assign(o.add(l)), n.finish(e), s = s.bypass(e.removeStack());
|
|
21859
21862
|
} else
|
|
21860
21863
|
r.nodes = [];
|
|
21861
21864
|
return e.lightsNode = t, s;
|
|
@@ -21932,14 +21935,14 @@ function QC(a, e, t) {
|
|
|
21932
21935
|
function JC(a, e, t) {
|
|
21933
21936
|
YC(a, t), KC(e, t);
|
|
21934
21937
|
}
|
|
21935
|
-
const pf = /* @__PURE__ */ new WeakMap(), eM = /* @__PURE__ */
|
|
21938
|
+
const pf = /* @__PURE__ */ new WeakMap(), eM = /* @__PURE__ */ I(({ depthTexture: a, shadowCoord: e, depthLayer: t }) => {
|
|
21936
21939
|
let s = _e(a, e.xy).label("t_basic");
|
|
21937
21940
|
return a.isArrayTexture && (s = s.depth(t)), s.compare(e.z);
|
|
21938
|
-
}), tM = /* @__PURE__ */
|
|
21941
|
+
}), tM = /* @__PURE__ */ I(({ depthTexture: a, shadowCoord: e, shadow: t, depthLayer: s }) => {
|
|
21939
21942
|
const i = (y, g) => {
|
|
21940
21943
|
let x = _e(a, y);
|
|
21941
21944
|
return a.isArrayTexture && (x = x.depth(s)), x.compare(g);
|
|
21942
|
-
}, n =
|
|
21945
|
+
}, n = Ie("mapSize", "vec2", t).setGroup(K), r = Ie("radius", "float", t).setGroup(K), o = V(1).div(n), l = o.x.negate().mul(r), c = o.y.negate().mul(r), h = o.x.mul(r), u = o.y.mul(r), d = l.div(2), p = c.div(2), f = h.div(2), m = u.div(2);
|
|
21943
21946
|
return Lt(
|
|
21944
21947
|
i(e.xy.add(V(l, c)), e.z),
|
|
21945
21948
|
i(e.xy.add(V(0, c)), e.z),
|
|
@@ -21959,11 +21962,11 @@ const pf = /* @__PURE__ */ new WeakMap(), eM = /* @__PURE__ */ B(({ depthTexture
|
|
|
21959
21962
|
i(e.xy.add(V(0, u)), e.z),
|
|
21960
21963
|
i(e.xy.add(V(h, u)), e.z)
|
|
21961
21964
|
).mul(1 / 17);
|
|
21962
|
-
}), sM = /* @__PURE__ */
|
|
21965
|
+
}), sM = /* @__PURE__ */ I(({ depthTexture: a, shadowCoord: e, shadow: t, depthLayer: s }) => {
|
|
21963
21966
|
const i = (u, d) => {
|
|
21964
21967
|
let p = _e(a, u);
|
|
21965
21968
|
return a.isArrayTexture && (p = p.depth(s)), p.compare(d);
|
|
21966
|
-
}, n =
|
|
21969
|
+
}, n = Ie("mapSize", "vec2", t).setGroup(K), r = V(1).div(n), o = r.x, l = r.y, c = e.xy, h = $i(c.mul(n).add(0.5));
|
|
21967
21970
|
return c.subAssign(h.mul(r)), Lt(
|
|
21968
21971
|
i(c, e.z),
|
|
21969
21972
|
i(c.add(V(o, 0)), e.z),
|
|
@@ -22003,7 +22006,7 @@ const pf = /* @__PURE__ */ new WeakMap(), eM = /* @__PURE__ */ B(({ depthTexture
|
|
|
22003
22006
|
h.y
|
|
22004
22007
|
)
|
|
22005
22008
|
).mul(1 / 9);
|
|
22006
|
-
}), iM = /* @__PURE__ */
|
|
22009
|
+
}), iM = /* @__PURE__ */ I(({ depthTexture: a, shadowCoord: e, depthLayer: t }) => {
|
|
22007
22010
|
const s = O(1).toVar();
|
|
22008
22011
|
let i = _e(a).sample(e.xy);
|
|
22009
22012
|
a.isArrayTexture && (i = i.depth(t)), i = i.rg;
|
|
@@ -22013,11 +22016,11 @@ const pf = /* @__PURE__ */ new WeakMap(), eM = /* @__PURE__ */ B(({ depthTexture
|
|
|
22013
22016
|
let l = o.div(o.add(r.mul(r)));
|
|
22014
22017
|
l = fi(Ft(l, 0.3).div(0.95 - 0.3)), s.assign(fi(Mt(n, l)));
|
|
22015
22018
|
}), s;
|
|
22016
|
-
}), nM = /* @__PURE__ */
|
|
22019
|
+
}), nM = /* @__PURE__ */ I(([a, e, t]) => {
|
|
22017
22020
|
let s = za.sub(a).length();
|
|
22018
22021
|
return s = s.sub(e).div(t.sub(e)), s = s.saturate(), s;
|
|
22019
22022
|
}), rM = (a) => {
|
|
22020
|
-
const e = a.shadow.camera, t =
|
|
22023
|
+
const e = a.shadow.camera, t = Ie("near", "float", e).setGroup(K), s = Ie("far", "float", e).setGroup(K), i = xw(a);
|
|
22021
22024
|
return nM(i, t, s);
|
|
22022
22025
|
}, aM = (a) => {
|
|
22023
22026
|
let e = pf.get(a);
|
|
@@ -22032,7 +22035,7 @@ const pf = /* @__PURE__ */ new WeakMap(), eM = /* @__PURE__ */ B(({ depthTexture
|
|
|
22032
22035
|
return (i === void 0 || i.shadowType !== t || i.useVelocity !== s) && (i = (n, r, o, l, c, h, ...u) => {
|
|
22033
22036
|
(n.castShadow === !0 || n.receiveShadow && t === Xo) && (s && (zg(n).useVelocity = !0), n.onBeforeShadow(a, n, o, e.camera, l, r.overrideMaterial, h), a.renderObject(n, r, o, l, c, h, ...u), n.onAfterShadow(a, n, o, e.camera, l, r.overrideMaterial, h));
|
|
22034
22037
|
}, i.shadowType = t, i.useVelocity = s, ff.set(Wn, i)), Wn[0] = null, Wn[1] = null, i;
|
|
22035
|
-
}, lM = /* @__PURE__ */
|
|
22038
|
+
}, lM = /* @__PURE__ */ I(({ samples: a, radius: e, size: t, shadowPass: s, depthLayer: i }) => {
|
|
22036
22039
|
const n = O(0).toVar("meanVertical"), r = O(0).toVar("squareMeanVertical"), o = a.lessThanEqual(O(1)).select(O(0), O(2).div(a.sub(1))), l = a.lessThanEqual(O(1)).select(O(0), O(-1));
|
|
22037
22040
|
Ms({ start: ze(0), end: ze(a), type: "int", condition: "<" }, ({ i: h }) => {
|
|
22038
22041
|
const u = l.add(O(h).mul(o));
|
|
@@ -22041,7 +22044,7 @@ const pf = /* @__PURE__ */ new WeakMap(), eM = /* @__PURE__ */ B(({ depthTexture
|
|
|
22041
22044
|
}), n.divAssign(a), r.divAssign(a);
|
|
22042
22045
|
const c = Wu(r.sub(n.mul(n)));
|
|
22043
22046
|
return V(n, c);
|
|
22044
|
-
}), cM = /* @__PURE__ */
|
|
22047
|
+
}), cM = /* @__PURE__ */ I(({ samples: a, radius: e, size: t, shadowPass: s, depthLayer: i }) => {
|
|
22045
22048
|
const n = O(0).toVar("meanHorizontal"), r = O(0).toVar("squareMeanHorizontal"), o = a.lessThanEqual(O(1)).select(O(0), O(2).div(a.sub(1))), l = a.lessThanEqual(O(1)).select(O(0), O(-1));
|
|
22046
22049
|
Ms({ start: ze(0), end: ze(a), type: "int", condition: "<" }, ({ i: h }) => {
|
|
22047
22050
|
const u = l.add(O(h).mul(o));
|
|
@@ -22089,17 +22092,17 @@ class i0 extends WC {
|
|
|
22089
22092
|
* @return {Node<vec3>} The shadow coordinates.
|
|
22090
22093
|
*/
|
|
22091
22094
|
setupShadowCoord(e, t) {
|
|
22092
|
-
const { shadow: s } = this, { renderer: i } = e, n =
|
|
22095
|
+
const { shadow: s } = this, { renderer: i } = e, n = Ie("bias", "float", s).setGroup(K);
|
|
22093
22096
|
let r = t, o;
|
|
22094
22097
|
if (s.camera.isOrthographicCamera || i.logarithmicDepthBuffer !== !0)
|
|
22095
22098
|
r = r.xyz.div(r.w), o = r.z, i.coordinateSystem === zi && (o = o.mul(2).sub(1));
|
|
22096
22099
|
else {
|
|
22097
22100
|
const l = r.w;
|
|
22098
22101
|
r = r.xy.div(l);
|
|
22099
|
-
const c =
|
|
22102
|
+
const c = Ie("near", "float", s.camera).setGroup(K), h = Ie("far", "float", s.camera).setGroup(K);
|
|
22100
22103
|
o = ky(l.negate(), c, h);
|
|
22101
22104
|
}
|
|
22102
|
-
return r =
|
|
22105
|
+
return r = B(
|
|
22103
22106
|
r.x,
|
|
22104
22107
|
r.y.oneMinus(),
|
|
22105
22108
|
// follow webgpu standards
|
|
@@ -22135,11 +22138,11 @@ class i0 extends WC {
|
|
|
22135
22138
|
r.isArrayTexture && (g = g.depth(this.depthLayer));
|
|
22136
22139
|
let x = _e(this.vsmShadowMapVertical.texture);
|
|
22137
22140
|
r.isArrayTexture && (x = x.depth(this.depthLayer));
|
|
22138
|
-
const _ =
|
|
22141
|
+
const _ = Ie("blurSamples", "float", i).setGroup(K), b = Ie("radius", "float", i).setGroup(K), T = Ie("mapSize", "vec2", i).setGroup(K);
|
|
22139
22142
|
let E = this.vsmMaterialVertical || (this.vsmMaterialVertical = new nt());
|
|
22140
22143
|
E.fragmentNode = lM({ samples: _, radius: b, size: T, shadowPass: g, depthLayer: this.depthLayer }).context(e.getSharedContext()), E.name = "VSMVertical", E = this.vsmMaterialHorizontal || (this.vsmMaterialHorizontal = new nt()), E.fragmentNode = cM({ samples: _, radius: b, size: T, shadowPass: x, depthLayer: this.depthLayer }).context(e.getSharedContext()), E.name = "VSMHorizontal";
|
|
22141
22144
|
}
|
|
22142
|
-
const l =
|
|
22145
|
+
const l = Ie("intensity", "float", i).setGroup(K), c = Ie("normalBias", "float", i).setGroup(K), h = Ky(s).mul(s0.add(id.mul(c))), u = this.setupShadowCoord(e, h), d = i.filterNode || this.getShadowFilterFn(t.shadowMap.type) || null;
|
|
22143
22146
|
if (d === null)
|
|
22144
22147
|
throw new Error("THREE.WebGPURenderer: Shadow map type not supported yet.");
|
|
22145
22148
|
const p = n === Xo && i.isPointLightShadow !== !0 ? this.vsmShadowMapHorizontal.texture : r, f = this.setupShadowFilter(e, { filterFn: d, shadowTexture: o.texture, depthTexture: p, shadowCoord: u, shadow: i, depthLayer: this.depthLayer });
|
|
@@ -22157,7 +22160,7 @@ class i0 extends WC {
|
|
|
22157
22160
|
*/
|
|
22158
22161
|
setup(e) {
|
|
22159
22162
|
if (e.renderer.shadowMap.enabled !== !1)
|
|
22160
|
-
return
|
|
22163
|
+
return I(() => {
|
|
22161
22164
|
let t = this._node;
|
|
22162
22165
|
return this.setupShadowPosition(e), t === null && (this._node = t = this.setupShadow(e)), e.material.shadowNode && console.warn('THREE.NodeMaterial: ".shadowNode" is deprecated. Use ".castShadowNode" instead.'), e.material.receivedShadowNode && (t = e.material.receivedShadowNode(t)), t;
|
|
22163
22166
|
})();
|
|
@@ -22213,7 +22216,7 @@ class i0 extends WC {
|
|
|
22213
22216
|
s && (this._cameraFrameId[e.camera] === e.frameId && (s = !1), this._cameraFrameId[e.camera] = e.frameId), s && (this.updateShadow(e), this.shadowMap.depthTexture.version === this._depthVersionCached && (t.needsUpdate = !1));
|
|
22214
22217
|
}
|
|
22215
22218
|
}
|
|
22216
|
-
const uM = (a, e) => U(new i0(a, e)), dM = /* @__PURE__ */ new ve(), Ls = /* @__PURE__ */
|
|
22219
|
+
const uM = (a, e) => U(new i0(a, e)), dM = /* @__PURE__ */ new ve(), Ls = /* @__PURE__ */ I(([a, e]) => {
|
|
22217
22220
|
const t = a.toVar(), s = cs(t), i = $s(1, Mt(s.x, Mt(s.y, s.z)));
|
|
22218
22221
|
s.mulAssign(i), t.mulAssign(i.mul(e.mul(2).oneMinus()));
|
|
22219
22222
|
const n = V(t.xy).toVar(), o = e.mul(1.5).oneMinus();
|
|
@@ -22235,11 +22238,11 @@ const uM = (a, e) => U(new i0(a, e)), dM = /* @__PURE__ */ new ve(), Ls = /* @__
|
|
|
22235
22238
|
{ name: "pos", type: "vec3" },
|
|
22236
22239
|
{ name: "texelSizeY", type: "float" }
|
|
22237
22240
|
]
|
|
22238
|
-
}), pM = /* @__PURE__ */
|
|
22239
|
-
const n =
|
|
22241
|
+
}), pM = /* @__PURE__ */ I(({ depthTexture: a, bd3D: e, dp: t, texelSize: s }) => _e(a, Ls(e, s.y)).compare(t)), fM = /* @__PURE__ */ I(({ depthTexture: a, bd3D: e, dp: t, texelSize: s, shadow: i }) => {
|
|
22242
|
+
const n = Ie("radius", "float", i).setGroup(K), r = V(-1, 1).mul(n).mul(s.y);
|
|
22240
22243
|
return _e(a, Ls(e.add(r.xyy), s.y)).compare(t).add(_e(a, Ls(e.add(r.yyy), s.y)).compare(t)).add(_e(a, Ls(e.add(r.xyx), s.y)).compare(t)).add(_e(a, Ls(e.add(r.yyx), s.y)).compare(t)).add(_e(a, Ls(e, s.y)).compare(t)).add(_e(a, Ls(e.add(r.xxy), s.y)).compare(t)).add(_e(a, Ls(e.add(r.yxy), s.y)).compare(t)).add(_e(a, Ls(e.add(r.xxx), s.y)).compare(t)).add(_e(a, Ls(e.add(r.yxx), s.y)).compare(t)).mul(1 / 9);
|
|
22241
|
-
}), mM = /* @__PURE__ */
|
|
22242
|
-
const i = t.xyz.toVar(), n = i.length(), r = Q("float").setGroup(K).onRenderUpdate(() => s.camera.near), o = Q("float").setGroup(K).onRenderUpdate(() => s.camera.far), l =
|
|
22244
|
+
}), mM = /* @__PURE__ */ I(({ filterFn: a, depthTexture: e, shadowCoord: t, shadow: s }) => {
|
|
22245
|
+
const i = t.xyz.toVar(), n = i.length(), r = Q("float").setGroup(K).onRenderUpdate(() => s.camera.near), o = Q("float").setGroup(K).onRenderUpdate(() => s.camera.far), l = Ie("bias", "float", s).setGroup(K), c = Q(s.mapSize).setGroup(K), h = O(1).toVar();
|
|
22243
22246
|
return Qe(n.sub(o).lessThanEqual(0).and(n.sub(r).greaterThanEqual(0)), () => {
|
|
22244
22247
|
const u = n.sub(r).div(o.sub(r)).toVar();
|
|
22245
22248
|
u.addAssign(l);
|
|
@@ -22321,7 +22324,7 @@ class gM extends i0 {
|
|
|
22321
22324
|
}
|
|
22322
22325
|
}
|
|
22323
22326
|
const yM = (a, e) => U(new gM(a, e));
|
|
22324
|
-
class Mn extends
|
|
22327
|
+
class Mn extends Br {
|
|
22325
22328
|
static get type() {
|
|
22326
22329
|
return "AnalyticLightNode";
|
|
22327
22330
|
}
|
|
@@ -22415,7 +22418,7 @@ class Mn extends Ir {
|
|
|
22415
22418
|
this.color.copy(e.color).multiplyScalar(e.intensity);
|
|
22416
22419
|
}
|
|
22417
22420
|
}
|
|
22418
|
-
const n0 = /* @__PURE__ */
|
|
22421
|
+
const n0 = /* @__PURE__ */ I(({ lightDistance: a, cutoffDistance: e, decayExponent: t }) => {
|
|
22419
22422
|
const s = a.pow(t).max(0.01).reciprocal();
|
|
22420
22423
|
return e.greaterThan(0).select(
|
|
22421
22424
|
s.mul(a.div(e).pow4().oneMinus().clamp().pow2()),
|
|
@@ -22467,8 +22470,8 @@ class _M extends Mn {
|
|
|
22467
22470
|
});
|
|
22468
22471
|
}
|
|
22469
22472
|
}
|
|
22470
|
-
const gf = /* @__PURE__ */ O(1), pu = /* @__PURE__ */ O(-2), wo = /* @__PURE__ */ O(0.8), $c = /* @__PURE__ */ O(-1), Eo = /* @__PURE__ */ O(0.4), Wc = /* @__PURE__ */ O(2), Co = /* @__PURE__ */ O(0.305), jc = /* @__PURE__ */ O(3), yf = /* @__PURE__ */ O(0.21), bM = /* @__PURE__ */ O(4), xf = /* @__PURE__ */ O(4), TM = /* @__PURE__ */ O(16), SM = /* @__PURE__ */
|
|
22471
|
-
const e =
|
|
22473
|
+
const gf = /* @__PURE__ */ O(1), pu = /* @__PURE__ */ O(-2), wo = /* @__PURE__ */ O(0.8), $c = /* @__PURE__ */ O(-1), Eo = /* @__PURE__ */ O(0.4), Wc = /* @__PURE__ */ O(2), Co = /* @__PURE__ */ O(0.305), jc = /* @__PURE__ */ O(3), yf = /* @__PURE__ */ O(0.21), bM = /* @__PURE__ */ O(4), xf = /* @__PURE__ */ O(4), TM = /* @__PURE__ */ O(16), SM = /* @__PURE__ */ I(([a]) => {
|
|
22474
|
+
const e = B(cs(a)).toVar(), t = O(-1).toVar();
|
|
22472
22475
|
return Qe(e.x.greaterThan(e.z), () => {
|
|
22473
22476
|
Qe(e.x.greaterThan(e.y), () => {
|
|
22474
22477
|
t.assign(Et(a.x.greaterThan(0), 0, 3));
|
|
@@ -22488,7 +22491,7 @@ const gf = /* @__PURE__ */ O(1), pu = /* @__PURE__ */ O(-2), wo = /* @__PURE__ *
|
|
|
22488
22491
|
inputs: [
|
|
22489
22492
|
{ name: "direction", type: "vec3" }
|
|
22490
22493
|
]
|
|
22491
|
-
}), vM = /* @__PURE__ */
|
|
22494
|
+
}), vM = /* @__PURE__ */ I(([a, e]) => {
|
|
22492
22495
|
const t = V().toVar();
|
|
22493
22496
|
return Qe(e.equal(0), () => {
|
|
22494
22497
|
t.assign(V(a.z, a.y).div(cs(a.x)));
|
|
@@ -22510,7 +22513,7 @@ const gf = /* @__PURE__ */ O(1), pu = /* @__PURE__ */ O(-2), wo = /* @__PURE__ *
|
|
|
22510
22513
|
{ name: "direction", type: "vec3" },
|
|
22511
22514
|
{ name: "face", type: "float" }
|
|
22512
22515
|
]
|
|
22513
|
-
}), wM = /* @__PURE__ */
|
|
22516
|
+
}), wM = /* @__PURE__ */ I(([a]) => {
|
|
22514
22517
|
const e = O(0).toVar();
|
|
22515
22518
|
return Qe(a.greaterThanEqual(wo), () => {
|
|
22516
22519
|
e.assign(gf.sub(a).mul($c.sub(pu)).div(gf.sub(wo)).add(pu));
|
|
@@ -22529,10 +22532,10 @@ const gf = /* @__PURE__ */ O(1), pu = /* @__PURE__ */ O(-2), wo = /* @__PURE__ *
|
|
|
22529
22532
|
inputs: [
|
|
22530
22533
|
{ name: "roughness", type: "float" }
|
|
22531
22534
|
]
|
|
22532
|
-
}), EM = /* @__PURE__ */
|
|
22535
|
+
}), EM = /* @__PURE__ */ I(([a, e]) => {
|
|
22533
22536
|
const t = a.toVar();
|
|
22534
22537
|
t.assign(fe(2, t).sub(1));
|
|
22535
|
-
const s =
|
|
22538
|
+
const s = B(t, 1).toVar();
|
|
22536
22539
|
return Qe(e.equal(0), () => {
|
|
22537
22540
|
s.assign(s.zyx);
|
|
22538
22541
|
}).ElseIf(e.equal(1), () => {
|
|
@@ -22553,28 +22556,28 @@ const gf = /* @__PURE__ */ O(1), pu = /* @__PURE__ */ O(-2), wo = /* @__PURE__ *
|
|
|
22553
22556
|
{ name: "uv", type: "vec2" },
|
|
22554
22557
|
{ name: "face", type: "float" }
|
|
22555
22558
|
]
|
|
22556
|
-
}), CM = /* @__PURE__ */
|
|
22557
|
-
const r = O(t), o =
|
|
22559
|
+
}), CM = /* @__PURE__ */ I(([a, e, t, s, i, n]) => {
|
|
22560
|
+
const r = O(t), o = B(e), l = fi(wM(r), pu, n), c = $i(l), h = bn(l), u = B(fu(a, o, h, s, i, n)).toVar();
|
|
22558
22561
|
return Qe(c.notEqual(0), () => {
|
|
22559
|
-
const d =
|
|
22562
|
+
const d = B(fu(a, o, h.add(1), s, i, n)).toVar();
|
|
22560
22563
|
u.assign(He(u, d, c));
|
|
22561
22564
|
}), u;
|
|
22562
|
-
}), fu = /* @__PURE__ */
|
|
22563
|
-
const r = O(t).toVar(), o =
|
|
22565
|
+
}), fu = /* @__PURE__ */ I(([a, e, t, s, i, n]) => {
|
|
22566
|
+
const r = O(t).toVar(), o = B(e), l = O(SM(o)).toVar(), c = O(Mt(xf.sub(r), 0)).toVar();
|
|
22564
22567
|
r.assign(Mt(r, xf));
|
|
22565
22568
|
const h = O(Ua(r)).toVar(), u = V(vM(o, l).mul(h.sub(2)).add(1)).toVar();
|
|
22566
22569
|
return Qe(l.greaterThan(2), () => {
|
|
22567
22570
|
u.y.addAssign(h), l.subAssign(3);
|
|
22568
22571
|
}), u.x.addAssign(l.mul(h)), u.x.addAssign(c.mul(fe(3, TM))), u.y.addAssign(fe(4, Ua(n).sub(h))), u.x.mulAssign(s), u.y.mulAssign(i), a.sample(u).grad(V(), V());
|
|
22569
|
-
}), qc = /* @__PURE__ */
|
|
22572
|
+
}), qc = /* @__PURE__ */ I(({ envMap: a, mipInt: e, outputDirection: t, theta: s, axis: i, CUBEUV_TEXEL_WIDTH: n, CUBEUV_TEXEL_HEIGHT: r, CUBEUV_MAX_MIP: o }) => {
|
|
22570
22573
|
const l = Pi(s), c = t.mul(l).add(i.cross(t).mul(Es(s))).add(i.mul(i.dot(t).mul(l.oneMinus())));
|
|
22571
22574
|
return fu(a, c, e, n, r, o);
|
|
22572
|
-
}), MM = /* @__PURE__ */
|
|
22573
|
-
const d =
|
|
22574
|
-
Qe(d.equal(
|
|
22575
|
-
d.assign(
|
|
22575
|
+
}), MM = /* @__PURE__ */ I(({ n: a, latitudinal: e, poleAxis: t, outputDirection: s, weights: i, samples: n, dTheta: r, mipInt: o, envMap: l, CUBEUV_TEXEL_WIDTH: c, CUBEUV_TEXEL_HEIGHT: h, CUBEUV_MAX_MIP: u }) => {
|
|
22576
|
+
const d = B(Et(e, t, gy(t, s))).toVar();
|
|
22577
|
+
Qe(d.equal(B(0)), () => {
|
|
22578
|
+
d.assign(B(s.z, 0, s.x.negate()));
|
|
22576
22579
|
}), d.assign(ka(d));
|
|
22577
|
-
const p =
|
|
22580
|
+
const p = B().toVar();
|
|
22578
22581
|
return p.addAssign(i.element(0).mul(qc({ theta: 0, axis: d, outputDirection: s, mipInt: o, envMap: l, CUBEUV_TEXEL_WIDTH: c, CUBEUV_TEXEL_HEIGHT: h, CUBEUV_MAX_MIP: u }))), Ms({ start: ze(1), end: a }, ({ i: f }) => {
|
|
22579
22582
|
Qe(f.greaterThanEqual(n), () => {
|
|
22580
22583
|
gw();
|
|
@@ -22773,7 +22776,7 @@ class Ya extends xi {
|
|
|
22773
22776
|
i = Math.floor(i), n = Math.floor(n), r = Math.floor(r);
|
|
22774
22777
|
const l = [], c = [], h = [], u = [];
|
|
22775
22778
|
let d = 0, p = 0;
|
|
22776
|
-
f("z", "y", "x", -1, -1, s, t, e, r, n, 0), f("z", "y", "x", 1, -1, s, t, -e, r, n, 1), f("x", "z", "y", 1, 1, e, s, t, i, r, 2), f("x", "z", "y", 1, -1, e, s, -t, i, r, 3), f("x", "y", "z", 1, -1, e, t, s, i, n, 4), f("x", "y", "z", -1, -1, e, t, -s, i, n, 5), this.setIndex(l), this.setAttribute("position", new
|
|
22779
|
+
f("z", "y", "x", -1, -1, s, t, e, r, n, 0), f("z", "y", "x", 1, -1, s, t, -e, r, n, 1), f("x", "z", "y", 1, 1, e, s, t, i, r, 2), f("x", "z", "y", 1, -1, e, s, -t, i, r, 3), f("x", "y", "z", 1, -1, e, t, s, i, n, 4), f("x", "y", "z", -1, -1, e, t, -s, i, n, 5), this.setIndex(l), this.setAttribute("position", new Bt(c, 3)), this.setAttribute("normal", new Bt(h, 3)), this.setAttribute("uv", new Bt(u, 2));
|
|
22777
22780
|
function f(m, y, g, x, _, b, T, E, v, A, N) {
|
|
22778
22781
|
const k = b / v, H = T / A, W = b / 2, $ = T / 2, q = E / 2, X = v + 1, we = A + 1;
|
|
22779
22782
|
let ue = 0, ye = 0;
|
|
@@ -22827,7 +22830,7 @@ const hn = (1 + Math.sqrt(5)) / 2, qn = 1 / hn, vf = [
|
|
|
22827
22830
|
0,
|
|
22828
22831
|
4,
|
|
22829
22832
|
2
|
|
22830
|
-
], Qc = /* @__PURE__ */ EM(qa(), Vi("faceIndex")).normalize(), ld = /* @__PURE__ */
|
|
22833
|
+
], Qc = /* @__PURE__ */ EM(qa(), Vi("faceIndex")).normalize(), ld = /* @__PURE__ */ B(Qc.x, Qc.y, Qc.z);
|
|
22831
22834
|
class PM {
|
|
22832
22835
|
/**
|
|
22833
22836
|
* Constructs a new PMREM generator.
|
|
@@ -22983,7 +22986,7 @@ class PM {
|
|
|
22983
22986
|
}
|
|
22984
22987
|
// private interface
|
|
22985
22988
|
_setSizeFromTexture(e) {
|
|
22986
|
-
e.mapping ===
|
|
22989
|
+
e.mapping === Ba || e.mapping === gl ? this._setSize(e.image.length === 0 ? 16 : e.image[0].width || e.image[0].image.width) : this._setSize(e.image.width / 4);
|
|
22987
22990
|
}
|
|
22988
22991
|
_setSize(e) {
|
|
22989
22992
|
this._lodMax = Math.floor(Math.log2(e)), this._cubeSize = Math.pow(2, this._lodMax);
|
|
@@ -23023,7 +23026,7 @@ class PM {
|
|
|
23023
23026
|
c.getClearColor(Sf), c.autoClear = !1;
|
|
23024
23027
|
let u = this._backgroundBox;
|
|
23025
23028
|
if (u === null) {
|
|
23026
|
-
const f = new
|
|
23029
|
+
const f = new Bi({
|
|
23027
23030
|
name: "PMREM.Background",
|
|
23028
23031
|
side: jt,
|
|
23029
23032
|
depthWrite: !1,
|
|
@@ -23043,7 +23046,7 @@ class PM {
|
|
|
23043
23046
|
c.autoClear = h, e.background = p;
|
|
23044
23047
|
}
|
|
23045
23048
|
_textureToCubeUV(e, t) {
|
|
23046
|
-
const s = this._renderer, i = e.mapping ===
|
|
23049
|
+
const s = this._renderer, i = e.mapping === Ba || e.mapping === gl;
|
|
23047
23050
|
i ? this._cubemapMaterial === null && (this._cubemapMaterial = Ef(e)) : this._equirectMaterial === null && (this._equirectMaterial = Cf(e));
|
|
23048
23051
|
const n = i ? this._cubemapMaterial : this._equirectMaterial;
|
|
23049
23052
|
n.fragmentNode.value = e;
|
|
@@ -23207,8 +23210,8 @@ function OM(a) {
|
|
|
23207
23210
|
const e = Math.log2(a) - 2, t = 1 / a;
|
|
23208
23211
|
return { texelWidth: 1 / (3 * Math.max(Math.pow(2, e), 7 * 16)), texelHeight: t, maxMip: e };
|
|
23209
23212
|
}
|
|
23210
|
-
function
|
|
23211
|
-
const s =
|
|
23213
|
+
function BM(a, e, t) {
|
|
23214
|
+
const s = IM(e);
|
|
23212
23215
|
let i = s.get(a);
|
|
23213
23216
|
if ((i !== void 0 ? i.pmremVersion : -1) !== a.pmremVersion) {
|
|
23214
23217
|
const r = a.image;
|
|
@@ -23225,7 +23228,7 @@ function IM(a, e, t) {
|
|
|
23225
23228
|
}
|
|
23226
23229
|
return i.texture;
|
|
23227
23230
|
}
|
|
23228
|
-
function
|
|
23231
|
+
function IM(a) {
|
|
23229
23232
|
let e = Mf.get(a);
|
|
23230
23233
|
return e === void 0 && (e = /* @__PURE__ */ new WeakMap(), Mf.set(a, e)), e;
|
|
23231
23234
|
}
|
|
@@ -23268,12 +23271,12 @@ class LM extends rt {
|
|
|
23268
23271
|
updateBefore(e) {
|
|
23269
23272
|
let t = this._pmrem;
|
|
23270
23273
|
const s = t ? t.pmremVersion : -1, i = this._value;
|
|
23271
|
-
s !== i.pmremVersion && (i.isPMREMTexture === !0 ? t = i : t =
|
|
23274
|
+
s !== i.pmremVersion && (i.isPMREMTexture === !0 ? t = i : t = BM(i, e.renderer, this._generator), t !== null && (this._pmrem = t, this.updateFromTexture(t)));
|
|
23272
23275
|
}
|
|
23273
23276
|
setup(e) {
|
|
23274
23277
|
this._generator === null && (this._generator = new PM(e.renderer)), this.updateBefore(e);
|
|
23275
23278
|
let t = this.uvNode;
|
|
23276
|
-
t === null && e.context.getUV && (t = e.context.getUV(this)), t = Vy.mul(
|
|
23279
|
+
t === null && e.context.getUV && (t = e.context.getUV(this)), t = Vy.mul(B(t.x, t.y.negate(), t.z));
|
|
23277
23280
|
let s = this.levelNode;
|
|
23278
23281
|
return s === null && e.context.getTextureLevel && (s = e.context.getTextureLevel(this)), CM(this._texture, t, s, this._width, this._height, this._maxMip);
|
|
23279
23282
|
}
|
|
@@ -23293,7 +23296,7 @@ function kM(a) {
|
|
|
23293
23296
|
return a == null ? !1 : a.height > 0;
|
|
23294
23297
|
}
|
|
23295
23298
|
const a0 = /* @__PURE__ */ L(LM).setParameterLength(1, 3);
|
|
23296
|
-
|
|
23299
|
+
I(([a = qa()], { renderer: e, material: t }) => {
|
|
23297
23300
|
const s = xy(a.mul(2).sub(1));
|
|
23298
23301
|
let i;
|
|
23299
23302
|
if (t.alphaToCoverage && e.samples > 1) {
|
|
@@ -23303,10 +23306,10 @@ B(([a = qa()], { renderer: e, material: t }) => {
|
|
|
23303
23306
|
i = Et(s.greaterThan(1), 0, 1);
|
|
23304
23307
|
return i;
|
|
23305
23308
|
});
|
|
23306
|
-
const Va = /* @__PURE__ */
|
|
23309
|
+
const Va = /* @__PURE__ */ I(({ f0: a, f90: e, dotVH: t }) => {
|
|
23307
23310
|
const s = t.mul(-5.55473).sub(6.98316).mul(t).exp2();
|
|
23308
23311
|
return a.mul(s.oneMinus()).add(e.mul(s));
|
|
23309
|
-
}), zM = /* @__PURE__ */
|
|
23312
|
+
}), zM = /* @__PURE__ */ I(({ alpha: a, dotNL: e, dotNV: t }) => {
|
|
23310
23313
|
const s = a.pow2(), i = e.mul(s.add(s.oneMinus().mul(t.pow2())).sqrt()), n = t.mul(s.add(s.oneMinus().mul(e.pow2())).sqrt());
|
|
23311
23314
|
return $s(0.5, i.add(n).max(sv));
|
|
23312
23315
|
}).setLayout({
|
|
@@ -23317,8 +23320,8 @@ const Va = /* @__PURE__ */ B(({ f0: a, f90: e, dotVH: t }) => {
|
|
|
23317
23320
|
{ name: "dotNL", type: "float" },
|
|
23318
23321
|
{ name: "dotNV", type: "float" }
|
|
23319
23322
|
]
|
|
23320
|
-
}), GM = /* @__PURE__ */
|
|
23321
|
-
const l = o.mul(
|
|
23323
|
+
}), GM = /* @__PURE__ */ I(({ alphaT: a, alphaB: e, dotTV: t, dotBV: s, dotTL: i, dotBL: n, dotNV: r, dotNL: o }) => {
|
|
23324
|
+
const l = o.mul(B(a.mul(t), e.mul(s), r).length()), c = r.mul(B(a.mul(i), e.mul(n), o).length());
|
|
23322
23325
|
return $s(0.5, l.add(c)).saturate();
|
|
23323
23326
|
}).setLayout({
|
|
23324
23327
|
name: "V_GGX_SmithCorrelated_Anisotropic",
|
|
@@ -23333,7 +23336,7 @@ const Va = /* @__PURE__ */ B(({ f0: a, f90: e, dotVH: t }) => {
|
|
|
23333
23336
|
{ name: "dotNV", type: "float", qualifier: "in" },
|
|
23334
23337
|
{ name: "dotNL", type: "float", qualifier: "in" }
|
|
23335
23338
|
]
|
|
23336
|
-
}), VM = /* @__PURE__ */
|
|
23339
|
+
}), VM = /* @__PURE__ */ I(({ alpha: a, dotNH: e }) => {
|
|
23337
23340
|
const t = a.pow2(), s = e.pow2().mul(t.oneMinus()).oneMinus();
|
|
23338
23341
|
return t.div(s.pow2()).mul(1 / Math.PI);
|
|
23339
23342
|
}).setLayout({
|
|
@@ -23343,8 +23346,8 @@ const Va = /* @__PURE__ */ B(({ f0: a, f90: e, dotVH: t }) => {
|
|
|
23343
23346
|
{ name: "alpha", type: "float" },
|
|
23344
23347
|
{ name: "dotNH", type: "float" }
|
|
23345
23348
|
]
|
|
23346
|
-
}), HM = /* @__PURE__ */ O(1 / Math.PI), $M = /* @__PURE__ */
|
|
23347
|
-
const n = a.mul(e), r =
|
|
23349
|
+
}), HM = /* @__PURE__ */ O(1 / Math.PI), $M = /* @__PURE__ */ I(({ alphaT: a, alphaB: e, dotNH: t, dotTH: s, dotBH: i }) => {
|
|
23350
|
+
const n = a.mul(e), r = B(e.mul(s), a.mul(i), n.mul(t)), o = r.dot(r), l = n.div(o);
|
|
23348
23351
|
return HM.mul(n.mul(l.pow2()));
|
|
23349
23352
|
}).setLayout({
|
|
23350
23353
|
name: "D_GGX_Anisotropic",
|
|
@@ -23356,16 +23359,16 @@ const Va = /* @__PURE__ */ B(({ f0: a, f90: e, dotVH: t }) => {
|
|
|
23356
23359
|
{ name: "dotTH", type: "float", qualifier: "in" },
|
|
23357
23360
|
{ name: "dotBH", type: "float", qualifier: "in" }
|
|
23358
23361
|
]
|
|
23359
|
-
}), Af = /* @__PURE__ */
|
|
23362
|
+
}), Af = /* @__PURE__ */ I((a) => {
|
|
23360
23363
|
const { lightDirection: e, f0: t, f90: s, roughness: i, f: n, USE_IRIDESCENCE: r, USE_ANISOTROPY: o } = a, l = a.normalView || st, c = i.pow2(), h = e.add(Ye).normalize(), u = l.dot(e).clamp(), d = l.dot(Ye).clamp(), p = l.dot(h).clamp(), f = Ye.dot(h).clamp();
|
|
23361
23364
|
let m = Va({ f0: t, f90: s, dotVH: f }), y, g;
|
|
23362
|
-
if (
|
|
23365
|
+
if (Bp(r) && (m = $u.mix(m, n)), Bp(o)) {
|
|
23363
23366
|
const x = Jo.dot(e), _ = Jo.dot(Ye), b = Jo.dot(h), T = xr.dot(e), E = xr.dot(Ye), v = xr.dot(h);
|
|
23364
23367
|
y = GM({ alphaT: ou, alphaB: c, dotTV: _, dotBV: E, dotTL: x, dotBL: T, dotNV: d, dotNL: u }), g = $M({ alphaT: ou, alphaB: c, dotNH: p, dotTH: b, dotBH: v });
|
|
23365
23368
|
} else
|
|
23366
23369
|
y = zM({ alpha: c, dotNL: u, dotNV: d }), g = VM({ alpha: c, dotNH: p });
|
|
23367
23370
|
return m.mul(y).mul(g);
|
|
23368
|
-
}), Rr = /* @__PURE__ */
|
|
23371
|
+
}), Rr = /* @__PURE__ */ I((a) => a.diffuseColor.mul(1 / Math.PI)), o0 = /* @__PURE__ */ I(({ roughness: a, dotNV: e }) => {
|
|
23369
23372
|
const t = ne(-1, -0.0275, -0.572, 0.022), s = ne(1, 0.0425, 1.04, -0.04), i = a.mul(t).add(s), n = i.x.mul(i.x).min(e.mul(-9.28).exp2()).mul(i.x).add(i.y);
|
|
23370
23373
|
return V(-1.04, 1.04).mul(n).add(i.zw);
|
|
23371
23374
|
}).setLayout({
|
|
@@ -23375,9 +23378,9 @@ const Va = /* @__PURE__ */ B(({ f0: a, f90: e, dotVH: t }) => {
|
|
|
23375
23378
|
{ name: "roughness", type: "float" },
|
|
23376
23379
|
{ name: "dotNV", type: "vec3" }
|
|
23377
23380
|
]
|
|
23378
|
-
}), WM = /* @__PURE__ */
|
|
23381
|
+
}), WM = /* @__PURE__ */ I(({ f: a, f90: e, dotVH: t }) => {
|
|
23379
23382
|
const s = t.oneMinus().saturate(), i = s.mul(s), n = s.mul(i, i).clamp(0, 0.9999);
|
|
23380
|
-
return a.sub(
|
|
23383
|
+
return a.sub(B(e).mul(n)).div(n.oneMinus());
|
|
23381
23384
|
}).setLayout({
|
|
23382
23385
|
name: "Schlick_to_F0",
|
|
23383
23386
|
type: "vec3",
|
|
@@ -23386,16 +23389,16 @@ const Va = /* @__PURE__ */ B(({ f0: a, f90: e, dotVH: t }) => {
|
|
|
23386
23389
|
{ name: "f90", type: "float" },
|
|
23387
23390
|
{ name: "dotVH", type: "float" }
|
|
23388
23391
|
]
|
|
23389
|
-
}), jM = /* @__PURE__ */
|
|
23392
|
+
}), jM = /* @__PURE__ */ I((a) => {
|
|
23390
23393
|
if (a.geometry.hasAttribute("normal") === !1)
|
|
23391
23394
|
return O(0);
|
|
23392
23395
|
const e = js.dFdx().abs().max(js.dFdy().abs());
|
|
23393
23396
|
return e.x.max(e.y).max(e.z);
|
|
23394
|
-
}), l0 = /* @__PURE__ */
|
|
23397
|
+
}), l0 = /* @__PURE__ */ I((a) => {
|
|
23395
23398
|
const { roughness: e } = a, t = jM();
|
|
23396
23399
|
let s = e.max(0.0525);
|
|
23397
23400
|
return s = s.add(t), s = s.min(1), s;
|
|
23398
|
-
}), qM = /* @__PURE__ */
|
|
23401
|
+
}), qM = /* @__PURE__ */ I(([a, e]) => {
|
|
23399
23402
|
const t = a.x, s = a.y, i = a.z;
|
|
23400
23403
|
let n = e.element(0).mul(0.886227);
|
|
23401
23404
|
return n = n.add(e.element(1).mul(2 * 0.511664).mul(s)), n = n.add(e.element(2).mul(2 * 0.511664).mul(i)), n = n.add(e.element(3).mul(2 * 0.511664).mul(t)), n = n.add(e.element(4).mul(2 * 0.429043).mul(t).mul(s)), n = n.add(e.element(5).mul(2 * 0.429043).mul(s).mul(i)), n = n.add(e.element(6).mul(i.mul(i).mul(0.743125).sub(0.247708))), n = n.add(e.element(7).mul(2 * 0.429043).mul(t).mul(i)), n = n.add(e.element(8).mul(0.429043).mul(fe(t, t).sub(fe(s, s)))), n;
|
|
@@ -23440,7 +23443,7 @@ class hd extends xi {
|
|
|
23440
23443
|
const _ = h[g][x + 1], b = h[g][x], T = h[g + 1][x], E = h[g + 1][x + 1];
|
|
23441
23444
|
(g !== 0 || r > 0) && p.push(_, b, E), (g !== s - 1 || l < Math.PI) && p.push(b, T, E);
|
|
23442
23445
|
}
|
|
23443
|
-
this.setIndex(p), this.setAttribute("position", new
|
|
23446
|
+
this.setIndex(p), this.setAttribute("position", new Bt(f, 3)), this.setAttribute("normal", new Bt(m, 3)), this.setAttribute("uv", new Bt(y, 2));
|
|
23444
23447
|
}
|
|
23445
23448
|
copy(e) {
|
|
23446
23449
|
return super.copy(e), this.parameters = Object.assign({}, e.parameters), this;
|
|
@@ -23456,7 +23459,7 @@ class hd extends xi {
|
|
|
23456
23459
|
return new hd(e.radius, e.widthSegments, e.heightSegments, e.phiStart, e.phiLength, e.thetaStart, e.thetaLength);
|
|
23457
23460
|
}
|
|
23458
23461
|
}
|
|
23459
|
-
const Ts = /* @__PURE__ */ new
|
|
23462
|
+
const Ts = /* @__PURE__ */ new Bu();
|
|
23460
23463
|
class YM extends Hi {
|
|
23461
23464
|
/**
|
|
23462
23465
|
* Constructs a new background management component.
|
|
@@ -23906,7 +23909,7 @@ function d0(a) {
|
|
|
23906
23909
|
t !== void 0 && (Pa.delete(e), t.dispose());
|
|
23907
23910
|
}
|
|
23908
23911
|
function Rf(a, e) {
|
|
23909
|
-
e === vu ? a.mapping =
|
|
23912
|
+
e === vu ? a.mapping = Ba : e === wu && (a.mapping = gl);
|
|
23910
23913
|
}
|
|
23911
23914
|
const p0 = /* @__PURE__ */ L(iA).setParameterLength(1);
|
|
23912
23915
|
class Xl {
|
|
@@ -24604,7 +24607,7 @@ class m0 {
|
|
|
24604
24607
|
* @return {boolean} Whether the given texture is filtered or not.
|
|
24605
24608
|
*/
|
|
24606
24609
|
isFilteredTexture(e) {
|
|
24607
|
-
return e.magFilter === ns || e.magFilter === zh || e.magFilter ===
|
|
24610
|
+
return e.magFilter === ns || e.magFilter === zh || e.magFilter === Ia || e.magFilter === ai || e.minFilter === ns || e.minFilter === zh || e.minFilter === Ia || e.minFilter === ai;
|
|
24608
24611
|
}
|
|
24609
24612
|
/**
|
|
24610
24613
|
* Adds the given node to the internal node chain.
|
|
@@ -25978,7 +25981,7 @@ class RA extends dd {
|
|
|
25978
25981
|
return i;
|
|
25979
25982
|
}
|
|
25980
25983
|
}
|
|
25981
|
-
const NA = /* @__PURE__ */
|
|
25984
|
+
const NA = /* @__PURE__ */ I(([a, e]) => {
|
|
25982
25985
|
const t = a.abs().sub(e);
|
|
25983
25986
|
return hi(Mt(t, 0)).add(Mr(Mt(t.x, t.y), 0));
|
|
25984
25987
|
});
|
|
@@ -26080,7 +26083,7 @@ class OA extends Mn {
|
|
|
26080
26083
|
}
|
|
26081
26084
|
}
|
|
26082
26085
|
const Df = /* @__PURE__ */ new WeakMap();
|
|
26083
|
-
class
|
|
26086
|
+
class BA extends Br {
|
|
26084
26087
|
static get type() {
|
|
26085
26088
|
return "EnvironmentNode";
|
|
26086
26089
|
}
|
|
@@ -26100,7 +26103,7 @@ class IA extends Ir {
|
|
|
26100
26103
|
let d = Df.get(u);
|
|
26101
26104
|
d === void 0 && (d = a0(u), Df.set(u, d)), s = d;
|
|
26102
26105
|
}
|
|
26103
|
-
const n = t.useAnisotropy === !0 || t.anisotropy > 0 ? rE : st, r = s.context(Of(ti, n)).mul(Ec), o = s.context(
|
|
26106
|
+
const n = t.useAnisotropy === !0 || t.anisotropy > 0 ? rE : st, r = s.context(Of(ti, n)).mul(Ec), o = s.context(IA(id)).mul(Math.PI).mul(Ec), l = sl(r), c = sl(o);
|
|
26104
26107
|
e.context.radiance.addAssign(l), e.context.iblIrradiance.addAssign(c);
|
|
26105
26108
|
const h = e.context.lightingModel.clearcoatRadiance;
|
|
26106
26109
|
if (h) {
|
|
@@ -26115,11 +26118,11 @@ const Of = (a, e) => {
|
|
|
26115
26118
|
getUV: () => (t === null && (t = Ye.negate().reflect(e), t = a.mul(a).mix(t, e).normalize(), t = t.transformDirection(yi)), t),
|
|
26116
26119
|
getTextureLevel: () => a
|
|
26117
26120
|
};
|
|
26118
|
-
},
|
|
26121
|
+
}, IA = (a) => ({
|
|
26119
26122
|
getUV: () => a,
|
|
26120
26123
|
getTextureLevel: () => O(1)
|
|
26121
26124
|
});
|
|
26122
|
-
class pd extends
|
|
26125
|
+
class pd extends Br {
|
|
26123
26126
|
static get type() {
|
|
26124
26127
|
return "BasicEnvironmentNode";
|
|
26125
26128
|
}
|
|
@@ -26171,9 +26174,9 @@ class fd {
|
|
|
26171
26174
|
}
|
|
26172
26175
|
}
|
|
26173
26176
|
fd.isNodeFunction = !0;
|
|
26174
|
-
const LA = /^\s*(highp|mediump|lowp)?\s*([a-z_0-9]+)\s*([a-z_0-9]+)?\s*\(([\s\S]*?)\)/i, UA = /[a-z_0-9]+/ig,
|
|
26177
|
+
const LA = /^\s*(highp|mediump|lowp)?\s*([a-z_0-9]+)\s*([a-z_0-9]+)?\s*\(([\s\S]*?)\)/i, UA = /[a-z_0-9]+/ig, Bf = "#pragma main", kA = (a) => {
|
|
26175
26178
|
a = a.trim();
|
|
26176
|
-
const e = a.indexOf(
|
|
26179
|
+
const e = a.indexOf(Bf), t = e !== -1 ? a.slice(e + Bf.length) : a, s = t.match(LA);
|
|
26177
26180
|
if (s !== null && s.length === 5) {
|
|
26178
26181
|
const i = s[4], n = [];
|
|
26179
26182
|
let r = null;
|
|
@@ -26284,7 +26287,7 @@ class y0 extends Xl {
|
|
|
26284
26287
|
}
|
|
26285
26288
|
}
|
|
26286
26289
|
}
|
|
26287
|
-
const VA = () => O(0.25), HA = /* @__PURE__ */
|
|
26290
|
+
const VA = () => O(0.25), HA = /* @__PURE__ */ I(({ dotNH: a }) => lu.mul(O(0.5)).add(1).mul(O(1 / Math.PI)).mul(a.pow(lu))), $A = /* @__PURE__ */ I(({ lightDirection: a }) => {
|
|
26288
26291
|
const e = a.add(Ye).normalize(), t = st.dot(e).clamp(), s = Ye.dot(e).clamp(), i = Va({ f0: Jt, f90: 1, dotVH: s }), n = VA(), r = HA({ dotNH: t });
|
|
26289
26292
|
return i.mul(n).mul(r);
|
|
26290
26293
|
});
|
|
@@ -26317,10 +26320,10 @@ class x0 extends y0 {
|
|
|
26317
26320
|
i.indirectDiffuse.addAssign(s.mul(Rr({ diffuseColor: Se }))), i.indirectDiffuse.mulAssign(t);
|
|
26318
26321
|
}
|
|
26319
26322
|
}
|
|
26320
|
-
const _0 = /* @__PURE__ */
|
|
26323
|
+
const _0 = /* @__PURE__ */ I((a) => {
|
|
26321
26324
|
const { dotNV: e, specularColor: t, specularF90: s, roughness: i } = a, n = o0({ dotNV: e, roughness: i });
|
|
26322
26325
|
return t.mul(n.x).add(s.mul(n.y));
|
|
26323
|
-
}), WA = /* @__PURE__ */
|
|
26326
|
+
}), WA = /* @__PURE__ */ I(({ roughness: a, dotNH: e }) => {
|
|
26324
26327
|
const t = a.pow2(), s = O(1).div(t), n = e.pow2().oneMinus().max(78125e-7);
|
|
26325
26328
|
return O(2).add(s).mul(n.pow(s.mul(0.5))).div(2 * Math.PI);
|
|
26326
26329
|
}).setLayout({
|
|
@@ -26330,17 +26333,17 @@ const _0 = /* @__PURE__ */ B((a) => {
|
|
|
26330
26333
|
{ name: "roughness", type: "float" },
|
|
26331
26334
|
{ name: "dotNH", type: "float" }
|
|
26332
26335
|
]
|
|
26333
|
-
}), jA = /* @__PURE__ */
|
|
26336
|
+
}), jA = /* @__PURE__ */ I(({ dotNV: a, dotNL: e }) => O(1).div(O(4).mul(e.add(a).sub(e.mul(a))))).setLayout({
|
|
26334
26337
|
name: "V_Neubelt",
|
|
26335
26338
|
type: "float",
|
|
26336
26339
|
inputs: [
|
|
26337
26340
|
{ name: "dotNV", type: "float" },
|
|
26338
26341
|
{ name: "dotNL", type: "float" }
|
|
26339
26342
|
]
|
|
26340
|
-
}), qA = /* @__PURE__ */
|
|
26343
|
+
}), qA = /* @__PURE__ */ I(({ lightDirection: a }) => {
|
|
26341
26344
|
const e = a.add(Ye).normalize(), t = st.dot(a).clamp(), s = st.dot(Ye).clamp(), i = st.dot(e).clamp(), n = WA({ roughness: Hu, dotNH: i }), r = jA({ dotNV: s, dotNL: t });
|
|
26342
26345
|
return lr.mul(n).mul(r);
|
|
26343
|
-
}), YA = /* @__PURE__ */
|
|
26346
|
+
}), YA = /* @__PURE__ */ I(({ N: a, V: e, roughness: t }) => {
|
|
26344
26347
|
const n = 78125e-7, r = a.dot(e).saturate(), o = V(t, r.oneMinus().sqrt());
|
|
26345
26348
|
return o.assign(o.mul(0.984375).add(n)), o;
|
|
26346
26349
|
}).setLayout({
|
|
@@ -26351,7 +26354,7 @@ const _0 = /* @__PURE__ */ B((a) => {
|
|
|
26351
26354
|
{ name: "V", type: "vec3" },
|
|
26352
26355
|
{ name: "roughness", type: "float" }
|
|
26353
26356
|
]
|
|
26354
|
-
}), XA = /* @__PURE__ */
|
|
26357
|
+
}), XA = /* @__PURE__ */ I(({ f: a }) => {
|
|
26355
26358
|
const e = a.length();
|
|
26356
26359
|
return Mt(e.mul(e).add(a.z).div(e.add(1)), 0);
|
|
26357
26360
|
}).setLayout({
|
|
@@ -26360,7 +26363,7 @@ const _0 = /* @__PURE__ */ B((a) => {
|
|
|
26360
26363
|
inputs: [
|
|
26361
26364
|
{ name: "f", type: "vec3" }
|
|
26362
26365
|
]
|
|
26363
|
-
}), No = /* @__PURE__ */
|
|
26366
|
+
}), No = /* @__PURE__ */ I(({ v1: a, v2: e }) => {
|
|
26364
26367
|
const t = a.dot(e), s = t.abs().toVar(), i = s.mul(0.0145206).add(0.4965155).mul(s).add(0.8543985).toVar(), n = s.add(4.1616724).mul(s).add(3.417594).toVar(), r = i.div(n), o = t.greaterThan(0).select(r, Mt(t.mul(t).oneMinus(), 1e-7).inverseSqrt().mul(0.5).sub(r));
|
|
26365
26368
|
return a.cross(e).mul(o);
|
|
26366
26369
|
}).setLayout({
|
|
@@ -26370,11 +26373,11 @@ const _0 = /* @__PURE__ */ B((a) => {
|
|
|
26370
26373
|
{ name: "v1", type: "vec3" },
|
|
26371
26374
|
{ name: "v2", type: "vec3" }
|
|
26372
26375
|
]
|
|
26373
|
-
}),
|
|
26374
|
-
const l = n.sub(i).toVar(), c = o.sub(i).toVar(), h = l.cross(c), u =
|
|
26376
|
+
}), If = /* @__PURE__ */ I(({ N: a, V: e, P: t, mInv: s, p0: i, p1: n, p2: r, p3: o }) => {
|
|
26377
|
+
const l = n.sub(i).toVar(), c = o.sub(i).toVar(), h = l.cross(c), u = B().toVar();
|
|
26375
26378
|
return Qe(h.dot(t.sub(i)).greaterThanEqual(0), () => {
|
|
26376
|
-
const d = e.sub(a.mul(e.dot(a))).normalize(), p = a.cross(d).negate(), f = s.mul(
|
|
26377
|
-
_.addAssign(No({ v1: m, v2: y })), _.addAssign(No({ v1: y, v2: g })), _.addAssign(No({ v1: g, v2: x })), _.addAssign(No({ v1: x, v2: m })), u.assign(
|
|
26379
|
+
const d = e.sub(a.mul(e.dot(a))).normalize(), p = a.cross(d).negate(), f = s.mul(It(d, p, a).transpose()).toVar(), m = f.mul(i.sub(t)).normalize().toVar(), y = f.mul(n.sub(t)).normalize().toVar(), g = f.mul(r.sub(t)).normalize().toVar(), x = f.mul(o.sub(t)).normalize().toVar(), _ = B(0).toVar();
|
|
26380
|
+
_.addAssign(No({ v1: m, v2: y })), _.addAssign(No({ v1: y, v2: g })), _.addAssign(No({ v1: g, v2: x })), _.addAssign(No({ v1: x, v2: m })), u.assign(B(XA({ f: _ })));
|
|
26378
26381
|
}), u;
|
|
26379
26382
|
}).setLayout({
|
|
26380
26383
|
name: "LTC_Evaluate",
|
|
@@ -26389,8 +26392,8 @@ const _0 = /* @__PURE__ */ B((a) => {
|
|
|
26389
26392
|
{ name: "p2", type: "vec3" },
|
|
26390
26393
|
{ name: "p3", type: "vec3" }
|
|
26391
26394
|
]
|
|
26392
|
-
}), Lf = /* @__PURE__ */
|
|
26393
|
-
const n =
|
|
26395
|
+
}), Lf = /* @__PURE__ */ I(([a, e, t, s, i]) => {
|
|
26396
|
+
const n = B(by(e.negate(), ka(a), $s(1, s))), r = B(
|
|
26394
26397
|
hi(i[0].xyz),
|
|
26395
26398
|
hi(i[1].xyz),
|
|
26396
26399
|
hi(i[2].xyz)
|
|
@@ -26406,20 +26409,20 @@ const _0 = /* @__PURE__ */ B((a) => {
|
|
|
26406
26409
|
{ name: "ior", type: "float" },
|
|
26407
26410
|
{ name: "modelMatrix", type: "mat4" }
|
|
26408
26411
|
]
|
|
26409
|
-
}), ZA = /* @__PURE__ */
|
|
26412
|
+
}), ZA = /* @__PURE__ */ I(([a, e]) => a.mul(fi(e.mul(2).sub(2), 0, 1))).setLayout({
|
|
26410
26413
|
name: "applyIorToRoughness",
|
|
26411
26414
|
type: "float",
|
|
26412
26415
|
inputs: [
|
|
26413
26416
|
{ name: "roughness", type: "float" },
|
|
26414
26417
|
{ name: "ior", type: "float" }
|
|
26415
26418
|
]
|
|
26416
|
-
}), KA = /* @__PURE__ */ Ly(), QA = /* @__PURE__ */ Ly(), Uf = /* @__PURE__ */
|
|
26419
|
+
}), KA = /* @__PURE__ */ Ly(), QA = /* @__PURE__ */ Ly(), Uf = /* @__PURE__ */ I(([a, e, t], { material: s }) => {
|
|
26417
26420
|
const n = (s.side === jt ? KA : QA).sample(a), r = ci(hu.x).mul(ZA(e, t));
|
|
26418
26421
|
return bC(n, r);
|
|
26419
|
-
}), kf = /* @__PURE__ */
|
|
26422
|
+
}), kf = /* @__PURE__ */ I(([a, e, t]) => (Qe(t.notEqual(0), () => {
|
|
26420
26423
|
const s = hy(e).negate().div(t);
|
|
26421
26424
|
return cy(s.negate().mul(a));
|
|
26422
|
-
}),
|
|
26425
|
+
}), B(1))).setLayout({
|
|
26423
26426
|
name: "volumeAttenuation",
|
|
26424
26427
|
type: "vec3",
|
|
26425
26428
|
inputs: [
|
|
@@ -26427,11 +26430,11 @@ const _0 = /* @__PURE__ */ B((a) => {
|
|
|
26427
26430
|
{ name: "attenuationColor", type: "vec3" },
|
|
26428
26431
|
{ name: "attenuationDistance", type: "float" }
|
|
26429
26432
|
]
|
|
26430
|
-
}), JA = /* @__PURE__ */
|
|
26433
|
+
}), JA = /* @__PURE__ */ I(([a, e, t, s, i, n, r, o, l, c, h, u, d, p, f]) => {
|
|
26431
26434
|
let m, y;
|
|
26432
26435
|
if (f) {
|
|
26433
|
-
m = ne().toVar(), y =
|
|
26434
|
-
const T = h.sub(1).mul(f.mul(0.025)), E =
|
|
26436
|
+
m = ne().toVar(), y = B().toVar();
|
|
26437
|
+
const T = h.sub(1).mul(f.mul(0.025)), E = B(h.sub(T), h, h.add(T));
|
|
26435
26438
|
Ms({ start: 0, end: 3 }, ({ i: v }) => {
|
|
26436
26439
|
const A = E.element(v), N = Lf(a, e, u, A, o), k = r.add(N), H = c.mul(l.mul(ne(k, 1))), W = V(H.xy.div(H.w)).toVar();
|
|
26437
26440
|
W.addAssign(1), W.divAssign(2), W.assign(V(W.x, W.y.oneMinus()));
|
|
@@ -26442,7 +26445,7 @@ const _0 = /* @__PURE__ */ B((a) => {
|
|
|
26442
26445
|
const T = Lf(a, e, u, h, o), E = r.add(T), v = c.mul(l.mul(ne(E, 1))), A = V(v.xy.div(v.w)).toVar();
|
|
26443
26446
|
A.addAssign(1), A.divAssign(2), A.assign(V(A.x, A.y.oneMinus())), m = Uf(A, t, h), y = s.mul(kf(hi(T), d, p));
|
|
26444
26447
|
}
|
|
26445
|
-
const g = y.rgb.mul(m.rgb), x = a.dot(e).clamp(), _ =
|
|
26448
|
+
const g = y.rgb.mul(m.rgb), x = a.dot(e).clamp(), _ = B(_0({
|
|
26446
26449
|
// n, v, specularColor, specularF90, roughness
|
|
26447
26450
|
dotNV: x,
|
|
26448
26451
|
specularColor: i,
|
|
@@ -26450,7 +26453,7 @@ const _0 = /* @__PURE__ */ B((a) => {
|
|
|
26450
26453
|
roughness: t
|
|
26451
26454
|
})), b = y.r.add(y.g, y.b).div(3);
|
|
26452
26455
|
return ne(_.oneMinus().mul(g), m.a.oneMinus().mul(b).oneMinus());
|
|
26453
|
-
}), eR = /* @__PURE__ */
|
|
26456
|
+
}), eR = /* @__PURE__ */ It(
|
|
26454
26457
|
3.2404542,
|
|
26455
26458
|
-0.969266,
|
|
26456
26459
|
0.0556434,
|
|
@@ -26462,24 +26465,24 @@ const _0 = /* @__PURE__ */ B((a) => {
|
|
|
26462
26465
|
1.0572252
|
|
26463
26466
|
), tR = (a) => {
|
|
26464
26467
|
const e = a.sqrt();
|
|
26465
|
-
return
|
|
26468
|
+
return B(1).add(e).div(B(1).sub(e));
|
|
26466
26469
|
}, zf = (a, e) => a.sub(e).div(a.add(e)).pow2(), sR = (a, e) => {
|
|
26467
|
-
const t = a.mul(2 * Math.PI * 1e-9), s =
|
|
26470
|
+
const t = a.mul(2 * Math.PI * 1e-9), s = B(54856e-17, 44201e-17, 52481e-17), i = B(1681e3, 1795300, 2208400), n = B(43278e5, 93046e5, 66121e5), r = O(9747e-17 * Math.sqrt(2 * Math.PI * 45282e5)).mul(t.mul(2239900).add(e.x).cos()).mul(t.pow2().mul(-45282e5).exp());
|
|
26468
26471
|
let o = s.mul(n.mul(2 * Math.PI).sqrt()).mul(i.mul(t).add(e).cos()).mul(t.pow2().negate().mul(n).exp());
|
|
26469
|
-
return o =
|
|
26470
|
-
}, iR = /* @__PURE__ */
|
|
26472
|
+
return o = B(o.x.add(r), o.y, o.z).div(10685e-11), eR.mul(o);
|
|
26473
|
+
}, iR = /* @__PURE__ */ I(({ outsideIOR: a, eta2: e, cosTheta1: t, thinFilmThickness: s, baseF0: i }) => {
|
|
26471
26474
|
const n = He(a, e, Gi(0, 0.03, s)), o = a.div(n).pow2().mul(t.pow2().oneMinus()).oneMinus();
|
|
26472
|
-
Qe(o.lessThan(0), () =>
|
|
26473
|
-
const l = o.sqrt(), c = zf(n, a), h = Va({ f0: c, f90: 1, dotVH: t }), u = h.oneMinus(), d = n.lessThan(a).select(Math.PI, 0), p = O(Math.PI).sub(d), f = tR(i.clamp(0, 0.9999)), m = zf(f, n.toVec3()), y = Va({ f0: m, f90: 1, dotVH: l }), g =
|
|
26475
|
+
Qe(o.lessThan(0), () => B(1));
|
|
26476
|
+
const l = o.sqrt(), c = zf(n, a), h = Va({ f0: c, f90: 1, dotVH: t }), u = h.oneMinus(), d = n.lessThan(a).select(Math.PI, 0), p = O(Math.PI).sub(d), f = tR(i.clamp(0, 0.9999)), m = zf(f, n.toVec3()), y = Va({ f0: m, f90: 1, dotVH: l }), g = B(
|
|
26474
26477
|
f.x.lessThan(n).select(Math.PI, 0),
|
|
26475
26478
|
f.y.lessThan(n).select(Math.PI, 0),
|
|
26476
26479
|
f.z.lessThan(n).select(Math.PI, 0)
|
|
26477
|
-
), x = n.mul(s, l, 2), _ =
|
|
26480
|
+
), x = n.mul(s, l, 2), _ = B(p).add(g), b = h.mul(y).clamp(1e-5, 0.9999), T = b.sqrt(), E = u.pow2().mul(y).div(B(1).sub(b)), A = h.add(E).toVar(), N = E.sub(u).toVar();
|
|
26478
26481
|
return Ms({ start: 1, end: 2, condition: "<=", name: "m" }, ({ m: k }) => {
|
|
26479
26482
|
N.mulAssign(T);
|
|
26480
26483
|
const H = sR(O(k).mul(x), O(k).mul(_)).mul(2);
|
|
26481
26484
|
A.addAssign(N.mul(H));
|
|
26482
|
-
}), A.max(
|
|
26485
|
+
}), A.max(B(0));
|
|
26483
26486
|
}).setLayout({
|
|
26484
26487
|
name: "evalIridescence",
|
|
26485
26488
|
type: "vec3",
|
|
@@ -26490,7 +26493,7 @@ const _0 = /* @__PURE__ */ B((a) => {
|
|
|
26490
26493
|
{ name: "thinFilmThickness", type: "float" },
|
|
26491
26494
|
{ name: "baseF0", type: "vec3" }
|
|
26492
26495
|
]
|
|
26493
|
-
}), nR = /* @__PURE__ */
|
|
26496
|
+
}), nR = /* @__PURE__ */ I(({ normal: a, viewDir: e, roughness: t }) => {
|
|
26494
26497
|
const s = a.dot(e).saturate(), i = t.pow2(), n = Et(
|
|
26495
26498
|
t.lessThan(0.25),
|
|
26496
26499
|
O(-339.2).mul(i).add(O(161.4).mul(t)).sub(25.9),
|
|
@@ -26501,7 +26504,7 @@ const _0 = /* @__PURE__ */ B((a) => {
|
|
|
26501
26504
|
O(1.97).mul(i).sub(O(3.27).mul(t)).add(0.72)
|
|
26502
26505
|
);
|
|
26503
26506
|
return Et(t.lessThan(0.25), 0, O(0.1).mul(t).sub(0.025)).add(n.mul(s).add(r).exp()).mul(1 / Math.PI).saturate();
|
|
26504
|
-
}), th =
|
|
26507
|
+
}), th = B(0.04), sh = O(1);
|
|
26505
26508
|
class b0 extends Xl {
|
|
26506
26509
|
/**
|
|
26507
26510
|
* Constructs a new physical lighting model.
|
|
@@ -26523,7 +26526,7 @@ class b0 extends Xl {
|
|
|
26523
26526
|
* @param {NodeBuilder} builder - The current node builder.
|
|
26524
26527
|
*/
|
|
26525
26528
|
start(e) {
|
|
26526
|
-
if (this.clearcoat === !0 && (this.clearcoatRadiance =
|
|
26529
|
+
if (this.clearcoat === !0 && (this.clearcoatRadiance = B().toVar("clearcoatRadiance"), this.clearcoatSpecularDirect = B().toVar("clearcoatSpecularDirect"), this.clearcoatSpecularIndirect = B().toVar("clearcoatSpecularIndirect")), this.sheen === !0 && (this.sheenSpecularDirect = B().toVar("sheenSpecularDirect"), this.sheenSpecularIndirect = B().toVar("sheenSpecularIndirect")), this.iridescence === !0) {
|
|
26527
26530
|
const t = st.dot(Ye).clamp();
|
|
26528
26531
|
this.iridescenceFresnel = iR({
|
|
26529
26532
|
outsideIOR: O(1),
|
|
@@ -26589,12 +26592,12 @@ class b0 extends Xl {
|
|
|
26589
26592
|
* @param {NodeBuilder} builder - The current node builder.
|
|
26590
26593
|
*/
|
|
26591
26594
|
directRectArea({ lightColor: e, lightPosition: t, halfWidth: s, halfHeight: i, reflectedLight: n, ltc_1: r, ltc_2: o }) {
|
|
26592
|
-
const l = t.add(s).sub(i), c = t.sub(s).sub(i), h = t.sub(s).add(i), u = t.add(s).add(i), d = st, p = Ye, f = it.toVar(), m = YA({ N: d, V: p, roughness: ti }), y = r.sample(m).toVar(), g = o.sample(m).toVar(), x =
|
|
26593
|
-
|
|
26594
|
-
|
|
26595
|
-
|
|
26595
|
+
const l = t.add(s).sub(i), c = t.sub(s).sub(i), h = t.sub(s).add(i), u = t.add(s).add(i), d = st, p = Ye, f = it.toVar(), m = YA({ N: d, V: p, roughness: ti }), y = r.sample(m).toVar(), g = o.sample(m).toVar(), x = It(
|
|
26596
|
+
B(y.x, 0, y.y),
|
|
26597
|
+
B(0, 1, 0),
|
|
26598
|
+
B(y.z, 0, y.w)
|
|
26596
26599
|
).toVar(), _ = Jt.mul(g.x).add(Jt.oneMinus().mul(g.y)).toVar();
|
|
26597
|
-
n.directSpecular.addAssign(e.mul(_).mul(
|
|
26600
|
+
n.directSpecular.addAssign(e.mul(_).mul(If({ N: d, V: p, P: f, mInv: x, p0: l, p1: c, p2: h, p3: u }))), n.directDiffuse.addAssign(e.mul(Se).mul(If({ N: d, V: p, P: f, mInv: It(1, 0, 0, 0, 1, 0, 0, 0, 1), p0: l, p1: c, p2: h, p3: u })));
|
|
26598
26601
|
}
|
|
26599
26602
|
/**
|
|
26600
26603
|
* Implements the indirect lighting.
|
|
@@ -26636,7 +26639,7 @@ class b0 extends Xl {
|
|
|
26636
26639
|
});
|
|
26637
26640
|
this.clearcoatSpecularIndirect.addAssign(this.clearcoatRadiance.mul(u));
|
|
26638
26641
|
}
|
|
26639
|
-
const n =
|
|
26642
|
+
const n = B().toVar("singleScattering"), r = B().toVar("multiScattering"), o = s.mul(1 / Math.PI);
|
|
26640
26643
|
this.computeMultiscattering(n, r, Cl);
|
|
26641
26644
|
const l = n.add(r), c = Se.mul(l.r.max(l.g).max(l.b).oneMinus());
|
|
26642
26645
|
i.indirectSpecular.addAssign(t.mul(n)), i.indirectSpecular.addAssign(r.mul(o)), i.indirectDiffuse.addAssign(c.mul(o));
|
|
@@ -26909,10 +26912,10 @@ class rR extends Hi {
|
|
|
26909
26912
|
if (t.fog !== s) {
|
|
26910
26913
|
const i = this.getCacheNode("fog", s, () => {
|
|
26911
26914
|
if (s.isFogExp2) {
|
|
26912
|
-
const n =
|
|
26915
|
+
const n = Ie("color", "color", s).setGroup(K), r = Ie("density", "float", s).setGroup(K);
|
|
26913
26916
|
return df(n, kC(r));
|
|
26914
26917
|
} else if (s.isFog) {
|
|
26915
|
-
const n =
|
|
26918
|
+
const n = Ie("color", "color", s).setGroup(K), r = Ie("near", "float", s).setGroup(K), o = Ie("far", "float", s).setGroup(K);
|
|
26916
26919
|
return df(n, UC(r, o));
|
|
26917
26920
|
} else
|
|
26918
26921
|
console.error("THREE.Renderer: Unsupported fog configuration.", s);
|
|
@@ -26977,7 +26980,7 @@ class rR extends Hi {
|
|
|
26977
26980
|
* @return {Node} The output node.
|
|
26978
26981
|
*/
|
|
26979
26982
|
getOutputNode(e) {
|
|
26980
|
-
const t = this.renderer, s = this.getOutputCacheKey(), i = e.isArrayTexture ? EC(e,
|
|
26983
|
+
const t = this.renderer, s = this.getOutputCacheKey(), i = e.isArrayTexture ? EC(e, B(_r, zl("gl_ViewID_OVR"))).renderOutput(t.toneMapping, t.currentColorSpace) : _e(e, _r).renderOutput(t.toneMapping, t.currentColorSpace);
|
|
26981
26984
|
return Gf.set(e, s), i;
|
|
26982
26985
|
}
|
|
26983
26986
|
/**
|
|
@@ -27480,7 +27483,7 @@ class md extends xi {
|
|
|
27480
27483
|
let f = 0;
|
|
27481
27484
|
const m = [], y = s / 2;
|
|
27482
27485
|
let g = 0;
|
|
27483
|
-
x(), r === !1 && (e > 0 && _(!0), t > 0 && _(!1)), this.setIndex(h), this.setAttribute("position", new
|
|
27486
|
+
x(), r === !1 && (e > 0 && _(!0), t > 0 && _(!1)), this.setIndex(h), this.setAttribute("position", new Bt(u, 3)), this.setAttribute("normal", new Bt(d, 3)), this.setAttribute("uv", new Bt(p, 2));
|
|
27484
27487
|
function x() {
|
|
27485
27488
|
const b = new R(), T = new R();
|
|
27486
27489
|
let E = 0;
|
|
@@ -27561,7 +27564,7 @@ class gd extends xi {
|
|
|
27561
27564
|
const _ = x + c * g, b = x + c * (g + 1), T = x + 1 + c * (g + 1), E = x + 1 + c * g;
|
|
27562
27565
|
p.push(_, b, E), p.push(b, T, E);
|
|
27563
27566
|
}
|
|
27564
|
-
this.setIndex(p), this.setAttribute("position", new
|
|
27567
|
+
this.setIndex(p), this.setAttribute("position", new Bt(f, 3)), this.setAttribute("normal", new Bt(m, 3)), this.setAttribute("uv", new Bt(y, 2));
|
|
27565
27568
|
}
|
|
27566
27569
|
copy(e) {
|
|
27567
27570
|
return super.copy(e), this.parameters = Object.assign({}, e.parameters), this;
|
|
@@ -27764,7 +27767,7 @@ class pR extends En {
|
|
|
27764
27767
|
}
|
|
27765
27768
|
);
|
|
27766
27769
|
h.autoAllocateDepthBuffer = !0;
|
|
27767
|
-
const u = new
|
|
27770
|
+
const u = new Bi({ color: 16777215, side: ni });
|
|
27768
27771
|
u.map = h.texture, u.map.offset.y = 1, u.map.repeat.y = -1;
|
|
27769
27772
|
const d = new mi(c, u);
|
|
27770
27773
|
d.position.copy(s), d.quaternion.copy(i);
|
|
@@ -27782,7 +27785,7 @@ class pR extends En {
|
|
|
27782
27785
|
renderTarget: h
|
|
27783
27786
|
};
|
|
27784
27787
|
if (this._layers.push(p), this._session !== null) {
|
|
27785
|
-
p.plane.material = new
|
|
27788
|
+
p.plane.material = new Bi({ color: 16777215, side: ni }), p.plane.material.blending = Ea, p.plane.material.blendEquation = Cs, p.plane.material.blendSrc = Ni, p.plane.material.blendDst = Ni, p.xrlayer = this._createXRLayer(p);
|
|
27786
27789
|
const f = this._session.renderState.layers;
|
|
27787
27790
|
f.unshift(p.xrlayer), this._session.updateRenderState({ layers: f });
|
|
27788
27791
|
} else
|
|
@@ -27830,7 +27833,7 @@ class pR extends En {
|
|
|
27830
27833
|
}
|
|
27831
27834
|
);
|
|
27832
27835
|
u.autoAllocateDepthBuffer = !0;
|
|
27833
|
-
const d = new
|
|
27836
|
+
const d = new Bi({ color: 16777215, side: jt });
|
|
27834
27837
|
d.map = u.texture, d.map.offset.y = 1, d.map.repeat.y = -1;
|
|
27835
27838
|
const p = new mi(h, d);
|
|
27836
27839
|
p.position.copy(i), p.quaternion.copy(n);
|
|
@@ -27849,7 +27852,7 @@ class pR extends En {
|
|
|
27849
27852
|
renderTarget: u
|
|
27850
27853
|
};
|
|
27851
27854
|
if (this._layers.push(f), this._session !== null) {
|
|
27852
|
-
f.plane.material = new
|
|
27855
|
+
f.plane.material = new Bi({ color: 16777215, side: jt }), f.plane.material.blending = Ea, f.plane.material.blendEquation = Cs, f.plane.material.blendSrc = Ni, f.plane.material.blendDst = Ni, f.xrlayer = this._createXRLayer(f);
|
|
27853
27856
|
const m = this._session.renderState.layers;
|
|
27854
27857
|
m.unshift(f.xrlayer), this._session.updateRenderState({ layers: m });
|
|
27855
27858
|
} else
|
|
@@ -27936,7 +27939,7 @@ class pR extends En {
|
|
|
27936
27939
|
}
|
|
27937
27940
|
), this._xrRenderTarget.hasExternalTextures = !0, this._xrRenderTarget.depth = this._useMultiview ? 2 : 1, this._supportsLayers = e.enabledFeatures.includes("layers"), this._referenceSpace = await e.requestReferenceSpace(this.getReferenceSpaceType()), this._supportsLayers)
|
|
27938
27941
|
for (const m of this._layers)
|
|
27939
|
-
m.plane.material = new
|
|
27942
|
+
m.plane.material = new Bi({ color: 16777215, side: m.type === "cylinder" ? jt : ni }), m.plane.material.blending = Ea, m.plane.material.blendEquation = Cs, m.plane.material.blendSrc = Ni, m.plane.material.blendDst = Ni, m.xrlayer = this._createXRLayer(m), d.unshift(m.xrlayer);
|
|
27940
27943
|
e.updateRenderState({ layers: d });
|
|
27941
27944
|
} else {
|
|
27942
27945
|
const r = {
|
|
@@ -28446,7 +28449,7 @@ class TR {
|
|
|
28446
28449
|
modelNormalViewMatrix: null
|
|
28447
28450
|
}, this.library = new T0(), this.lighting = new cR(), this._getFallback = c, this._pixelRatio = 1, this._width = this.domElement.width, this._height = this.domElement.height, this._viewport = new ge(0, 0, this._width, this._height), this._scissor = new ge(0, 0, this._width, this._height), this._scissorTest = !1, this._attributes = null, this._geometries = null, this._nodes = null, this._animation = null, this._bindings = null, this._objects = null, this._pipelines = null, this._bundles = null, this._renderLists = null, this._renderContexts = null, this._textures = null, this._background = null, this._quad = new od(new nt()), this._quad.material.name = "Renderer_output", this._currentRenderContext = null, this._opaqueSort = null, this._transparentSort = null, this._frameBufferTarget = null;
|
|
28448
28451
|
const d = this.alpha === !0 ? 0 : 1;
|
|
28449
|
-
this._clearColor = new
|
|
28452
|
+
this._clearColor = new Bu(0, 0, 0, d), this._clearDepth = 1, this._clearStencil = 0, this._renderTarget = null, this._activeCubeFace = 0, this._activeMipmapLevel = 0, this._outputRenderTarget = null, this._mrt = null, this._renderObjectFunction = null, this._currentRenderObjectFunction = null, this._currentRenderBundle = null, this._handleObjectFunction = this._renderObjectDirect, this._isDeviceLost = !1, this.onDeviceLost = this._onDeviceLost, this._colorBufferType = h, this._initialized = !1, this._initPromise = null, this._compilationPromises = null, this.transparent = !0, this.opaque = !0, this.shadowMap = {
|
|
28450
28453
|
enabled: !1,
|
|
28451
28454
|
type: Ab
|
|
28452
28455
|
}, this.xr = new pR(this, u), this.debug = {
|
|
@@ -31198,7 +31201,7 @@ class A0 {
|
|
|
31198
31201
|
*/
|
|
31199
31202
|
getClearColor() {
|
|
31200
31203
|
const e = this.renderer;
|
|
31201
|
-
return Zn = Zn || new
|
|
31204
|
+
return Zn = Zn || new Bu(), e.getClearColor(Zn), Zn.getRGB(Zn), Zn;
|
|
31202
31205
|
}
|
|
31203
31206
|
/**
|
|
31204
31207
|
* Returns the DOM element. If no DOM element exists, the backend
|
|
@@ -31257,7 +31260,7 @@ class A0 {
|
|
|
31257
31260
|
}
|
|
31258
31261
|
}
|
|
31259
31262
|
let OR = 0;
|
|
31260
|
-
class
|
|
31263
|
+
class BR {
|
|
31261
31264
|
constructor(e, t) {
|
|
31262
31265
|
this.buffers = [e.bufferGPU, t], this.type = e.type, this.bufferType = e.bufferType, this.pbo = e.pbo, this.byteLength = e.byteLength, this.bytesPerElement = e.BYTES_PER_ELEMENT, this.version = e.version, this.isInteger = e.isInteger, this.activeBufferIndex = 0, this.baseId = e.id;
|
|
31263
31266
|
}
|
|
@@ -31274,7 +31277,7 @@ class IR {
|
|
|
31274
31277
|
this.activeBufferIndex ^= 1;
|
|
31275
31278
|
}
|
|
31276
31279
|
}
|
|
31277
|
-
class
|
|
31280
|
+
class IR {
|
|
31278
31281
|
/**
|
|
31279
31282
|
* Constructs a new utility object.
|
|
31280
31283
|
*
|
|
@@ -31325,7 +31328,7 @@ class BR {
|
|
|
31325
31328
|
};
|
|
31326
31329
|
if (e.isStorageBufferAttribute || e.isStorageInstancedBufferAttribute) {
|
|
31327
31330
|
const d = this._createBuffer(i, t, n, r);
|
|
31328
|
-
u = new
|
|
31331
|
+
u = new BR(u, d);
|
|
31329
31332
|
}
|
|
31330
31333
|
s.set(e, u);
|
|
31331
31334
|
}
|
|
@@ -32014,7 +32017,7 @@ class UR {
|
|
|
32014
32017
|
});
|
|
32015
32018
|
}
|
|
32016
32019
|
}
|
|
32017
|
-
let Zf = !1,
|
|
32020
|
+
let Zf = !1, Bo, ch, Kf;
|
|
32018
32021
|
class kR {
|
|
32019
32022
|
/**
|
|
32020
32023
|
* Constructs a new utility object.
|
|
@@ -32031,20 +32034,20 @@ class kR {
|
|
|
32031
32034
|
*/
|
|
32032
32035
|
_init() {
|
|
32033
32036
|
const e = this.gl;
|
|
32034
|
-
|
|
32037
|
+
Bo = {
|
|
32035
32038
|
[wr]: e.REPEAT,
|
|
32036
|
-
[
|
|
32039
|
+
[Ii]: e.CLAMP_TO_EDGE,
|
|
32037
32040
|
[Er]: e.MIRRORED_REPEAT
|
|
32038
32041
|
}, ch = {
|
|
32039
32042
|
[dt]: e.NEAREST,
|
|
32040
32043
|
[Mg]: e.NEAREST_MIPMAP_NEAREST,
|
|
32041
|
-
[
|
|
32044
|
+
[Ia]: e.NEAREST_MIPMAP_LINEAR,
|
|
32042
32045
|
[ns]: e.LINEAR,
|
|
32043
32046
|
[zh]: e.LINEAR_MIPMAP_NEAREST,
|
|
32044
32047
|
[ai]: e.LINEAR_MIPMAP_LINEAR
|
|
32045
32048
|
}, Kf = {
|
|
32046
32049
|
[Rg]: e.NEVER,
|
|
32047
|
-
[
|
|
32050
|
+
[Bg]: e.ALWAYS,
|
|
32048
32051
|
[Nu]: e.LESS,
|
|
32049
32052
|
[Pg]: e.LEQUAL,
|
|
32050
32053
|
[Ng]: e.EQUAL,
|
|
@@ -32099,10 +32102,10 @@ class kR {
|
|
|
32099
32102
|
*/
|
|
32100
32103
|
setTextureParameters(e, t) {
|
|
32101
32104
|
const { gl: s, extensions: i, backend: n } = this, r = ke.getPrimaries(ke.workingColorSpace), o = t.colorSpace === di ? null : ke.getPrimaries(t.colorSpace), l = t.colorSpace === di || r === o ? s.NONE : s.BROWSER_DEFAULT_WEBGL;
|
|
32102
|
-
s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY), s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha), s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment), s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL, l), s.texParameteri(e, s.TEXTURE_WRAP_S,
|
|
32105
|
+
s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY), s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha), s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment), s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL, l), s.texParameteri(e, s.TEXTURE_WRAP_S, Bo[t.wrapS]), s.texParameteri(e, s.TEXTURE_WRAP_T, Bo[t.wrapT]), (e === s.TEXTURE_3D || e === s.TEXTURE_2D_ARRAY) && (t.isArrayTexture || s.texParameteri(e, s.TEXTURE_WRAP_R, Bo[t.wrapR])), s.texParameteri(e, s.TEXTURE_MAG_FILTER, ch[t.magFilter]);
|
|
32103
32106
|
const c = t.mipmaps !== void 0 && t.mipmaps.length > 0, h = t.minFilter === ns && c ? ai : t.minFilter;
|
|
32104
32107
|
if (s.texParameteri(e, s.TEXTURE_MIN_FILTER, ch[h]), t.compareFunction && (s.texParameteri(e, s.TEXTURE_COMPARE_MODE, s.COMPARE_REF_TO_TEXTURE), s.texParameteri(e, s.TEXTURE_COMPARE_FUNC, Kf[t.compareFunction])), i.has("EXT_texture_filter_anisotropic") === !0) {
|
|
32105
|
-
if (t.magFilter === dt || t.minFilter !==
|
|
32108
|
+
if (t.magFilter === dt || t.minFilter !== Ia && t.minFilter !== ai || t.type === is && i.has("OES_texture_float_linear") === !1) return;
|
|
32106
32109
|
if (t.anisotropy > 1) {
|
|
32107
32110
|
const u = i.get("EXT_texture_filter_anisotropic");
|
|
32108
32111
|
s.texParameterf(e, u.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, n.getMaxAnisotropy()));
|
|
@@ -32696,7 +32699,7 @@ class tm extends A0 {
|
|
|
32696
32699
|
};
|
|
32697
32700
|
e.onDeviceLost(o);
|
|
32698
32701
|
}
|
|
32699
|
-
this._onContextLost = n, e.domElement.addEventListener("webglcontextlost", n, !1), this.gl = i, this.extensions = new zR(this), this.capabilities = new GR(this), this.attributeUtils = new
|
|
32702
|
+
this._onContextLost = n, e.domElement.addEventListener("webglcontextlost", n, !1), this.gl = i, this.extensions = new zR(this), this.capabilities = new GR(this), this.attributeUtils = new IR(this), this.textureUtils = new kR(this), this.bufferRenderer = new VR(this), this.state = new LR(this), this.utils = new UR(this), this.extensions.get("EXT_color_buffer_float"), this.extensions.get("WEBGL_clip_cull_distance"), this.extensions.get("OES_texture_float_linear"), this.extensions.get("EXT_color_buffer_half_float"), this.extensions.get("WEBGL_multisampled_render_to_texture"), this.extensions.get("WEBGL_render_shared_exponent"), this.extensions.get("WEBGL_multi_draw"), this.extensions.get("OVR_multiview2"), this.disjoint = this.extensions.get("EXT_disjoint_timer_query_webgl2"), this.parallel = this.extensions.get("KHR_parallel_shader_compile");
|
|
32700
32703
|
}
|
|
32701
32704
|
/**
|
|
32702
32705
|
* The coordinate system of the backend.
|
|
@@ -33924,7 +33927,7 @@ const hr = {
|
|
|
33924
33927
|
ThreeD: "3d"
|
|
33925
33928
|
}, $R = {
|
|
33926
33929
|
All: "all"
|
|
33927
|
-
},
|
|
33930
|
+
}, Io = {
|
|
33928
33931
|
Vertex: "vertex",
|
|
33929
33932
|
Instance: "instance"
|
|
33930
33933
|
}, gu = {
|
|
@@ -34262,7 +34265,7 @@ const KR = {
|
|
|
34262
34265
|
[Pg]: "less-equal",
|
|
34263
34266
|
[Fg]: "greater",
|
|
34264
34267
|
[Og]: "greater-equal",
|
|
34265
|
-
[
|
|
34268
|
+
[Bg]: "always",
|
|
34266
34269
|
[Dg]: "not-equal"
|
|
34267
34270
|
}, QR = [0, 1, 3, 2, 4, 5];
|
|
34268
34271
|
class JR {
|
|
@@ -34738,7 +34741,7 @@ class JR {
|
|
|
34738
34741
|
*/
|
|
34739
34742
|
_convertFilterMode(e) {
|
|
34740
34743
|
let t = mn.Linear;
|
|
34741
|
-
return (e === dt || e === Mg || e ===
|
|
34744
|
+
return (e === dt || e === Mg || e === Ia) && (t = mn.Nearest), t;
|
|
34742
34745
|
}
|
|
34743
34746
|
/**
|
|
34744
34747
|
* Returns the bytes-per-texel value for the given GPU texture format.
|
|
@@ -35162,7 +35165,7 @@ const Kn = typeof self < "u" ? self.GPUShaderStage : { VERTEX: 1, FRAGMENT: 2, C
|
|
|
35162
35165
|
[si.READ_WRITE]: "read_write"
|
|
35163
35166
|
}, am = {
|
|
35164
35167
|
[wr]: "repeat",
|
|
35165
|
-
[
|
|
35168
|
+
[Ii]: "clamp",
|
|
35166
35169
|
[Er]: "mirror"
|
|
35167
35170
|
}, Lo = {
|
|
35168
35171
|
vertex: Kn ? Kn.VERTEX : 1,
|
|
@@ -35329,7 +35332,7 @@ class l1 extends m0 {
|
|
|
35329
35332
|
return ${n}(
|
|
35330
35333
|
`;
|
|
35331
35334
|
const o = (l, c) => {
|
|
35332
|
-
l === wr ? (i.push(ls.repeatWrapping_float), r += ` tsl_repeatWrapping_float( coord.${c} )`) : l ===
|
|
35335
|
+
l === wr ? (i.push(ls.repeatWrapping_float), r += ` tsl_repeatWrapping_float( coord.${c} )`) : l === Ii ? (i.push(ls.clampWrapping_float), r += ` tsl_clampWrapping_float( coord.${c} )`) : l === Er ? (i.push(ls.mirrorWrapping_float), r += ` tsl_mirrorWrapping_float( coord.${c} )`) : (r += ` coord.${c}`, console.warn(`WebGPURenderer: Unsupported texture wrap type "${l}" for vertex shader.`));
|
|
35333
35336
|
};
|
|
35334
35337
|
o(e.wrapS, "x"), r += `,
|
|
35335
35338
|
`, o(e.wrapT, "y"), e.isData3DTexture && (r += `,
|
|
@@ -36546,7 +36549,7 @@ class p1 {
|
|
|
36546
36549
|
let l = s.get(o);
|
|
36547
36550
|
if (l === void 0) {
|
|
36548
36551
|
let u, d;
|
|
36549
|
-
n.isInterleavedBufferAttribute === !0 ? (u = n.data.stride * r, d = n.data.isInstancedInterleavedBuffer ?
|
|
36552
|
+
n.isInterleavedBufferAttribute === !0 ? (u = n.data.stride * r, d = n.data.isInstancedInterleavedBuffer ? Io.Instance : Io.Vertex) : (u = n.itemSize * r, d = n.isInstancedBufferAttribute ? Io.Instance : Io.Vertex), n.normalized === !1 && (n.array.constructor === Int16Array || n.array.constructor === Uint16Array) && (u = 4), l = {
|
|
36550
36553
|
arrayStride: u,
|
|
36551
36554
|
attributes: [],
|
|
36552
36555
|
stepMode: d
|
|
@@ -38507,7 +38510,7 @@ class F0 extends nt {
|
|
|
38507
38510
|
*/
|
|
38508
38511
|
setupEnvironment(e) {
|
|
38509
38512
|
let t = super.setupEnvironment(e);
|
|
38510
|
-
return t === null && e.environmentNode && (t = e.environmentNode), t ? new
|
|
38513
|
+
return t === null && e.environmentNode && (t = e.environmentNode), t ? new BA(t) : null;
|
|
38511
38514
|
}
|
|
38512
38515
|
/**
|
|
38513
38516
|
* Setups the lighting model.
|
|
@@ -38521,7 +38524,7 @@ class F0 extends nt {
|
|
|
38521
38524
|
* Setups the specular related node variables.
|
|
38522
38525
|
*/
|
|
38523
38526
|
setupSpecular() {
|
|
38524
|
-
const e = He(
|
|
38527
|
+
const e = He(B(0.04), Se.rgb, wl);
|
|
38525
38528
|
Jt.assign(e), Cl.assign(1);
|
|
38526
38529
|
}
|
|
38527
38530
|
/**
|
|
@@ -38724,7 +38727,7 @@ class w1 extends F0 {
|
|
|
38724
38727
|
*/
|
|
38725
38728
|
setupSpecular() {
|
|
38726
38729
|
const e = this.iorNode ? O(this.iorNode) : DE;
|
|
38727
|
-
el.assign(e), Jt.assign(He(Mr(yy(el.sub(1).div(el.add(1))).mul(yE),
|
|
38730
|
+
el.assign(e), Jt.assign(He(Mr(yy(el.sub(1).div(el.add(1))).mul(yE), B(1)).mul(Xp), Se.rgb, wl)), Cl.assign(He(Xp, 1, wl));
|
|
38728
38731
|
}
|
|
38729
38732
|
/**
|
|
38730
38733
|
* Setups the lighting model.
|
|
@@ -38745,7 +38748,7 @@ class w1 extends F0 {
|
|
|
38745
38748
|
au.assign(t), El.assign(l0({ roughness: s }));
|
|
38746
38749
|
}
|
|
38747
38750
|
if (this.useSheen) {
|
|
38748
|
-
const t = this.sheenNode ?
|
|
38751
|
+
const t = this.sheenNode ? B(this.sheenNode) : EE, s = this.sheenRoughnessNode ? O(this.sheenRoughnessNode) : CE;
|
|
38749
38752
|
lr.assign(t), Hu.assign(s);
|
|
38750
38753
|
}
|
|
38751
38754
|
if (this.useIridescence) {
|
|
@@ -38761,7 +38764,7 @@ class w1 extends F0 {
|
|
|
38761
38764
|
}), ou.assign(cn.pow2().mix(ti.pow2(), 1)), Jo.assign(xa[0].mul(t.x).add(xa[1].mul(t.y))), xr.assign(xa[1].mul(t.x).sub(xa[0].mul(t.y)));
|
|
38762
38765
|
}
|
|
38763
38766
|
if (this.useTransmission) {
|
|
38764
|
-
const t = this.transmissionNode ? O(this.transmissionNode) : PE, s = this.thicknessNode ? O(this.thicknessNode) : FE, i = this.attenuationDistanceNode ? O(this.attenuationDistanceNode) : OE, n = this.attenuationColorNode ?
|
|
38767
|
+
const t = this.transmissionNode ? O(this.transmissionNode) : PE, s = this.thicknessNode ? O(this.thicknessNode) : FE, i = this.attenuationDistanceNode ? O(this.attenuationDistanceNode) : OE, n = this.attenuationColorNode ? B(this.attenuationColorNode) : BE;
|
|
38765
38768
|
if (cu.assign(t), ny.assign(s), ry.assign(i), ay.assign(n), this.useDispersion) {
|
|
38766
38769
|
const r = this.dispersionNode ? O(this.dispersionNode) : GE;
|
|
38767
38770
|
oy.assign(r);
|
|
@@ -38774,7 +38777,7 @@ class w1 extends F0 {
|
|
|
38774
38777
|
* @return {Node<vec3>} The clearcoat normal.
|
|
38775
38778
|
*/
|
|
38776
38779
|
setupClearcoatNormal() {
|
|
38777
|
-
return this.clearcoatNormalNode ?
|
|
38780
|
+
return this.clearcoatNormalNode ? B(this.clearcoatNormalNode) : vE;
|
|
38778
38781
|
}
|
|
38779
38782
|
setup(e) {
|
|
38780
38783
|
e.context.setupClearcoatNormal = () => this.setupClearcoatNormal(e), super.setup(e);
|
|
@@ -38783,14 +38786,14 @@ class w1 extends F0 {
|
|
|
38783
38786
|
return this.clearcoatNode = e.clearcoatNode, this.clearcoatRoughnessNode = e.clearcoatRoughnessNode, this.clearcoatNormalNode = e.clearcoatNormalNode, this.sheenNode = e.sheenNode, this.sheenRoughnessNode = e.sheenRoughnessNode, this.iridescenceNode = e.iridescenceNode, this.iridescenceIORNode = e.iridescenceIORNode, this.iridescenceThicknessNode = e.iridescenceThicknessNode, this.specularIntensityNode = e.specularIntensityNode, this.specularColorNode = e.specularColorNode, this.transmissionNode = e.transmissionNode, this.thicknessNode = e.thicknessNode, this.attenuationDistanceNode = e.attenuationDistanceNode, this.attenuationColorNode = e.attenuationColorNode, this.dispersionNode = e.dispersionNode, this.anisotropyNode = e.anisotropyNode, super.copy(e);
|
|
38784
38787
|
}
|
|
38785
38788
|
}
|
|
38786
|
-
const E1 = /* @__PURE__ */
|
|
38789
|
+
const E1 = /* @__PURE__ */ I(({ normal: a, lightDirection: e, builder: t }) => {
|
|
38787
38790
|
const s = a.dot(e), i = V(s.mul(0.5).add(0.5), 0);
|
|
38788
38791
|
if (t.material.gradientMap) {
|
|
38789
38792
|
const n = Oi("gradientMap", "texture").context({ getUV: () => i });
|
|
38790
|
-
return
|
|
38793
|
+
return B(n.r);
|
|
38791
38794
|
} else {
|
|
38792
38795
|
const n = i.fwidth().mul(0.5);
|
|
38793
|
-
return He(
|
|
38796
|
+
return He(B(0.7), B(1), Gi(O(0.7).sub(n.x), O(0.7).add(n.x), i.x));
|
|
38794
38797
|
}
|
|
38795
38798
|
});
|
|
38796
38799
|
class C1 extends Xl {
|
|
@@ -38854,7 +38857,7 @@ class R1 extends nt {
|
|
|
38854
38857
|
return new C1();
|
|
38855
38858
|
}
|
|
38856
38859
|
}
|
|
38857
|
-
class N1 extends
|
|
38860
|
+
class N1 extends Br {
|
|
38858
38861
|
static get type() {
|
|
38859
38862
|
return "BasicLightMapNode";
|
|
38860
38863
|
}
|
|
@@ -38871,7 +38874,7 @@ class N1 extends Ir {
|
|
|
38871
38874
|
e.context.irradianceLightMap = this.lightMapNode.mul(t);
|
|
38872
38875
|
}
|
|
38873
38876
|
}
|
|
38874
|
-
const P1 = /* @__PURE__ */ new
|
|
38877
|
+
const P1 = /* @__PURE__ */ new Bi();
|
|
38875
38878
|
class F1 extends nt {
|
|
38876
38879
|
static get type() {
|
|
38877
38880
|
return "MeshBasicNodeMaterial";
|
|
@@ -38951,7 +38954,7 @@ class D1 extends qt {
|
|
|
38951
38954
|
}
|
|
38952
38955
|
}
|
|
38953
38956
|
const O1 = /* @__PURE__ */ new D1();
|
|
38954
|
-
class
|
|
38957
|
+
class B1 extends nt {
|
|
38955
38958
|
static get type() {
|
|
38956
38959
|
return "MeshLambertNodeMaterial";
|
|
38957
38960
|
}
|
|
@@ -38983,7 +38986,7 @@ class I1 extends nt {
|
|
|
38983
38986
|
return new x0(!1);
|
|
38984
38987
|
}
|
|
38985
38988
|
}
|
|
38986
|
-
class
|
|
38989
|
+
class I1 extends qt {
|
|
38987
38990
|
/**
|
|
38988
38991
|
* Constructs a new mesh normal material.
|
|
38989
38992
|
*
|
|
@@ -39000,7 +39003,7 @@ class B1 extends qt {
|
|
|
39000
39003
|
return super.copy(e), this.bumpMap = e.bumpMap, this.bumpScale = e.bumpScale, this.normalMap = e.normalMap, this.normalMapType = e.normalMapType, this.normalScale.copy(e.normalScale), this.displacementMap = e.displacementMap, this.displacementScale = e.displacementScale, this.displacementBias = e.displacementBias, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.flatShading = e.flatShading, this;
|
|
39001
39004
|
}
|
|
39002
39005
|
}
|
|
39003
|
-
const L1 = /* @__PURE__ */ new
|
|
39006
|
+
const L1 = /* @__PURE__ */ new I1();
|
|
39004
39007
|
class U1 extends nt {
|
|
39005
39008
|
static get type() {
|
|
39006
39009
|
return "MeshNormalNodeMaterial";
|
|
@@ -39060,7 +39063,7 @@ class G1 extends nt {
|
|
|
39060
39063
|
setupVariants(e) {
|
|
39061
39064
|
const t = Pw;
|
|
39062
39065
|
let s;
|
|
39063
|
-
e.material.matcap ? s = Oi("matcap", "texture").context({ getUV: () => t }) : s =
|
|
39066
|
+
e.material.matcap ? s = Oi("matcap", "texture").context({ getUV: () => t }) : s = B(He(0.2, 0.8, t.y)), Se.rgb.mulAssign(s.rgb);
|
|
39064
39067
|
}
|
|
39065
39068
|
}
|
|
39066
39069
|
class D0 extends qt {
|
|
@@ -39130,7 +39133,7 @@ class j1 extends nt {
|
|
|
39130
39133
|
* @param {NodeBuilder} builder - The current node builder.
|
|
39131
39134
|
*/
|
|
39132
39135
|
setupVariants() {
|
|
39133
|
-
const e = this.offsetNode ? O(this.offsetNode) : kE, t = this.dashScaleNode ? O(this.dashScaleNode) :
|
|
39136
|
+
const e = this.offsetNode ? O(this.offsetNode) : kE, t = this.dashScaleNode ? O(this.dashScaleNode) : IE, s = this.dashSizeNode ? O(this.dashSizeNode) : LE, i = this.gapSizeNode ? O(this.gapSizeNode) : UE;
|
|
39134
39137
|
xc.assign(s), Up.assign(i);
|
|
39135
39138
|
const n = Ns(Vi("lineDistance").mul(t));
|
|
39136
39139
|
(e ? n.add(e) : n).mod(xc.add(Up)).greaterThan(xc).discard();
|
|
@@ -39174,7 +39177,7 @@ class O0 extends nt {
|
|
|
39174
39177
|
* @return {Node<vec3>} The position in view space.
|
|
39175
39178
|
*/
|
|
39176
39179
|
setupPositionView(e) {
|
|
39177
|
-
const { object: t, camera: s } = e, i = this.sizeAttenuation, { positionNode: n, rotationNode: r, scaleNode: o } = this, l = Gl.mul(
|
|
39180
|
+
const { object: t, camera: s } = e, i = this.sizeAttenuation, { positionNode: n, rotationNode: r, scaleNode: o } = this, l = Gl.mul(B(n || 0));
|
|
39178
39181
|
let c = V(vn[0].xyz.length(), vn[1].xyz.length());
|
|
39179
39182
|
if (o !== null && (c = c.mul(V(o))), i === !1)
|
|
39180
39183
|
if (s.isPerspectiveCamera)
|
|
@@ -39240,7 +39243,7 @@ class K1 extends O0 {
|
|
|
39240
39243
|
}
|
|
39241
39244
|
setupPositionView() {
|
|
39242
39245
|
const { positionNode: e } = this;
|
|
39243
|
-
return Gl.mul(
|
|
39246
|
+
return Gl.mul(B(e || wt)).xyz;
|
|
39244
39247
|
}
|
|
39245
39248
|
setupVertex(e) {
|
|
39246
39249
|
const t = super.setupVertex(e);
|
|
@@ -39918,7 +39921,7 @@ class fN extends T0 {
|
|
|
39918
39921
|
* Constructs a new standard node library.
|
|
39919
39922
|
*/
|
|
39920
39923
|
constructor() {
|
|
39921
|
-
super(), this.addMaterial(b1, "MeshPhongMaterial"), this.addMaterial(F0, "MeshStandardMaterial"), this.addMaterial(w1, "MeshPhysicalMaterial"), this.addMaterial(R1, "MeshToonMaterial"), this.addMaterial(F1, "MeshBasicMaterial"), this.addMaterial(
|
|
39924
|
+
super(), this.addMaterial(b1, "MeshPhongMaterial"), this.addMaterial(F0, "MeshStandardMaterial"), this.addMaterial(w1, "MeshPhysicalMaterial"), this.addMaterial(R1, "MeshToonMaterial"), this.addMaterial(F1, "MeshBasicMaterial"), this.addMaterial(B1, "MeshLambertMaterial"), this.addMaterial(U1, "MeshNormalMaterial"), this.addMaterial(G1, "MeshMatcapMaterial"), this.addMaterial(H1, "LineBasicMaterial"), this.addMaterial(j1, "LineDashedMaterial"), this.addMaterial(K1, "PointsMaterial"), this.addMaterial(O0, "SpriteMaterial"), this.addMaterial(tN, "ShadowMaterial"), this.addLight(_M, iN), this.addLight(MA, rN), this.addLight(AA, aN), this.addLight(dd, Td), this.addLight(FA, lN), this.addLight(DA, cN), this.addLight(OA, uN), this.addLight(RA, dN), this.addLight(PA, pN), this.addToneMapping(MC, Db), this.addToneMapping(AC, Ob), this.addToneMapping(RC, Bb), this.addToneMapping(PC, Ib), this.addToneMapping(BC, Lb), this.addToneMapping(IC, Ub);
|
|
39922
39925
|
}
|
|
39923
39926
|
}
|
|
39924
39927
|
class Uo extends TR {
|
|
@@ -39984,7 +39987,7 @@ class mN extends Us {
|
|
|
39984
39987
|
this.geometry.dispose(), this.material.dispose(), this.children[0].geometry.dispose(), this.children[0].material.dispose();
|
|
39985
39988
|
}
|
|
39986
39989
|
}
|
|
39987
|
-
const dm = { type: "change" }, Sd = { type: "start" },
|
|
39990
|
+
const dm = { type: "change" }, Sd = { type: "start" }, B0 = { type: "end" }, ko = new Cx(), pm = new Mx(), gN = Math.cos(70 * Ax.DEG2RAD), ct = new Z(), Gt = 2 * Math.PI, De = {
|
|
39988
39991
|
NONE: -1,
|
|
39989
39992
|
ROTATE: 0,
|
|
39990
39993
|
DOLLY: 1,
|
|
@@ -40299,7 +40302,7 @@ function _N(a) {
|
|
|
40299
40302
|
function bN(a) {
|
|
40300
40303
|
switch (this._removePointer(a), this._pointers.length) {
|
|
40301
40304
|
case 0:
|
|
40302
|
-
this.domElement.releasePointerCapture(a.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(
|
|
40305
|
+
this.domElement.releasePointerCapture(a.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(B0), this.state = De.NONE;
|
|
40303
40306
|
break;
|
|
40304
40307
|
case 1:
|
|
40305
40308
|
const e = this._pointers[0], t = this._pointerPositions[e];
|
|
@@ -40367,7 +40370,7 @@ function SN(a) {
|
|
|
40367
40370
|
}
|
|
40368
40371
|
}
|
|
40369
40372
|
function vN(a) {
|
|
40370
|
-
this.enabled === !1 || this.enableZoom === !1 || this.state !== De.NONE || (a.preventDefault(), this.dispatchEvent(Sd), this._handleMouseWheel(this._customWheelEvent(a)), this.dispatchEvent(
|
|
40373
|
+
this.enabled === !1 || this.enableZoom === !1 || this.state !== De.NONE || (a.preventDefault(), this.dispatchEvent(Sd), this._handleMouseWheel(this._customWheelEvent(a)), this.dispatchEvent(B0));
|
|
40371
40374
|
}
|
|
40372
40375
|
function wN(a) {
|
|
40373
40376
|
this.enabled !== !1 && this._handleKeyDown(a);
|
|
@@ -40481,14 +40484,14 @@ function tn(a) {
|
|
|
40481
40484
|
function Ai(a) {
|
|
40482
40485
|
return a.isOrthographicCamera;
|
|
40483
40486
|
}
|
|
40484
|
-
const Jn = Math.PI * 2, fm = Math.PI / 2,
|
|
40487
|
+
const Jn = Math.PI * 2, fm = Math.PI / 2, I0 = 1e-5, aa = Math.PI / 180;
|
|
40485
40488
|
function Ss(a, e, t) {
|
|
40486
40489
|
return Math.max(e, Math.min(t, a));
|
|
40487
40490
|
}
|
|
40488
|
-
function Ue(a, e =
|
|
40491
|
+
function Ue(a, e = I0) {
|
|
40489
40492
|
return Math.abs(a) < e;
|
|
40490
40493
|
}
|
|
40491
|
-
function Ae(a, e, t =
|
|
40494
|
+
function Ae(a, e, t = I0) {
|
|
40492
40495
|
return Ue(a - e, t);
|
|
40493
40496
|
}
|
|
40494
40497
|
function mm(a, e) {
|
|
@@ -40600,7 +40603,7 @@ class NN {
|
|
|
40600
40603
|
}
|
|
40601
40604
|
var bh;
|
|
40602
40605
|
const PN = "2.10.1", Go = 1 / 8, FN = /Mac/.test((bh = globalThis?.navigator) === null || bh === void 0 ? void 0 : bh.platform);
|
|
40603
|
-
let J, ym, Vo, Th, Vt, oe, Te, er, ca, Os,
|
|
40606
|
+
let J, ym, Vo, Th, Vt, oe, Te, er, ca, Os, Bs, sn, xm, _m, os, ha, tr, bm, Sh, Tm, vh, wh, Ho;
|
|
40604
40607
|
class zs extends NN {
|
|
40605
40608
|
/**
|
|
40606
40609
|
* Injects THREE as the dependency. You can then proceed to use CameraControls.
|
|
@@ -40643,7 +40646,7 @@ class zs extends NN {
|
|
|
40643
40646
|
* @category Statics
|
|
40644
40647
|
*/
|
|
40645
40648
|
static install(e) {
|
|
40646
|
-
J = e.THREE, ym = Object.freeze(new J.Vector3(0, 0, 0)), Vo = Object.freeze(new J.Vector3(0, 1, 0)), Th = Object.freeze(new J.Vector3(0, 0, 1)), Vt = new J.Vector2(), oe = new J.Vector3(), Te = new J.Vector3(), er = new J.Vector3(), ca = new J.Vector3(), Os = new J.Vector3(),
|
|
40649
|
+
J = e.THREE, ym = Object.freeze(new J.Vector3(0, 0, 0)), Vo = Object.freeze(new J.Vector3(0, 1, 0)), Th = Object.freeze(new J.Vector3(0, 0, 1)), Vt = new J.Vector2(), oe = new J.Vector3(), Te = new J.Vector3(), er = new J.Vector3(), ca = new J.Vector3(), Os = new J.Vector3(), Bs = new J.Vector3(), sn = new J.Vector3(), xm = new J.Vector3(), _m = new J.Vector3(), os = new J.Spherical(), ha = new J.Spherical(), tr = new J.Box3(), bm = new J.Box3(), Sh = new J.Sphere(), Tm = new J.Quaternion(), vh = new J.Quaternion(), wh = new J.Matrix4(), Ho = new J.Raycaster();
|
|
40647
40650
|
}
|
|
40648
40651
|
/**
|
|
40649
40652
|
* list all ACTIONs
|
|
@@ -41194,8 +41197,8 @@ class zs extends NN {
|
|
|
41194
41197
|
* @category Methods
|
|
41195
41198
|
*/
|
|
41196
41199
|
truck(e, t, s = !1) {
|
|
41197
|
-
this._camera.updateMatrix(), Os.setFromMatrixColumn(this._camera.matrix, 0),
|
|
41198
|
-
const i = oe.copy(Os).add(
|
|
41200
|
+
this._camera.updateMatrix(), Os.setFromMatrixColumn(this._camera.matrix, 0), Bs.setFromMatrixColumn(this._camera.matrix, 1), Os.multiplyScalar(e), Bs.multiplyScalar(-t);
|
|
41201
|
+
const i = oe.copy(Os).add(Bs), n = Te.copy(this._targetEnd).add(i);
|
|
41199
41202
|
return this.moveTo(n.x, n.y, n.z, s);
|
|
41200
41203
|
}
|
|
41201
41204
|
/**
|
|
@@ -41389,9 +41392,9 @@ class zs extends NN {
|
|
|
41389
41392
|
* @category Methods
|
|
41390
41393
|
*/
|
|
41391
41394
|
setOrbitPoint(e, t, s) {
|
|
41392
|
-
this._camera.updateMatrixWorld(), Os.setFromMatrixColumn(this._camera.matrixWorldInverse, 0),
|
|
41395
|
+
this._camera.updateMatrixWorld(), Os.setFromMatrixColumn(this._camera.matrixWorldInverse, 0), Bs.setFromMatrixColumn(this._camera.matrixWorldInverse, 1), sn.setFromMatrixColumn(this._camera.matrixWorldInverse, 2);
|
|
41393
41396
|
const i = oe.set(e, t, s), n = i.distanceTo(this._camera.position), r = i.sub(this._camera.position);
|
|
41394
|
-
Os.multiplyScalar(r.x),
|
|
41397
|
+
Os.multiplyScalar(r.x), Bs.multiplyScalar(r.y), sn.multiplyScalar(r.z), oe.copy(Os).add(Bs).add(sn), oe.z = oe.z + n, this.dollyTo(n, !1), this.setFocalOffset(-oe.x, oe.y, -oe.z, !1), this.moveTo(e, t, s, !1);
|
|
41395
41398
|
}
|
|
41396
41399
|
/**
|
|
41397
41400
|
* Set the boundary box that encloses the target of the camera. box3 is in THREE.Box3
|
|
@@ -41607,7 +41610,7 @@ class zs extends NN {
|
|
|
41607
41610
|
}
|
|
41608
41611
|
this._camera.zoom !== this._zoom && (this._camera.zoom = this._zoom, this._camera.updateProjectionMatrix(), this._updateNearPlaneCorners(), this._needsUpdate = !0), this._dragNeedsUpdate = !0;
|
|
41609
41612
|
const l = this._collisionTest();
|
|
41610
|
-
this._spherical.radius = Math.min(this._spherical.radius, l), this._spherical.makeSafe(), this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target), this._camera.lookAt(this._target), (!Ue(this._focalOffset.x) || !Ue(this._focalOffset.y) || !Ue(this._focalOffset.z)) && (Os.setFromMatrixColumn(this._camera.matrix, 0),
|
|
41613
|
+
this._spherical.radius = Math.min(this._spherical.radius, l), this._spherical.makeSafe(), this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target), this._camera.lookAt(this._target), (!Ue(this._focalOffset.x) || !Ue(this._focalOffset.y) || !Ue(this._focalOffset.z)) && (Os.setFromMatrixColumn(this._camera.matrix, 0), Bs.setFromMatrixColumn(this._camera.matrix, 1), sn.setFromMatrixColumn(this._camera.matrix, 2), Os.multiplyScalar(this._focalOffset.x), Bs.multiplyScalar(-this._focalOffset.y), sn.multiplyScalar(this._focalOffset.z), oe.copy(Os).add(Bs).add(sn), this._camera.position.add(oe), this._camera.updateMatrixWorld()), this._boundaryEnclosesCamera && this._encloseToBoundary(this._camera.position.copy(this._target), oe.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse), 1);
|
|
41611
41614
|
const h = this._needsUpdate;
|
|
41612
41615
|
return h && !this._updatedLastTime ? (this._hasRested = !1, this.dispatchEvent({ type: "wake" }), this.dispatchEvent({ type: "update" })) : h ? (this.dispatchEvent({ type: "update" }), Ue(t, this.restThreshold) && Ue(s, this.restThreshold) && Ue(i, this.restThreshold) && Ue(n.x, this.restThreshold) && Ue(n.y, this.restThreshold) && Ue(n.z, this.restThreshold) && Ue(r.x, this.restThreshold) && Ue(r.y, this.restThreshold) && Ue(r.z, this.restThreshold) && Ue(o, this.restThreshold) && !this._hasRested && (this._hasRested = !0, this.dispatchEvent({ type: "rest" }))) : !h && this._updatedLastTime && this.dispatchEvent({ type: "sleep" }), this._lastDistance = this._spherical.radius, this._lastZoom = this._zoom, this._updatedLastTime = h, this._needsUpdate = !1, h;
|
|
41613
41616
|
}
|
|
@@ -41943,7 +41946,7 @@ void main() {
|
|
|
41943
41946
|
|
|
41944
41947
|
if (fragColor.a <= minAlpha) discard;
|
|
41945
41948
|
}`;
|
|
41946
|
-
class
|
|
41949
|
+
class BN extends Zm {
|
|
41947
41950
|
constructor(e) {
|
|
41948
41951
|
super({
|
|
41949
41952
|
extensions: {
|
|
@@ -41979,10 +41982,10 @@ class IN extends Zm {
|
|
|
41979
41982
|
});
|
|
41980
41983
|
}
|
|
41981
41984
|
}
|
|
41982
|
-
class
|
|
41985
|
+
class IN extends Y {
|
|
41983
41986
|
gridMaterial;
|
|
41984
41987
|
constructor(e) {
|
|
41985
|
-
const t = new
|
|
41988
|
+
const t = new BN(e);
|
|
41986
41989
|
super(new Km(), t), this.gridMaterial = t, this.frustumCulled = !1, this.name = "InfiniteGridHelper";
|
|
41987
41990
|
}
|
|
41988
41991
|
update() {
|
|
@@ -42284,7 +42287,7 @@ function Mh(a, e, t) {
|
|
|
42284
42287
|
return s[i];
|
|
42285
42288
|
return !1;
|
|
42286
42289
|
}
|
|
42287
|
-
const $o = new Jm(),
|
|
42290
|
+
const $o = new Jm(), Be = new Z(0, 1, 0), Cm = new Z(0, 0, 0), Mm = new Nl(), Wo = new es(), rl = new es(), Is = new Z(), Am = new Nl(), Ta = new Z(1, 0, 0), un = new Z(0, 1, 0), Sa = new Z(0, 0, 1), jo = new Z(), ua = new Z(), da = new Z();
|
|
42288
42291
|
class jN extends Tr {
|
|
42289
42292
|
constructor(e) {
|
|
42290
42293
|
super(), this.isTransformControlsRoot = !0, this.controls = e, this.visible = !1;
|
|
@@ -42549,10 +42552,10 @@ class qN extends Tr {
|
|
|
42549
42552
|
r.visible = !0, r.rotation.set(0, 0, 0), r.position.copy(this.worldPosition);
|
|
42550
42553
|
let o;
|
|
42551
42554
|
if (this.camera.isOrthographicCamera ? o = (this.camera.top - this.camera.bottom) / this.camera.zoom : o = this.worldPosition.distanceTo(this.cameraPosition) * Math.min(1.9 * Math.tan(Math.PI * this.camera.fov / 360) / this.camera.zoom, 7), r.scale.set(1, 1, 1).multiplyScalar(o * this.size / 4), r.tag === "helper") {
|
|
42552
|
-
r.visible = !1, r.name === "AXIS" ? (r.visible = !!this.axis, this.axis === "X" && (We.setFromEuler($o.set(0, 0, 0)), r.quaternion.copy(s).multiply(We), Math.abs(
|
|
42555
|
+
r.visible = !1, r.name === "AXIS" ? (r.visible = !!this.axis, this.axis === "X" && (We.setFromEuler($o.set(0, 0, 0)), r.quaternion.copy(s).multiply(We), Math.abs(Be.copy(Ta).applyQuaternion(s).dot(this.eye)) > 0.9 && (r.visible = !1)), this.axis === "Y" && (We.setFromEuler($o.set(0, 0, Math.PI / 2)), r.quaternion.copy(s).multiply(We), Math.abs(Be.copy(un).applyQuaternion(s).dot(this.eye)) > 0.9 && (r.visible = !1)), this.axis === "Z" && (We.setFromEuler($o.set(0, Math.PI / 2, 0)), r.quaternion.copy(s).multiply(We), Math.abs(Be.copy(Sa).applyQuaternion(s).dot(this.eye)) > 0.9 && (r.visible = !1)), this.axis === "XYZE" && (We.setFromEuler($o.set(0, Math.PI / 2, 0)), Be.copy(this.rotationAxis), r.quaternion.setFromRotationMatrix(Mm.lookAt(Cm, Be, un)), r.quaternion.multiply(We), r.visible = this.dragging), this.axis === "E" && (r.visible = !1)) : r.name === "START" ? (r.position.copy(this.worldPositionStart), r.visible = this.dragging) : r.name === "END" ? (r.position.copy(this.worldPosition), r.visible = this.dragging) : r.name === "DELTA" ? (r.position.copy(this.worldPositionStart), r.quaternion.copy(this.worldQuaternionStart), vt.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), vt.applyQuaternion(this.worldQuaternionStart.clone().invert()), r.scale.copy(vt), r.visible = this.dragging) : (r.quaternion.copy(s), this.dragging ? r.position.copy(this.worldPositionStart) : r.position.copy(this.worldPosition), this.axis && (r.visible = this.axis.search(r.name) !== -1));
|
|
42553
42556
|
continue;
|
|
42554
42557
|
}
|
|
42555
|
-
r.quaternion.copy(s), this.mode === "translate" || this.mode === "scale" ? (r.name === "X" && Math.abs(
|
|
42558
|
+
r.quaternion.copy(s), this.mode === "translate" || this.mode === "scale" ? (r.name === "X" && Math.abs(Be.copy(Ta).applyQuaternion(s).dot(this.eye)) > 0.99 && (r.scale.set(1e-10, 1e-10, 1e-10), r.visible = !1), r.name === "Y" && Math.abs(Be.copy(un).applyQuaternion(s).dot(this.eye)) > 0.99 && (r.scale.set(1e-10, 1e-10, 1e-10), r.visible = !1), r.name === "Z" && Math.abs(Be.copy(Sa).applyQuaternion(s).dot(this.eye)) > 0.99 && (r.scale.set(1e-10, 1e-10, 1e-10), r.visible = !1), r.name === "XY" && Math.abs(Be.copy(Sa).applyQuaternion(s).dot(this.eye)) < 0.2 && (r.scale.set(1e-10, 1e-10, 1e-10), r.visible = !1), r.name === "YZ" && Math.abs(Be.copy(Ta).applyQuaternion(s).dot(this.eye)) < 0.2 && (r.scale.set(1e-10, 1e-10, 1e-10), r.visible = !1), r.name === "XZ" && Math.abs(Be.copy(un).applyQuaternion(s).dot(this.eye)) < 0.2 && (r.scale.set(1e-10, 1e-10, 1e-10), r.visible = !1)) : this.mode === "rotate" && (Wo.copy(s), Be.copy(this.eye).applyQuaternion(We.copy(s).invert()), r.name.search("E") !== -1 && r.quaternion.setFromRotationMatrix(Mm.lookAt(this.eye, Cm, un)), r.name === "X" && (We.setFromAxisAngle(Ta, Math.atan2(-Be.y, Be.z)), We.multiplyQuaternions(Wo, We), r.quaternion.copy(We)), r.name === "Y" && (We.setFromAxisAngle(un, Math.atan2(Be.x, Be.z)), We.multiplyQuaternions(Wo, We), r.quaternion.copy(We)), r.name === "Z" && (We.setFromAxisAngle(Sa, Math.atan2(Be.y, Be.x)), We.multiplyQuaternions(Wo, We), r.quaternion.copy(We))), r.visible = r.visible && (r.name.indexOf("X") === -1 || this.showX), r.visible = r.visible && (r.name.indexOf("Y") === -1 || this.showY), r.visible = r.visible && (r.name.indexOf("Z") === -1 || this.showZ), r.visible = r.visible && (r.name.indexOf("E") === -1 || this.showX && this.showY && this.showZ), r.material._color = r.material._color || r.material.color.clone(), r.material._opacity = r.material._opacity || r.material.opacity, r.material.color.copy(r.material._color), r.material.opacity = r.material._opacity, this.enabled && this.axis && (r.name === this.axis || this.axis.split("").some(function(l) {
|
|
42556
42559
|
return r.name === l;
|
|
42557
42560
|
})) && (r.material.color.setHex(16776960), r.material.opacity = 1);
|
|
42558
42561
|
}
|
|
@@ -42568,39 +42571,39 @@ class YN extends Y {
|
|
|
42568
42571
|
}
|
|
42569
42572
|
updateMatrixWorld(e) {
|
|
42570
42573
|
let t = this.space;
|
|
42571
|
-
switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), jo.copy(Ta).applyQuaternion(t === "local" ? this.worldQuaternion : rl), ua.copy(un).applyQuaternion(t === "local" ? this.worldQuaternion : rl), da.copy(Sa).applyQuaternion(t === "local" ? this.worldQuaternion : rl),
|
|
42574
|
+
switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), jo.copy(Ta).applyQuaternion(t === "local" ? this.worldQuaternion : rl), ua.copy(un).applyQuaternion(t === "local" ? this.worldQuaternion : rl), da.copy(Sa).applyQuaternion(t === "local" ? this.worldQuaternion : rl), Be.copy(ua), this.mode) {
|
|
42572
42575
|
case "translate":
|
|
42573
42576
|
case "scale":
|
|
42574
42577
|
switch (this.axis) {
|
|
42575
42578
|
case "X":
|
|
42576
|
-
|
|
42579
|
+
Be.copy(this.eye).cross(jo), Is.copy(jo).cross(Be);
|
|
42577
42580
|
break;
|
|
42578
42581
|
case "Y":
|
|
42579
|
-
|
|
42582
|
+
Be.copy(this.eye).cross(ua), Is.copy(ua).cross(Be);
|
|
42580
42583
|
break;
|
|
42581
42584
|
case "Z":
|
|
42582
|
-
|
|
42585
|
+
Be.copy(this.eye).cross(da), Is.copy(da).cross(Be);
|
|
42583
42586
|
break;
|
|
42584
42587
|
case "XY":
|
|
42585
|
-
|
|
42588
|
+
Is.copy(da);
|
|
42586
42589
|
break;
|
|
42587
42590
|
case "YZ":
|
|
42588
|
-
|
|
42591
|
+
Is.copy(jo);
|
|
42589
42592
|
break;
|
|
42590
42593
|
case "XZ":
|
|
42591
|
-
|
|
42594
|
+
Be.copy(da), Is.copy(ua);
|
|
42592
42595
|
break;
|
|
42593
42596
|
case "XYZ":
|
|
42594
42597
|
case "E":
|
|
42595
|
-
|
|
42598
|
+
Is.set(0, 0, 0);
|
|
42596
42599
|
break;
|
|
42597
42600
|
}
|
|
42598
42601
|
break;
|
|
42599
42602
|
case "rotate":
|
|
42600
42603
|
default:
|
|
42601
|
-
|
|
42604
|
+
Is.set(0, 0, 0);
|
|
42602
42605
|
}
|
|
42603
|
-
|
|
42606
|
+
Is.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (Am.lookAt(vt.set(0, 0, 0), Is, Be), this.quaternion.setFromRotationMatrix(Am)), super.updateMatrixWorld(e);
|
|
42604
42607
|
}
|
|
42605
42608
|
}
|
|
42606
42609
|
class _t extends Dm {
|
|
@@ -43208,7 +43211,7 @@ class ut extends Ha {
|
|
|
43208
43211
|
helpersContainer = new Nx();
|
|
43209
43212
|
cameraHelpers = /* @__PURE__ */ new Map();
|
|
43210
43213
|
lightHelpers = /* @__PURE__ */ new Map();
|
|
43211
|
-
grid = new
|
|
43214
|
+
grid = new IN();
|
|
43212
43215
|
interactionHelper = new Px(25);
|
|
43213
43216
|
currentTransform;
|
|
43214
43217
|
// Tools
|
|
@@ -43278,11 +43281,11 @@ class ut extends Ha {
|
|
|
43278
43281
|
const n = {
|
|
43279
43282
|
Vector2: xt,
|
|
43280
43283
|
Vector3: Z,
|
|
43281
|
-
Vector4:
|
|
43284
|
+
Vector4: Ix,
|
|
43282
43285
|
Quaternion: es,
|
|
43283
43286
|
Matrix4: Nl,
|
|
43284
43287
|
Spherical: Dh,
|
|
43285
|
-
Box3:
|
|
43288
|
+
Box3: Bx,
|
|
43286
43289
|
Sphere: Ox,
|
|
43287
43290
|
Raycaster: Da
|
|
43288
43291
|
};
|
|
@@ -44576,8 +44579,8 @@ export {
|
|
|
44576
44579
|
wP as ElementProxy,
|
|
44577
44580
|
C_ as ElementProxyReceiver,
|
|
44578
44581
|
xn as ExportTexture,
|
|
44579
|
-
|
|
44580
|
-
|
|
44582
|
+
IN as InfiniteGridHelper,
|
|
44583
|
+
BN as InfiniteGridMaterial,
|
|
44581
44584
|
sP as Inspector,
|
|
44582
44585
|
ut as MultiView,
|
|
44583
44586
|
rg as NavButton,
|
|
@@ -44612,7 +44615,7 @@ export {
|
|
|
44612
44615
|
SP as generateCubemap,
|
|
44613
44616
|
m_ as getObjectMaterialObject,
|
|
44614
44617
|
f_ as getObjectMaterialProps,
|
|
44615
|
-
|
|
44618
|
+
Ih as hierarchyUUID,
|
|
44616
44619
|
bP as inspectComposer,
|
|
44617
44620
|
y_ as inspectComposerPass,
|
|
44618
44621
|
t_ as isColor,
|
|
@@ -44626,5 +44629,5 @@ export {
|
|
|
44626
44629
|
mP as rgbaToHex,
|
|
44627
44630
|
ws as round,
|
|
44628
44631
|
pP as roundTo,
|
|
44629
|
-
|
|
44632
|
+
Bh as totalThreeObjects
|
|
44630
44633
|
};
|