@mulmoclaude/shapescript-plugin 2.4.0 → 2.5.1
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/README.md +4 -5
- package/dist/core/definition.d.ts.map +1 -1
- package/dist/core/samples.d.ts.map +1 -1
- package/dist/{core-DmD6zaRF.cjs → core-1E7QiANi.cjs} +1 -1
- package/dist/{core-CvNYv5VF.js → core-CiJHiO3H.js} +2 -2
- package/dist/core.cjs +1 -1
- package/dist/core.js +4 -4
- package/dist/export/usdz.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +4 -4
- package/dist/render.cjs +2 -2
- package/dist/render.js +9 -9
- package/dist/{samples-y59fsGq8.js → samples-BwyNyHha.js} +353 -298
- package/dist/{samples-BrJ4z8v-.cjs → samples-b6J0NoFm.cjs} +42 -18
- package/dist/shapescript/meshValues.d.ts +4 -0
- package/dist/shapescript/meshValues.d.ts.map +1 -1
- package/dist/shapescript/parser.d.ts +7 -0
- package/dist/shapescript/parser.d.ts.map +1 -1
- package/dist/shapescript/toThreeJS.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/{toThreeJS-CaZGJjfO.cjs → toThreeJS-BETrskvw.cjs} +4 -4
- package/dist/{toThreeJS-OGEAi4zV.js → toThreeJS-DyLC4g1t.js} +132 -94
- package/dist/vue/index.d.ts +1 -1
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue.cjs +22 -21
- package/dist/vue.js +1078 -1077
- package/package.json +1 -1
package/dist/vue.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as e, h as t, n, o as r, r as i, s as a, t as o, v as s, y as c } from "./samples-
|
|
2
|
-
import { $ as l, A as u, An as d, B as f,
|
|
3
|
-
import { computed as
|
|
1
|
+
import { a as e, h as t, n, o as r, r as i, s as a, t as o, v as s, y as c } from "./samples-BwyNyHha.js";
|
|
2
|
+
import { $ as l, A as u, An as d, B as f, C as p, Cn as m, D as h, Dn as g, E as _, En as v, F as y, Fn as b, G as x, Gt as S, H as C, Hn as w, In as T, J as E, Jt as D, K as O, Kt as k, L as A, Ln as j, M, Mn as ee, N, Nn as P, O as te, On as F, Pn as ne, Q as re, Qt as ie, Rn as ae, S as I, Sn as L, T as oe, Tn as se, U as R, Un as ce, V as le, Vn as ue, W as de, X as fe, Xt as pe, Y as z, Z as me, Zt as he, _ as B, a as ge, an as _e, at as ve, b as ye, bn as be, cn as xe, ct as Se, d as Ce, dn as we, et as Te, f as Ee, fn as De, g as V, gn as Oe, h as ke, ht as Ae, i as je, in as Me, it as H, j as Ne, jn as U, k as Pe, kn as Fe, l as Ie, ln as W, mn as Le, mt as Re, nt as G, o as K, on as ze, ot as Be, p as Ve, pn as He, q, qt as Ue, r as We, rn as Ge, rt as Ke, s as qe, tt as Je, u as Ye, un as Xe, ut as Ze, v as Qe, vn as $e, w as et, wn as tt, x as nt, xn as rt, y as it, yn as at, z as ot } from "./toThreeJS-DyLC4g1t.js";
|
|
3
|
+
import { computed as J, createCommentVNode as st, createElementBlock as ct, createElementVNode as Y, createTextVNode as lt, defineComponent as ut, nextTick as dt, onMounted as ft, onUnmounted as pt, openBlock as mt, ref as ht, toDisplayString as X, unref as gt, vModelText as _t, watch as vt, withDirectives as yt } from "vue";
|
|
4
4
|
import { createUseT as bt, useRuntime as xt } from "gui-chat-protocol/vue";
|
|
5
5
|
//#region ../../../node_modules/three/build/three.module.js
|
|
6
6
|
function St() {
|
|
@@ -243,21 +243,21 @@ var Z = {
|
|
|
243
243
|
sprite_frag: "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n vec3 outgoingLight = vec3( 0.0 );\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n outgoingLight = diffuseColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n}"
|
|
244
244
|
}, Q = {
|
|
245
245
|
common: {
|
|
246
|
-
diffuse: { value: /*@__PURE__*/ new
|
|
246
|
+
diffuse: { value: /*@__PURE__*/ new V(16777215) },
|
|
247
247
|
opacity: { value: 1 },
|
|
248
248
|
map: { value: null },
|
|
249
|
-
mapTransform: { value: /*@__PURE__*/ new
|
|
249
|
+
mapTransform: { value: /*@__PURE__*/ new q() },
|
|
250
250
|
alphaMap: { value: null },
|
|
251
|
-
alphaMapTransform: { value: /*@__PURE__*/ new
|
|
251
|
+
alphaMapTransform: { value: /*@__PURE__*/ new q() },
|
|
252
252
|
alphaTest: { value: 0 }
|
|
253
253
|
},
|
|
254
254
|
specularmap: {
|
|
255
255
|
specularMap: { value: null },
|
|
256
|
-
specularMapTransform: { value: /*@__PURE__*/ new
|
|
256
|
+
specularMapTransform: { value: /*@__PURE__*/ new q() }
|
|
257
257
|
},
|
|
258
258
|
envmap: {
|
|
259
259
|
envMap: { value: null },
|
|
260
|
-
envMapRotation: { value: /*@__PURE__*/ new
|
|
260
|
+
envMapRotation: { value: /*@__PURE__*/ new q() },
|
|
261
261
|
reflectivity: { value: 1 },
|
|
262
262
|
ior: { value: 1.5 },
|
|
263
263
|
refractionRatio: { value: .98 },
|
|
@@ -266,47 +266,47 @@ var Z = {
|
|
|
266
266
|
aomap: {
|
|
267
267
|
aoMap: { value: null },
|
|
268
268
|
aoMapIntensity: { value: 1 },
|
|
269
|
-
aoMapTransform: { value: /*@__PURE__*/ new
|
|
269
|
+
aoMapTransform: { value: /*@__PURE__*/ new q() }
|
|
270
270
|
},
|
|
271
271
|
lightmap: {
|
|
272
272
|
lightMap: { value: null },
|
|
273
273
|
lightMapIntensity: { value: 1 },
|
|
274
|
-
lightMapTransform: { value: /*@__PURE__*/ new
|
|
274
|
+
lightMapTransform: { value: /*@__PURE__*/ new q() }
|
|
275
275
|
},
|
|
276
276
|
bumpmap: {
|
|
277
277
|
bumpMap: { value: null },
|
|
278
|
-
bumpMapTransform: { value: /*@__PURE__*/ new
|
|
278
|
+
bumpMapTransform: { value: /*@__PURE__*/ new q() },
|
|
279
279
|
bumpScale: { value: 1 }
|
|
280
280
|
},
|
|
281
281
|
normalmap: {
|
|
282
282
|
normalMap: { value: null },
|
|
283
|
-
normalMapTransform: { value: /*@__PURE__*/ new
|
|
284
|
-
normalScale: { value: /*@__PURE__*/ new
|
|
283
|
+
normalMapTransform: { value: /*@__PURE__*/ new q() },
|
|
284
|
+
normalScale: { value: /*@__PURE__*/ new L(1, 1) }
|
|
285
285
|
},
|
|
286
286
|
displacementmap: {
|
|
287
287
|
displacementMap: { value: null },
|
|
288
|
-
displacementMapTransform: { value: /*@__PURE__*/ new
|
|
288
|
+
displacementMapTransform: { value: /*@__PURE__*/ new q() },
|
|
289
289
|
displacementScale: { value: 1 },
|
|
290
290
|
displacementBias: { value: 0 }
|
|
291
291
|
},
|
|
292
292
|
emissivemap: {
|
|
293
293
|
emissiveMap: { value: null },
|
|
294
|
-
emissiveMapTransform: { value: /*@__PURE__*/ new
|
|
294
|
+
emissiveMapTransform: { value: /*@__PURE__*/ new q() }
|
|
295
295
|
},
|
|
296
296
|
metalnessmap: {
|
|
297
297
|
metalnessMap: { value: null },
|
|
298
|
-
metalnessMapTransform: { value: /*@__PURE__*/ new
|
|
298
|
+
metalnessMapTransform: { value: /*@__PURE__*/ new q() }
|
|
299
299
|
},
|
|
300
300
|
roughnessmap: {
|
|
301
301
|
roughnessMap: { value: null },
|
|
302
|
-
roughnessMapTransform: { value: /*@__PURE__*/ new
|
|
302
|
+
roughnessMapTransform: { value: /*@__PURE__*/ new q() }
|
|
303
303
|
},
|
|
304
304
|
gradientmap: { gradientMap: { value: null } },
|
|
305
305
|
fog: {
|
|
306
306
|
fogDensity: { value: 25e-5 },
|
|
307
307
|
fogNear: { value: 1 },
|
|
308
308
|
fogFar: { value: 2e3 },
|
|
309
|
-
fogColor: { value: /*@__PURE__*/ new
|
|
309
|
+
fogColor: { value: /*@__PURE__*/ new V(16777215) }
|
|
310
310
|
},
|
|
311
311
|
lights: {
|
|
312
312
|
ambientLightColor: { value: [] },
|
|
@@ -395,35 +395,35 @@ var Z = {
|
|
|
395
395
|
ltc_1: { value: null },
|
|
396
396
|
ltc_2: { value: null },
|
|
397
397
|
probesSH: { value: null },
|
|
398
|
-
probesMin: { value: /*@__PURE__*/ new
|
|
399
|
-
probesMax: { value: /*@__PURE__*/ new
|
|
400
|
-
probesResolution: { value: /*@__PURE__*/ new
|
|
398
|
+
probesMin: { value: /*@__PURE__*/ new m() },
|
|
399
|
+
probesMax: { value: /*@__PURE__*/ new m() },
|
|
400
|
+
probesResolution: { value: /*@__PURE__*/ new m() }
|
|
401
401
|
},
|
|
402
402
|
points: {
|
|
403
|
-
diffuse: { value: /*@__PURE__*/ new
|
|
403
|
+
diffuse: { value: /*@__PURE__*/ new V(16777215) },
|
|
404
404
|
opacity: { value: 1 },
|
|
405
405
|
size: { value: 1 },
|
|
406
406
|
scale: { value: 1 },
|
|
407
407
|
map: { value: null },
|
|
408
408
|
alphaMap: { value: null },
|
|
409
|
-
alphaMapTransform: { value: /*@__PURE__*/ new
|
|
409
|
+
alphaMapTransform: { value: /*@__PURE__*/ new q() },
|
|
410
410
|
alphaTest: { value: 0 },
|
|
411
|
-
uvTransform: { value: /*@__PURE__*/ new
|
|
411
|
+
uvTransform: { value: /*@__PURE__*/ new q() }
|
|
412
412
|
},
|
|
413
413
|
sprite: {
|
|
414
|
-
diffuse: { value: /*@__PURE__*/ new
|
|
414
|
+
diffuse: { value: /*@__PURE__*/ new V(16777215) },
|
|
415
415
|
opacity: { value: 1 },
|
|
416
|
-
center: { value: /*@__PURE__*/ new
|
|
416
|
+
center: { value: /*@__PURE__*/ new L(.5, .5) },
|
|
417
417
|
rotation: { value: 0 },
|
|
418
418
|
map: { value: null },
|
|
419
|
-
mapTransform: { value: /*@__PURE__*/ new
|
|
419
|
+
mapTransform: { value: /*@__PURE__*/ new q() },
|
|
420
420
|
alphaMap: { value: null },
|
|
421
|
-
alphaMapTransform: { value: /*@__PURE__*/ new
|
|
421
|
+
alphaMapTransform: { value: /*@__PURE__*/ new q() },
|
|
422
422
|
alphaTest: { value: 0 }
|
|
423
423
|
}
|
|
424
424
|
}, wt = {
|
|
425
425
|
basic: {
|
|
426
|
-
uniforms: /*@__PURE__*/
|
|
426
|
+
uniforms: /*@__PURE__*/ b([
|
|
427
427
|
Q.common,
|
|
428
428
|
Q.specularmap,
|
|
429
429
|
Q.envmap,
|
|
@@ -435,7 +435,7 @@ var Z = {
|
|
|
435
435
|
fragmentShader: Z.meshbasic_frag
|
|
436
436
|
},
|
|
437
437
|
lambert: {
|
|
438
|
-
uniforms: /*@__PURE__*/
|
|
438
|
+
uniforms: /*@__PURE__*/ b([
|
|
439
439
|
Q.common,
|
|
440
440
|
Q.specularmap,
|
|
441
441
|
Q.envmap,
|
|
@@ -448,7 +448,7 @@ var Z = {
|
|
|
448
448
|
Q.fog,
|
|
449
449
|
Q.lights,
|
|
450
450
|
{
|
|
451
|
-
emissive: { value: /*@__PURE__*/ new
|
|
451
|
+
emissive: { value: /*@__PURE__*/ new V(0) },
|
|
452
452
|
envMapIntensity: { value: 1 }
|
|
453
453
|
}
|
|
454
454
|
]),
|
|
@@ -456,7 +456,7 @@ var Z = {
|
|
|
456
456
|
fragmentShader: Z.meshlambert_frag
|
|
457
457
|
},
|
|
458
458
|
phong: {
|
|
459
|
-
uniforms: /*@__PURE__*/
|
|
459
|
+
uniforms: /*@__PURE__*/ b([
|
|
460
460
|
Q.common,
|
|
461
461
|
Q.specularmap,
|
|
462
462
|
Q.envmap,
|
|
@@ -469,8 +469,8 @@ var Z = {
|
|
|
469
469
|
Q.fog,
|
|
470
470
|
Q.lights,
|
|
471
471
|
{
|
|
472
|
-
emissive: { value: /*@__PURE__*/ new
|
|
473
|
-
specular: { value: /*@__PURE__*/ new
|
|
472
|
+
emissive: { value: /*@__PURE__*/ new V(0) },
|
|
473
|
+
specular: { value: /*@__PURE__*/ new V(1118481) },
|
|
474
474
|
shininess: { value: 30 },
|
|
475
475
|
envMapIntensity: { value: 1 }
|
|
476
476
|
}
|
|
@@ -479,7 +479,7 @@ var Z = {
|
|
|
479
479
|
fragmentShader: Z.meshphong_frag
|
|
480
480
|
},
|
|
481
481
|
standard: {
|
|
482
|
-
uniforms: /*@__PURE__*/
|
|
482
|
+
uniforms: /*@__PURE__*/ b([
|
|
483
483
|
Q.common,
|
|
484
484
|
Q.envmap,
|
|
485
485
|
Q.aomap,
|
|
@@ -493,7 +493,7 @@ var Z = {
|
|
|
493
493
|
Q.fog,
|
|
494
494
|
Q.lights,
|
|
495
495
|
{
|
|
496
|
-
emissive: { value: /*@__PURE__*/ new
|
|
496
|
+
emissive: { value: /*@__PURE__*/ new V(0) },
|
|
497
497
|
roughness: { value: 1 },
|
|
498
498
|
metalness: { value: 0 },
|
|
499
499
|
envMapIntensity: { value: 1 }
|
|
@@ -503,7 +503,7 @@ var Z = {
|
|
|
503
503
|
fragmentShader: Z.meshphysical_frag
|
|
504
504
|
},
|
|
505
505
|
toon: {
|
|
506
|
-
uniforms: /*@__PURE__*/
|
|
506
|
+
uniforms: /*@__PURE__*/ b([
|
|
507
507
|
Q.common,
|
|
508
508
|
Q.aomap,
|
|
509
509
|
Q.lightmap,
|
|
@@ -514,13 +514,13 @@ var Z = {
|
|
|
514
514
|
Q.gradientmap,
|
|
515
515
|
Q.fog,
|
|
516
516
|
Q.lights,
|
|
517
|
-
{ emissive: { value: /*@__PURE__*/ new
|
|
517
|
+
{ emissive: { value: /*@__PURE__*/ new V(0) } }
|
|
518
518
|
]),
|
|
519
519
|
vertexShader: Z.meshtoon_vert,
|
|
520
520
|
fragmentShader: Z.meshtoon_frag
|
|
521
521
|
},
|
|
522
522
|
matcap: {
|
|
523
|
-
uniforms: /*@__PURE__*/
|
|
523
|
+
uniforms: /*@__PURE__*/ b([
|
|
524
524
|
Q.common,
|
|
525
525
|
Q.bumpmap,
|
|
526
526
|
Q.normalmap,
|
|
@@ -532,12 +532,12 @@ var Z = {
|
|
|
532
532
|
fragmentShader: Z.meshmatcap_frag
|
|
533
533
|
},
|
|
534
534
|
points: {
|
|
535
|
-
uniforms: /*@__PURE__*/
|
|
535
|
+
uniforms: /*@__PURE__*/ b([Q.points, Q.fog]),
|
|
536
536
|
vertexShader: Z.points_vert,
|
|
537
537
|
fragmentShader: Z.points_frag
|
|
538
538
|
},
|
|
539
539
|
dashed: {
|
|
540
|
-
uniforms: /*@__PURE__*/
|
|
540
|
+
uniforms: /*@__PURE__*/ b([
|
|
541
541
|
Q.common,
|
|
542
542
|
Q.fog,
|
|
543
543
|
{
|
|
@@ -550,12 +550,12 @@ var Z = {
|
|
|
550
550
|
fragmentShader: Z.linedashed_frag
|
|
551
551
|
},
|
|
552
552
|
depth: {
|
|
553
|
-
uniforms: /*@__PURE__*/
|
|
553
|
+
uniforms: /*@__PURE__*/ b([Q.common, Q.displacementmap]),
|
|
554
554
|
vertexShader: Z.depth_vert,
|
|
555
555
|
fragmentShader: Z.depth_frag
|
|
556
556
|
},
|
|
557
557
|
normal: {
|
|
558
|
-
uniforms: /*@__PURE__*/
|
|
558
|
+
uniforms: /*@__PURE__*/ b([
|
|
559
559
|
Q.common,
|
|
560
560
|
Q.bumpmap,
|
|
561
561
|
Q.normalmap,
|
|
@@ -566,13 +566,13 @@ var Z = {
|
|
|
566
566
|
fragmentShader: Z.meshnormal_frag
|
|
567
567
|
},
|
|
568
568
|
sprite: {
|
|
569
|
-
uniforms: /*@__PURE__*/
|
|
569
|
+
uniforms: /*@__PURE__*/ b([Q.sprite, Q.fog]),
|
|
570
570
|
vertexShader: Z.sprite_vert,
|
|
571
571
|
fragmentShader: Z.sprite_frag
|
|
572
572
|
},
|
|
573
573
|
background: {
|
|
574
574
|
uniforms: {
|
|
575
|
-
uvTransform: { value: /*@__PURE__*/ new
|
|
575
|
+
uvTransform: { value: /*@__PURE__*/ new q() },
|
|
576
576
|
t2D: { value: null },
|
|
577
577
|
backgroundIntensity: { value: 1 }
|
|
578
578
|
},
|
|
@@ -584,7 +584,7 @@ var Z = {
|
|
|
584
584
|
envMap: { value: null },
|
|
585
585
|
backgroundBlurriness: { value: 0 },
|
|
586
586
|
backgroundIntensity: { value: 1 },
|
|
587
|
-
backgroundRotation: { value: /*@__PURE__*/ new
|
|
587
|
+
backgroundRotation: { value: /*@__PURE__*/ new q() }
|
|
588
588
|
},
|
|
589
589
|
vertexShader: Z.backgroundCube_vert,
|
|
590
590
|
fragmentShader: Z.backgroundCube_frag
|
|
@@ -604,11 +604,11 @@ var Z = {
|
|
|
604
604
|
fragmentShader: Z.equirect_frag
|
|
605
605
|
},
|
|
606
606
|
distance: {
|
|
607
|
-
uniforms: /*@__PURE__*/
|
|
607
|
+
uniforms: /*@__PURE__*/ b([
|
|
608
608
|
Q.common,
|
|
609
609
|
Q.displacementmap,
|
|
610
610
|
{
|
|
611
|
-
referencePosition: { value: /*@__PURE__*/ new
|
|
611
|
+
referencePosition: { value: /*@__PURE__*/ new m() },
|
|
612
612
|
nearDistance: { value: 1 },
|
|
613
613
|
farDistance: { value: 1e3 }
|
|
614
614
|
}
|
|
@@ -617,11 +617,11 @@ var Z = {
|
|
|
617
617
|
fragmentShader: Z.distance_frag
|
|
618
618
|
},
|
|
619
619
|
shadow: {
|
|
620
|
-
uniforms: /*@__PURE__*/
|
|
620
|
+
uniforms: /*@__PURE__*/ b([
|
|
621
621
|
Q.lights,
|
|
622
622
|
Q.fog,
|
|
623
623
|
{
|
|
624
|
-
color: { value: /*@__PURE__*/ new
|
|
624
|
+
color: { value: /*@__PURE__*/ new V(0) },
|
|
625
625
|
opacity: { value: 1 }
|
|
626
626
|
}
|
|
627
627
|
]),
|
|
@@ -630,51 +630,51 @@ var Z = {
|
|
|
630
630
|
}
|
|
631
631
|
};
|
|
632
632
|
wt.physical = {
|
|
633
|
-
uniforms: /*@__PURE__*/
|
|
633
|
+
uniforms: /*@__PURE__*/ b([wt.standard.uniforms, {
|
|
634
634
|
clearcoat: { value: 0 },
|
|
635
635
|
clearcoatMap: { value: null },
|
|
636
|
-
clearcoatMapTransform: { value: /*@__PURE__*/ new
|
|
636
|
+
clearcoatMapTransform: { value: /*@__PURE__*/ new q() },
|
|
637
637
|
clearcoatNormalMap: { value: null },
|
|
638
|
-
clearcoatNormalMapTransform: { value: /*@__PURE__*/ new
|
|
639
|
-
clearcoatNormalScale: { value: /*@__PURE__*/ new
|
|
638
|
+
clearcoatNormalMapTransform: { value: /*@__PURE__*/ new q() },
|
|
639
|
+
clearcoatNormalScale: { value: /*@__PURE__*/ new L(1, 1) },
|
|
640
640
|
clearcoatRoughness: { value: 0 },
|
|
641
641
|
clearcoatRoughnessMap: { value: null },
|
|
642
|
-
clearcoatRoughnessMapTransform: { value: /*@__PURE__*/ new
|
|
642
|
+
clearcoatRoughnessMapTransform: { value: /*@__PURE__*/ new q() },
|
|
643
643
|
dispersion: { value: 0 },
|
|
644
644
|
iridescence: { value: 0 },
|
|
645
645
|
iridescenceMap: { value: null },
|
|
646
|
-
iridescenceMapTransform: { value: /*@__PURE__*/ new
|
|
646
|
+
iridescenceMapTransform: { value: /*@__PURE__*/ new q() },
|
|
647
647
|
iridescenceIOR: { value: 1.3 },
|
|
648
648
|
iridescenceThicknessMinimum: { value: 100 },
|
|
649
649
|
iridescenceThicknessMaximum: { value: 400 },
|
|
650
650
|
iridescenceThicknessMap: { value: null },
|
|
651
|
-
iridescenceThicknessMapTransform: { value: /*@__PURE__*/ new
|
|
651
|
+
iridescenceThicknessMapTransform: { value: /*@__PURE__*/ new q() },
|
|
652
652
|
sheen: { value: 0 },
|
|
653
|
-
sheenColor: { value: /*@__PURE__*/ new
|
|
653
|
+
sheenColor: { value: /*@__PURE__*/ new V(0) },
|
|
654
654
|
sheenColorMap: { value: null },
|
|
655
|
-
sheenColorMapTransform: { value: /*@__PURE__*/ new
|
|
655
|
+
sheenColorMapTransform: { value: /*@__PURE__*/ new q() },
|
|
656
656
|
sheenRoughness: { value: 1 },
|
|
657
657
|
sheenRoughnessMap: { value: null },
|
|
658
|
-
sheenRoughnessMapTransform: { value: /*@__PURE__*/ new
|
|
658
|
+
sheenRoughnessMapTransform: { value: /*@__PURE__*/ new q() },
|
|
659
659
|
transmission: { value: 0 },
|
|
660
660
|
transmissionMap: { value: null },
|
|
661
|
-
transmissionMapTransform: { value: /*@__PURE__*/ new
|
|
662
|
-
transmissionSamplerSize: { value: /*@__PURE__*/ new
|
|
661
|
+
transmissionMapTransform: { value: /*@__PURE__*/ new q() },
|
|
662
|
+
transmissionSamplerSize: { value: /*@__PURE__*/ new L() },
|
|
663
663
|
transmissionSamplerMap: { value: null },
|
|
664
664
|
thickness: { value: 0 },
|
|
665
665
|
thicknessMap: { value: null },
|
|
666
|
-
thicknessMapTransform: { value: /*@__PURE__*/ new
|
|
666
|
+
thicknessMapTransform: { value: /*@__PURE__*/ new q() },
|
|
667
667
|
attenuationDistance: { value: 0 },
|
|
668
|
-
attenuationColor: { value: /*@__PURE__*/ new
|
|
669
|
-
specularColor: { value: /*@__PURE__*/ new
|
|
668
|
+
attenuationColor: { value: /*@__PURE__*/ new V(0) },
|
|
669
|
+
specularColor: { value: /*@__PURE__*/ new V(1, 1, 1) },
|
|
670
670
|
specularColorMap: { value: null },
|
|
671
|
-
specularColorMapTransform: { value: /*@__PURE__*/ new
|
|
671
|
+
specularColorMapTransform: { value: /*@__PURE__*/ new q() },
|
|
672
672
|
specularIntensity: { value: 1 },
|
|
673
673
|
specularIntensityMap: { value: null },
|
|
674
|
-
specularIntensityMapTransform: { value: /*@__PURE__*/ new
|
|
675
|
-
anisotropyVector: { value: /*@__PURE__*/ new
|
|
674
|
+
specularIntensityMapTransform: { value: /*@__PURE__*/ new q() },
|
|
675
|
+
anisotropyVector: { value: /*@__PURE__*/ new L() },
|
|
676
676
|
anisotropyMap: { value: null },
|
|
677
|
-
anisotropyMapTransform: { value: /*@__PURE__*/ new
|
|
677
|
+
anisotropyMapTransform: { value: /*@__PURE__*/ new q() }
|
|
678
678
|
}]),
|
|
679
679
|
vertexShader: Z.meshphysical_vert,
|
|
680
680
|
fragmentShader: Z.meshphysical_frag
|
|
@@ -683,10 +683,10 @@ var Tt = {
|
|
|
683
683
|
r: 0,
|
|
684
684
|
b: 0,
|
|
685
685
|
g: 0
|
|
686
|
-
}, Et = /*@__PURE__*/ new
|
|
686
|
+
}, Et = /*@__PURE__*/ new E(), Dt = /*@__PURE__*/ new q();
|
|
687
687
|
Dt.set(-1, 0, 0, 0, 1, 0, 0, 0, 1);
|
|
688
688
|
function Ot(e, t, n, r, i, a) {
|
|
689
|
-
let o = new
|
|
689
|
+
let o = new V(0), s = i === !0 ? 0 : 1, c, l, u = null, d = 0, f = null;
|
|
690
690
|
function p(e) {
|
|
691
691
|
let n = e.isScene === !0 ? e.background : null;
|
|
692
692
|
if (n && n.isTexture) {
|
|
@@ -703,9 +703,9 @@ function Ot(e, t, n, r, i, a) {
|
|
|
703
703
|
}
|
|
704
704
|
function h(t, n) {
|
|
705
705
|
let i = p(n);
|
|
706
|
-
i && (i.isCubeTexture || i.mapping === 306) ? (l === void 0 && (l = new
|
|
706
|
+
i && (i.isCubeTexture || i.mapping === 306) ? (l === void 0 && (l = new z(new Ce(1, 1, 1), new ze({
|
|
707
707
|
name: "BackgroundCubeMaterial",
|
|
708
|
-
uniforms:
|
|
708
|
+
uniforms: F(wt.backgroundCube.uniforms),
|
|
709
709
|
vertexShader: wt.backgroundCube.vertexShader,
|
|
710
710
|
fragmentShader: wt.backgroundCube.fragmentShader,
|
|
711
711
|
side: 1,
|
|
@@ -717,9 +717,9 @@ function Ot(e, t, n, r, i, a) {
|
|
|
717
717
|
this.matrixWorld.copyPosition(n.matrixWorld);
|
|
718
718
|
}, Object.defineProperty(l.material, "envMap", { get: function() {
|
|
719
719
|
return this.uniforms.envMap.value;
|
|
720
|
-
} }), r.update(l)), l.material.uniforms.envMap.value = i, l.material.uniforms.backgroundBlurriness.value = n.backgroundBlurriness, l.material.uniforms.backgroundIntensity.value = n.backgroundIntensity, l.material.uniforms.backgroundRotation.value.setFromMatrix4(Et.makeRotationFromEuler(n.backgroundRotation)).transpose(), i.isCubeTexture && i.isRenderTargetTexture === !1 && l.material.uniforms.backgroundRotation.value.premultiply(Dt), l.material.toneMapped =
|
|
720
|
+
} }), r.update(l)), l.material.uniforms.envMap.value = i, l.material.uniforms.backgroundBlurriness.value = n.backgroundBlurriness, l.material.uniforms.backgroundIntensity.value = n.backgroundIntensity, l.material.uniforms.backgroundRotation.value.setFromMatrix4(Et.makeRotationFromEuler(n.backgroundRotation)).transpose(), i.isCubeTexture && i.isRenderTargetTexture === !1 && l.material.uniforms.backgroundRotation.value.premultiply(Dt), l.material.toneMapped = B.getTransfer(i.colorSpace) !== Me, (u !== i || d !== i.version || f !== e.toneMapping) && (l.material.needsUpdate = !0, u = i, d = i.version, f = e.toneMapping), l.layers.enableAll(), t.unshift(l, l.geometry, l.material, 0, 0, null)) : i && i.isTexture && (c === void 0 && (c = new z(new Be(2, 2), new ze({
|
|
721
721
|
name: "BackgroundMaterial",
|
|
722
|
-
uniforms:
|
|
722
|
+
uniforms: F(wt.background.uniforms),
|
|
723
723
|
vertexShader: wt.background.vertexShader,
|
|
724
724
|
fragmentShader: wt.background.fragmentShader,
|
|
725
725
|
side: 0,
|
|
@@ -729,12 +729,12 @@ function Ot(e, t, n, r, i, a) {
|
|
|
729
729
|
allowOverride: !1
|
|
730
730
|
})), c.geometry.deleteAttribute("normal"), Object.defineProperty(c.material, "map", { get: function() {
|
|
731
731
|
return this.uniforms.t2D.value;
|
|
732
|
-
} }), r.update(c)), c.material.uniforms.t2D.value = i, c.material.uniforms.backgroundIntensity.value = n.backgroundIntensity, c.material.toneMapped =
|
|
732
|
+
} }), r.update(c)), c.material.uniforms.t2D.value = i, c.material.uniforms.backgroundIntensity.value = n.backgroundIntensity, c.material.toneMapped = B.getTransfer(i.colorSpace) !== Me, i.matrixAutoUpdate === !0 && i.updateMatrix(), c.material.uniforms.uvTransform.value.copy(i.matrix), (u !== i || d !== i.version || f !== e.toneMapping) && (c.material.needsUpdate = !0, u = i, d = i.version, f = e.toneMapping), c.layers.enableAll(), t.unshift(c, c.geometry, c.material, 0, 0, null));
|
|
733
733
|
}
|
|
734
734
|
function g(t, r) {
|
|
735
|
-
t.getRGB(Tt,
|
|
735
|
+
t.getRGB(Tt, P(e)), n.buffers.color.setClear(Tt.r, Tt.g, Tt.b, r, a);
|
|
736
736
|
}
|
|
737
|
-
function
|
|
737
|
+
function _() {
|
|
738
738
|
l !== void 0 && (l.geometry.dispose(), l.material.dispose(), l = void 0), c !== void 0 && (c.geometry.dispose(), c.material.dispose(), c = void 0);
|
|
739
739
|
}
|
|
740
740
|
return {
|
|
@@ -752,7 +752,7 @@ function Ot(e, t, n, r, i, a) {
|
|
|
752
752
|
},
|
|
753
753
|
render: m,
|
|
754
754
|
addToRenderList: h,
|
|
755
|
-
dispose:
|
|
755
|
+
dispose: _
|
|
756
756
|
};
|
|
757
757
|
}
|
|
758
758
|
function kt(e, t) {
|
|
@@ -995,9 +995,9 @@ function jt(e, t, n, r) {
|
|
|
995
995
|
return t === "mediump" && e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.MEDIUM_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.MEDIUM_FLOAT).precision > 0 ? "mediump" : "lowp";
|
|
996
996
|
}
|
|
997
997
|
let l = n.precision === void 0 ? "highp" : n.precision, u = c(l);
|
|
998
|
-
u !== l && (
|
|
998
|
+
u !== l && (j("WebGLRenderer:", l, "not supported, using", u, "instead."), l = u);
|
|
999
999
|
let d = n.logarithmicDepthBuffer === !0, f = n.reversedDepthBuffer === !0 && t.has("EXT_clip_control");
|
|
1000
|
-
n.reversedDepthBuffer === !0 && f === !1 &&
|
|
1000
|
+
n.reversedDepthBuffer === !0 && f === !1 && j("WebGLRenderer: Unable to use reversed depth buffer due to missing EXT_clip_control extension. Fallback to default depth buffer.");
|
|
1001
1001
|
let p = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS), m = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS), h = e.getParameter(e.MAX_TEXTURE_SIZE), g = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE), _ = e.getParameter(e.MAX_VERTEX_ATTRIBS), v = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS), y = e.getParameter(e.MAX_VARYING_VECTORS), b = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS), x = e.getParameter(e.MAX_SAMPLES), S = e.getParameter(e.SAMPLES);
|
|
1002
1002
|
return {
|
|
1003
1003
|
isWebGL2: !0,
|
|
@@ -1021,7 +1021,7 @@ function jt(e, t, n, r) {
|
|
|
1021
1021
|
};
|
|
1022
1022
|
}
|
|
1023
1023
|
function Mt(e) {
|
|
1024
|
-
let t = this, n = null, r = 0, i = !1, a = !1, o = new
|
|
1024
|
+
let t = this, n = null, r = 0, i = !1, a = !1, o = new ve(), s = new q(), c = {
|
|
1025
1025
|
value: null,
|
|
1026
1026
|
needsUpdate: !1
|
|
1027
1027
|
};
|
|
@@ -1067,7 +1067,7 @@ var Nt = 4, Pt = [
|
|
|
1067
1067
|
.446,
|
|
1068
1068
|
.526,
|
|
1069
1069
|
.582
|
|
1070
|
-
], Ft = 20, It = 256, Lt = /*@__PURE__*/ new
|
|
1070
|
+
], Ft = 20, It = 256, Lt = /*@__PURE__*/ new Ke(), Rt = /*@__PURE__*/ new V(), zt = null, Bt = 0, Vt = 0, Ht = !1, Ut = /*@__PURE__*/ new m(), Wt = class {
|
|
1071
1071
|
constructor(e) {
|
|
1072
1072
|
this._renderer = e, this._pingPongRenderTarget = null, this._lodMax = 0, this._cubeSize = 0, this._sizeLods = [], this._sigmas = [], this._lodMeshes = [], this._backgroundBox = null, this._cubemapMaterial = null, this._equirectMaterial = null, this._blurMaterial = null, this._ggxMaterial = null;
|
|
1073
1073
|
}
|
|
@@ -1109,12 +1109,12 @@ var Nt = 4, Pt = [
|
|
|
1109
1109
|
}
|
|
1110
1110
|
_allocateTargets() {
|
|
1111
1111
|
let e = 3 * Math.max(this._cubeSize, 112), t = 4 * this._cubeSize, n = {
|
|
1112
|
-
magFilter:
|
|
1113
|
-
minFilter:
|
|
1112
|
+
magFilter: f,
|
|
1113
|
+
minFilter: f,
|
|
1114
1114
|
generateMipmaps: !1,
|
|
1115
|
-
type:
|
|
1116
|
-
format:
|
|
1117
|
-
colorSpace:
|
|
1115
|
+
type: A,
|
|
1116
|
+
format: Re,
|
|
1117
|
+
colorSpace: R,
|
|
1118
1118
|
depthBuffer: !1
|
|
1119
1119
|
}, r = Kt(e, t, n);
|
|
1120
1120
|
if (this._pingPongRenderTarget === null || this._pingPongRenderTarget.width !== e || this._pingPongRenderTarget.height !== t) {
|
|
@@ -1125,11 +1125,11 @@ var Nt = 4, Pt = [
|
|
|
1125
1125
|
return r;
|
|
1126
1126
|
}
|
|
1127
1127
|
_compileMaterial(e) {
|
|
1128
|
-
let t = new
|
|
1128
|
+
let t = new z(new Ve(), e);
|
|
1129
1129
|
this._renderer.compile(t, Lt);
|
|
1130
1130
|
}
|
|
1131
1131
|
_sceneToCubeUV(e, t, n, r, i) {
|
|
1132
|
-
let a = new
|
|
1132
|
+
let a = new H(90, 1, t, n), o = [
|
|
1133
1133
|
1,
|
|
1134
1134
|
-1,
|
|
1135
1135
|
1,
|
|
@@ -1144,7 +1144,7 @@ var Nt = 4, Pt = [
|
|
|
1144
1144
|
-1,
|
|
1145
1145
|
-1
|
|
1146
1146
|
], c = this._renderer, l = c.autoClear, u = c.toneMapping;
|
|
1147
|
-
c.getClearColor(Rt), c.toneMapping = 0, c.autoClear = !1, c.state.buffers.depth.getReversed() && (c.setRenderTarget(r), c.clearDepth(), c.setRenderTarget(null)), this._backgroundBox === null && (this._backgroundBox = new
|
|
1147
|
+
c.getClearColor(Rt), c.toneMapping = 0, c.autoClear = !1, c.state.buffers.depth.getReversed() && (c.setRenderTarget(r), c.clearDepth(), c.setRenderTarget(null)), this._backgroundBox === null && (this._backgroundBox = new z(new Ce(), new fe({
|
|
1148
1148
|
name: "PMREM.Background",
|
|
1149
1149
|
side: 1,
|
|
1150
1150
|
depthWrite: !1,
|
|
@@ -1189,22 +1189,22 @@ var Nt = 4, Pt = [
|
|
|
1189
1189
|
}
|
|
1190
1190
|
_halfBlur(e, t, n, r, i, a, o) {
|
|
1191
1191
|
let s = this._renderer, c = this._blurMaterial;
|
|
1192
|
-
a !== "latitudinal" && a !== "longitudinal" &&
|
|
1192
|
+
a !== "latitudinal" && a !== "longitudinal" && U("blur direction must be either latitudinal or longitudinal!");
|
|
1193
1193
|
let l = this._lodMeshes[r];
|
|
1194
1194
|
l.material = c;
|
|
1195
|
-
let u = c.uniforms,
|
|
1196
|
-
|
|
1197
|
-
let
|
|
1195
|
+
let u = c.uniforms, d = this._sizeLods[n] - 1, f = isFinite(i) ? Math.PI / (2 * d) : 2 * Math.PI / 39, p = i / f, m = isFinite(i) ? 1 + Math.floor(3 * p) : Ft;
|
|
1196
|
+
m > Ft && j(`sigmaRadians, ${i}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${Ft}`);
|
|
1197
|
+
let h = [], g = 0;
|
|
1198
1198
|
for (let e = 0; e < Ft; ++e) {
|
|
1199
|
-
let t = e /
|
|
1200
|
-
|
|
1199
|
+
let t = e / p, n = Math.exp(-t * t / 2);
|
|
1200
|
+
h.push(n), e === 0 ? g += n : e < m && (g += 2 * n);
|
|
1201
1201
|
}
|
|
1202
|
-
for (let e = 0; e <
|
|
1203
|
-
u.envMap.value = e.texture, u.samples.value =
|
|
1204
|
-
let { _lodMax:
|
|
1205
|
-
u.dTheta.value =
|
|
1206
|
-
let
|
|
1207
|
-
qt(t, 3 *
|
|
1202
|
+
for (let e = 0; e < h.length; e++) h[e] = h[e] / g;
|
|
1203
|
+
u.envMap.value = e.texture, u.samples.value = m, u.weights.value = h, u.latitudinal.value = a === "latitudinal", o && (u.poleAxis.value = o);
|
|
1204
|
+
let { _lodMax: _ } = this;
|
|
1205
|
+
u.dTheta.value = f, u.mipInt.value = _ - n;
|
|
1206
|
+
let v = this._sizeLods[r];
|
|
1207
|
+
qt(t, 3 * v * (r > _ - Nt ? r - _ + Nt : 0), 4 * (this._cubeSize - v), 3 * v, 2 * v), s.setRenderTarget(t), s.render(l, Lt);
|
|
1208
1208
|
}
|
|
1209
1209
|
};
|
|
1210
1210
|
function Gt(e) {
|
|
@@ -1260,8 +1260,8 @@ function Gt(e) {
|
|
|
1260
1260
|
];
|
|
1261
1261
|
m.set(i, 6 * e);
|
|
1262
1262
|
}
|
|
1263
|
-
let h = new
|
|
1264
|
-
h.setAttribute("position", new
|
|
1263
|
+
let h = new Ve();
|
|
1264
|
+
h.setAttribute("position", new Ee(f, 3)), h.setAttribute("uv", new Ee(p, 2)), h.setAttribute("faceIndex", new Ee(m, 1)), r.push(new z(h, null)), i > Nt && i--;
|
|
1265
1265
|
}
|
|
1266
1266
|
return {
|
|
1267
1267
|
lodMeshes: r,
|
|
@@ -1270,14 +1270,14 @@ function Gt(e) {
|
|
|
1270
1270
|
};
|
|
1271
1271
|
}
|
|
1272
1272
|
function Kt(e, t, n) {
|
|
1273
|
-
let r = new
|
|
1273
|
+
let r = new v(e, t, n);
|
|
1274
1274
|
return r.texture.mapping = 306, r.texture.name = "PMREM.cubeUv", r.scissorTest = !0, r;
|
|
1275
1275
|
}
|
|
1276
1276
|
function qt(e, t, n, r, i) {
|
|
1277
1277
|
e.viewport.set(t, n, r, i), e.scissor.set(t, n, r, i);
|
|
1278
1278
|
}
|
|
1279
1279
|
function Jt(e, t, n) {
|
|
1280
|
-
return new
|
|
1280
|
+
return new ze({
|
|
1281
1281
|
name: "PMREMGGXConvolution",
|
|
1282
1282
|
defines: {
|
|
1283
1283
|
GGX_SAMPLES: It,
|
|
@@ -1298,8 +1298,8 @@ function Jt(e, t, n) {
|
|
|
1298
1298
|
});
|
|
1299
1299
|
}
|
|
1300
1300
|
function Yt(e, t, n) {
|
|
1301
|
-
let r = new Float32Array(Ft), i = new
|
|
1302
|
-
return new
|
|
1301
|
+
let r = new Float32Array(Ft), i = new m(0, 1, 0);
|
|
1302
|
+
return new ze({
|
|
1303
1303
|
name: "SphericalGaussianBlur",
|
|
1304
1304
|
defines: {
|
|
1305
1305
|
n: Ft,
|
|
@@ -1324,7 +1324,7 @@ function Yt(e, t, n) {
|
|
|
1324
1324
|
});
|
|
1325
1325
|
}
|
|
1326
1326
|
function Xt() {
|
|
1327
|
-
return new
|
|
1327
|
+
return new ze({
|
|
1328
1328
|
name: "EquirectangularToCubeUV",
|
|
1329
1329
|
uniforms: { envMap: { value: null } },
|
|
1330
1330
|
vertexShader: Qt(),
|
|
@@ -1335,7 +1335,7 @@ function Xt() {
|
|
|
1335
1335
|
});
|
|
1336
1336
|
}
|
|
1337
1337
|
function Zt() {
|
|
1338
|
-
return new
|
|
1338
|
+
return new ze({
|
|
1339
1339
|
name: "CubemapToCubeUV",
|
|
1340
1340
|
uniforms: {
|
|
1341
1341
|
envMap: { value: null },
|
|
@@ -1351,7 +1351,7 @@ function Zt() {
|
|
|
1351
1351
|
function Qt() {
|
|
1352
1352
|
return "\n\n precision mediump float;\n precision mediump int;\n\n attribute float faceIndex;\n\n varying vec3 vOutputDirection;\n\n // RH coordinate system; PMREM face-indexing convention\n vec3 getDirection( vec2 uv, float face ) {\n\n uv = 2.0 * uv - 1.0;\n\n vec3 direction = vec3( uv, 1.0 );\n\n if ( face == 0.0 ) {\n\n direction = direction.zyx; // ( 1, v, u ) pos x\n\n } else if ( face == 1.0 ) {\n\n direction = direction.xzy;\n direction.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n } else if ( face == 2.0 ) {\n\n direction.x *= -1.0; // ( -u, v, 1 ) pos z\n\n } else if ( face == 3.0 ) {\n\n direction = direction.zyx;\n direction.xz *= -1.0; // ( -1, v, -u ) neg x\n\n } else if ( face == 4.0 ) {\n\n direction = direction.xzy;\n direction.xy *= -1.0; // ( -u, -1, v ) neg y\n\n } else if ( face == 5.0 ) {\n\n direction.z *= -1.0; // ( u, v, -1 ) neg z\n\n }\n\n return direction;\n\n }\n\n void main() {\n\n vOutputDirection = getDirection( uv, faceIndex );\n gl_Position = vec4( position, 1.0 );\n\n }\n ";
|
|
1353
1353
|
}
|
|
1354
|
-
var $t = class extends
|
|
1354
|
+
var $t = class extends v {
|
|
1355
1355
|
constructor(e = 1, t = {}) {
|
|
1356
1356
|
super(e, e, t), this.isWebGLCubeRenderTarget = !0;
|
|
1357
1357
|
let n = {
|
|
@@ -1374,17 +1374,17 @@ var $t = class extends se {
|
|
|
1374
1374
|
uniforms: { tEquirect: { value: null } },
|
|
1375
1375
|
vertexShader: "\n\n varying vec3 vWorldDirection;\n\n vec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n }\n\n void main() {\n\n vWorldDirection = transformDirection( position, modelMatrix );\n\n #include <begin_vertex>\n #include <project_vertex>\n\n }\n ",
|
|
1376
1376
|
fragmentShader: "\n\n uniform sampler2D tEquirect;\n\n varying vec3 vWorldDirection;\n\n #include <common>\n\n void main() {\n\n vec3 direction = normalize( vWorldDirection );\n\n vec2 sampleUV = equirectUv( direction );\n\n gl_FragColor = texture2D( tEquirect, sampleUV );\n\n }\n "
|
|
1377
|
-
}, r = new
|
|
1377
|
+
}, r = new Ce(5, 5, 5), i = new ze({
|
|
1378
1378
|
name: "CubemapFromEquirect",
|
|
1379
|
-
uniforms:
|
|
1379
|
+
uniforms: F(n.uniforms),
|
|
1380
1380
|
vertexShader: n.vertexShader,
|
|
1381
1381
|
fragmentShader: n.fragmentShader,
|
|
1382
1382
|
side: 1,
|
|
1383
1383
|
blending: 0
|
|
1384
1384
|
});
|
|
1385
1385
|
i.uniforms.tEquirect.value = t;
|
|
1386
|
-
let a = new
|
|
1387
|
-
return t.minFilter === 1008 && (t.minFilter =
|
|
1386
|
+
let a = new z(r, i), o = t.minFilter;
|
|
1387
|
+
return t.minFilter === 1008 && (t.minFilter = f), new it(1, 10, this).update(e, a), t.minFilter = o, a.geometry.dispose(), a.material.dispose(), this;
|
|
1388
1388
|
}
|
|
1389
1389
|
clear(e, t = !0, n = !0, r = !0) {
|
|
1390
1390
|
let i = e.getRenderTarget();
|
|
@@ -1476,7 +1476,7 @@ function tn(e) {
|
|
|
1476
1476
|
},
|
|
1477
1477
|
get: function(e) {
|
|
1478
1478
|
let t = n(e);
|
|
1479
|
-
return t === null &&
|
|
1479
|
+
return t === null && ae("WebGLRenderer: " + e + " extension not supported."), t;
|
|
1480
1480
|
}
|
|
1481
1481
|
};
|
|
1482
1482
|
}
|
|
@@ -1515,7 +1515,7 @@ function nn(e, t, n, r) {
|
|
|
1515
1515
|
n.push(e, r, r, i, i, e);
|
|
1516
1516
|
}
|
|
1517
1517
|
}
|
|
1518
|
-
let s = new (i.count >= 65535 ?
|
|
1518
|
+
let s = new (i.count >= 65535 ? De : we)(n, 1);
|
|
1519
1519
|
s.version = o;
|
|
1520
1520
|
let c = a.get(e);
|
|
1521
1521
|
c && t.remove(c), a.set(e, s);
|
|
@@ -1586,7 +1586,7 @@ function an(e) {
|
|
|
1586
1586
|
case e.POINTS:
|
|
1587
1587
|
n.points += i * t;
|
|
1588
1588
|
break;
|
|
1589
|
-
default:
|
|
1589
|
+
default: U("WebGLInfo: Unknown draw mode:", r);
|
|
1590
1590
|
}
|
|
1591
1591
|
}
|
|
1592
1592
|
function i() {
|
|
@@ -1602,20 +1602,20 @@ function an(e) {
|
|
|
1602
1602
|
};
|
|
1603
1603
|
}
|
|
1604
1604
|
function on(e, t, n) {
|
|
1605
|
-
let r = /* @__PURE__ */ new WeakMap(), i = new
|
|
1605
|
+
let r = /* @__PURE__ */ new WeakMap(), i = new tt();
|
|
1606
1606
|
function a(a, o, s) {
|
|
1607
1607
|
let c = a.morphTargetInfluences, l = o.morphAttributes.position || o.morphAttributes.normal || o.morphAttributes.color, u = l === void 0 ? 0 : l.length, d = r.get(o);
|
|
1608
1608
|
if (d === void 0 || d.count !== u) {
|
|
1609
1609
|
d !== void 0 && d.texture.dispose();
|
|
1610
1610
|
let e = o.morphAttributes.position !== void 0, n = o.morphAttributes.normal !== void 0, a = o.morphAttributes.color !== void 0, s = o.morphAttributes.position || [], c = o.morphAttributes.normal || [], l = o.morphAttributes.color || [], f = 0;
|
|
1611
1611
|
e === !0 && (f = 1), n === !0 && (f = 2), a === !0 && (f = 3);
|
|
1612
|
-
let
|
|
1613
|
-
|
|
1614
|
-
let g = new Float32Array(
|
|
1612
|
+
let m = o.attributes.position.count * f, h = 1;
|
|
1613
|
+
m > t.maxTextureSize && (h = Math.ceil(m / t.maxTextureSize), m = t.maxTextureSize);
|
|
1614
|
+
let g = new Float32Array(m * h * 4 * u), _ = new p(g, m, h, u);
|
|
1615
1615
|
_.type = M, _.needsUpdate = !0;
|
|
1616
1616
|
let v = f * 4;
|
|
1617
1617
|
for (let t = 0; t < u; t++) {
|
|
1618
|
-
let r = s[t], o = c[t], u = l[t], d =
|
|
1618
|
+
let r = s[t], o = c[t], u = l[t], d = m * h * 4 * t;
|
|
1619
1619
|
for (let t = 0; t < r.count; t++) {
|
|
1620
1620
|
let s = t * v;
|
|
1621
1621
|
e === !0 && (i.fromBufferAttribute(r, t), g[d + s + 0] = i.x, g[d + s + 1] = i.y, g[d + s + 2] = i.z, g[d + s + 3] = 0), n === !0 && (i.fromBufferAttribute(o, t), g[d + s + 4] = i.x, g[d + s + 5] = i.y, g[d + s + 6] = i.z, g[d + s + 7] = 0), a === !0 && (i.fromBufferAttribute(u, t), g[d + s + 8] = i.x, g[d + s + 9] = i.y, g[d + s + 10] = i.z, g[d + s + 11] = u.itemSize === 4 ? i.w : 1);
|
|
@@ -1624,7 +1624,7 @@ function on(e, t, n) {
|
|
|
1624
1624
|
d = {
|
|
1625
1625
|
count: u,
|
|
1626
1626
|
texture: _,
|
|
1627
|
-
size: new
|
|
1627
|
+
size: new L(m, h)
|
|
1628
1628
|
}, r.set(o, d);
|
|
1629
1629
|
function y() {
|
|
1630
1630
|
_.dispose(), r.delete(o), o.removeEventListener("dispose", y);
|
|
@@ -1674,18 +1674,18 @@ var cn = {
|
|
|
1674
1674
|
5: "CUSTOM_TONE_MAPPING"
|
|
1675
1675
|
};
|
|
1676
1676
|
function ln(e, t, n, r, i, a) {
|
|
1677
|
-
let o = new
|
|
1677
|
+
let o = new v(t, n, {
|
|
1678
1678
|
type: e,
|
|
1679
1679
|
depthBuffer: i,
|
|
1680
1680
|
stencilBuffer: a,
|
|
1681
1681
|
samples: r ? 4 : 0,
|
|
1682
|
-
depthTexture: i ? new
|
|
1683
|
-
}), s = new
|
|
1684
|
-
type:
|
|
1682
|
+
depthTexture: i ? new h(t, n) : void 0
|
|
1683
|
+
}), s = new v(t, n, {
|
|
1684
|
+
type: A,
|
|
1685
1685
|
depthBuffer: !1,
|
|
1686
1686
|
stencilBuffer: !1
|
|
1687
|
-
}), c = new
|
|
1688
|
-
c.setAttribute("position", new
|
|
1687
|
+
}), c = new Ve();
|
|
1688
|
+
c.setAttribute("position", new Ne([
|
|
1689
1689
|
-1,
|
|
1690
1690
|
3,
|
|
1691
1691
|
0,
|
|
@@ -1695,7 +1695,7 @@ function ln(e, t, n, r, i, a) {
|
|
|
1695
1695
|
3,
|
|
1696
1696
|
-1,
|
|
1697
1697
|
0
|
|
1698
|
-
], 3)), c.setAttribute("uv", new
|
|
1698
|
+
], 3)), c.setAttribute("uv", new Ne([
|
|
1699
1699
|
0,
|
|
1700
1700
|
2,
|
|
1701
1701
|
0,
|
|
@@ -1703,47 +1703,47 @@ function ln(e, t, n, r, i, a) {
|
|
|
1703
1703
|
2,
|
|
1704
1704
|
0
|
|
1705
1705
|
], 2));
|
|
1706
|
-
let l = new
|
|
1706
|
+
let l = new Ue({
|
|
1707
1707
|
uniforms: { tDiffuse: { value: null } },
|
|
1708
1708
|
vertexShader: "\n precision highp float;\n\n uniform mat4 modelViewMatrix;\n uniform mat4 projectionMatrix;\n\n attribute vec3 position;\n attribute vec2 uv;\n\n varying vec2 vUv;\n\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",
|
|
1709
1709
|
fragmentShader: "\n precision highp float;\n\n uniform sampler2D tDiffuse;\n\n varying vec2 vUv;\n\n #include <tonemapping_pars_fragment>\n #include <colorspace_pars_fragment>\n\n void main() {\n gl_FragColor = texture2D( tDiffuse, vUv );\n\n #ifdef LINEAR_TONE_MAPPING\n gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb );\n #elif defined( REINHARD_TONE_MAPPING )\n gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb );\n #elif defined( CINEON_TONE_MAPPING )\n gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb );\n #elif defined( ACES_FILMIC_TONE_MAPPING )\n gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb );\n #elif defined( AGX_TONE_MAPPING )\n gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb );\n #elif defined( NEUTRAL_TONE_MAPPING )\n gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb );\n #elif defined( CUSTOM_TONE_MAPPING )\n gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb );\n #endif\n\n #ifdef SRGB_TRANSFER\n gl_FragColor = sRGBTransferOETF( gl_FragColor );\n #endif\n }",
|
|
1710
1710
|
depthTest: !1,
|
|
1711
1711
|
depthWrite: !1
|
|
1712
|
-
}), u = new
|
|
1712
|
+
}), u = new z(c, l), d = new Ke(-1, 1, 1, -1, 0, 1), f = null, p = null, m = !1, g, _ = null, y = [], b = !1;
|
|
1713
1713
|
this.setSize = function(e, t) {
|
|
1714
1714
|
o.setSize(e, t), s.setSize(e, t);
|
|
1715
|
-
for (let n = 0; n <
|
|
1716
|
-
let r =
|
|
1715
|
+
for (let n = 0; n < y.length; n++) {
|
|
1716
|
+
let r = y[n];
|
|
1717
1717
|
r.setSize && r.setSize(e, t);
|
|
1718
1718
|
}
|
|
1719
1719
|
}, this.setEffects = function(e) {
|
|
1720
|
-
|
|
1720
|
+
y = e, b = y.length > 0 && y[0].isRenderPass === !0;
|
|
1721
1721
|
let t = o.width, n = o.height;
|
|
1722
|
-
for (let e = 0; e <
|
|
1723
|
-
let r =
|
|
1722
|
+
for (let e = 0; e < y.length; e++) {
|
|
1723
|
+
let r = y[e];
|
|
1724
1724
|
r.setSize && r.setSize(t, n);
|
|
1725
1725
|
}
|
|
1726
1726
|
}, this.begin = function(e, t) {
|
|
1727
|
-
if (m || e.toneMapping === 0 &&
|
|
1727
|
+
if (m || e.toneMapping === 0 && y.length === 0) return !1;
|
|
1728
1728
|
if (_ = t, t !== null) {
|
|
1729
1729
|
let e = t.width, n = t.height;
|
|
1730
1730
|
(o.width !== e || o.height !== n) && this.setSize(e, n);
|
|
1731
1731
|
}
|
|
1732
|
-
return
|
|
1732
|
+
return b === !1 && e.setRenderTarget(o), g = e.toneMapping, e.toneMapping = 0, !0;
|
|
1733
1733
|
}, this.hasRenderPass = function() {
|
|
1734
|
-
return
|
|
1734
|
+
return b;
|
|
1735
1735
|
}, this.end = function(e, t) {
|
|
1736
|
-
e.toneMapping =
|
|
1736
|
+
e.toneMapping = g, m = !0;
|
|
1737
1737
|
let n = o, r = s;
|
|
1738
|
-
for (let i = 0; i <
|
|
1739
|
-
let a =
|
|
1738
|
+
for (let i = 0; i < y.length; i++) {
|
|
1739
|
+
let a = y[i];
|
|
1740
1740
|
if (a.enabled !== !1 && (a.render(e, r, n, t), a.needsSwap !== !1)) {
|
|
1741
1741
|
let e = n;
|
|
1742
1742
|
n = r, r = e;
|
|
1743
1743
|
}
|
|
1744
1744
|
}
|
|
1745
1745
|
if (f !== e.outputColorSpace || p !== e.toneMapping) {
|
|
1746
|
-
f = e.outputColorSpace, p = e.toneMapping, l.defines = {},
|
|
1746
|
+
f = e.outputColorSpace, p = e.toneMapping, l.defines = {}, B.getTransfer(f) === "srgb" && (l.defines.SRGB_TRANSFER = "");
|
|
1747
1747
|
let t = cn[p];
|
|
1748
1748
|
t && (l.defines[t] = ""), l.needsUpdate = !0;
|
|
1749
1749
|
}
|
|
@@ -1754,7 +1754,7 @@ function ln(e, t, n, r, i, a) {
|
|
|
1754
1754
|
o.depthTexture && o.depthTexture.dispose(), o.dispose(), s.dispose(), c.dispose(), l.dispose();
|
|
1755
1755
|
};
|
|
1756
1756
|
}
|
|
1757
|
-
var un = /*@__PURE__*/ new
|
|
1757
|
+
var un = /*@__PURE__*/ new Xe(), dn = /*@__PURE__*/ new h(1, 1), fn = /*@__PURE__*/ new p(), pn = /*@__PURE__*/ new I(), mn = /*@__PURE__*/ new nt(), hn = [], gn = [], _n = /* @__PURE__ */ new Float32Array(16), vn = /* @__PURE__ */ new Float32Array(9), yn = /* @__PURE__ */ new Float32Array(4);
|
|
1758
1758
|
function bn(e, t, n) {
|
|
1759
1759
|
let r = e[0];
|
|
1760
1760
|
if (r <= 0 || r > 0) return e;
|
|
@@ -2148,14 +2148,14 @@ function br(e, t) {
|
|
|
2148
2148
|
}
|
|
2149
2149
|
return r.join("\n");
|
|
2150
2150
|
}
|
|
2151
|
-
var xr = /*@__PURE__*/ new
|
|
2151
|
+
var xr = /*@__PURE__*/ new q();
|
|
2152
2152
|
function Sr(e) {
|
|
2153
|
-
|
|
2153
|
+
B._getMatrix(xr, B.workingColorSpace, e);
|
|
2154
2154
|
let t = `mat3( ${xr.elements.map((e) => e.toFixed(4))} )`;
|
|
2155
|
-
switch (
|
|
2156
|
-
case
|
|
2157
|
-
case
|
|
2158
|
-
default: return
|
|
2155
|
+
switch (B.getTransfer(e)) {
|
|
2156
|
+
case de: return [t, "LinearTransferOETF"];
|
|
2157
|
+
case Me: return [t, "sRGBTransferOETF"];
|
|
2158
|
+
default: return j("WebGLProgram: Unsupported color space: ", e), [t, "LinearTransferOETF"];
|
|
2159
2159
|
}
|
|
2160
2160
|
}
|
|
2161
2161
|
function Cr(e, t, n) {
|
|
@@ -2187,11 +2187,11 @@ var Tr = {
|
|
|
2187
2187
|
};
|
|
2188
2188
|
function Er(e, t) {
|
|
2189
2189
|
let n = Tr[t];
|
|
2190
|
-
return n === void 0 ? (
|
|
2190
|
+
return n === void 0 ? (j("WebGLProgram: Unsupported toneMapping:", t), "vec3 " + e + "( vec3 color ) { return LinearToneMapping( color ); }") : "vec3 " + e + "( vec3 color ) { return " + n + "ToneMapping( color ); }";
|
|
2191
2191
|
}
|
|
2192
|
-
var Dr = /*@__PURE__*/ new
|
|
2192
|
+
var Dr = /*@__PURE__*/ new m();
|
|
2193
2193
|
function Or() {
|
|
2194
|
-
return
|
|
2194
|
+
return B.getLuminanceCoefficients(Dr), [
|
|
2195
2195
|
"float luminance( const in vec3 rgb ) {",
|
|
2196
2196
|
` const vec3 weights = vec3( ${Dr.x.toFixed(4)}, ${Dr.y.toFixed(4)}, ${Dr.z.toFixed(4)} );`,
|
|
2197
2197
|
" return dot( weights, rgb );",
|
|
@@ -2240,7 +2240,7 @@ function Rr(e, t) {
|
|
|
2240
2240
|
let n = Z[t];
|
|
2241
2241
|
if (n === void 0) {
|
|
2242
2242
|
let e = Lr.get(t);
|
|
2243
|
-
if (e !== void 0) n = Z[e],
|
|
2243
|
+
if (e !== void 0) n = Z[e], j("WebGLRenderer: Shader chunk \"%s\" has been deprecated. Use \"%s\" instead.", t, e);
|
|
2244
2244
|
else throw Error("THREE.WebGLProgram: Can not resolve #include <" + t + ">");
|
|
2245
2245
|
}
|
|
2246
2246
|
return Ir(n);
|
|
@@ -2313,20 +2313,20 @@ function Zr(e) {
|
|
|
2313
2313
|
};
|
|
2314
2314
|
}
|
|
2315
2315
|
function Qr(e, t, n, r) {
|
|
2316
|
-
let i = e.getContext(), a = n.defines, o = n.vertexShader, s = n.fragmentShader, c = Wr(n), l = Kr(n), u = Jr(n),
|
|
2317
|
-
n.isRawShaderMaterial ? (
|
|
2316
|
+
let i = e.getContext(), a = n.defines, o = n.vertexShader, s = n.fragmentShader, c = Wr(n), l = Kr(n), u = Jr(n), d = Xr(n), f = Zr(n), p = kr(n), m = Ar(a), h = i.createProgram(), g, _, v = n.glslVersion ? "#version " + n.glslVersion + "\n" : "";
|
|
2317
|
+
n.isRawShaderMaterial ? (g = [
|
|
2318
2318
|
"#define SHADER_TYPE " + n.shaderType,
|
|
2319
2319
|
"#define SHADER_NAME " + n.shaderName,
|
|
2320
|
-
|
|
2321
|
-
].filter(Mr).join("\n"),
|
|
2320
|
+
m
|
|
2321
|
+
].filter(Mr).join("\n"), g.length > 0 && (g += "\n"), _ = [
|
|
2322
2322
|
"#define SHADER_TYPE " + n.shaderType,
|
|
2323
2323
|
"#define SHADER_NAME " + n.shaderName,
|
|
2324
|
-
|
|
2325
|
-
].filter(Mr).join("\n"),
|
|
2324
|
+
m
|
|
2325
|
+
].filter(Mr).join("\n"), _.length > 0 && (_ += "\n")) : (g = [
|
|
2326
2326
|
Hr(n),
|
|
2327
2327
|
"#define SHADER_TYPE " + n.shaderType,
|
|
2328
2328
|
"#define SHADER_NAME " + n.shaderName,
|
|
2329
|
-
|
|
2329
|
+
m,
|
|
2330
2330
|
n.extensionClipCullDistance ? "#define USE_CLIP_DISTANCE" : "",
|
|
2331
2331
|
n.batching ? "#define USE_BATCHING" : "",
|
|
2332
2332
|
n.batchingColor ? "#define USE_BATCHING_COLOR" : "",
|
|
@@ -2452,11 +2452,11 @@ function Qr(e, t, n, r) {
|
|
|
2452
2452
|
" attribute vec4 skinWeight;",
|
|
2453
2453
|
"#endif",
|
|
2454
2454
|
"\n"
|
|
2455
|
-
].filter(Mr).join("\n"),
|
|
2455
|
+
].filter(Mr).join("\n"), _ = [
|
|
2456
2456
|
Hr(n),
|
|
2457
2457
|
"#define SHADER_TYPE " + n.shaderType,
|
|
2458
2458
|
"#define SHADER_NAME " + n.shaderName,
|
|
2459
|
-
|
|
2459
|
+
m,
|
|
2460
2460
|
n.useFog && n.fog ? "#define USE_FOG" : "",
|
|
2461
2461
|
n.useFog && n.fogExp2 ? "#define FOG_EXP2" : "",
|
|
2462
2462
|
n.alphaToCoverage ? "#define ALPHA_TO_COVERAGE" : "",
|
|
@@ -2465,10 +2465,10 @@ function Qr(e, t, n, r) {
|
|
|
2465
2465
|
n.envMap ? "#define USE_ENVMAP" : "",
|
|
2466
2466
|
n.envMap ? "#define " + l : "",
|
|
2467
2467
|
n.envMap ? "#define " + u : "",
|
|
2468
|
-
n.envMap ? "#define " +
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2468
|
+
n.envMap ? "#define " + d : "",
|
|
2469
|
+
f ? "#define CUBEUV_TEXEL_WIDTH " + f.texelWidth : "",
|
|
2470
|
+
f ? "#define CUBEUV_TEXEL_HEIGHT " + f.texelHeight : "",
|
|
2471
|
+
f ? "#define CUBEUV_MAX_MIP " + f.maxMip + ".0" : "",
|
|
2472
2472
|
n.lightMap ? "#define USE_LIGHTMAP" : "",
|
|
2473
2473
|
n.aoMap ? "#define USE_AOMAP" : "",
|
|
2474
2474
|
n.bumpMap ? "#define USE_BUMPMAP" : "",
|
|
@@ -2534,12 +2534,12 @@ function Qr(e, t, n, r) {
|
|
|
2534
2534
|
Or(),
|
|
2535
2535
|
n.useDepthPacking ? "#define DEPTH_PACKING " + n.depthPacking : "",
|
|
2536
2536
|
"\n"
|
|
2537
|
-
].filter(Mr).join("\n")), o = Ir(o), o = Nr(o, n), o = Pr(o, n), s = Ir(s), s = Nr(s, n), s = Pr(s, n), o = Br(o), s = Br(s), n.isRawShaderMaterial !== !0 && (
|
|
2538
|
-
|
|
2537
|
+
].filter(Mr).join("\n")), o = Ir(o), o = Nr(o, n), o = Pr(o, n), s = Ir(s), s = Nr(s, n), s = Pr(s, n), o = Br(o), s = Br(s), n.isRawShaderMaterial !== !0 && (v = "#version 300 es\n", g = [
|
|
2538
|
+
p,
|
|
2539
2539
|
"#define attribute in",
|
|
2540
2540
|
"#define varying out",
|
|
2541
2541
|
"#define texture2D texture"
|
|
2542
|
-
].join("\n") + "\n" +
|
|
2542
|
+
].join("\n") + "\n" + g, _ = [
|
|
2543
2543
|
"#define varying in",
|
|
2544
2544
|
n.glslVersion === "300 es" ? "" : "layout(location = 0) out highp vec4 pc_fragColor;",
|
|
2545
2545
|
n.glslVersion === "300 es" ? "" : "#define gl_FragColor pc_fragColor",
|
|
@@ -2553,48 +2553,48 @@ function Qr(e, t, n, r) {
|
|
|
2553
2553
|
"#define texture2DGradEXT textureGrad",
|
|
2554
2554
|
"#define texture2DProjGradEXT textureProjGrad",
|
|
2555
2555
|
"#define textureCubeGradEXT textureGrad"
|
|
2556
|
-
].join("\n") + "\n" +
|
|
2557
|
-
let
|
|
2558
|
-
i.attachShader(
|
|
2559
|
-
function
|
|
2556
|
+
].join("\n") + "\n" + _);
|
|
2557
|
+
let y = v + g + o, b = v + _ + s, x = _r(i, i.VERTEX_SHADER, y), S = _r(i, i.FRAGMENT_SHADER, b);
|
|
2558
|
+
i.attachShader(h, x), i.attachShader(h, S), n.index0AttributeName === void 0 ? n.hasPositionAttribute === !0 && i.bindAttribLocation(h, 0, "position") : i.bindAttribLocation(h, 0, n.index0AttributeName), i.linkProgram(h);
|
|
2559
|
+
function C(t) {
|
|
2560
2560
|
if (e.debug.checkShaderErrors) {
|
|
2561
|
-
let n = i.getProgramInfoLog(
|
|
2562
|
-
if (i.getProgramParameter(
|
|
2563
|
-
if (l = !1, typeof e.debug.onShaderError == "function") e.debug.onShaderError(i,
|
|
2561
|
+
let n = i.getProgramInfoLog(h) || "", r = i.getShaderInfoLog(x) || "", a = i.getShaderInfoLog(S) || "", o = n.trim(), s = r.trim(), c = a.trim(), l = !0, u = !0;
|
|
2562
|
+
if (i.getProgramParameter(h, i.LINK_STATUS) === !1) {
|
|
2563
|
+
if (l = !1, typeof e.debug.onShaderError == "function") e.debug.onShaderError(i, h, x, S);
|
|
2564
2564
|
else {
|
|
2565
|
-
let e = Cr(i,
|
|
2566
|
-
|
|
2565
|
+
let e = Cr(i, x, "vertex"), n = Cr(i, S, "fragment");
|
|
2566
|
+
U("WebGLProgram: Shader Error " + i.getError() + " - VALIDATE_STATUS " + i.getProgramParameter(h, i.VALIDATE_STATUS) + "\n\nMaterial Name: " + t.name + "\nMaterial Type: " + t.type + "\n\nProgram Info Log: " + o + "\n" + e + "\n" + n);
|
|
2567
2567
|
}
|
|
2568
|
-
} else o === "" ? (s === "" || c === "") && (u = !1) :
|
|
2568
|
+
} else o === "" ? (s === "" || c === "") && (u = !1) : j("WebGLProgram: Program Info Log:", o);
|
|
2569
2569
|
u && (t.diagnostics = {
|
|
2570
2570
|
runnable: l,
|
|
2571
2571
|
programLog: o,
|
|
2572
2572
|
vertexShader: {
|
|
2573
2573
|
log: s,
|
|
2574
|
-
prefix:
|
|
2574
|
+
prefix: g
|
|
2575
2575
|
},
|
|
2576
2576
|
fragmentShader: {
|
|
2577
2577
|
log: c,
|
|
2578
|
-
prefix:
|
|
2578
|
+
prefix: _
|
|
2579
2579
|
}
|
|
2580
2580
|
});
|
|
2581
2581
|
}
|
|
2582
|
-
i.deleteShader(
|
|
2582
|
+
i.deleteShader(x), i.deleteShader(S), w = new gr(i, h), T = jr(i, h);
|
|
2583
2583
|
}
|
|
2584
|
-
let
|
|
2584
|
+
let w;
|
|
2585
2585
|
this.getUniforms = function() {
|
|
2586
|
-
return
|
|
2586
|
+
return w === void 0 && C(this), w;
|
|
2587
2587
|
};
|
|
2588
|
-
let
|
|
2588
|
+
let T;
|
|
2589
2589
|
this.getAttributes = function() {
|
|
2590
|
-
return
|
|
2590
|
+
return T === void 0 && C(this), T;
|
|
2591
2591
|
};
|
|
2592
|
-
let
|
|
2592
|
+
let E = n.rendererExtensionParallelShaderCompile === !1;
|
|
2593
2593
|
return this.isReady = function() {
|
|
2594
|
-
return
|
|
2594
|
+
return E === !1 && (E = i.getProgramParameter(h, vr)), E;
|
|
2595
2595
|
}, this.destroy = function() {
|
|
2596
|
-
r.releaseStatesOfProgram(this), i.deleteProgram(
|
|
2597
|
-
}, this.type = n.shaderType, this.name = n.shaderName, this.id = yr++, this.cacheKey = t, this.usedTimes = 1, this.program =
|
|
2596
|
+
r.releaseStatesOfProgram(this), i.deleteProgram(h), this.program = void 0;
|
|
2597
|
+
}, this.type = n.shaderType, this.name = n.shaderName, this.id = yr++, this.cacheKey = t, this.usedTimes = 1, this.program = h, this.vertexShader = x, this.fragmentShader = S, this;
|
|
2598
2598
|
}
|
|
2599
2599
|
var $r = 0, ei = class {
|
|
2600
2600
|
constructor() {
|
|
@@ -2635,7 +2635,7 @@ function ni(e) {
|
|
|
2635
2635
|
return e === 1030 || e === 37490 || e === 36285;
|
|
2636
2636
|
}
|
|
2637
2637
|
function ri(e, t, n, r, i, a) {
|
|
2638
|
-
let o = new
|
|
2638
|
+
let o = new ot(), s = new ei(), c = /* @__PURE__ */ new Set(), l = [], u = /* @__PURE__ */ new Map(), d = r.logarithmicDepthBuffer, f = r.precision, p = {
|
|
2639
2639
|
MeshDepthMaterial: "depth",
|
|
2640
2640
|
MeshDistanceMaterial: "distance",
|
|
2641
2641
|
MeshNormalMaterial: "normal",
|
|
@@ -2657,115 +2657,115 @@ function ri(e, t, n, r, i, a) {
|
|
|
2657
2657
|
}
|
|
2658
2658
|
function h(i, o, l, u, h, g) {
|
|
2659
2659
|
let _ = u.fog, v = h.geometry, y = i.isMeshStandardMaterial || i.isMeshLambertMaterial || i.isMeshPhongMaterial ? u.environment : null, b = i.isMeshStandardMaterial || i.isMeshLambertMaterial && !i.envMap || i.isMeshPhongMaterial && !i.envMap, x = t.get(i.envMap || y, b), S = x && x.mapping === 306 ? x.image.height : null, C = p[i.type];
|
|
2660
|
-
i.precision !== null && (f = r.getMaxPrecision(i.precision), f !== i.precision &&
|
|
2660
|
+
i.precision !== null && (f = r.getMaxPrecision(i.precision), f !== i.precision && j("WebGLProgram.getParameters:", i.precision, "not supported, using", f, "instead."));
|
|
2661
2661
|
let w = v.morphAttributes.position || v.morphAttributes.normal || v.morphAttributes.color, T = w === void 0 ? 0 : w.length, E = 0;
|
|
2662
2662
|
v.morphAttributes.position !== void 0 && (E = 1), v.morphAttributes.normal !== void 0 && (E = 2), v.morphAttributes.color !== void 0 && (E = 3);
|
|
2663
|
-
let O, k, A
|
|
2663
|
+
let D, O, k, A;
|
|
2664
2664
|
if (C) {
|
|
2665
2665
|
let e = wt[C];
|
|
2666
|
-
|
|
2666
|
+
D = e.vertexShader, O = e.fragmentShader;
|
|
2667
2667
|
} else {
|
|
2668
|
-
|
|
2668
|
+
D = i.vertexShader, O = i.fragmentShader;
|
|
2669
2669
|
let e = s.getVertexShaderStage(i), t = s.getFragmentShaderStage(i);
|
|
2670
|
-
s.update(i, e, t),
|
|
2670
|
+
s.update(i, e, t), k = e.id, A = t.id;
|
|
2671
2671
|
}
|
|
2672
|
-
let M = e.getRenderTarget(),
|
|
2673
|
-
i.toneMapped && (M === null || M.isXRRenderTarget === !0) && (
|
|
2674
|
-
let
|
|
2672
|
+
let M = e.getRenderTarget(), ee = e.state.buffers.depth.getReversed(), N = h.isInstancedMesh === !0, P = h.isBatchedMesh === !0, te = !!i.map, F = !!i.matcap, ne = !!x, re = !!i.aoMap, ie = !!i.lightMap, ae = !!i.bumpMap && i.wireframe === !1, I = !!i.normalMap, L = !!i.displacementMap, oe = !!i.emissiveMap, se = !!i.metalnessMap, R = !!i.roughnessMap, ce = i.anisotropy > 0, le = i.clearcoat > 0, ue = i.dispersion > 0, de = i.iridescence > 0, fe = i.sheen > 0, pe = i.transmission > 0, z = ce && !!i.anisotropyMap, me = le && !!i.clearcoatMap, he = le && !!i.clearcoatNormalMap, ge = le && !!i.clearcoatRoughnessMap, _e = de && !!i.iridescenceMap, ve = de && !!i.iridescenceThicknessMap, ye = fe && !!i.sheenColorMap, be = fe && !!i.sheenRoughnessMap, xe = !!i.specularMap, Se = !!i.specularColorMap, Ce = !!i.specularIntensityMap, we = pe && !!i.transmissionMap, Te = pe && !!i.thicknessMap, Ee = !!i.gradientMap, De = !!i.alphaMap, V = i.alphaTest > 0, Oe = !!i.alphaHash, ke = !!i.extensions, Ae = 0;
|
|
2673
|
+
i.toneMapped && (M === null || M.isXRRenderTarget === !0) && (Ae = e.toneMapping);
|
|
2674
|
+
let je = {
|
|
2675
2675
|
shaderID: C,
|
|
2676
2676
|
shaderType: i.type,
|
|
2677
2677
|
shaderName: i.name,
|
|
2678
|
-
vertexShader:
|
|
2679
|
-
fragmentShader:
|
|
2678
|
+
vertexShader: D,
|
|
2679
|
+
fragmentShader: O,
|
|
2680
2680
|
defines: i.defines,
|
|
2681
|
-
customVertexShaderID:
|
|
2682
|
-
customFragmentShaderID:
|
|
2681
|
+
customVertexShaderID: k,
|
|
2682
|
+
customFragmentShaderID: A,
|
|
2683
2683
|
isRawShaderMaterial: i.isRawShaderMaterial === !0,
|
|
2684
2684
|
glslVersion: i.glslVersion,
|
|
2685
2685
|
precision: f,
|
|
2686
|
-
batching:
|
|
2687
|
-
batchingColor:
|
|
2688
|
-
instancing:
|
|
2689
|
-
instancingColor:
|
|
2690
|
-
instancingMorph:
|
|
2691
|
-
outputColorSpace: M === null ? e.outputColorSpace : M.isXRRenderTarget === !0 ? M.texture.colorSpace :
|
|
2686
|
+
batching: P,
|
|
2687
|
+
batchingColor: P && h._colorsTexture !== null,
|
|
2688
|
+
instancing: N,
|
|
2689
|
+
instancingColor: N && h.instanceColor !== null,
|
|
2690
|
+
instancingMorph: N && h.morphTexture !== null,
|
|
2691
|
+
outputColorSpace: M === null ? e.outputColorSpace : M.isXRRenderTarget === !0 ? M.texture.colorSpace : B.workingColorSpace,
|
|
2692
2692
|
alphaToCoverage: !!i.alphaToCoverage,
|
|
2693
|
-
map:
|
|
2694
|
-
matcap:
|
|
2695
|
-
envMap:
|
|
2696
|
-
envMapMode:
|
|
2693
|
+
map: te,
|
|
2694
|
+
matcap: F,
|
|
2695
|
+
envMap: ne,
|
|
2696
|
+
envMapMode: ne && x.mapping,
|
|
2697
2697
|
envMapCubeUVHeight: S,
|
|
2698
2698
|
aoMap: re,
|
|
2699
2699
|
lightMap: ie,
|
|
2700
2700
|
bumpMap: ae,
|
|
2701
2701
|
normalMap: I,
|
|
2702
|
-
displacementMap:
|
|
2703
|
-
emissiveMap:
|
|
2702
|
+
displacementMap: L,
|
|
2703
|
+
emissiveMap: oe,
|
|
2704
2704
|
normalMapObjectSpace: I && i.normalMapType === 1,
|
|
2705
2705
|
normalMapTangentSpace: I && i.normalMapType === 0,
|
|
2706
2706
|
packedNormalMap: I && i.normalMapType === 0 && ni(i.normalMap.format),
|
|
2707
|
-
metalnessMap:
|
|
2707
|
+
metalnessMap: se,
|
|
2708
2708
|
roughnessMap: R,
|
|
2709
|
-
anisotropy:
|
|
2710
|
-
anisotropyMap:
|
|
2711
|
-
clearcoat:
|
|
2712
|
-
clearcoatMap:
|
|
2713
|
-
clearcoatNormalMap:
|
|
2714
|
-
clearcoatRoughnessMap:
|
|
2715
|
-
dispersion:
|
|
2716
|
-
iridescence:
|
|
2717
|
-
iridescenceMap:
|
|
2718
|
-
iridescenceThicknessMap:
|
|
2719
|
-
sheen:
|
|
2720
|
-
sheenColorMap:
|
|
2721
|
-
sheenRoughnessMap:
|
|
2722
|
-
specularMap:
|
|
2723
|
-
specularColorMap:
|
|
2724
|
-
specularIntensityMap:
|
|
2725
|
-
transmission:
|
|
2726
|
-
transmissionMap:
|
|
2727
|
-
thicknessMap:
|
|
2728
|
-
gradientMap:
|
|
2709
|
+
anisotropy: ce,
|
|
2710
|
+
anisotropyMap: z,
|
|
2711
|
+
clearcoat: le,
|
|
2712
|
+
clearcoatMap: me,
|
|
2713
|
+
clearcoatNormalMap: he,
|
|
2714
|
+
clearcoatRoughnessMap: ge,
|
|
2715
|
+
dispersion: ue,
|
|
2716
|
+
iridescence: de,
|
|
2717
|
+
iridescenceMap: _e,
|
|
2718
|
+
iridescenceThicknessMap: ve,
|
|
2719
|
+
sheen: fe,
|
|
2720
|
+
sheenColorMap: ye,
|
|
2721
|
+
sheenRoughnessMap: be,
|
|
2722
|
+
specularMap: xe,
|
|
2723
|
+
specularColorMap: Se,
|
|
2724
|
+
specularIntensityMap: Ce,
|
|
2725
|
+
transmission: pe,
|
|
2726
|
+
transmissionMap: we,
|
|
2727
|
+
thicknessMap: Te,
|
|
2728
|
+
gradientMap: Ee,
|
|
2729
2729
|
opaque: i.transparent === !1 && i.blending === 1 && i.alphaToCoverage === !1,
|
|
2730
|
-
alphaMap:
|
|
2731
|
-
alphaTest:
|
|
2732
|
-
alphaHash:
|
|
2730
|
+
alphaMap: De,
|
|
2731
|
+
alphaTest: V,
|
|
2732
|
+
alphaHash: Oe,
|
|
2733
2733
|
combine: i.combine,
|
|
2734
|
-
mapUv:
|
|
2734
|
+
mapUv: te && m(i.map.channel),
|
|
2735
2735
|
aoMapUv: re && m(i.aoMap.channel),
|
|
2736
2736
|
lightMapUv: ie && m(i.lightMap.channel),
|
|
2737
2737
|
bumpMapUv: ae && m(i.bumpMap.channel),
|
|
2738
2738
|
normalMapUv: I && m(i.normalMap.channel),
|
|
2739
|
-
displacementMapUv:
|
|
2740
|
-
emissiveMapUv:
|
|
2741
|
-
metalnessMapUv:
|
|
2739
|
+
displacementMapUv: L && m(i.displacementMap.channel),
|
|
2740
|
+
emissiveMapUv: oe && m(i.emissiveMap.channel),
|
|
2741
|
+
metalnessMapUv: se && m(i.metalnessMap.channel),
|
|
2742
2742
|
roughnessMapUv: R && m(i.roughnessMap.channel),
|
|
2743
|
-
anisotropyMapUv:
|
|
2744
|
-
clearcoatMapUv:
|
|
2745
|
-
clearcoatNormalMapUv:
|
|
2746
|
-
clearcoatRoughnessMapUv:
|
|
2747
|
-
iridescenceMapUv:
|
|
2748
|
-
iridescenceThicknessMapUv:
|
|
2749
|
-
sheenColorMapUv:
|
|
2750
|
-
sheenRoughnessMapUv:
|
|
2751
|
-
specularMapUv:
|
|
2752
|
-
specularColorMapUv:
|
|
2753
|
-
specularIntensityMapUv:
|
|
2754
|
-
transmissionMapUv:
|
|
2755
|
-
thicknessMapUv:
|
|
2756
|
-
alphaMapUv:
|
|
2757
|
-
vertexTangents: !!v.attributes.tangent && (I ||
|
|
2743
|
+
anisotropyMapUv: z && m(i.anisotropyMap.channel),
|
|
2744
|
+
clearcoatMapUv: me && m(i.clearcoatMap.channel),
|
|
2745
|
+
clearcoatNormalMapUv: he && m(i.clearcoatNormalMap.channel),
|
|
2746
|
+
clearcoatRoughnessMapUv: ge && m(i.clearcoatRoughnessMap.channel),
|
|
2747
|
+
iridescenceMapUv: _e && m(i.iridescenceMap.channel),
|
|
2748
|
+
iridescenceThicknessMapUv: ve && m(i.iridescenceThicknessMap.channel),
|
|
2749
|
+
sheenColorMapUv: ye && m(i.sheenColorMap.channel),
|
|
2750
|
+
sheenRoughnessMapUv: be && m(i.sheenRoughnessMap.channel),
|
|
2751
|
+
specularMapUv: xe && m(i.specularMap.channel),
|
|
2752
|
+
specularColorMapUv: Se && m(i.specularColorMap.channel),
|
|
2753
|
+
specularIntensityMapUv: Ce && m(i.specularIntensityMap.channel),
|
|
2754
|
+
transmissionMapUv: we && m(i.transmissionMap.channel),
|
|
2755
|
+
thicknessMapUv: Te && m(i.thicknessMap.channel),
|
|
2756
|
+
alphaMapUv: De && m(i.alphaMap.channel),
|
|
2757
|
+
vertexTangents: !!v.attributes.tangent && (I || ce),
|
|
2758
2758
|
vertexNormals: !!v.attributes.normal,
|
|
2759
2759
|
vertexColors: i.vertexColors,
|
|
2760
2760
|
vertexAlphas: i.vertexColors === !0 && !!v.attributes.color && v.attributes.color.itemSize === 4,
|
|
2761
|
-
pointsUvs: h.isPoints === !0 && !!v.attributes.uv && (
|
|
2761
|
+
pointsUvs: h.isPoints === !0 && !!v.attributes.uv && (te || De),
|
|
2762
2762
|
fog: !!_,
|
|
2763
2763
|
useFog: i.fog === !0,
|
|
2764
2764
|
fogExp2: !!_ && _.isFogExp2,
|
|
2765
2765
|
flatShading: i.wireframe === !1 && (i.flatShading === !0 || v.attributes.normal === void 0 && I === !1 && (i.isMeshLambertMaterial || i.isMeshPhongMaterial || i.isMeshStandardMaterial || i.isMeshPhysicalMaterial)),
|
|
2766
2766
|
sizeAttenuation: i.sizeAttenuation === !0,
|
|
2767
2767
|
logarithmicDepthBuffer: d,
|
|
2768
|
-
reversedDepthBuffer:
|
|
2768
|
+
reversedDepthBuffer: ee,
|
|
2769
2769
|
skinning: h.isSkinnedMesh === !0,
|
|
2770
2770
|
hasPositionAttribute: v.attributes.position !== void 0,
|
|
2771
2771
|
morphTargets: v.morphAttributes.position !== void 0,
|
|
@@ -2790,21 +2790,21 @@ function ri(e, t, n, r, i, a) {
|
|
|
2790
2790
|
dithering: i.dithering,
|
|
2791
2791
|
shadowMapEnabled: e.shadowMap.enabled && l.length > 0,
|
|
2792
2792
|
shadowMapType: e.shadowMap.type,
|
|
2793
|
-
toneMapping:
|
|
2794
|
-
decodeVideoTexture:
|
|
2795
|
-
decodeVideoTextureEmissive:
|
|
2793
|
+
toneMapping: Ae,
|
|
2794
|
+
decodeVideoTexture: te && i.map.isVideoTexture === !0 && B.getTransfer(i.map.colorSpace) === "srgb",
|
|
2795
|
+
decodeVideoTextureEmissive: oe && i.emissiveMap.isVideoTexture === !0 && B.getTransfer(i.emissiveMap.colorSpace) === "srgb",
|
|
2796
2796
|
premultipliedAlpha: i.premultipliedAlpha,
|
|
2797
2797
|
doubleSided: i.side === 2,
|
|
2798
2798
|
flipSided: i.side === 1,
|
|
2799
2799
|
useDepthPacking: i.depthPacking >= 0,
|
|
2800
2800
|
depthPacking: i.depthPacking || 0,
|
|
2801
2801
|
index0AttributeName: i.index0AttributeName,
|
|
2802
|
-
extensionClipCullDistance:
|
|
2803
|
-
extensionMultiDraw: (
|
|
2802
|
+
extensionClipCullDistance: ke && i.extensions.clipCullDistance === !0 && n.has("WEBGL_clip_cull_distance"),
|
|
2803
|
+
extensionMultiDraw: (ke && i.extensions.multiDraw === !0 || P) && n.has("WEBGL_multi_draw"),
|
|
2804
2804
|
rendererExtensionParallelShaderCompile: n.has("KHR_parallel_shader_compile"),
|
|
2805
2805
|
customProgramCacheKey: i.customProgramCacheKey()
|
|
2806
2806
|
};
|
|
2807
|
-
return
|
|
2807
|
+
return je.vertexUv1s = c.has(1), je.vertexUv2s = c.has(2), je.vertexUv3s = c.has(3), c.clear(), je;
|
|
2808
2808
|
}
|
|
2809
2809
|
function g(t) {
|
|
2810
2810
|
let n = [];
|
|
@@ -2821,7 +2821,7 @@ function ri(e, t, n, r, i, a) {
|
|
|
2821
2821
|
let t = p[e.type], n;
|
|
2822
2822
|
if (t) {
|
|
2823
2823
|
let e = wt[t];
|
|
2824
|
-
n =
|
|
2824
|
+
n = He.clone(e.uniforms);
|
|
2825
2825
|
} else n = e.uniforms;
|
|
2826
2826
|
return n;
|
|
2827
2827
|
}
|
|
@@ -2958,15 +2958,15 @@ function li() {
|
|
|
2958
2958
|
switch (t.type) {
|
|
2959
2959
|
case "DirectionalLight":
|
|
2960
2960
|
n = {
|
|
2961
|
-
direction: new
|
|
2962
|
-
color: new
|
|
2961
|
+
direction: new m(),
|
|
2962
|
+
color: new V()
|
|
2963
2963
|
};
|
|
2964
2964
|
break;
|
|
2965
2965
|
case "SpotLight":
|
|
2966
2966
|
n = {
|
|
2967
|
-
position: new
|
|
2968
|
-
direction: new
|
|
2969
|
-
color: new
|
|
2967
|
+
position: new m(),
|
|
2968
|
+
direction: new m(),
|
|
2969
|
+
color: new V(),
|
|
2970
2970
|
distance: 0,
|
|
2971
2971
|
coneCos: 0,
|
|
2972
2972
|
penumbraCos: 0,
|
|
@@ -2975,24 +2975,24 @@ function li() {
|
|
|
2975
2975
|
break;
|
|
2976
2976
|
case "PointLight":
|
|
2977
2977
|
n = {
|
|
2978
|
-
position: new
|
|
2979
|
-
color: new
|
|
2978
|
+
position: new m(),
|
|
2979
|
+
color: new V(),
|
|
2980
2980
|
distance: 0,
|
|
2981
2981
|
decay: 0
|
|
2982
2982
|
};
|
|
2983
2983
|
break;
|
|
2984
2984
|
case "HemisphereLight":
|
|
2985
2985
|
n = {
|
|
2986
|
-
direction: new
|
|
2987
|
-
skyColor: new
|
|
2988
|
-
groundColor: new
|
|
2986
|
+
direction: new m(),
|
|
2987
|
+
skyColor: new V(),
|
|
2988
|
+
groundColor: new V()
|
|
2989
2989
|
};
|
|
2990
2990
|
break;
|
|
2991
2991
|
case "RectAreaLight": n = {
|
|
2992
|
-
color: new
|
|
2993
|
-
position: new
|
|
2994
|
-
halfWidth: new
|
|
2995
|
-
halfHeight: new
|
|
2992
|
+
color: new V(),
|
|
2993
|
+
position: new m(),
|
|
2994
|
+
halfWidth: new m(),
|
|
2995
|
+
halfHeight: new m()
|
|
2996
2996
|
};
|
|
2997
2997
|
}
|
|
2998
2998
|
return e[t.id] = n, n;
|
|
@@ -3010,7 +3010,7 @@ function ui() {
|
|
|
3010
3010
|
shadowBias: 0,
|
|
3011
3011
|
shadowNormalBias: 0,
|
|
3012
3012
|
shadowRadius: 1,
|
|
3013
|
-
shadowMapSize: new
|
|
3013
|
+
shadowMapSize: new L()
|
|
3014
3014
|
};
|
|
3015
3015
|
break;
|
|
3016
3016
|
case "SpotLight":
|
|
@@ -3019,7 +3019,7 @@ function ui() {
|
|
|
3019
3019
|
shadowBias: 0,
|
|
3020
3020
|
shadowNormalBias: 0,
|
|
3021
3021
|
shadowRadius: 1,
|
|
3022
|
-
shadowMapSize: new
|
|
3022
|
+
shadowMapSize: new L()
|
|
3023
3023
|
};
|
|
3024
3024
|
break;
|
|
3025
3025
|
case "PointLight": n = {
|
|
@@ -3027,7 +3027,7 @@ function ui() {
|
|
|
3027
3027
|
shadowBias: 0,
|
|
3028
3028
|
shadowNormalBias: 0,
|
|
3029
3029
|
shadowRadius: 1,
|
|
3030
|
-
shadowMapSize: new
|
|
3030
|
+
shadowMapSize: new L(),
|
|
3031
3031
|
shadowCameraNear: 1,
|
|
3032
3032
|
shadowCameraFar: 1e3
|
|
3033
3033
|
};
|
|
@@ -3080,8 +3080,8 @@ function pi(e) {
|
|
|
3080
3080
|
numSpotLightShadowsWithMaps: 0,
|
|
3081
3081
|
numLightProbes: 0
|
|
3082
3082
|
};
|
|
3083
|
-
for (let e = 0; e < 9; e++) r.probe.push(new
|
|
3084
|
-
let i = new
|
|
3083
|
+
for (let e = 0; e < 9; e++) r.probe.push(new m());
|
|
3084
|
+
let i = new m(), a = new E(), o = new E();
|
|
3085
3085
|
function s(i) {
|
|
3086
3086
|
let a = 0, o = 0, s = 0;
|
|
3087
3087
|
for (let e = 0; e < 9; e++) r.probe[e].set(0, 0, 0);
|
|
@@ -3210,38 +3210,38 @@ function hi(e) {
|
|
|
3210
3210
|
};
|
|
3211
3211
|
}
|
|
3212
3212
|
var gi = "void main() {\n gl_Position = vec4( position, 1.0 );\n}", _i = "uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\nvoid main() {\n const float samples = float( VSM_SAMPLES );\n float mean = 0.0;\n float squared_mean = 0.0;\n float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n float uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n for ( float i = 0.0; i < samples; i ++ ) {\n float uvOffset = uvStart + i * uvStride;\n #ifdef HORIZONTAL_PASS\n vec2 distribution = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ).rg;\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ).r;\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean / samples;\n squared_mean = squared_mean / samples;\n float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) );\n gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 );\n}", vi = [
|
|
3213
|
-
/*@__PURE__*/ new
|
|
3214
|
-
/*@__PURE__*/ new
|
|
3215
|
-
/*@__PURE__*/ new
|
|
3216
|
-
/*@__PURE__*/ new
|
|
3217
|
-
/*@__PURE__*/ new
|
|
3218
|
-
/*@__PURE__*/ new
|
|
3213
|
+
/*@__PURE__*/ new m(1, 0, 0),
|
|
3214
|
+
/*@__PURE__*/ new m(-1, 0, 0),
|
|
3215
|
+
/*@__PURE__*/ new m(0, 1, 0),
|
|
3216
|
+
/*@__PURE__*/ new m(0, -1, 0),
|
|
3217
|
+
/*@__PURE__*/ new m(0, 0, 1),
|
|
3218
|
+
/*@__PURE__*/ new m(0, 0, -1)
|
|
3219
3219
|
], yi = [
|
|
3220
|
-
/*@__PURE__*/ new
|
|
3221
|
-
/*@__PURE__*/ new
|
|
3222
|
-
/*@__PURE__*/ new
|
|
3223
|
-
/*@__PURE__*/ new
|
|
3224
|
-
/*@__PURE__*/ new
|
|
3225
|
-
/*@__PURE__*/ new
|
|
3226
|
-
], bi = /*@__PURE__*/ new
|
|
3220
|
+
/*@__PURE__*/ new m(0, -1, 0),
|
|
3221
|
+
/*@__PURE__*/ new m(0, -1, 0),
|
|
3222
|
+
/*@__PURE__*/ new m(0, 0, 1),
|
|
3223
|
+
/*@__PURE__*/ new m(0, 0, -1),
|
|
3224
|
+
/*@__PURE__*/ new m(0, -1, 0),
|
|
3225
|
+
/*@__PURE__*/ new m(0, -1, 0)
|
|
3226
|
+
], bi = /*@__PURE__*/ new E(), xi = /*@__PURE__*/ new m(), Si = /*@__PURE__*/ new m();
|
|
3227
3227
|
function Ci(e, t, n) {
|
|
3228
|
-
let r = new
|
|
3228
|
+
let r = new N(), i = new L(), a = new L(), o = new tt(), s = new me(), c = new re(), l = {}, u = n.maxTextureSize, d = {
|
|
3229
3229
|
0: 1,
|
|
3230
3230
|
1: 0,
|
|
3231
3231
|
2: 2
|
|
3232
|
-
}, p = new
|
|
3232
|
+
}, p = new ze({
|
|
3233
3233
|
defines: { VSM_SAMPLES: 8 },
|
|
3234
3234
|
uniforms: {
|
|
3235
3235
|
shadow_pass: { value: null },
|
|
3236
|
-
resolution: { value: new
|
|
3236
|
+
resolution: { value: new L() },
|
|
3237
3237
|
radius: { value: 4 }
|
|
3238
3238
|
},
|
|
3239
3239
|
vertexShader: gi,
|
|
3240
3240
|
fragmentShader: _i
|
|
3241
3241
|
}), m = p.clone();
|
|
3242
3242
|
m.defines.HORIZONTAL_PASS = 1;
|
|
3243
|
-
let
|
|
3244
|
-
|
|
3243
|
+
let g = new Ve();
|
|
3244
|
+
g.setAttribute("position", new Ee(new Float32Array([
|
|
3245
3245
|
-1,
|
|
3246
3246
|
-1,
|
|
3247
3247
|
.5,
|
|
@@ -3252,86 +3252,86 @@ function Ci(e, t, n) {
|
|
|
3252
3252
|
3,
|
|
3253
3253
|
.5
|
|
3254
3254
|
]), 3));
|
|
3255
|
-
let
|
|
3255
|
+
let _ = new z(g, p), y = this;
|
|
3256
3256
|
this.enabled = !1, this.autoUpdate = !0, this.needsUpdate = !1, this.type = 1;
|
|
3257
3257
|
let b = this.type;
|
|
3258
3258
|
this.render = function(t, n, s) {
|
|
3259
3259
|
if (y.enabled === !1 || y.autoUpdate === !1 && y.needsUpdate === !1 || t.length === 0) return;
|
|
3260
|
-
this.type === 2 && (
|
|
3261
|
-
let c = e.getRenderTarget(),
|
|
3260
|
+
this.type === 2 && (j("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."), this.type = 1);
|
|
3261
|
+
let c = e.getRenderTarget(), l = e.getActiveCubeFace(), d = e.getActiveMipmapLevel(), p = e.state;
|
|
3262
3262
|
p.setBlending(0), p.buffers.depth.getReversed() === !0 ? p.buffers.color.setClear(0, 0, 0, 0) : p.buffers.color.setClear(1, 1, 1, 1), p.buffers.depth.setTest(!0), p.setScissorTest(!1);
|
|
3263
3263
|
let m = b !== this.type;
|
|
3264
3264
|
m && n.traverse(function(e) {
|
|
3265
3265
|
e.material && (Array.isArray(e.material) ? e.material.forEach((e) => e.needsUpdate = !0) : e.material.needsUpdate = !0);
|
|
3266
3266
|
});
|
|
3267
|
-
for (let c = 0,
|
|
3268
|
-
let
|
|
3269
|
-
if (
|
|
3270
|
-
|
|
3267
|
+
for (let c = 0, l = t.length; c < l; c++) {
|
|
3268
|
+
let l = t[c], d = l.shadow;
|
|
3269
|
+
if (d === void 0) {
|
|
3270
|
+
j("WebGLShadowMap:", l, "has no shadow.");
|
|
3271
3271
|
continue;
|
|
3272
3272
|
}
|
|
3273
|
-
if (
|
|
3274
|
-
i.copy(
|
|
3275
|
-
let
|
|
3276
|
-
i.multiply(
|
|
3273
|
+
if (d.autoUpdate === !1 && d.needsUpdate === !1) continue;
|
|
3274
|
+
i.copy(d.mapSize);
|
|
3275
|
+
let g = d.getFrameExtents();
|
|
3276
|
+
i.multiply(g), a.copy(d.mapSize), (i.x > u || i.y > u) && (i.x > u && (a.x = Math.floor(u / g.x), i.x = a.x * g.x, d.mapSize.x = a.x), i.y > u && (a.y = Math.floor(u / g.y), i.y = a.y * g.y, d.mapSize.y = a.y));
|
|
3277
3277
|
let _ = e.state.buffers.depth.getReversed();
|
|
3278
|
-
if (
|
|
3279
|
-
if (
|
|
3280
|
-
if (
|
|
3281
|
-
|
|
3278
|
+
if (d.camera._reversedDepth = _, d.map === null || m === !0) {
|
|
3279
|
+
if (d.map !== null && (d.map.depthTexture !== null && (d.map.depthTexture.dispose(), d.map.depthTexture = null), d.map.dispose()), this.type === 3) {
|
|
3280
|
+
if (l.isPointLight) {
|
|
3281
|
+
j("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");
|
|
3282
3282
|
continue;
|
|
3283
3283
|
}
|
|
3284
|
-
|
|
3285
|
-
format:
|
|
3286
|
-
type:
|
|
3287
|
-
minFilter:
|
|
3288
|
-
magFilter:
|
|
3284
|
+
d.map = new v(i.x, i.y, {
|
|
3285
|
+
format: S,
|
|
3286
|
+
type: A,
|
|
3287
|
+
minFilter: f,
|
|
3288
|
+
magFilter: f,
|
|
3289
3289
|
generateMipmaps: !1
|
|
3290
|
-
}),
|
|
3291
|
-
} else
|
|
3292
|
-
|
|
3290
|
+
}), d.map.texture.name = l.name + ".shadowMap", d.map.depthTexture = new h(i.x, i.y, M), d.map.depthTexture.name = l.name + ".shadowMapDepth", d.map.depthTexture.format = oe, d.map.depthTexture.compareFunction = null, d.map.depthTexture.minFilter = Te, d.map.depthTexture.magFilter = Te;
|
|
3291
|
+
} else l.isPointLight ? (d.map = new $t(i.x), d.map.depthTexture = new ye(i.x, $e)) : (d.map = new v(i.x, i.y), d.map.depthTexture = new h(i.x, i.y, $e)), d.map.depthTexture.name = l.name + ".shadowMap", d.map.depthTexture.format = oe, this.type === 1 ? (d.map.depthTexture.compareFunction = _ ? 518 : 515, d.map.depthTexture.minFilter = f, d.map.depthTexture.magFilter = f) : (d.map.depthTexture.compareFunction = null, d.map.depthTexture.minFilter = Te, d.map.depthTexture.magFilter = Te);
|
|
3292
|
+
d.camera.updateProjectionMatrix();
|
|
3293
3293
|
}
|
|
3294
|
-
let
|
|
3295
|
-
for (let t = 0; t <
|
|
3296
|
-
if (
|
|
3294
|
+
let y = d.map.isWebGLCubeRenderTarget ? 6 : 1;
|
|
3295
|
+
for (let t = 0; t < y; t++) {
|
|
3296
|
+
if (d.map.isWebGLCubeRenderTarget) e.setRenderTarget(d.map, t), e.clear();
|
|
3297
3297
|
else {
|
|
3298
|
-
t === 0 && (e.setRenderTarget(
|
|
3299
|
-
let n =
|
|
3298
|
+
t === 0 && (e.setRenderTarget(d.map), e.clear());
|
|
3299
|
+
let n = d.getViewport(t);
|
|
3300
3300
|
o.set(a.x * n.x, a.y * n.y, a.x * n.z, a.y * n.w), p.viewport(o);
|
|
3301
3301
|
}
|
|
3302
|
-
if (
|
|
3303
|
-
let e =
|
|
3304
|
-
r !== e.far && (e.far = r, e.updateProjectionMatrix()), xi.setFromMatrixPosition(
|
|
3305
|
-
} else
|
|
3306
|
-
r =
|
|
3302
|
+
if (l.isPointLight) {
|
|
3303
|
+
let e = d.camera, n = d.matrix, r = l.distance || e.far;
|
|
3304
|
+
r !== e.far && (e.far = r, e.updateProjectionMatrix()), xi.setFromMatrixPosition(l.matrixWorld), e.position.copy(xi), Si.copy(e.position), Si.add(vi[t]), e.up.copy(yi[t]), e.lookAt(Si), e.updateMatrixWorld(), n.makeTranslation(-xi.x, -xi.y, -xi.z), bi.multiplyMatrices(e.projectionMatrix, e.matrixWorldInverse), d._frustum.setFromProjectionMatrix(bi, e.coordinateSystem, e.reversedDepth);
|
|
3305
|
+
} else d.updateMatrices(l);
|
|
3306
|
+
r = d.getFrustum(), w(n, s, d.camera, l, this.type);
|
|
3307
3307
|
}
|
|
3308
|
-
|
|
3308
|
+
d.isPointLightShadow !== !0 && this.type === 3 && x(d, s), d.needsUpdate = !1;
|
|
3309
3309
|
}
|
|
3310
|
-
b = this.type, y.needsUpdate = !1, e.setRenderTarget(c,
|
|
3310
|
+
b = this.type, y.needsUpdate = !1, e.setRenderTarget(c, l, d);
|
|
3311
3311
|
};
|
|
3312
3312
|
function x(n, r) {
|
|
3313
|
-
let a = t.update(
|
|
3314
|
-
p.defines.VSM_SAMPLES !== n.blurSamples && (p.defines.VSM_SAMPLES = n.blurSamples, m.defines.VSM_SAMPLES = n.blurSamples, p.needsUpdate = !0, m.needsUpdate = !0), n.mapPass === null && (n.mapPass = new
|
|
3315
|
-
format:
|
|
3316
|
-
type:
|
|
3317
|
-
})), p.uniforms.shadow_pass.value = n.map.depthTexture, p.uniforms.resolution.value = n.mapSize, p.uniforms.radius.value = n.radius, e.setRenderTarget(n.mapPass), e.clear(), e.renderBufferDirect(r, null, a, p,
|
|
3313
|
+
let a = t.update(_);
|
|
3314
|
+
p.defines.VSM_SAMPLES !== n.blurSamples && (p.defines.VSM_SAMPLES = n.blurSamples, m.defines.VSM_SAMPLES = n.blurSamples, p.needsUpdate = !0, m.needsUpdate = !0), n.mapPass === null && (n.mapPass = new v(i.x, i.y, {
|
|
3315
|
+
format: S,
|
|
3316
|
+
type: A
|
|
3317
|
+
})), p.uniforms.shadow_pass.value = n.map.depthTexture, p.uniforms.resolution.value = n.mapSize, p.uniforms.radius.value = n.radius, e.setRenderTarget(n.mapPass), e.clear(), e.renderBufferDirect(r, null, a, p, _, null), m.uniforms.shadow_pass.value = n.mapPass.texture, m.uniforms.resolution.value = n.mapSize, m.uniforms.radius.value = n.radius, e.setRenderTarget(n.map), e.clear(), e.renderBufferDirect(r, null, a, m, _, null);
|
|
3318
3318
|
}
|
|
3319
|
-
function
|
|
3319
|
+
function C(t, n, r, i) {
|
|
3320
3320
|
let a = null, o = r.isPointLight === !0 ? t.customDistanceMaterial : t.customDepthMaterial;
|
|
3321
3321
|
if (o !== void 0) a = o;
|
|
3322
3322
|
else if (a = r.isPointLight === !0 ? c : s, e.localClippingEnabled && n.clipShadows === !0 && Array.isArray(n.clippingPlanes) && n.clippingPlanes.length !== 0 || n.displacementMap && n.displacementScale !== 0 || n.alphaMap && n.alphaTest > 0 || n.map && n.alphaTest > 0 || n.alphaToCoverage === !0) {
|
|
3323
|
-
let e = a.uuid, t = n.uuid, r =
|
|
3324
|
-
r === void 0 && (r = {},
|
|
3323
|
+
let e = a.uuid, t = n.uuid, r = l[e];
|
|
3324
|
+
r === void 0 && (r = {}, l[e] = r);
|
|
3325
3325
|
let i = r[t];
|
|
3326
|
-
i === void 0 && (i = a.clone(), r[t] = i, n.addEventListener("dispose",
|
|
3326
|
+
i === void 0 && (i = a.clone(), r[t] = i, n.addEventListener("dispose", T)), a = i;
|
|
3327
3327
|
}
|
|
3328
|
-
if (a.visible = n.visible, a.wireframe = n.wireframe, i === 3 ? a.side = n.shadowSide === null ? n.side : n.shadowSide : a.side = n.shadowSide === null ?
|
|
3328
|
+
if (a.visible = n.visible, a.wireframe = n.wireframe, i === 3 ? a.side = n.shadowSide === null ? n.side : n.shadowSide : a.side = n.shadowSide === null ? d[n.side] : n.shadowSide, a.alphaMap = n.alphaMap, a.alphaTest = n.alphaToCoverage === !0 ? .5 : n.alphaTest, a.map = n.map, a.clipShadows = n.clipShadows, a.clippingPlanes = n.clippingPlanes, a.clipIntersection = n.clipIntersection, a.displacementMap = n.displacementMap, a.displacementScale = n.displacementScale, a.displacementBias = n.displacementBias, a.wireframeLinewidth = n.wireframeLinewidth, a.linewidth = n.linewidth, r.isPointLight === !0 && a.isMeshDistanceMaterial === !0) {
|
|
3329
3329
|
let t = e.properties.get(a);
|
|
3330
3330
|
t.light = r;
|
|
3331
3331
|
}
|
|
3332
3332
|
return a;
|
|
3333
3333
|
}
|
|
3334
|
-
function
|
|
3334
|
+
function w(n, i, a, o, s) {
|
|
3335
3335
|
if (n.visible === !1) return;
|
|
3336
3336
|
if (n.layers.test(i.layers) && (n.isMesh || n.isLine || n.isPoints) && (n.castShadow || n.receiveShadow && s === 3) && (!n.frustumCulled || r.intersectsObject(n))) {
|
|
3337
3337
|
n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse, n.matrixWorld);
|
|
@@ -3341,29 +3341,29 @@ function Ci(e, t, n) {
|
|
|
3341
3341
|
for (let l = 0, u = t.length; l < u; l++) {
|
|
3342
3342
|
let u = t[l], d = c[u.materialIndex];
|
|
3343
3343
|
if (d && d.visible) {
|
|
3344
|
-
let t =
|
|
3344
|
+
let t = C(n, d, o, s);
|
|
3345
3345
|
n.onBeforeShadow(e, n, i, a, r, t, u), e.renderBufferDirect(a, null, r, t, n, u), n.onAfterShadow(e, n, i, a, r, t, u);
|
|
3346
3346
|
}
|
|
3347
3347
|
}
|
|
3348
3348
|
} else if (c.visible) {
|
|
3349
|
-
let t =
|
|
3349
|
+
let t = C(n, c, o, s);
|
|
3350
3350
|
n.onBeforeShadow(e, n, i, a, r, t, null), e.renderBufferDirect(a, null, r, t, n, null), n.onAfterShadow(e, n, i, a, r, t, null);
|
|
3351
3351
|
}
|
|
3352
3352
|
}
|
|
3353
3353
|
let c = n.children;
|
|
3354
|
-
for (let e = 0, t = c.length; e < t; e++)
|
|
3354
|
+
for (let e = 0, t = c.length; e < t; e++) w(c[e], i, a, o, s);
|
|
3355
3355
|
}
|
|
3356
|
-
function
|
|
3357
|
-
e.target.removeEventListener("dispose",
|
|
3358
|
-
for (let t in
|
|
3359
|
-
let n =
|
|
3356
|
+
function T(e) {
|
|
3357
|
+
e.target.removeEventListener("dispose", T);
|
|
3358
|
+
for (let t in l) {
|
|
3359
|
+
let n = l[t], r = e.target.uuid;
|
|
3360
3360
|
r in n && (n[r].dispose(), delete n[r]);
|
|
3361
3361
|
}
|
|
3362
3362
|
}
|
|
3363
3363
|
}
|
|
3364
3364
|
function wi(e, t) {
|
|
3365
3365
|
function n() {
|
|
3366
|
-
let t = !1, n = new
|
|
3366
|
+
let t = !1, n = new tt(), r = null, i = new tt(0, 0, 0, 0);
|
|
3367
3367
|
return {
|
|
3368
3368
|
setMask: function(n) {
|
|
3369
3369
|
r !== n && !t && (e.colorMask(n, n, n, n), r = n);
|
|
@@ -3394,13 +3394,13 @@ function wi(e, t) {
|
|
|
3394
3394
|
return r;
|
|
3395
3395
|
},
|
|
3396
3396
|
setTest: function(t) {
|
|
3397
|
-
t ?
|
|
3397
|
+
t ? se(e.DEPTH_TEST) : R(e.DEPTH_TEST);
|
|
3398
3398
|
},
|
|
3399
3399
|
setMask: function(t) {
|
|
3400
3400
|
i !== t && !n && (e.depthMask(t), i = t);
|
|
3401
3401
|
},
|
|
3402
3402
|
setFunc: function(t) {
|
|
3403
|
-
if (r && (t =
|
|
3403
|
+
if (r && (t = ie[t]), a !== t) {
|
|
3404
3404
|
switch (t) {
|
|
3405
3405
|
case 0:
|
|
3406
3406
|
e.depthFunc(e.NEVER);
|
|
@@ -3446,7 +3446,7 @@ function wi(e, t) {
|
|
|
3446
3446
|
let t = !1, n = null, r = null, i = null, a = null, o = null, s = null, c = null, l = null;
|
|
3447
3447
|
return {
|
|
3448
3448
|
setTest: function(n) {
|
|
3449
|
-
t || (n ?
|
|
3449
|
+
t || (n ? se(e.STENCIL_TEST) : R(e.STENCIL_TEST));
|
|
3450
3450
|
},
|
|
3451
3451
|
setMask: function(r) {
|
|
3452
3452
|
n !== r && !t && (e.stencilMask(r), n = r);
|
|
@@ -3468,30 +3468,30 @@ function wi(e, t) {
|
|
|
3468
3468
|
}
|
|
3469
3469
|
};
|
|
3470
3470
|
}
|
|
3471
|
-
let a = new n(), o = new r(), s = new i(), c = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap(), u = {},
|
|
3472
|
-
|
|
3473
|
-
let
|
|
3474
|
-
function
|
|
3471
|
+
let a = new n(), o = new r(), s = new i(), c = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap(), u = {}, d = {}, f = {}, p = /* @__PURE__ */ new WeakMap(), m = [], h = null, g = !1, _ = null, v = null, y = null, b = null, x = null, S = null, C = null, w = new V(0, 0, 0), T = 0, E = !1, D = null, O = null, k = null, A = null, j = null, M = e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS), ee = !1, N = 0, P = e.getParameter(e.VERSION);
|
|
3472
|
+
P.indexOf("WebGL") === -1 ? P.indexOf("OpenGL ES") !== -1 && (N = parseFloat(/^OpenGL ES (\d)/.exec(P)[1]), ee = N >= 2) : (N = parseFloat(/^WebGL (\d)/.exec(P)[1]), ee = N >= 1);
|
|
3473
|
+
let te = null, F = {}, ne = e.getParameter(e.SCISSOR_BOX), re = e.getParameter(e.VIEWPORT), ae = new tt().fromArray(ne), I = new tt().fromArray(re);
|
|
3474
|
+
function L(t, n, r, i) {
|
|
3475
3475
|
let a = /* @__PURE__ */ new Uint8Array(4), o = e.createTexture();
|
|
3476
3476
|
e.bindTexture(t, o), e.texParameteri(t, e.TEXTURE_MIN_FILTER, e.NEAREST), e.texParameteri(t, e.TEXTURE_MAG_FILTER, e.NEAREST);
|
|
3477
3477
|
for (let o = 0; o < r; o++) t === e.TEXTURE_3D || t === e.TEXTURE_2D_ARRAY ? e.texImage3D(n, 0, e.RGBA, 1, 1, i, 0, e.RGBA, e.UNSIGNED_BYTE, a) : e.texImage2D(n + o, 0, e.RGBA, 1, 1, 0, e.RGBA, e.UNSIGNED_BYTE, a);
|
|
3478
3478
|
return o;
|
|
3479
3479
|
}
|
|
3480
|
-
let
|
|
3481
|
-
|
|
3482
|
-
function
|
|
3480
|
+
let oe = {};
|
|
3481
|
+
oe[e.TEXTURE_2D] = L(e.TEXTURE_2D, e.TEXTURE_2D, 1), oe[e.TEXTURE_CUBE_MAP] = L(e.TEXTURE_CUBE_MAP, e.TEXTURE_CUBE_MAP_POSITIVE_X, 6), oe[e.TEXTURE_2D_ARRAY] = L(e.TEXTURE_2D_ARRAY, e.TEXTURE_2D_ARRAY, 1, 1), oe[e.TEXTURE_3D] = L(e.TEXTURE_3D, e.TEXTURE_3D, 1, 1), a.setClear(0, 0, 0, 1), o.setClear(1), s.setClear(0), se(e.DEPTH_TEST), o.setFunc(3), me(!1), he(1), se(e.CULL_FACE), pe(0);
|
|
3482
|
+
function se(t) {
|
|
3483
3483
|
u[t] !== !0 && (e.enable(t), u[t] = !0);
|
|
3484
3484
|
}
|
|
3485
|
-
function
|
|
3485
|
+
function R(t) {
|
|
3486
3486
|
u[t] !== !1 && (e.disable(t), u[t] = !1);
|
|
3487
3487
|
}
|
|
3488
|
-
function
|
|
3489
|
-
return
|
|
3488
|
+
function ce(t, n) {
|
|
3489
|
+
return f[t] !== n && (e.bindFramebuffer(t, n), f[t] = n, t === e.DRAW_FRAMEBUFFER && (f[e.FRAMEBUFFER] = n), t === e.FRAMEBUFFER && (f[e.DRAW_FRAMEBUFFER] = n), !0);
|
|
3490
3490
|
}
|
|
3491
|
-
function
|
|
3492
|
-
let r =
|
|
3491
|
+
function le(t, n) {
|
|
3492
|
+
let r = m, i = !1;
|
|
3493
3493
|
if (t) {
|
|
3494
|
-
r =
|
|
3494
|
+
r = p.get(n), r === void 0 && (r = [], p.set(n, r));
|
|
3495
3495
|
let a = t.textures;
|
|
3496
3496
|
if (r.length !== a.length || r[0] !== e.COLOR_ATTACHMENT0) {
|
|
3497
3497
|
for (let t = 0, n = a.length; t < n; t++) r[t] = e.COLOR_ATTACHMENT0 + t;
|
|
@@ -3500,16 +3500,16 @@ function wi(e, t) {
|
|
|
3500
3500
|
} else r[0] !== e.BACK && (r[0] = e.BACK, i = !0);
|
|
3501
3501
|
i && e.drawBuffers(r);
|
|
3502
3502
|
}
|
|
3503
|
-
function
|
|
3504
|
-
return
|
|
3503
|
+
function ue(t) {
|
|
3504
|
+
return h !== t && (e.useProgram(t), h = t, !0);
|
|
3505
3505
|
}
|
|
3506
|
-
let
|
|
3506
|
+
let de = {
|
|
3507
3507
|
100: e.FUNC_ADD,
|
|
3508
3508
|
101: e.FUNC_SUBTRACT,
|
|
3509
3509
|
102: e.FUNC_REVERSE_SUBTRACT
|
|
3510
3510
|
};
|
|
3511
|
-
|
|
3512
|
-
let
|
|
3511
|
+
de[103] = e.MIN, de[104] = e.MAX;
|
|
3512
|
+
let fe = {
|
|
3513
3513
|
200: e.ZERO,
|
|
3514
3514
|
201: e.ONE,
|
|
3515
3515
|
202: e.SRC_COLOR,
|
|
@@ -3526,14 +3526,14 @@ function wi(e, t) {
|
|
|
3526
3526
|
213: e.CONSTANT_ALPHA,
|
|
3527
3527
|
214: e.ONE_MINUS_CONSTANT_ALPHA
|
|
3528
3528
|
};
|
|
3529
|
-
function
|
|
3529
|
+
function pe(t, n, r, i, a, o, s, c, l, u) {
|
|
3530
3530
|
if (t === 0) {
|
|
3531
|
-
|
|
3531
|
+
g === !0 && (R(e.BLEND), g = !1);
|
|
3532
3532
|
return;
|
|
3533
3533
|
}
|
|
3534
|
-
if (
|
|
3535
|
-
if (t !==
|
|
3536
|
-
if ((
|
|
3534
|
+
if (g === !1 && (se(e.BLEND), g = !0), t !== 5) {
|
|
3535
|
+
if (t !== _ || u !== E) {
|
|
3536
|
+
if ((v !== 100 || x !== 100) && (e.blendEquation(e.FUNC_ADD), v = 100, x = 100), u) switch (t) {
|
|
3537
3537
|
case 1:
|
|
3538
3538
|
e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA);
|
|
3539
3539
|
break;
|
|
@@ -3546,7 +3546,7 @@ function wi(e, t) {
|
|
|
3546
3546
|
case 4:
|
|
3547
3547
|
e.blendFuncSeparate(e.DST_COLOR, e.ONE_MINUS_SRC_ALPHA, e.ZERO, e.ONE);
|
|
3548
3548
|
break;
|
|
3549
|
-
default:
|
|
3549
|
+
default: U("WebGLState: Invalid blending: ", t);
|
|
3550
3550
|
}
|
|
3551
3551
|
else switch (t) {
|
|
3552
3552
|
case 1:
|
|
@@ -3556,137 +3556,137 @@ function wi(e, t) {
|
|
|
3556
3556
|
e.blendFuncSeparate(e.SRC_ALPHA, e.ONE, e.ONE, e.ONE);
|
|
3557
3557
|
break;
|
|
3558
3558
|
case 3:
|
|
3559
|
-
|
|
3559
|
+
U("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");
|
|
3560
3560
|
break;
|
|
3561
3561
|
case 4:
|
|
3562
|
-
|
|
3562
|
+
U("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");
|
|
3563
3563
|
break;
|
|
3564
|
-
default:
|
|
3564
|
+
default: U("WebGLState: Invalid blending: ", t);
|
|
3565
3565
|
}
|
|
3566
|
-
|
|
3566
|
+
y = null, b = null, S = null, C = null, w.set(0, 0, 0), T = 0, _ = t, E = u;
|
|
3567
3567
|
}
|
|
3568
3568
|
return;
|
|
3569
3569
|
}
|
|
3570
|
-
a ||= n, o ||= r, s ||= i, (n !==
|
|
3570
|
+
a ||= n, o ||= r, s ||= i, (n !== v || a !== x) && (e.blendEquationSeparate(de[n], de[a]), v = n, x = a), (r !== y || i !== b || o !== S || s !== C) && (e.blendFuncSeparate(fe[r], fe[i], fe[o], fe[s]), y = r, b = i, S = o, C = s), (c.equals(w) === !1 || l !== T) && (e.blendColor(c.r, c.g, c.b, l), w.copy(c), T = l), _ = t, E = !1;
|
|
3571
3571
|
}
|
|
3572
|
-
function
|
|
3573
|
-
t.side === 2 ?
|
|
3572
|
+
function z(t, n) {
|
|
3573
|
+
t.side === 2 ? R(e.CULL_FACE) : se(e.CULL_FACE);
|
|
3574
3574
|
let r = t.side === 1;
|
|
3575
|
-
n && (r = !r),
|
|
3575
|
+
n && (r = !r), me(r), t.blending === 1 && t.transparent === !1 ? pe(0) : pe(t.blending, t.blendEquation, t.blendSrc, t.blendDst, t.blendEquationAlpha, t.blendSrcAlpha, t.blendDstAlpha, t.blendColor, t.blendAlpha, t.premultipliedAlpha), o.setFunc(t.depthFunc), o.setTest(t.depthTest), o.setMask(t.depthWrite), a.setMask(t.colorWrite);
|
|
3576
3576
|
let i = t.stencilWrite;
|
|
3577
|
-
s.setTest(i), i && (s.setMask(t.stencilWriteMask), s.setFunc(t.stencilFunc, t.stencilRef, t.stencilFuncMask), s.setOp(t.stencilFail, t.stencilZFail, t.stencilZPass)), ge(t.polygonOffset, t.polygonOffsetFactor, t.polygonOffsetUnits), t.alphaToCoverage === !0 ?
|
|
3578
|
-
}
|
|
3579
|
-
function H(t) {
|
|
3580
|
-
k !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW), k = t);
|
|
3577
|
+
s.setTest(i), i && (s.setMask(t.stencilWriteMask), s.setFunc(t.stencilFunc, t.stencilRef, t.stencilFuncMask), s.setOp(t.stencilFail, t.stencilZFail, t.stencilZPass)), ge(t.polygonOffset, t.polygonOffsetFactor, t.polygonOffsetUnits), t.alphaToCoverage === !0 ? se(e.SAMPLE_ALPHA_TO_COVERAGE) : R(e.SAMPLE_ALPHA_TO_COVERAGE);
|
|
3581
3578
|
}
|
|
3582
3579
|
function me(t) {
|
|
3583
|
-
|
|
3580
|
+
D !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW), D = t);
|
|
3584
3581
|
}
|
|
3585
3582
|
function he(t) {
|
|
3586
|
-
t !==
|
|
3583
|
+
t === 0 ? R(e.CULL_FACE) : (se(e.CULL_FACE), t !== O && (t === 1 ? e.cullFace(e.BACK) : t === 2 ? e.cullFace(e.FRONT) : e.cullFace(e.FRONT_AND_BACK))), O = t;
|
|
3584
|
+
}
|
|
3585
|
+
function B(t) {
|
|
3586
|
+
t !== k && (ee && e.lineWidth(t), k = t);
|
|
3587
3587
|
}
|
|
3588
3588
|
function ge(t, n, r) {
|
|
3589
|
-
t ? (
|
|
3589
|
+
t ? (se(e.POLYGON_OFFSET_FILL), (A !== n || j !== r) && (A = n, j = r, o.getReversed() && (n = -n), e.polygonOffset(n, r))) : R(e.POLYGON_OFFSET_FILL);
|
|
3590
3590
|
}
|
|
3591
3591
|
function _e(t) {
|
|
3592
|
-
t ?
|
|
3592
|
+
t ? se(e.SCISSOR_TEST) : R(e.SCISSOR_TEST);
|
|
3593
3593
|
}
|
|
3594
3594
|
function ve(t) {
|
|
3595
|
-
t === void 0 && (t = e.TEXTURE0 +
|
|
3595
|
+
t === void 0 && (t = e.TEXTURE0 + M - 1), te !== t && (e.activeTexture(t), te = t);
|
|
3596
3596
|
}
|
|
3597
3597
|
function ye(t, n, r) {
|
|
3598
|
-
r === void 0 && (r =
|
|
3599
|
-
let i =
|
|
3598
|
+
r === void 0 && (r = te === null ? e.TEXTURE0 + M - 1 : te);
|
|
3599
|
+
let i = F[r];
|
|
3600
3600
|
i === void 0 && (i = {
|
|
3601
3601
|
type: void 0,
|
|
3602
3602
|
texture: void 0
|
|
3603
|
-
},
|
|
3603
|
+
}, F[r] = i), (i.type !== t || i.texture !== n) && (te !== r && (e.activeTexture(r), te = r), e.bindTexture(t, n || oe[t]), i.type = t, i.texture = n);
|
|
3604
3604
|
}
|
|
3605
3605
|
function be() {
|
|
3606
|
-
let t =
|
|
3606
|
+
let t = F[te];
|
|
3607
3607
|
t !== void 0 && t.type !== void 0 && (e.bindTexture(t.type, null), t.type = void 0, t.texture = void 0);
|
|
3608
3608
|
}
|
|
3609
3609
|
function xe() {
|
|
3610
3610
|
try {
|
|
3611
3611
|
e.compressedTexImage2D(...arguments);
|
|
3612
3612
|
} catch (e) {
|
|
3613
|
-
|
|
3613
|
+
U("WebGLState:", e);
|
|
3614
3614
|
}
|
|
3615
3615
|
}
|
|
3616
3616
|
function Se() {
|
|
3617
3617
|
try {
|
|
3618
3618
|
e.compressedTexImage3D(...arguments);
|
|
3619
3619
|
} catch (e) {
|
|
3620
|
-
|
|
3620
|
+
U("WebGLState:", e);
|
|
3621
3621
|
}
|
|
3622
3622
|
}
|
|
3623
3623
|
function Ce() {
|
|
3624
3624
|
try {
|
|
3625
3625
|
e.texSubImage2D(...arguments);
|
|
3626
3626
|
} catch (e) {
|
|
3627
|
-
|
|
3627
|
+
U("WebGLState:", e);
|
|
3628
3628
|
}
|
|
3629
3629
|
}
|
|
3630
3630
|
function we() {
|
|
3631
3631
|
try {
|
|
3632
3632
|
e.texSubImage3D(...arguments);
|
|
3633
3633
|
} catch (e) {
|
|
3634
|
-
|
|
3634
|
+
U("WebGLState:", e);
|
|
3635
3635
|
}
|
|
3636
3636
|
}
|
|
3637
3637
|
function Te() {
|
|
3638
3638
|
try {
|
|
3639
3639
|
e.compressedTexSubImage2D(...arguments);
|
|
3640
3640
|
} catch (e) {
|
|
3641
|
-
|
|
3641
|
+
U("WebGLState:", e);
|
|
3642
3642
|
}
|
|
3643
3643
|
}
|
|
3644
3644
|
function Ee() {
|
|
3645
3645
|
try {
|
|
3646
3646
|
e.compressedTexSubImage3D(...arguments);
|
|
3647
3647
|
} catch (e) {
|
|
3648
|
-
|
|
3648
|
+
U("WebGLState:", e);
|
|
3649
3649
|
}
|
|
3650
3650
|
}
|
|
3651
3651
|
function De() {
|
|
3652
3652
|
try {
|
|
3653
3653
|
e.texStorage2D(...arguments);
|
|
3654
3654
|
} catch (e) {
|
|
3655
|
-
|
|
3655
|
+
U("WebGLState:", e);
|
|
3656
3656
|
}
|
|
3657
3657
|
}
|
|
3658
3658
|
function Oe() {
|
|
3659
3659
|
try {
|
|
3660
3660
|
e.texStorage3D(...arguments);
|
|
3661
3661
|
} catch (e) {
|
|
3662
|
-
|
|
3662
|
+
U("WebGLState:", e);
|
|
3663
3663
|
}
|
|
3664
3664
|
}
|
|
3665
3665
|
function ke() {
|
|
3666
3666
|
try {
|
|
3667
3667
|
e.texImage2D(...arguments);
|
|
3668
3668
|
} catch (e) {
|
|
3669
|
-
|
|
3669
|
+
U("WebGLState:", e);
|
|
3670
3670
|
}
|
|
3671
3671
|
}
|
|
3672
3672
|
function Ae() {
|
|
3673
3673
|
try {
|
|
3674
3674
|
e.texImage3D(...arguments);
|
|
3675
3675
|
} catch (e) {
|
|
3676
|
-
|
|
3676
|
+
U("WebGLState:", e);
|
|
3677
3677
|
}
|
|
3678
3678
|
}
|
|
3679
3679
|
function je(t) {
|
|
3680
|
-
return
|
|
3680
|
+
return d[t] === void 0 ? e.getParameter(t) : d[t];
|
|
3681
3681
|
}
|
|
3682
|
-
function
|
|
3683
|
-
|
|
3682
|
+
function Me(t, n) {
|
|
3683
|
+
d[t] !== n && (e.pixelStorei(t, n), d[t] = n);
|
|
3684
3684
|
}
|
|
3685
|
-
function
|
|
3686
|
-
|
|
3685
|
+
function H(t) {
|
|
3686
|
+
ae.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w), ae.copy(t));
|
|
3687
3687
|
}
|
|
3688
3688
|
function Ne(t) {
|
|
3689
|
-
|
|
3689
|
+
I.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w), I.copy(t));
|
|
3690
3690
|
}
|
|
3691
3691
|
function Pe(t, n) {
|
|
3692
3692
|
let r = l.get(n);
|
|
@@ -3694,12 +3694,12 @@ function wi(e, t) {
|
|
|
3694
3694
|
let i = r.get(t);
|
|
3695
3695
|
i === void 0 && (i = e.getUniformBlockIndex(n, t.name), r.set(t, i));
|
|
3696
3696
|
}
|
|
3697
|
-
function
|
|
3697
|
+
function Fe(t, n) {
|
|
3698
3698
|
let r = l.get(n).get(t);
|
|
3699
3699
|
c.get(n) !== r && (e.uniformBlockBinding(n, r, t.__bindingPointIndex), c.set(n, r));
|
|
3700
3700
|
}
|
|
3701
|
-
function
|
|
3702
|
-
e.disable(e.BLEND), e.disable(e.CULL_FACE), e.disable(e.DEPTH_TEST), e.disable(e.POLYGON_OFFSET_FILL), e.disable(e.SCISSOR_TEST), e.disable(e.STENCIL_TEST), e.disable(e.SAMPLE_ALPHA_TO_COVERAGE), e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ONE, e.ZERO), e.blendFuncSeparate(e.ONE, e.ZERO, e.ONE, e.ZERO), e.blendColor(0, 0, 0, 0), e.colorMask(!0, !0, !0, !0), e.clearColor(0, 0, 0, 0), e.depthMask(!0), e.depthFunc(e.LESS), o.setReversed(!1), e.clearDepth(1), e.stencilMask(4294967295), e.stencilFunc(e.ALWAYS, 0, 4294967295), e.stencilOp(e.KEEP, e.KEEP, e.KEEP), e.clearStencil(0), e.cullFace(e.BACK), e.frontFace(e.CCW), e.polygonOffset(0, 0), e.activeTexture(e.TEXTURE0), e.bindFramebuffer(e.FRAMEBUFFER, null), e.bindFramebuffer(e.DRAW_FRAMEBUFFER, null), e.bindFramebuffer(e.READ_FRAMEBUFFER, null), e.useProgram(null), e.lineWidth(1), e.scissor(0, 0, e.canvas.width, e.canvas.height), e.viewport(0, 0, e.canvas.width, e.canvas.height), e.pixelStorei(e.PACK_ALIGNMENT, 4), e.pixelStorei(e.UNPACK_ALIGNMENT, 4), e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL, !1), e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !1), e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL, e.BROWSER_DEFAULT_WEBGL), e.pixelStorei(e.PACK_ROW_LENGTH, 0), e.pixelStorei(e.PACK_SKIP_PIXELS, 0), e.pixelStorei(e.PACK_SKIP_ROWS, 0), e.pixelStorei(e.UNPACK_ROW_LENGTH, 0), e.pixelStorei(e.UNPACK_IMAGE_HEIGHT, 0), e.pixelStorei(e.UNPACK_SKIP_PIXELS, 0), e.pixelStorei(e.UNPACK_SKIP_ROWS, 0), e.pixelStorei(e.UNPACK_SKIP_IMAGES, 0), u = {},
|
|
3701
|
+
function Ie() {
|
|
3702
|
+
e.disable(e.BLEND), e.disable(e.CULL_FACE), e.disable(e.DEPTH_TEST), e.disable(e.POLYGON_OFFSET_FILL), e.disable(e.SCISSOR_TEST), e.disable(e.STENCIL_TEST), e.disable(e.SAMPLE_ALPHA_TO_COVERAGE), e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ONE, e.ZERO), e.blendFuncSeparate(e.ONE, e.ZERO, e.ONE, e.ZERO), e.blendColor(0, 0, 0, 0), e.colorMask(!0, !0, !0, !0), e.clearColor(0, 0, 0, 0), e.depthMask(!0), e.depthFunc(e.LESS), o.setReversed(!1), e.clearDepth(1), e.stencilMask(4294967295), e.stencilFunc(e.ALWAYS, 0, 4294967295), e.stencilOp(e.KEEP, e.KEEP, e.KEEP), e.clearStencil(0), e.cullFace(e.BACK), e.frontFace(e.CCW), e.polygonOffset(0, 0), e.activeTexture(e.TEXTURE0), e.bindFramebuffer(e.FRAMEBUFFER, null), e.bindFramebuffer(e.DRAW_FRAMEBUFFER, null), e.bindFramebuffer(e.READ_FRAMEBUFFER, null), e.useProgram(null), e.lineWidth(1), e.scissor(0, 0, e.canvas.width, e.canvas.height), e.viewport(0, 0, e.canvas.width, e.canvas.height), e.pixelStorei(e.PACK_ALIGNMENT, 4), e.pixelStorei(e.UNPACK_ALIGNMENT, 4), e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL, !1), e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !1), e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL, e.BROWSER_DEFAULT_WEBGL), e.pixelStorei(e.PACK_ROW_LENGTH, 0), e.pixelStorei(e.PACK_SKIP_PIXELS, 0), e.pixelStorei(e.PACK_SKIP_ROWS, 0), e.pixelStorei(e.UNPACK_ROW_LENGTH, 0), e.pixelStorei(e.UNPACK_IMAGE_HEIGHT, 0), e.pixelStorei(e.UNPACK_SKIP_PIXELS, 0), e.pixelStorei(e.UNPACK_SKIP_ROWS, 0), e.pixelStorei(e.UNPACK_SKIP_IMAGES, 0), u = {}, d = {}, te = null, F = {}, f = {}, p = /* @__PURE__ */ new WeakMap(), m = [], h = null, g = !1, _ = null, v = null, y = null, b = null, x = null, S = null, C = null, w = new V(0, 0, 0), T = 0, E = !1, D = null, O = null, k = null, A = null, j = null, ae.set(0, 0, e.canvas.width, e.canvas.height), I.set(0, 0, e.canvas.width, e.canvas.height), a.reset(), o.reset(), s.reset();
|
|
3703
3703
|
}
|
|
3704
3704
|
return {
|
|
3705
3705
|
buffers: {
|
|
@@ -3707,16 +3707,16 @@ function wi(e, t) {
|
|
|
3707
3707
|
depth: o,
|
|
3708
3708
|
stencil: s
|
|
3709
3709
|
},
|
|
3710
|
-
enable:
|
|
3711
|
-
disable:
|
|
3712
|
-
bindFramebuffer:
|
|
3713
|
-
drawBuffers:
|
|
3714
|
-
useProgram:
|
|
3715
|
-
setBlending:
|
|
3716
|
-
setMaterial:
|
|
3717
|
-
setFlipSided:
|
|
3718
|
-
setCullFace:
|
|
3719
|
-
setLineWidth:
|
|
3710
|
+
enable: se,
|
|
3711
|
+
disable: R,
|
|
3712
|
+
bindFramebuffer: ce,
|
|
3713
|
+
drawBuffers: le,
|
|
3714
|
+
useProgram: ue,
|
|
3715
|
+
setBlending: pe,
|
|
3716
|
+
setMaterial: z,
|
|
3717
|
+
setFlipSided: me,
|
|
3718
|
+
setCullFace: he,
|
|
3719
|
+
setLineWidth: B,
|
|
3720
3720
|
setPolygonOffset: ge,
|
|
3721
3721
|
setScissorTest: _e,
|
|
3722
3722
|
activeTexture: ve,
|
|
@@ -3726,39 +3726,39 @@ function wi(e, t) {
|
|
|
3726
3726
|
compressedTexImage3D: Se,
|
|
3727
3727
|
texImage2D: ke,
|
|
3728
3728
|
texImage3D: Ae,
|
|
3729
|
-
pixelStorei:
|
|
3729
|
+
pixelStorei: Me,
|
|
3730
3730
|
getParameter: je,
|
|
3731
3731
|
updateUBOMapping: Pe,
|
|
3732
|
-
uniformBlockBinding:
|
|
3732
|
+
uniformBlockBinding: Fe,
|
|
3733
3733
|
texStorage2D: De,
|
|
3734
3734
|
texStorage3D: Oe,
|
|
3735
3735
|
texSubImage2D: Ce,
|
|
3736
3736
|
texSubImage3D: we,
|
|
3737
3737
|
compressedTexSubImage2D: Te,
|
|
3738
3738
|
compressedTexSubImage3D: Ee,
|
|
3739
|
-
scissor:
|
|
3739
|
+
scissor: H,
|
|
3740
3740
|
viewport: Ne,
|
|
3741
|
-
reset:
|
|
3741
|
+
reset: Ie
|
|
3742
3742
|
};
|
|
3743
3743
|
}
|
|
3744
3744
|
function Ti(e, t, n, r, i, a, o) {
|
|
3745
|
-
let s = t.has("WEBGL_multisampled_render_to_texture") ? t.get("WEBGL_multisampled_render_to_texture") : null, c = typeof navigator > "u" ? !1 : /OculusBrowser/g.test(navigator.userAgent), u = new
|
|
3745
|
+
let s = t.has("WEBGL_multisampled_render_to_texture") ? t.get("WEBGL_multisampled_render_to_texture") : null, c = typeof navigator > "u" ? !1 : /OculusBrowser/g.test(navigator.userAgent), u = new L(), p = /* @__PURE__ */ new WeakMap(), m = /* @__PURE__ */ new Set(), h, g = /* @__PURE__ */ new WeakMap(), v = !1;
|
|
3746
3746
|
try {
|
|
3747
|
-
|
|
3747
|
+
v = typeof OffscreenCanvas < "u" && new OffscreenCanvas(1, 1).getContext("2d") !== null;
|
|
3748
3748
|
} catch {}
|
|
3749
3749
|
function y(e, t) {
|
|
3750
|
-
return
|
|
3750
|
+
return v ? new OffscreenCanvas(e, t) : d("canvas");
|
|
3751
3751
|
}
|
|
3752
3752
|
function b(e, t, n) {
|
|
3753
|
-
let r = 1, i =
|
|
3753
|
+
let r = 1, i = H(e);
|
|
3754
3754
|
if ((i.width > n || i.height > n) && (r = n / Math.max(i.width, i.height)), r < 1) {
|
|
3755
3755
|
if (typeof HTMLImageElement < "u" && e instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && e instanceof ImageBitmap || typeof VideoFrame < "u" && e instanceof VideoFrame) {
|
|
3756
3756
|
let n = Math.floor(r * i.width), a = Math.floor(r * i.height);
|
|
3757
3757
|
h === void 0 && (h = y(n, a));
|
|
3758
3758
|
let o = t ? y(n, a) : h;
|
|
3759
|
-
return o.width = n, o.height = a, o.getContext("2d").drawImage(e, 0, 0, n, a),
|
|
3759
|
+
return o.width = n, o.height = a, o.getContext("2d").drawImage(e, 0, 0, n, a), j("WebGLRenderer: Texture has been resized from (" + i.width + "x" + i.height + ") to (" + n + "x" + a + ")."), o;
|
|
3760
3760
|
}
|
|
3761
|
-
return "data" in e &&
|
|
3761
|
+
return "data" in e && j("WebGLRenderer: Image in DataTexture is too big (" + i.width + "x" + i.height + ")."), e;
|
|
3762
3762
|
}
|
|
3763
3763
|
return e;
|
|
3764
3764
|
}
|
|
@@ -3768,28 +3768,28 @@ function Ti(e, t, n, r, i, a, o) {
|
|
|
3768
3768
|
function S(t) {
|
|
3769
3769
|
e.generateMipmap(t);
|
|
3770
3770
|
}
|
|
3771
|
-
function
|
|
3771
|
+
function w(t) {
|
|
3772
3772
|
return t.isWebGLCubeRenderTarget ? e.TEXTURE_CUBE_MAP : t.isWebGL3DRenderTarget ? e.TEXTURE_3D : t.isWebGLArrayRenderTarget || t.isCompressedArrayTexture ? e.TEXTURE_2D_ARRAY : e.TEXTURE_2D;
|
|
3773
3773
|
}
|
|
3774
|
-
function
|
|
3774
|
+
function T(n, r, i, a, o, s = !1) {
|
|
3775
3775
|
if (n !== null) {
|
|
3776
3776
|
if (e[n] !== void 0) return e[n];
|
|
3777
|
-
|
|
3777
|
+
j("WebGLRenderer: Attempt to use non-existing WebGL internal format '" + n + "'");
|
|
3778
3778
|
}
|
|
3779
3779
|
let c;
|
|
3780
|
-
a && (c = t.get("EXT_texture_norm16"), c ||
|
|
3780
|
+
a && (c = t.get("EXT_texture_norm16"), c || j("WebGLRenderer: Unable to use normalized textures without EXT_texture_norm16 extension"));
|
|
3781
3781
|
let l = r;
|
|
3782
3782
|
if (r === e.RED && (i === e.FLOAT && (l = e.R32F), i === e.HALF_FLOAT && (l = e.R16F), i === e.UNSIGNED_BYTE && (l = e.R8), i === e.UNSIGNED_SHORT && c && (l = c.R16_EXT), i === e.SHORT && c && (l = c.R16_SNORM_EXT)), r === e.RED_INTEGER && (i === e.UNSIGNED_BYTE && (l = e.R8UI), i === e.UNSIGNED_SHORT && (l = e.R16UI), i === e.UNSIGNED_INT && (l = e.R32UI), i === e.BYTE && (l = e.R8I), i === e.SHORT && (l = e.R16I), i === e.INT && (l = e.R32I)), r === e.RG && (i === e.FLOAT && (l = e.RG32F), i === e.HALF_FLOAT && (l = e.RG16F), i === e.UNSIGNED_BYTE && (l = e.RG8), i === e.UNSIGNED_SHORT && c && (l = c.RG16_EXT), i === e.SHORT && c && (l = c.RG16_SNORM_EXT)), r === e.RG_INTEGER && (i === e.UNSIGNED_BYTE && (l = e.RG8UI), i === e.UNSIGNED_SHORT && (l = e.RG16UI), i === e.UNSIGNED_INT && (l = e.RG32UI), i === e.BYTE && (l = e.RG8I), i === e.SHORT && (l = e.RG16I), i === e.INT && (l = e.RG32I)), r === e.RGB_INTEGER && (i === e.UNSIGNED_BYTE && (l = e.RGB8UI), i === e.UNSIGNED_SHORT && (l = e.RGB16UI), i === e.UNSIGNED_INT && (l = e.RGB32UI), i === e.BYTE && (l = e.RGB8I), i === e.SHORT && (l = e.RGB16I), i === e.INT && (l = e.RGB32I)), r === e.RGBA_INTEGER && (i === e.UNSIGNED_BYTE && (l = e.RGBA8UI), i === e.UNSIGNED_SHORT && (l = e.RGBA16UI), i === e.UNSIGNED_INT && (l = e.RGBA32UI), i === e.BYTE && (l = e.RGBA8I), i === e.SHORT && (l = e.RGBA16I), i === e.INT && (l = e.RGBA32I)), r === e.RGB && (i === e.UNSIGNED_SHORT && c && (l = c.RGB16_EXT), i === e.SHORT && c && (l = c.RGB16_SNORM_EXT), i === e.UNSIGNED_INT_5_9_9_9_REV && (l = e.RGB9_E5), i === e.UNSIGNED_INT_10F_11F_11F_REV && (l = e.R11F_G11F_B10F)), r === e.RGBA) {
|
|
3783
|
-
let t = s ?
|
|
3783
|
+
let t = s ? de : B.getTransfer(o);
|
|
3784
3784
|
i === e.FLOAT && (l = e.RGBA32F), i === e.HALF_FLOAT && (l = e.RGBA16F), i === e.UNSIGNED_BYTE && (l = t === "srgb" ? e.SRGB8_ALPHA8 : e.RGBA8), i === e.UNSIGNED_SHORT && c && (l = c.RGBA16_EXT), i === e.SHORT && c && (l = c.RGBA16_SNORM_EXT), i === e.UNSIGNED_SHORT_4_4_4_4 && (l = e.RGBA4), i === e.UNSIGNED_SHORT_5_5_5_1 && (l = e.RGB5_A1);
|
|
3785
3785
|
}
|
|
3786
3786
|
return (l === e.R16F || l === e.R32F || l === e.RG16F || l === e.RG32F || l === e.RGBA16F || l === e.RGBA32F) && t.get("EXT_color_buffer_float"), l;
|
|
3787
3787
|
}
|
|
3788
|
-
function
|
|
3788
|
+
function E(t, n) {
|
|
3789
3789
|
let r;
|
|
3790
|
-
return t ? n === null || n === 1014 || n === 1020 ? r = e.DEPTH24_STENCIL8 : n === 1015 ? r = e.DEPTH32F_STENCIL8 : n === 1012 && (r = e.DEPTH24_STENCIL8,
|
|
3790
|
+
return t ? n === null || n === 1014 || n === 1020 ? r = e.DEPTH24_STENCIL8 : n === 1015 ? r = e.DEPTH32F_STENCIL8 : n === 1012 && (r = e.DEPTH24_STENCIL8, j("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")) : n === null || n === 1014 || n === 1020 ? r = e.DEPTH_COMPONENT24 : n === 1015 ? r = e.DEPTH_COMPONENT32F : n === 1012 && (r = e.DEPTH_COMPONENT16), r;
|
|
3791
3791
|
}
|
|
3792
|
-
function
|
|
3792
|
+
function D(e, t) {
|
|
3793
3793
|
return x(e) === !0 || e.isFramebufferTexture && e.minFilter !== 1003 && e.minFilter !== 1006 ? Math.log2(Math.max(t.width, t.height)) + 1 : e.mipmaps !== void 0 && e.mipmaps.length > 0 ? e.mipmaps.length : e.isCompressedTexture && Array.isArray(e.image) ? t.mipmaps.length : 1;
|
|
3794
3794
|
}
|
|
3795
3795
|
function O(e) {
|
|
@@ -3798,7 +3798,7 @@ function Ti(e, t, n, r, i, a, o) {
|
|
|
3798
3798
|
}
|
|
3799
3799
|
function k(e) {
|
|
3800
3800
|
let t = e.target;
|
|
3801
|
-
t.removeEventListener("dispose", k),
|
|
3801
|
+
t.removeEventListener("dispose", k), N(t);
|
|
3802
3802
|
}
|
|
3803
3803
|
function A(e) {
|
|
3804
3804
|
let t = r.get(e);
|
|
@@ -3806,17 +3806,17 @@ function Ti(e, t, n, r, i, a, o) {
|
|
|
3806
3806
|
let n = e.source, i = g.get(n);
|
|
3807
3807
|
if (i) {
|
|
3808
3808
|
let r = i[t.__cacheKey];
|
|
3809
|
-
r.usedTimes--, r.usedTimes === 0 &&
|
|
3809
|
+
r.usedTimes--, r.usedTimes === 0 && M(e), Object.keys(i).length === 0 && g.delete(n);
|
|
3810
3810
|
}
|
|
3811
3811
|
r.remove(e);
|
|
3812
3812
|
}
|
|
3813
|
-
function
|
|
3813
|
+
function M(t) {
|
|
3814
3814
|
let n = r.get(t);
|
|
3815
3815
|
e.deleteTexture(n.__webglTexture);
|
|
3816
3816
|
let i = t.source, a = g.get(i);
|
|
3817
3817
|
delete a[n.__cacheKey], o.memory.textures--;
|
|
3818
3818
|
}
|
|
3819
|
-
function
|
|
3819
|
+
function N(t) {
|
|
3820
3820
|
let n = r.get(t);
|
|
3821
3821
|
if (t.depthTexture && (t.depthTexture.dispose(), r.remove(t.depthTexture)), t.isWebGLCubeRenderTarget) for (let t = 0; t < 6; t++) {
|
|
3822
3822
|
if (Array.isArray(n.__webglFramebuffer[t])) for (let r = 0; r < n.__webglFramebuffer[t].length; r++) e.deleteFramebuffer(n.__webglFramebuffer[t][r]);
|
|
@@ -3836,73 +3836,73 @@ function Ti(e, t, n, r, i, a, o) {
|
|
|
3836
3836
|
}
|
|
3837
3837
|
r.remove(t);
|
|
3838
3838
|
}
|
|
3839
|
-
let
|
|
3840
|
-
function ee() {
|
|
3841
|
-
N = 0;
|
|
3842
|
-
}
|
|
3839
|
+
let P = 0;
|
|
3843
3840
|
function te() {
|
|
3844
|
-
|
|
3841
|
+
P = 0;
|
|
3845
3842
|
}
|
|
3846
|
-
function
|
|
3847
|
-
|
|
3843
|
+
function F() {
|
|
3844
|
+
return P;
|
|
3848
3845
|
}
|
|
3849
|
-
function ne() {
|
|
3850
|
-
|
|
3851
|
-
return e >= i.maxTextures && D("WebGLTextures: Trying to use " + e + " texture units while this GPU supports only " + i.maxTextures), N += 1, e;
|
|
3846
|
+
function ne(e) {
|
|
3847
|
+
P = e;
|
|
3852
3848
|
}
|
|
3853
|
-
function
|
|
3849
|
+
function re() {
|
|
3850
|
+
let e = P;
|
|
3851
|
+
return e >= i.maxTextures && j("WebGLTextures: Trying to use " + e + " texture units while this GPU supports only " + i.maxTextures), P += 1, e;
|
|
3852
|
+
}
|
|
3853
|
+
function ie(e) {
|
|
3854
3854
|
let t = [];
|
|
3855
3855
|
return t.push(e.wrapS), t.push(e.wrapT), t.push(e.wrapR || 0), t.push(e.magFilter), t.push(e.minFilter), t.push(e.anisotropy), t.push(e.internalFormat), t.push(e.format), t.push(e.type), t.push(e.generateMipmaps), t.push(e.premultiplyAlpha), t.push(e.flipY), t.push(e.unpackAlignment), t.push(e.colorSpace), t.join();
|
|
3856
3856
|
}
|
|
3857
|
-
function
|
|
3857
|
+
function ae(t, i) {
|
|
3858
3858
|
let a = r.get(t);
|
|
3859
|
-
if (t.isVideoTexture &&
|
|
3859
|
+
if (t.isVideoTexture && je(t), t.isRenderTargetTexture === !1 && t.isExternalTexture !== !0 && t.version > 0 && a.__version !== t.version) {
|
|
3860
3860
|
let e = t.image;
|
|
3861
|
-
if (e === null)
|
|
3862
|
-
else if (e.complete === !1)
|
|
3861
|
+
if (e === null) j("WebGLRenderer: Texture marked for update but no image data found.");
|
|
3862
|
+
else if (e.complete === !1) j("WebGLRenderer: Texture marked for update but image is incomplete");
|
|
3863
3863
|
else {
|
|
3864
|
-
|
|
3864
|
+
ge(a, t, i);
|
|
3865
3865
|
return;
|
|
3866
3866
|
}
|
|
3867
3867
|
} else t.isExternalTexture && (a.__webglTexture = t.sourceTexture ? t.sourceTexture : null);
|
|
3868
3868
|
n.bindTexture(e.TEXTURE_2D, a.__webglTexture, e.TEXTURE0 + i);
|
|
3869
3869
|
}
|
|
3870
|
-
function
|
|
3870
|
+
function I(t, i) {
|
|
3871
3871
|
let a = r.get(t);
|
|
3872
3872
|
if (t.isRenderTargetTexture === !1 && t.version > 0 && a.__version !== t.version) {
|
|
3873
|
-
|
|
3873
|
+
ge(a, t, i);
|
|
3874
3874
|
return;
|
|
3875
3875
|
}
|
|
3876
3876
|
t.isExternalTexture && (a.__webglTexture = t.sourceTexture ? t.sourceTexture : null), n.bindTexture(e.TEXTURE_2D_ARRAY, a.__webglTexture, e.TEXTURE0 + i);
|
|
3877
3877
|
}
|
|
3878
|
-
function
|
|
3878
|
+
function oe(t, i) {
|
|
3879
3879
|
let a = r.get(t);
|
|
3880
3880
|
if (t.isRenderTargetTexture === !1 && t.version > 0 && a.__version !== t.version) {
|
|
3881
|
-
|
|
3881
|
+
ge(a, t, i);
|
|
3882
3882
|
return;
|
|
3883
3883
|
}
|
|
3884
3884
|
n.bindTexture(e.TEXTURE_3D, a.__webglTexture, e.TEXTURE0 + i);
|
|
3885
3885
|
}
|
|
3886
|
-
function
|
|
3886
|
+
function se(t, i) {
|
|
3887
3887
|
let a = r.get(t);
|
|
3888
3888
|
if (t.isCubeDepthTexture !== !0 && t.version > 0 && a.__version !== t.version) {
|
|
3889
|
-
|
|
3889
|
+
_e(a, t, i);
|
|
3890
3890
|
return;
|
|
3891
3891
|
}
|
|
3892
3892
|
n.bindTexture(e.TEXTURE_CUBE_MAP, a.__webglTexture, e.TEXTURE0 + i);
|
|
3893
3893
|
}
|
|
3894
|
-
let
|
|
3895
|
-
[
|
|
3896
|
-
[
|
|
3897
|
-
[
|
|
3898
|
-
},
|
|
3899
|
-
[
|
|
3900
|
-
[
|
|
3901
|
-
[
|
|
3902
|
-
[
|
|
3903
|
-
[
|
|
3904
|
-
[
|
|
3905
|
-
},
|
|
3894
|
+
let R = {
|
|
3895
|
+
[he]: e.REPEAT,
|
|
3896
|
+
[ke]: e.CLAMP_TO_EDGE,
|
|
3897
|
+
[l]: e.MIRRORED_REPEAT
|
|
3898
|
+
}, ce = {
|
|
3899
|
+
[Te]: e.NEAREST,
|
|
3900
|
+
[G]: e.NEAREST_MIPMAP_NEAREST,
|
|
3901
|
+
[Je]: e.NEAREST_MIPMAP_LINEAR,
|
|
3902
|
+
[f]: e.LINEAR,
|
|
3903
|
+
[C]: e.LINEAR_MIPMAP_NEAREST,
|
|
3904
|
+
[le]: e.LINEAR_MIPMAP_LINEAR
|
|
3905
|
+
}, ue = {
|
|
3906
3906
|
512: e.NEVER,
|
|
3907
3907
|
519: e.ALWAYS,
|
|
3908
3908
|
513: e.LESS,
|
|
@@ -3912,8 +3912,8 @@ function Ti(e, t, n, r, i, a, o) {
|
|
|
3912
3912
|
516: e.GREATER,
|
|
3913
3913
|
517: e.NOTEQUAL
|
|
3914
3914
|
};
|
|
3915
|
-
function
|
|
3916
|
-
if (a.type === 1015 && t.has("OES_texture_float_linear") === !1 && (a.magFilter === 1006 || a.magFilter === 1007 || a.magFilter === 1005 || a.magFilter === 1008 || a.minFilter === 1006 || a.minFilter === 1007 || a.minFilter === 1005 || a.minFilter === 1008) &&
|
|
3915
|
+
function fe(n, a) {
|
|
3916
|
+
if (a.type === 1015 && t.has("OES_texture_float_linear") === !1 && (a.magFilter === 1006 || a.magFilter === 1007 || a.magFilter === 1005 || a.magFilter === 1008 || a.minFilter === 1006 || a.minFilter === 1007 || a.minFilter === 1005 || a.minFilter === 1008) && j("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."), e.texParameteri(n, e.TEXTURE_WRAP_S, R[a.wrapS]), e.texParameteri(n, e.TEXTURE_WRAP_T, R[a.wrapT]), (n === e.TEXTURE_3D || n === e.TEXTURE_2D_ARRAY) && e.texParameteri(n, e.TEXTURE_WRAP_R, R[a.wrapR]), e.texParameteri(n, e.TEXTURE_MAG_FILTER, ce[a.magFilter]), e.texParameteri(n, e.TEXTURE_MIN_FILTER, ce[a.minFilter]), a.compareFunction && (e.texParameteri(n, e.TEXTURE_COMPARE_MODE, e.COMPARE_REF_TO_TEXTURE), e.texParameteri(n, e.TEXTURE_COMPARE_FUNC, ue[a.compareFunction])), t.has("EXT_texture_filter_anisotropic") === !0) {
|
|
3917
3917
|
if (a.magFilter === 1003 || a.minFilter !== 1005 && a.minFilter !== 1008 || a.type === 1015 && t.has("OES_texture_float_linear") === !1) return;
|
|
3918
3918
|
if (a.anisotropy > 1 || r.get(a).__currentAnisotropy) {
|
|
3919
3919
|
let o = t.get("EXT_texture_filter_anisotropic");
|
|
@@ -3921,34 +3921,34 @@ function Ti(e, t, n, r, i, a, o) {
|
|
|
3921
3921
|
}
|
|
3922
3922
|
}
|
|
3923
3923
|
}
|
|
3924
|
-
function
|
|
3924
|
+
function pe(t, n) {
|
|
3925
3925
|
let r = !1;
|
|
3926
3926
|
t.__webglInit === void 0 && (t.__webglInit = !0, n.addEventListener("dispose", O));
|
|
3927
3927
|
let i = n.source, a = g.get(i);
|
|
3928
3928
|
a === void 0 && (a = {}, g.set(i, a));
|
|
3929
|
-
let s =
|
|
3929
|
+
let s = ie(n);
|
|
3930
3930
|
if (s !== t.__cacheKey) {
|
|
3931
3931
|
a[s] === void 0 && (a[s] = {
|
|
3932
3932
|
texture: e.createTexture(),
|
|
3933
3933
|
usedTimes: 0
|
|
3934
3934
|
}, o.memory.textures++, r = !0), a[s].usedTimes++;
|
|
3935
3935
|
let i = a[t.__cacheKey];
|
|
3936
|
-
i !== void 0 && (a[t.__cacheKey].usedTimes--, i.usedTimes === 0 &&
|
|
3936
|
+
i !== void 0 && (a[t.__cacheKey].usedTimes--, i.usedTimes === 0 && M(n)), t.__cacheKey = s, t.__webglTexture = a[s].texture;
|
|
3937
3937
|
}
|
|
3938
3938
|
return r;
|
|
3939
3939
|
}
|
|
3940
|
-
function
|
|
3940
|
+
function z(e, t, n) {
|
|
3941
3941
|
return Math.floor(Math.floor(e / n) / t);
|
|
3942
3942
|
}
|
|
3943
|
-
function
|
|
3943
|
+
function me(t, r, i, a) {
|
|
3944
3944
|
let o = t.updateRanges;
|
|
3945
3945
|
if (o.length === 0) n.texSubImage2D(e.TEXTURE_2D, 0, 0, 0, r.width, r.height, i, a, r.data);
|
|
3946
3946
|
else {
|
|
3947
3947
|
o.sort((e, t) => e.start - t.start);
|
|
3948
3948
|
let s = 0;
|
|
3949
3949
|
for (let e = 1; e < o.length; e++) {
|
|
3950
|
-
let t = o[s], n = o[e], i = t.start + t.count, a =
|
|
3951
|
-
n.start <= i + 1 && a === c &&
|
|
3950
|
+
let t = o[s], n = o[e], i = t.start + t.count, a = z(n.start, r.width, 4), c = z(t.start, r.width, 4);
|
|
3951
|
+
n.start <= i + 1 && a === c && z(n.start + n.count - 1, r.width, 4) === a ? t.count = Math.max(t.count, n.start + n.count - t.start) : (++s, o[s] = n);
|
|
3952
3952
|
}
|
|
3953
3953
|
o.length = s + 1;
|
|
3954
3954
|
let c = n.getParameter(e.UNPACK_ROW_LENGTH), l = n.getParameter(e.UNPACK_SKIP_PIXELS), u = n.getParameter(e.UNPACK_SKIP_ROWS);
|
|
@@ -3960,39 +3960,39 @@ function Ti(e, t, n, r, i, a, o) {
|
|
|
3960
3960
|
t.clearUpdateRanges(), n.pixelStorei(e.UNPACK_ROW_LENGTH, c), n.pixelStorei(e.UNPACK_SKIP_PIXELS, l), n.pixelStorei(e.UNPACK_SKIP_ROWS, u);
|
|
3961
3961
|
}
|
|
3962
3962
|
}
|
|
3963
|
-
function
|
|
3963
|
+
function ge(t, o, s) {
|
|
3964
3964
|
let c = e.TEXTURE_2D;
|
|
3965
3965
|
(o.isDataArrayTexture || o.isCompressedArrayTexture) && (c = e.TEXTURE_2D_ARRAY), o.isData3DTexture && (c = e.TEXTURE_3D);
|
|
3966
|
-
let l =
|
|
3966
|
+
let l = pe(t, o), u = o.source;
|
|
3967
3967
|
n.bindTexture(c, t.__webglTexture, e.TEXTURE0 + s);
|
|
3968
3968
|
let d = r.get(u);
|
|
3969
3969
|
if (u.version !== d.__version || l === !0) {
|
|
3970
3970
|
if (n.activeTexture(e.TEXTURE0 + s), !(typeof ImageBitmap < "u" && o.image instanceof ImageBitmap)) {
|
|
3971
|
-
let t =
|
|
3971
|
+
let t = B.getPrimaries(B.workingColorSpace), r = o.colorSpace === "" ? null : B.getPrimaries(o.colorSpace), i = o.colorSpace === "" || t === r ? e.NONE : e.BROWSER_DEFAULT_WEBGL;
|
|
3972
3972
|
n.pixelStorei(e.UNPACK_FLIP_Y_WEBGL, o.flipY), n.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, o.premultiplyAlpha), n.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL, i);
|
|
3973
3973
|
}
|
|
3974
3974
|
n.pixelStorei(e.UNPACK_ALIGNMENT, o.unpackAlignment);
|
|
3975
3975
|
let t = b(o.image, !1, i.maxTextureSize);
|
|
3976
|
-
t =
|
|
3977
|
-
let r = a.convert(o.format, o.colorSpace), f = a.convert(o.type), p =
|
|
3978
|
-
|
|
3979
|
-
let h, g = o.mipmaps,
|
|
3980
|
-
if (o.isDepthTexture) p =
|
|
3976
|
+
t = Me(o, t);
|
|
3977
|
+
let r = a.convert(o.format, o.colorSpace), f = a.convert(o.type), p = T(o.internalFormat, r, f, o.normalized, o.colorSpace, o.isVideoTexture);
|
|
3978
|
+
fe(c, o);
|
|
3979
|
+
let h, g = o.mipmaps, v = o.isVideoTexture !== !0, y = d.__version === void 0 || l === !0, C = u.dataReady, w = D(o, t);
|
|
3980
|
+
if (o.isDepthTexture) p = E(o.format === _, o.type), y && (v ? n.texStorage2D(e.TEXTURE_2D, 1, p, t.width, t.height) : n.texImage2D(e.TEXTURE_2D, 0, p, t.width, t.height, 0, r, f, null));
|
|
3981
3981
|
else if (o.isDataTexture) {
|
|
3982
3982
|
if (g.length > 0) {
|
|
3983
|
-
|
|
3984
|
-
for (let t = 0, i = g.length; t < i; t++) h = g[t],
|
|
3983
|
+
v && y && n.texStorage2D(e.TEXTURE_2D, w, p, g[0].width, g[0].height);
|
|
3984
|
+
for (let t = 0, i = g.length; t < i; t++) h = g[t], v ? C && n.texSubImage2D(e.TEXTURE_2D, t, 0, 0, h.width, h.height, r, f, h.data) : n.texImage2D(e.TEXTURE_2D, t, p, h.width, h.height, 0, r, f, h.data);
|
|
3985
3985
|
o.generateMipmaps = !1;
|
|
3986
|
-
} else
|
|
3986
|
+
} else v ? (y && n.texStorage2D(e.TEXTURE_2D, w, p, t.width, t.height), C && me(o, t, r, f)) : n.texImage2D(e.TEXTURE_2D, 0, p, t.width, t.height, 0, r, f, t.data);
|
|
3987
3987
|
} else if (o.isCompressedTexture) {
|
|
3988
3988
|
if (o.isCompressedArrayTexture) {
|
|
3989
|
-
|
|
3989
|
+
v && y && n.texStorage3D(e.TEXTURE_2D_ARRAY, w, p, g[0].width, g[0].height, t.depth);
|
|
3990
3990
|
for (let i = 0, a = g.length; i < a; i++) if (h = g[i], o.format !== 1023) {
|
|
3991
3991
|
if (r !== null) {
|
|
3992
|
-
if (
|
|
3992
|
+
if (v) {
|
|
3993
3993
|
if (C) {
|
|
3994
3994
|
if (o.layerUpdates.size > 0) {
|
|
3995
|
-
let t =
|
|
3995
|
+
let t = ee(h.width, h.height, o.format, o.type);
|
|
3996
3996
|
for (let a of o.layerUpdates) {
|
|
3997
3997
|
let o = h.data.subarray(a * t / h.data.BYTES_PER_ELEMENT, (a + 1) * t / h.data.BYTES_PER_ELEMENT);
|
|
3998
3998
|
n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY, i, 0, 0, a, h.width, h.height, 1, r, o);
|
|
@@ -4001,17 +4001,17 @@ function Ti(e, t, n, r, i, a, o) {
|
|
|
4001
4001
|
} else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY, i, 0, 0, 0, h.width, h.height, t.depth, r, h.data);
|
|
4002
4002
|
}
|
|
4003
4003
|
} else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY, i, p, h.width, h.height, t.depth, 0, h.data, 0, 0);
|
|
4004
|
-
} else
|
|
4005
|
-
} else
|
|
4004
|
+
} else j("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");
|
|
4005
|
+
} else v ? C && n.texSubImage3D(e.TEXTURE_2D_ARRAY, i, 0, 0, 0, h.width, h.height, t.depth, r, f, h.data) : n.texImage3D(e.TEXTURE_2D_ARRAY, i, p, h.width, h.height, t.depth, 0, r, f, h.data);
|
|
4006
4006
|
} else {
|
|
4007
|
-
|
|
4008
|
-
for (let t = 0, i = g.length; t < i; t++) h = g[t], o.format === 1023 ?
|
|
4007
|
+
v && y && n.texStorage2D(e.TEXTURE_2D, w, p, g[0].width, g[0].height);
|
|
4008
|
+
for (let t = 0, i = g.length; t < i; t++) h = g[t], o.format === 1023 ? v ? C && n.texSubImage2D(e.TEXTURE_2D, t, 0, 0, h.width, h.height, r, f, h.data) : n.texImage2D(e.TEXTURE_2D, t, p, h.width, h.height, 0, r, f, h.data) : r === null ? j("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : v ? C && n.compressedTexSubImage2D(e.TEXTURE_2D, t, 0, 0, h.width, h.height, r, h.data) : n.compressedTexImage2D(e.TEXTURE_2D, t, p, h.width, h.height, 0, h.data);
|
|
4009
4009
|
}
|
|
4010
4010
|
} else if (o.isDataArrayTexture) {
|
|
4011
|
-
if (
|
|
4012
|
-
if (y && n.texStorage3D(e.TEXTURE_2D_ARRAY,
|
|
4011
|
+
if (v) {
|
|
4012
|
+
if (y && n.texStorage3D(e.TEXTURE_2D_ARRAY, w, p, t.width, t.height, t.depth), C) {
|
|
4013
4013
|
if (o.layerUpdates.size > 0) {
|
|
4014
|
-
let i =
|
|
4014
|
+
let i = ee(t.width, t.height, o.format, o.type);
|
|
4015
4015
|
for (let a of o.layerUpdates) {
|
|
4016
4016
|
let o = t.data.subarray(a * i / t.data.BYTES_PER_ELEMENT, (a + 1) * i / t.data.BYTES_PER_ELEMENT);
|
|
4017
4017
|
n.texSubImage3D(e.TEXTURE_2D_ARRAY, 0, 0, 0, a, t.width, t.height, 1, r, f, o);
|
|
@@ -4020,13 +4020,13 @@ function Ti(e, t, n, r, i, a, o) {
|
|
|
4020
4020
|
} else n.texSubImage3D(e.TEXTURE_2D_ARRAY, 0, 0, 0, 0, t.width, t.height, t.depth, r, f, t.data);
|
|
4021
4021
|
}
|
|
4022
4022
|
} else n.texImage3D(e.TEXTURE_2D_ARRAY, 0, p, t.width, t.height, t.depth, 0, r, f, t.data);
|
|
4023
|
-
} else if (o.isData3DTexture)
|
|
4023
|
+
} else if (o.isData3DTexture) v ? (y && n.texStorage3D(e.TEXTURE_3D, w, p, t.width, t.height, t.depth), C && n.texSubImage3D(e.TEXTURE_3D, 0, 0, 0, 0, t.width, t.height, t.depth, r, f, t.data)) : n.texImage3D(e.TEXTURE_3D, 0, p, t.width, t.height, t.depth, 0, r, f, t.data);
|
|
4024
4024
|
else if (o.isFramebufferTexture) {
|
|
4025
4025
|
if (y) {
|
|
4026
|
-
if (
|
|
4026
|
+
if (v) n.texStorage2D(e.TEXTURE_2D, w, p, t.width, t.height);
|
|
4027
4027
|
else {
|
|
4028
4028
|
let i = t.width, a = t.height;
|
|
4029
|
-
for (let t = 0; t <
|
|
4029
|
+
for (let t = 0; t < w; t++) n.texImage2D(e.TEXTURE_2D, t, p, i, a, 0, r, f, null), i >>= 1, a >>= 1;
|
|
4030
4030
|
}
|
|
4031
4031
|
}
|
|
4032
4032
|
} else if (o.isHTMLTexture) {
|
|
@@ -4047,16 +4047,16 @@ function Ti(e, t, n, r, i, a, o) {
|
|
|
4047
4047
|
e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.CLAMP_TO_EDGE);
|
|
4048
4048
|
}
|
|
4049
4049
|
} else if (g.length > 0) {
|
|
4050
|
-
if (
|
|
4051
|
-
let t =
|
|
4052
|
-
n.texStorage2D(e.TEXTURE_2D,
|
|
4050
|
+
if (v && y) {
|
|
4051
|
+
let t = H(g[0]);
|
|
4052
|
+
n.texStorage2D(e.TEXTURE_2D, w, p, t.width, t.height);
|
|
4053
4053
|
}
|
|
4054
|
-
for (let t = 0, i = g.length; t < i; t++) h = g[t],
|
|
4054
|
+
for (let t = 0, i = g.length; t < i; t++) h = g[t], v ? C && n.texSubImage2D(e.TEXTURE_2D, t, 0, 0, r, f, h) : n.texImage2D(e.TEXTURE_2D, t, p, r, f, h);
|
|
4055
4055
|
o.generateMipmaps = !1;
|
|
4056
|
-
} else if (
|
|
4056
|
+
} else if (v) {
|
|
4057
4057
|
if (y) {
|
|
4058
|
-
let r =
|
|
4059
|
-
n.texStorage2D(e.TEXTURE_2D,
|
|
4058
|
+
let r = H(t);
|
|
4059
|
+
n.texStorage2D(e.TEXTURE_2D, w, p, r.width, r.height);
|
|
4060
4060
|
}
|
|
4061
4061
|
C && n.texSubImage2D(e.TEXTURE_2D, 0, 0, 0, r, f, t);
|
|
4062
4062
|
} else n.texImage2D(e.TEXTURE_2D, 0, p, r, f, t);
|
|
@@ -4064,46 +4064,46 @@ function Ti(e, t, n, r, i, a, o) {
|
|
|
4064
4064
|
}
|
|
4065
4065
|
t.__version = o.version;
|
|
4066
4066
|
}
|
|
4067
|
-
function
|
|
4067
|
+
function _e(t, o, s) {
|
|
4068
4068
|
if (o.image.length !== 6) return;
|
|
4069
|
-
let c =
|
|
4069
|
+
let c = pe(t, o), l = o.source;
|
|
4070
4070
|
n.bindTexture(e.TEXTURE_CUBE_MAP, t.__webglTexture, e.TEXTURE0 + s);
|
|
4071
4071
|
let u = r.get(l);
|
|
4072
4072
|
if (l.version !== u.__version || c === !0) {
|
|
4073
4073
|
n.activeTexture(e.TEXTURE0 + s);
|
|
4074
|
-
let t =
|
|
4074
|
+
let t = B.getPrimaries(B.workingColorSpace), r = o.colorSpace === "" ? null : B.getPrimaries(o.colorSpace), d = o.colorSpace === "" || t === r ? e.NONE : e.BROWSER_DEFAULT_WEBGL;
|
|
4075
4075
|
n.pixelStorei(e.UNPACK_FLIP_Y_WEBGL, o.flipY), n.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, o.premultiplyAlpha), n.pixelStorei(e.UNPACK_ALIGNMENT, o.unpackAlignment), n.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL, d);
|
|
4076
4076
|
let f = o.isCompressedTexture || o.image[0].isCompressedTexture, p = o.image[0] && o.image[0].isDataTexture, m = [];
|
|
4077
|
-
for (let e = 0; e < 6; e++) !f && !p ? m[e] = b(o.image[e], !0, i.maxCubemapSize) : m[e] = p ? o.image[e].image : o.image[e], m[e] =
|
|
4078
|
-
let h = m[0], g = a.convert(o.format, o.colorSpace), _ = a.convert(o.type), v =
|
|
4079
|
-
|
|
4080
|
-
let
|
|
4077
|
+
for (let e = 0; e < 6; e++) !f && !p ? m[e] = b(o.image[e], !0, i.maxCubemapSize) : m[e] = p ? o.image[e].image : o.image[e], m[e] = Me(o, m[e]);
|
|
4078
|
+
let h = m[0], g = a.convert(o.format, o.colorSpace), _ = a.convert(o.type), v = T(o.internalFormat, g, _, o.normalized, o.colorSpace), y = o.isVideoTexture !== !0, C = u.__version === void 0 || c === !0, w = l.dataReady, E = D(o, h);
|
|
4079
|
+
fe(e.TEXTURE_CUBE_MAP, o);
|
|
4080
|
+
let O;
|
|
4081
4081
|
if (f) {
|
|
4082
|
-
y && C && n.texStorage2D(e.TEXTURE_CUBE_MAP,
|
|
4082
|
+
y && C && n.texStorage2D(e.TEXTURE_CUBE_MAP, E, v, h.width, h.height);
|
|
4083
4083
|
for (let t = 0; t < 6; t++) {
|
|
4084
|
-
|
|
4085
|
-
for (let r = 0; r <
|
|
4086
|
-
let i =
|
|
4087
|
-
o.format === 1023 ? y ?
|
|
4084
|
+
O = m[t].mipmaps;
|
|
4085
|
+
for (let r = 0; r < O.length; r++) {
|
|
4086
|
+
let i = O[r];
|
|
4087
|
+
o.format === 1023 ? y ? w && n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, r, 0, 0, i.width, i.height, g, _, i.data) : n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, r, v, i.width, i.height, 0, g, _, i.data) : g === null ? j("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()") : y ? w && n.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, r, 0, 0, i.width, i.height, g, i.data) : n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, r, v, i.width, i.height, 0, i.data);
|
|
4088
4088
|
}
|
|
4089
4089
|
}
|
|
4090
4090
|
} else {
|
|
4091
|
-
if (
|
|
4092
|
-
|
|
4093
|
-
let t =
|
|
4094
|
-
n.texStorage2D(e.TEXTURE_CUBE_MAP,
|
|
4091
|
+
if (O = o.mipmaps, y && C) {
|
|
4092
|
+
O.length > 0 && E++;
|
|
4093
|
+
let t = H(m[0]);
|
|
4094
|
+
n.texStorage2D(e.TEXTURE_CUBE_MAP, E, v, t.width, t.height);
|
|
4095
4095
|
}
|
|
4096
4096
|
for (let t = 0; t < 6; t++) if (p) {
|
|
4097
|
-
y ?
|
|
4098
|
-
for (let r = 0; r <
|
|
4099
|
-
let i =
|
|
4100
|
-
y ?
|
|
4097
|
+
y ? w && n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, 0, 0, 0, m[t].width, m[t].height, g, _, m[t].data) : n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, 0, v, m[t].width, m[t].height, 0, g, _, m[t].data);
|
|
4098
|
+
for (let r = 0; r < O.length; r++) {
|
|
4099
|
+
let i = O[r].image[t].image;
|
|
4100
|
+
y ? w && n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, r + 1, 0, 0, i.width, i.height, g, _, i.data) : n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, r + 1, v, i.width, i.height, 0, g, _, i.data);
|
|
4101
4101
|
}
|
|
4102
4102
|
} else {
|
|
4103
|
-
y ?
|
|
4104
|
-
for (let r = 0; r <
|
|
4105
|
-
let i =
|
|
4106
|
-
y ?
|
|
4103
|
+
y ? w && n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, 0, 0, 0, g, _, m[t]) : n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, 0, v, g, _, m[t]);
|
|
4104
|
+
for (let r = 0; r < O.length; r++) {
|
|
4105
|
+
let i = O[r];
|
|
4106
|
+
y ? w && n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, r + 1, 0, 0, g, _, i.image[t]) : n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, r + 1, v, g, _, i.image[t]);
|
|
4107
4107
|
}
|
|
4108
4108
|
}
|
|
4109
4109
|
}
|
|
@@ -4111,45 +4111,45 @@ function Ti(e, t, n, r, i, a, o) {
|
|
|
4111
4111
|
}
|
|
4112
4112
|
t.__version = o.version;
|
|
4113
4113
|
}
|
|
4114
|
-
function
|
|
4115
|
-
let d = a.convert(o.format, o.colorSpace), f = a.convert(o.type), p =
|
|
4114
|
+
function ve(t, i, o, c, l, u) {
|
|
4115
|
+
let d = a.convert(o.format, o.colorSpace), f = a.convert(o.type), p = T(o.internalFormat, d, f, o.normalized, o.colorSpace), m = r.get(i), h = r.get(o);
|
|
4116
4116
|
if (h.__renderTarget = i, !m.__hasExternalTextures) {
|
|
4117
4117
|
let t = Math.max(1, i.width >> u), r = Math.max(1, i.height >> u);
|
|
4118
4118
|
l === e.TEXTURE_3D || l === e.TEXTURE_2D_ARRAY ? n.texImage3D(l, u, p, t, r, i.depth, 0, d, f, null) : n.texImage2D(l, u, p, t, r, 0, d, f, null);
|
|
4119
4119
|
}
|
|
4120
|
-
n.bindFramebuffer(e.FRAMEBUFFER, t),
|
|
4120
|
+
n.bindFramebuffer(e.FRAMEBUFFER, t), Ae(i) ? s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER, c, l, h.__webglTexture, 0, Oe(i)) : (l === e.TEXTURE_2D || l >= e.TEXTURE_CUBE_MAP_POSITIVE_X && l <= e.TEXTURE_CUBE_MAP_NEGATIVE_Z) && e.framebufferTexture2D(e.FRAMEBUFFER, c, l, h.__webglTexture, u), n.bindFramebuffer(e.FRAMEBUFFER, null);
|
|
4121
4121
|
}
|
|
4122
|
-
function
|
|
4122
|
+
function ye(t, n, r) {
|
|
4123
4123
|
if (e.bindRenderbuffer(e.RENDERBUFFER, t), n.depthBuffer) {
|
|
4124
|
-
let i = n.depthTexture, a = i && i.isDepthTexture ? i.type : null, o =
|
|
4125
|
-
|
|
4124
|
+
let i = n.depthTexture, a = i && i.isDepthTexture ? i.type : null, o = E(n.stencilBuffer, a), c = n.stencilBuffer ? e.DEPTH_STENCIL_ATTACHMENT : e.DEPTH_ATTACHMENT;
|
|
4125
|
+
Ae(n) ? s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER, Oe(n), o, n.width, n.height) : r ? e.renderbufferStorageMultisample(e.RENDERBUFFER, Oe(n), o, n.width, n.height) : e.renderbufferStorage(e.RENDERBUFFER, o, n.width, n.height), e.framebufferRenderbuffer(e.FRAMEBUFFER, c, e.RENDERBUFFER, t);
|
|
4126
4126
|
} else {
|
|
4127
4127
|
let t = n.textures;
|
|
4128
4128
|
for (let i = 0; i < t.length; i++) {
|
|
4129
|
-
let o = t[i], c = a.convert(o.format, o.colorSpace), l = a.convert(o.type), u =
|
|
4130
|
-
|
|
4129
|
+
let o = t[i], c = a.convert(o.format, o.colorSpace), l = a.convert(o.type), u = T(o.internalFormat, c, l, o.normalized, o.colorSpace);
|
|
4130
|
+
Ae(n) ? s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER, Oe(n), u, n.width, n.height) : r ? e.renderbufferStorageMultisample(e.RENDERBUFFER, Oe(n), u, n.width, n.height) : e.renderbufferStorage(e.RENDERBUFFER, u, n.width, n.height);
|
|
4131
4131
|
}
|
|
4132
4132
|
}
|
|
4133
4133
|
e.bindRenderbuffer(e.RENDERBUFFER, null);
|
|
4134
4134
|
}
|
|
4135
|
-
function
|
|
4135
|
+
function be(t, i, o) {
|
|
4136
4136
|
let c = i.isWebGLCubeRenderTarget === !0;
|
|
4137
4137
|
if (n.bindFramebuffer(e.FRAMEBUFFER, t), !(i.depthTexture && i.depthTexture.isDepthTexture)) throw Error("THREE.WebGLTextures: renderTarget.depthTexture must be an instance of THREE.DepthTexture.");
|
|
4138
4138
|
let l = r.get(i.depthTexture);
|
|
4139
4139
|
if (l.__renderTarget = i, (!l.__webglTexture || i.depthTexture.image.width !== i.width || i.depthTexture.image.height !== i.height) && (i.depthTexture.image.width = i.width, i.depthTexture.image.height = i.height, i.depthTexture.needsUpdate = !0), c) {
|
|
4140
4140
|
if (l.__webglInit === void 0 && (l.__webglInit = !0, i.depthTexture.addEventListener("dispose", O)), l.__webglTexture === void 0) {
|
|
4141
|
-
l.__webglTexture = e.createTexture(), n.bindTexture(e.TEXTURE_CUBE_MAP, l.__webglTexture),
|
|
4141
|
+
l.__webglTexture = e.createTexture(), n.bindTexture(e.TEXTURE_CUBE_MAP, l.__webglTexture), fe(e.TEXTURE_CUBE_MAP, i.depthTexture);
|
|
4142
4142
|
let t = a.convert(i.depthTexture.format), r = a.convert(i.depthTexture.type), o;
|
|
4143
4143
|
i.depthTexture.format === 1026 ? o = e.DEPTH_COMPONENT24 : i.depthTexture.format === 1027 && (o = e.DEPTH24_STENCIL8);
|
|
4144
4144
|
for (let n = 0; n < 6; n++) e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + n, 0, o, i.width, i.height, 0, t, r, null);
|
|
4145
4145
|
}
|
|
4146
|
-
} else
|
|
4147
|
-
let u = l.__webglTexture, d =
|
|
4148
|
-
if (i.depthTexture.format === 1026)
|
|
4149
|
-
else if (i.depthTexture.format === 1027)
|
|
4146
|
+
} else ae(i.depthTexture, 0);
|
|
4147
|
+
let u = l.__webglTexture, d = Oe(i), f = c ? e.TEXTURE_CUBE_MAP_POSITIVE_X + o : e.TEXTURE_2D, p = i.depthTexture.format === 1027 ? e.DEPTH_STENCIL_ATTACHMENT : e.DEPTH_ATTACHMENT;
|
|
4148
|
+
if (i.depthTexture.format === 1026) Ae(i) ? s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER, p, f, u, 0, d) : e.framebufferTexture2D(e.FRAMEBUFFER, p, f, u, 0);
|
|
4149
|
+
else if (i.depthTexture.format === 1027) Ae(i) ? s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER, p, f, u, 0, d) : e.framebufferTexture2D(e.FRAMEBUFFER, p, f, u, 0);
|
|
4150
4150
|
else throw Error("THREE.WebGLTextures: Unknown depthTexture format.");
|
|
4151
4151
|
}
|
|
4152
|
-
function
|
|
4152
|
+
function xe(t) {
|
|
4153
4153
|
let i = r.get(t), a = t.isWebGLCubeRenderTarget === !0;
|
|
4154
4154
|
if (i.__boundDepthTexture !== t.depthTexture) {
|
|
4155
4155
|
let e = t.depthTexture;
|
|
@@ -4162,21 +4162,21 @@ function Ti(e, t, n, r, i, a, o) {
|
|
|
4162
4162
|
i.__boundDepthTexture = e;
|
|
4163
4163
|
}
|
|
4164
4164
|
if (t.depthTexture && !i.__autoAllocateDepthBuffer) {
|
|
4165
|
-
if (a) for (let e = 0; e < 6; e++)
|
|
4165
|
+
if (a) for (let e = 0; e < 6; e++) be(i.__webglFramebuffer[e], t, e);
|
|
4166
4166
|
else {
|
|
4167
4167
|
let e = t.texture.mipmaps;
|
|
4168
|
-
e && e.length > 0 ?
|
|
4168
|
+
e && e.length > 0 ? be(i.__webglFramebuffer[0], t, 0) : be(i.__webglFramebuffer, t, 0);
|
|
4169
4169
|
}
|
|
4170
4170
|
} else if (a) {
|
|
4171
4171
|
i.__webglDepthbuffer = [];
|
|
4172
|
-
for (let r = 0; r < 6; r++) if (n.bindFramebuffer(e.FRAMEBUFFER, i.__webglFramebuffer[r]), i.__webglDepthbuffer[r] === void 0) i.__webglDepthbuffer[r] = e.createRenderbuffer(),
|
|
4172
|
+
for (let r = 0; r < 6; r++) if (n.bindFramebuffer(e.FRAMEBUFFER, i.__webglFramebuffer[r]), i.__webglDepthbuffer[r] === void 0) i.__webglDepthbuffer[r] = e.createRenderbuffer(), ye(i.__webglDepthbuffer[r], t, !1);
|
|
4173
4173
|
else {
|
|
4174
4174
|
let n = t.stencilBuffer ? e.DEPTH_STENCIL_ATTACHMENT : e.DEPTH_ATTACHMENT, a = i.__webglDepthbuffer[r];
|
|
4175
4175
|
e.bindRenderbuffer(e.RENDERBUFFER, a), e.framebufferRenderbuffer(e.FRAMEBUFFER, n, e.RENDERBUFFER, a);
|
|
4176
4176
|
}
|
|
4177
4177
|
} else {
|
|
4178
4178
|
let r = t.texture.mipmaps;
|
|
4179
|
-
if (r && r.length > 0 ? n.bindFramebuffer(e.FRAMEBUFFER, i.__webglFramebuffer[0]) : n.bindFramebuffer(e.FRAMEBUFFER, i.__webglFramebuffer), i.__webglDepthbuffer === void 0) i.__webglDepthbuffer = e.createRenderbuffer(),
|
|
4179
|
+
if (r && r.length > 0 ? n.bindFramebuffer(e.FRAMEBUFFER, i.__webglFramebuffer[0]) : n.bindFramebuffer(e.FRAMEBUFFER, i.__webglFramebuffer), i.__webglDepthbuffer === void 0) i.__webglDepthbuffer = e.createRenderbuffer(), ye(i.__webglDepthbuffer, t, !1);
|
|
4180
4180
|
else {
|
|
4181
4181
|
let n = t.stencilBuffer ? e.DEPTH_STENCIL_ATTACHMENT : e.DEPTH_ATTACHMENT, r = i.__webglDepthbuffer;
|
|
4182
4182
|
e.bindRenderbuffer(e.RENDERBUFFER, r), e.framebufferRenderbuffer(e.FRAMEBUFFER, n, e.RENDERBUFFER, r);
|
|
@@ -4184,11 +4184,11 @@ function Ti(e, t, n, r, i, a, o) {
|
|
|
4184
4184
|
}
|
|
4185
4185
|
n.bindFramebuffer(e.FRAMEBUFFER, null);
|
|
4186
4186
|
}
|
|
4187
|
-
function
|
|
4187
|
+
function Se(t, n, i) {
|
|
4188
4188
|
let a = r.get(t);
|
|
4189
|
-
n !== void 0 &&
|
|
4189
|
+
n !== void 0 && ve(a.__webglFramebuffer, t, t.texture, e.COLOR_ATTACHMENT0, e.TEXTURE_2D, 0), i !== void 0 && xe(t);
|
|
4190
4190
|
}
|
|
4191
|
-
function
|
|
4191
|
+
function Ce(t) {
|
|
4192
4192
|
let i = t.texture, s = r.get(t), c = r.get(i);
|
|
4193
4193
|
t.addEventListener("dispose", k);
|
|
4194
4194
|
let l = t.textures, u = t.isWebGLCubeRenderTarget === !0, d = l.length > 1;
|
|
@@ -4207,50 +4207,50 @@ function Ti(e, t, n, r, i, a, o) {
|
|
|
4207
4207
|
let n = r.get(l[t]);
|
|
4208
4208
|
n.__webglTexture === void 0 && (n.__webglTexture = e.createTexture(), o.memory.textures++);
|
|
4209
4209
|
}
|
|
4210
|
-
if (t.samples > 0 &&
|
|
4210
|
+
if (t.samples > 0 && Ae(t) === !1) {
|
|
4211
4211
|
s.__webglMultisampledFramebuffer = e.createFramebuffer(), s.__webglColorRenderbuffer = [], n.bindFramebuffer(e.FRAMEBUFFER, s.__webglMultisampledFramebuffer);
|
|
4212
4212
|
for (let n = 0; n < l.length; n++) {
|
|
4213
4213
|
let r = l[n];
|
|
4214
4214
|
s.__webglColorRenderbuffer[n] = e.createRenderbuffer(), e.bindRenderbuffer(e.RENDERBUFFER, s.__webglColorRenderbuffer[n]);
|
|
4215
|
-
let i = a.convert(r.format, r.colorSpace), o = a.convert(r.type), c =
|
|
4215
|
+
let i = a.convert(r.format, r.colorSpace), o = a.convert(r.type), c = T(r.internalFormat, i, o, r.normalized, r.colorSpace, t.isXRRenderTarget === !0), u = Oe(t);
|
|
4216
4216
|
e.renderbufferStorageMultisample(e.RENDERBUFFER, u, c, t.width, t.height), e.framebufferRenderbuffer(e.FRAMEBUFFER, e.COLOR_ATTACHMENT0 + n, e.RENDERBUFFER, s.__webglColorRenderbuffer[n]);
|
|
4217
4217
|
}
|
|
4218
|
-
e.bindRenderbuffer(e.RENDERBUFFER, null), t.depthBuffer && (s.__webglDepthRenderbuffer = e.createRenderbuffer(),
|
|
4218
|
+
e.bindRenderbuffer(e.RENDERBUFFER, null), t.depthBuffer && (s.__webglDepthRenderbuffer = e.createRenderbuffer(), ye(s.__webglDepthRenderbuffer, t, !0)), n.bindFramebuffer(e.FRAMEBUFFER, null);
|
|
4219
4219
|
}
|
|
4220
4220
|
}
|
|
4221
4221
|
if (u) {
|
|
4222
|
-
n.bindTexture(e.TEXTURE_CUBE_MAP, c.__webglTexture),
|
|
4223
|
-
for (let n = 0; n < 6; n++) if (i.mipmaps && i.mipmaps.length > 0) for (let r = 0; r < i.mipmaps.length; r++)
|
|
4224
|
-
else
|
|
4222
|
+
n.bindTexture(e.TEXTURE_CUBE_MAP, c.__webglTexture), fe(e.TEXTURE_CUBE_MAP, i);
|
|
4223
|
+
for (let n = 0; n < 6; n++) if (i.mipmaps && i.mipmaps.length > 0) for (let r = 0; r < i.mipmaps.length; r++) ve(s.__webglFramebuffer[n][r], t, i, e.COLOR_ATTACHMENT0, e.TEXTURE_CUBE_MAP_POSITIVE_X + n, r);
|
|
4224
|
+
else ve(s.__webglFramebuffer[n], t, i, e.COLOR_ATTACHMENT0, e.TEXTURE_CUBE_MAP_POSITIVE_X + n, 0);
|
|
4225
4225
|
x(i) && S(e.TEXTURE_CUBE_MAP), n.unbindTexture();
|
|
4226
4226
|
} else if (d) {
|
|
4227
4227
|
for (let i = 0, a = l.length; i < a; i++) {
|
|
4228
4228
|
let a = l[i], o = r.get(a), c = e.TEXTURE_2D;
|
|
4229
|
-
(t.isWebGL3DRenderTarget || t.isWebGLArrayRenderTarget) && (c = t.isWebGL3DRenderTarget ? e.TEXTURE_3D : e.TEXTURE_2D_ARRAY), n.bindTexture(c, o.__webglTexture),
|
|
4229
|
+
(t.isWebGL3DRenderTarget || t.isWebGLArrayRenderTarget) && (c = t.isWebGL3DRenderTarget ? e.TEXTURE_3D : e.TEXTURE_2D_ARRAY), n.bindTexture(c, o.__webglTexture), fe(c, a), ve(s.__webglFramebuffer, t, a, e.COLOR_ATTACHMENT0 + i, c, 0), x(a) && S(c);
|
|
4230
4230
|
}
|
|
4231
4231
|
n.unbindTexture();
|
|
4232
4232
|
} else {
|
|
4233
4233
|
let r = e.TEXTURE_2D;
|
|
4234
|
-
if ((t.isWebGL3DRenderTarget || t.isWebGLArrayRenderTarget) && (r = t.isWebGL3DRenderTarget ? e.TEXTURE_3D : e.TEXTURE_2D_ARRAY), n.bindTexture(r, c.__webglTexture),
|
|
4235
|
-
else
|
|
4234
|
+
if ((t.isWebGL3DRenderTarget || t.isWebGLArrayRenderTarget) && (r = t.isWebGL3DRenderTarget ? e.TEXTURE_3D : e.TEXTURE_2D_ARRAY), n.bindTexture(r, c.__webglTexture), fe(r, i), i.mipmaps && i.mipmaps.length > 0) for (let n = 0; n < i.mipmaps.length; n++) ve(s.__webglFramebuffer[n], t, i, e.COLOR_ATTACHMENT0, r, n);
|
|
4235
|
+
else ve(s.__webglFramebuffer, t, i, e.COLOR_ATTACHMENT0, r, 0);
|
|
4236
4236
|
x(i) && S(r), n.unbindTexture();
|
|
4237
4237
|
}
|
|
4238
|
-
t.depthBuffer &&
|
|
4238
|
+
t.depthBuffer && xe(t);
|
|
4239
4239
|
}
|
|
4240
|
-
function
|
|
4240
|
+
function we(e) {
|
|
4241
4241
|
let t = e.textures;
|
|
4242
4242
|
for (let i = 0, a = t.length; i < a; i++) {
|
|
4243
4243
|
let a = t[i];
|
|
4244
4244
|
if (x(a)) {
|
|
4245
|
-
let t =
|
|
4245
|
+
let t = w(e), i = r.get(a).__webglTexture;
|
|
4246
4246
|
n.bindTexture(t, i), S(t), n.unbindTexture();
|
|
4247
4247
|
}
|
|
4248
4248
|
}
|
|
4249
4249
|
}
|
|
4250
|
-
let
|
|
4251
|
-
function
|
|
4250
|
+
let Ee = [], De = [];
|
|
4251
|
+
function V(t) {
|
|
4252
4252
|
if (t.samples > 0) {
|
|
4253
|
-
if (
|
|
4253
|
+
if (Ae(t) === !1) {
|
|
4254
4254
|
let i = t.textures, a = t.width, o = t.height, s = e.COLOR_BUFFER_BIT, l = t.stencilBuffer ? e.DEPTH_STENCIL_ATTACHMENT : e.DEPTH_ATTACHMENT, u = r.get(t), d = i.length > 1;
|
|
4255
4255
|
if (d) for (let t = 0; t < i.length; t++) n.bindFramebuffer(e.FRAMEBUFFER, u.__webglMultisampledFramebuffer), e.framebufferRenderbuffer(e.FRAMEBUFFER, e.COLOR_ATTACHMENT0 + t, e.RENDERBUFFER, null), n.bindFramebuffer(e.FRAMEBUFFER, u.__webglFramebuffer), e.framebufferTexture2D(e.DRAW_FRAMEBUFFER, e.COLOR_ATTACHMENT0 + t, e.TEXTURE_2D, null, 0);
|
|
4256
4256
|
n.bindFramebuffer(e.READ_FRAMEBUFFER, u.__webglMultisampledFramebuffer);
|
|
@@ -4262,7 +4262,7 @@ function Ti(e, t, n, r, i, a, o) {
|
|
|
4262
4262
|
let t = r.get(i[n]).__webglTexture;
|
|
4263
4263
|
e.framebufferTexture2D(e.DRAW_FRAMEBUFFER, e.COLOR_ATTACHMENT0, e.TEXTURE_2D, t, 0);
|
|
4264
4264
|
}
|
|
4265
|
-
e.blitFramebuffer(0, 0, a, o, 0, 0, a, o, s, e.NEAREST), c === !0 && (
|
|
4265
|
+
e.blitFramebuffer(0, 0, a, o, 0, 0, a, o, s, e.NEAREST), c === !0 && (Ee.length = 0, De.length = 0, Ee.push(e.COLOR_ATTACHMENT0 + n), t.depthBuffer && t.resolveDepthBuffer === !1 && (Ee.push(l), De.push(l), e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER, De)), e.invalidateFramebuffer(e.READ_FRAMEBUFFER, Ee));
|
|
4266
4266
|
}
|
|
4267
4267
|
if (n.bindFramebuffer(e.READ_FRAMEBUFFER, null), n.bindFramebuffer(e.DRAW_FRAMEBUFFER, null), d) for (let t = 0; t < i.length; t++) {
|
|
4268
4268
|
n.bindFramebuffer(e.FRAMEBUFFER, u.__webglMultisampledFramebuffer), e.framebufferRenderbuffer(e.FRAMEBUFFER, e.COLOR_ATTACHMENT0 + t, e.RENDERBUFFER, u.__webglColorRenderbuffer[t]);
|
|
@@ -4276,31 +4276,31 @@ function Ti(e, t, n, r, i, a, o) {
|
|
|
4276
4276
|
}
|
|
4277
4277
|
}
|
|
4278
4278
|
}
|
|
4279
|
-
function
|
|
4279
|
+
function Oe(e) {
|
|
4280
4280
|
return Math.min(i.maxSamples, e.samples);
|
|
4281
4281
|
}
|
|
4282
|
-
function
|
|
4282
|
+
function Ae(e) {
|
|
4283
4283
|
let n = r.get(e);
|
|
4284
4284
|
return e.samples > 0 && t.has("WEBGL_multisampled_render_to_texture") === !0 && n.__useRenderToTexture !== !1;
|
|
4285
4285
|
}
|
|
4286
|
-
function
|
|
4286
|
+
function je(e) {
|
|
4287
4287
|
let t = o.render.frame;
|
|
4288
4288
|
p.get(e) !== t && (p.set(e, t), e.update());
|
|
4289
4289
|
}
|
|
4290
|
-
function
|
|
4290
|
+
function Me(e, t) {
|
|
4291
4291
|
let n = e.colorSpace, r = e.format, i = e.type;
|
|
4292
|
-
return e.isCompressedTexture === !0 || e.isVideoTexture === !0 || n !== "srgb-linear" && n !== "" && (
|
|
4292
|
+
return e.isCompressedTexture === !0 || e.isVideoTexture === !0 || n !== "srgb-linear" && n !== "" && (B.getTransfer(n) === "srgb" ? (r !== 1023 || i !== 1009) && j("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.") : U("WebGLTextures: Unsupported texture color space:", n)), t;
|
|
4293
4293
|
}
|
|
4294
|
-
function
|
|
4294
|
+
function H(e) {
|
|
4295
4295
|
return typeof HTMLImageElement < "u" && e instanceof HTMLImageElement ? (u.width = e.naturalWidth || e.width, u.height = e.naturalHeight || e.height) : typeof VideoFrame < "u" && e instanceof VideoFrame ? (u.width = e.displayWidth, u.height = e.displayHeight) : (u.width = e.width, u.height = e.height), u;
|
|
4296
4296
|
}
|
|
4297
|
-
this.allocateTextureUnit =
|
|
4297
|
+
this.allocateTextureUnit = re, this.resetTextureUnits = te, this.getTextureUnits = F, this.setTextureUnits = ne, this.setTexture2D = ae, this.setTexture2DArray = I, this.setTexture3D = oe, this.setTextureCube = se, this.rebindTextures = Se, this.setupRenderTarget = Ce, this.updateRenderTargetMipmap = we, this.updateMultisampleRenderTarget = V, this.setupDepthRenderbuffer = xe, this.setupFrameBufferTexture = ve, this.useMultisampledRTT = Ae, this.isReversedDepthBuffer = function() {
|
|
4298
4298
|
return n.buffers.depth.getReversed();
|
|
4299
4299
|
};
|
|
4300
4300
|
}
|
|
4301
4301
|
function Ei(e, t) {
|
|
4302
4302
|
function n(n, r = "") {
|
|
4303
|
-
let i, a =
|
|
4303
|
+
let i, a = B.getTransfer(r);
|
|
4304
4304
|
if (n === 1009) return e.UNSIGNED_BYTE;
|
|
4305
4305
|
if (n === 1017) return e.UNSIGNED_SHORT_4_4_4_4;
|
|
4306
4306
|
if (n === 1018) return e.UNSIGNED_SHORT_5_5_5_1;
|
|
@@ -4405,7 +4405,7 @@ var Di = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Oi = "
|
|
|
4405
4405
|
}
|
|
4406
4406
|
getMesh(e) {
|
|
4407
4407
|
if (this.texture !== null && this.mesh === null) {
|
|
4408
|
-
let t = e.cameras[0].viewport, n = new
|
|
4408
|
+
let t = e.cameras[0].viewport, n = new ze({
|
|
4409
4409
|
vertexShader: Di,
|
|
4410
4410
|
fragmentShader: Oi,
|
|
4411
4411
|
uniforms: {
|
|
@@ -4414,7 +4414,7 @@ var Di = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Oi = "
|
|
|
4414
4414
|
depthHeight: { value: t.w }
|
|
4415
4415
|
}
|
|
4416
4416
|
});
|
|
4417
|
-
this.mesh = new
|
|
4417
|
+
this.mesh = new z(new Be(20, 20), n);
|
|
4418
4418
|
}
|
|
4419
4419
|
return this.mesh;
|
|
4420
4420
|
}
|
|
@@ -4424,47 +4424,47 @@ var Di = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Oi = "
|
|
|
4424
4424
|
getDepthTexture() {
|
|
4425
4425
|
return this.texture;
|
|
4426
4426
|
}
|
|
4427
|
-
}, Ai = class extends
|
|
4427
|
+
}, Ai = class extends Pe {
|
|
4428
4428
|
constructor(e, t) {
|
|
4429
4429
|
super();
|
|
4430
|
-
let n = this, r = null, i = 1, a = null, o = "local-floor", s = 1, c = null, l = null, d = null, f = null, p = null,
|
|
4431
|
-
A.viewport = new
|
|
4432
|
-
let
|
|
4433
|
-
|
|
4434
|
-
let
|
|
4430
|
+
let n = this, r = null, i = 1, a = null, o = "local-floor", s = 1, c = null, l = null, d = null, f = null, p = null, y = null, b = typeof XRWebGLBinding < "u", x = new ki(), S = {}, C = t.getContextAttributes(), w = null, T = null, E = [], D = [], O = new L(), k = null, A = new H();
|
|
4431
|
+
A.viewport = new tt();
|
|
4432
|
+
let M = new H();
|
|
4433
|
+
M.viewport = new tt();
|
|
4434
|
+
let ee = [A, M], N = new Ye(), P = null, te = null;
|
|
4435
4435
|
this.cameraAutoUpdate = !0, this.enabled = !1, this.isPresenting = !1, this.getController = function(e) {
|
|
4436
|
-
let t =
|
|
4437
|
-
return t === void 0 && (t = new
|
|
4436
|
+
let t = E[e];
|
|
4437
|
+
return t === void 0 && (t = new g(), E[e] = t), t.getTargetRaySpace();
|
|
4438
4438
|
}, this.getControllerGrip = function(e) {
|
|
4439
|
-
let t =
|
|
4440
|
-
return t === void 0 && (t = new
|
|
4439
|
+
let t = E[e];
|
|
4440
|
+
return t === void 0 && (t = new g(), E[e] = t), t.getGripSpace();
|
|
4441
4441
|
}, this.getHand = function(e) {
|
|
4442
|
-
let t =
|
|
4443
|
-
return t === void 0 && (t = new
|
|
4442
|
+
let t = E[e];
|
|
4443
|
+
return t === void 0 && (t = new g(), E[e] = t), t.getHandSpace();
|
|
4444
4444
|
};
|
|
4445
|
-
function
|
|
4446
|
-
let t =
|
|
4445
|
+
function F(e) {
|
|
4446
|
+
let t = D.indexOf(e.inputSource);
|
|
4447
4447
|
if (t === -1) return;
|
|
4448
|
-
let n =
|
|
4448
|
+
let n = E[t];
|
|
4449
4449
|
n !== void 0 && (n.update(e.inputSource, e.frame, c || a), n.dispatchEvent({
|
|
4450
4450
|
type: e.type,
|
|
4451
4451
|
data: e.inputSource
|
|
4452
4452
|
}));
|
|
4453
4453
|
}
|
|
4454
4454
|
function ne() {
|
|
4455
|
-
r.removeEventListener("select",
|
|
4456
|
-
for (let e = 0; e <
|
|
4457
|
-
let t =
|
|
4458
|
-
t !== null && (
|
|
4455
|
+
r.removeEventListener("select", F), r.removeEventListener("selectstart", F), r.removeEventListener("selectend", F), r.removeEventListener("squeeze", F), r.removeEventListener("squeezestart", F), r.removeEventListener("squeezeend", F), r.removeEventListener("end", ne), r.removeEventListener("inputsourceschange", re);
|
|
4456
|
+
for (let e = 0; e < E.length; e++) {
|
|
4457
|
+
let t = D[e];
|
|
4458
|
+
t !== null && (D[e] = null, E[e].disconnect(t));
|
|
4459
4459
|
}
|
|
4460
|
-
|
|
4461
|
-
for (let e in
|
|
4462
|
-
e.setRenderTarget(
|
|
4460
|
+
P = null, te = null, x.reset();
|
|
4461
|
+
for (let e in S) delete S[e];
|
|
4462
|
+
e.setRenderTarget(w), p = null, f = null, d = null, r = null, T = null, ue.stop(), n.isPresenting = !1, e.setPixelRatio(k), e.setSize(O.width, O.height, !1), n.dispatchEvent({ type: "sessionend" });
|
|
4463
4463
|
}
|
|
4464
4464
|
this.setFramebufferScaleFactor = function(e) {
|
|
4465
|
-
i = e, n.isPresenting === !0 &&
|
|
4465
|
+
i = e, n.isPresenting === !0 && j("WebXRManager: Cannot change framebuffer scale while presenting.");
|
|
4466
4466
|
}, this.setReferenceSpaceType = function(e) {
|
|
4467
|
-
o = e, n.isPresenting === !0 &&
|
|
4467
|
+
o = e, n.isPresenting === !0 && j("WebXRManager: Cannot change reference space type while presenting.");
|
|
4468
4468
|
}, this.getReferenceSpace = function() {
|
|
4469
4469
|
return c || a;
|
|
4470
4470
|
}, this.setReferenceSpace = function(e) {
|
|
@@ -4472,103 +4472,103 @@ var Di = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Oi = "
|
|
|
4472
4472
|
}, this.getBaseLayer = function() {
|
|
4473
4473
|
return f === null ? p : f;
|
|
4474
4474
|
}, this.getBinding = function() {
|
|
4475
|
-
return d === null &&
|
|
4475
|
+
return d === null && b && (d = new XRWebGLBinding(r, t)), d;
|
|
4476
4476
|
}, this.getFrame = function() {
|
|
4477
|
-
return
|
|
4477
|
+
return y;
|
|
4478
4478
|
}, this.getSession = function() {
|
|
4479
4479
|
return r;
|
|
4480
4480
|
}, this.setSession = async function(l) {
|
|
4481
4481
|
if (r = l, r !== null) {
|
|
4482
|
-
if (
|
|
4482
|
+
if (w = e.getRenderTarget(), r.addEventListener("select", F), r.addEventListener("selectstart", F), r.addEventListener("selectend", F), r.addEventListener("squeeze", F), r.addEventListener("squeezestart", F), r.addEventListener("squeezeend", F), r.addEventListener("end", ne), r.addEventListener("inputsourceschange", re), C.xrCompatible !== !0 && await t.makeXRCompatible(), k = e.getPixelRatio(), e.getSize(O), b && "createProjectionLayer" in XRWebGLBinding.prototype) {
|
|
4483
4483
|
let n = null, a = null, o = null;
|
|
4484
|
-
|
|
4484
|
+
C.depth && (o = C.stencil ? t.DEPTH24_STENCIL8 : t.DEPTH_COMPONENT24, n = C.stencil ? _ : oe, a = C.stencil ? Oe : $e);
|
|
4485
4485
|
let s = {
|
|
4486
4486
|
colorFormat: t.RGBA8,
|
|
4487
4487
|
depthFormat: o,
|
|
4488
4488
|
scaleFactor: i
|
|
4489
4489
|
};
|
|
4490
|
-
d = this.getBinding(), f = d.createProjectionLayer(s), r.updateRenderState({ layers: [f] }), e.setPixelRatio(1), e.setSize(f.textureWidth, f.textureHeight, !1),
|
|
4491
|
-
format:
|
|
4492
|
-
type:
|
|
4493
|
-
depthTexture: new
|
|
4494
|
-
stencilBuffer:
|
|
4490
|
+
d = this.getBinding(), f = d.createProjectionLayer(s), r.updateRenderState({ layers: [f] }), e.setPixelRatio(1), e.setSize(f.textureWidth, f.textureHeight, !1), T = new v(f.textureWidth, f.textureHeight, {
|
|
4491
|
+
format: Re,
|
|
4492
|
+
type: Le,
|
|
4493
|
+
depthTexture: new h(f.textureWidth, f.textureHeight, a, void 0, void 0, void 0, void 0, void 0, void 0, n),
|
|
4494
|
+
stencilBuffer: C.stencil,
|
|
4495
4495
|
colorSpace: e.outputColorSpace,
|
|
4496
|
-
samples:
|
|
4496
|
+
samples: C.antialias ? 4 : 0,
|
|
4497
4497
|
resolveDepthBuffer: f.ignoreDepthValues === !1,
|
|
4498
4498
|
resolveStencilBuffer: f.ignoreDepthValues === !1
|
|
4499
4499
|
});
|
|
4500
4500
|
} else {
|
|
4501
4501
|
let n = {
|
|
4502
|
-
antialias:
|
|
4502
|
+
antialias: C.antialias,
|
|
4503
4503
|
alpha: !0,
|
|
4504
|
-
depth:
|
|
4505
|
-
stencil:
|
|
4504
|
+
depth: C.depth,
|
|
4505
|
+
stencil: C.stencil,
|
|
4506
4506
|
framebufferScaleFactor: i
|
|
4507
4507
|
};
|
|
4508
|
-
p = new XRWebGLLayer(r, t, n), r.updateRenderState({ baseLayer: p }), e.setPixelRatio(1), e.setSize(p.framebufferWidth, p.framebufferHeight, !1),
|
|
4509
|
-
format:
|
|
4510
|
-
type:
|
|
4508
|
+
p = new XRWebGLLayer(r, t, n), r.updateRenderState({ baseLayer: p }), e.setPixelRatio(1), e.setSize(p.framebufferWidth, p.framebufferHeight, !1), T = new v(p.framebufferWidth, p.framebufferHeight, {
|
|
4509
|
+
format: Re,
|
|
4510
|
+
type: Le,
|
|
4511
4511
|
colorSpace: e.outputColorSpace,
|
|
4512
|
-
stencilBuffer:
|
|
4512
|
+
stencilBuffer: C.stencil,
|
|
4513
4513
|
resolveDepthBuffer: p.ignoreDepthValues === !1,
|
|
4514
4514
|
resolveStencilBuffer: p.ignoreDepthValues === !1
|
|
4515
4515
|
});
|
|
4516
4516
|
}
|
|
4517
|
-
|
|
4517
|
+
T.isXRRenderTarget = !0, this.setFoveation(s), c = null, a = await r.requestReferenceSpace(o), ue.setContext(r), ue.start(), n.isPresenting = !0, n.dispatchEvent({ type: "sessionstart" });
|
|
4518
4518
|
}
|
|
4519
4519
|
}, this.getEnvironmentBlendMode = function() {
|
|
4520
4520
|
if (r !== null) return r.environmentBlendMode;
|
|
4521
4521
|
}, this.getDepthTexture = function() {
|
|
4522
|
-
return
|
|
4522
|
+
return x.getDepthTexture();
|
|
4523
4523
|
};
|
|
4524
|
-
function
|
|
4524
|
+
function re(e) {
|
|
4525
4525
|
for (let t = 0; t < e.removed.length; t++) {
|
|
4526
|
-
let n = e.removed[t], r =
|
|
4527
|
-
r >= 0 && (
|
|
4526
|
+
let n = e.removed[t], r = D.indexOf(n);
|
|
4527
|
+
r >= 0 && (D[r] = null, E[r].disconnect(n));
|
|
4528
4528
|
}
|
|
4529
4529
|
for (let t = 0; t < e.added.length; t++) {
|
|
4530
|
-
let n = e.added[t], r =
|
|
4530
|
+
let n = e.added[t], r = D.indexOf(n);
|
|
4531
4531
|
if (r === -1) {
|
|
4532
|
-
for (let e = 0; e <
|
|
4533
|
-
|
|
4532
|
+
for (let e = 0; e < E.length; e++) if (e >= D.length) {
|
|
4533
|
+
D.push(n), r = e;
|
|
4534
4534
|
break;
|
|
4535
|
-
} else if (
|
|
4536
|
-
|
|
4535
|
+
} else if (D[e] === null) {
|
|
4536
|
+
D[e] = n, r = e;
|
|
4537
4537
|
break;
|
|
4538
4538
|
}
|
|
4539
4539
|
if (r === -1) break;
|
|
4540
4540
|
}
|
|
4541
|
-
let i =
|
|
4541
|
+
let i = E[r];
|
|
4542
4542
|
i && i.connect(n);
|
|
4543
4543
|
}
|
|
4544
4544
|
}
|
|
4545
|
-
let
|
|
4546
|
-
function
|
|
4547
|
-
|
|
4548
|
-
let r =
|
|
4545
|
+
let ie = new m(), ae = new m();
|
|
4546
|
+
function I(e, t, n) {
|
|
4547
|
+
ie.setFromMatrixPosition(t.matrixWorld), ae.setFromMatrixPosition(n.matrixWorld);
|
|
4548
|
+
let r = ie.distanceTo(ae), i = t.projectionMatrix.elements, a = n.projectionMatrix.elements, o = i[14] / (i[10] - 1), s = i[14] / (i[10] + 1), c = (i[9] + 1) / i[5], l = (i[9] - 1) / i[5], u = (i[8] - 1) / i[0], d = (a[8] + 1) / a[0], f = o * u, p = o * d, m = r / (-u + d), h = m * -u;
|
|
4549
4549
|
if (t.matrixWorld.decompose(e.position, e.quaternion, e.scale), e.translateX(h), e.translateZ(m), e.matrixWorld.compose(e.position, e.quaternion, e.scale), e.matrixWorldInverse.copy(e.matrixWorld).invert(), i[10] === -1) e.projectionMatrix.copy(t.projectionMatrix), e.projectionMatrixInverse.copy(t.projectionMatrixInverse);
|
|
4550
4550
|
else {
|
|
4551
4551
|
let t = o + m, n = s + m, i = f - h, a = p + (r - h), u = c * s / n * t, d = l * s / n * t;
|
|
4552
4552
|
e.projectionMatrix.makePerspective(i, a, u, d, t, n), e.projectionMatrixInverse.copy(e.projectionMatrix).invert();
|
|
4553
4553
|
}
|
|
4554
4554
|
}
|
|
4555
|
-
function
|
|
4555
|
+
function se(e, t) {
|
|
4556
4556
|
t === null ? e.matrixWorld.copy(e.matrix) : e.matrixWorld.multiplyMatrices(t.matrixWorld, e.matrix), e.matrixWorldInverse.copy(e.matrixWorld).invert();
|
|
4557
4557
|
}
|
|
4558
4558
|
this.updateCamera = function(e) {
|
|
4559
4559
|
if (r === null) return;
|
|
4560
4560
|
let t = e.near, n = e.far;
|
|
4561
|
-
|
|
4561
|
+
x.texture !== null && (x.depthNear > 0 && (t = x.depthNear), x.depthFar > 0 && (n = x.depthFar)), N.near = M.near = A.near = t, N.far = M.far = A.far = n, (P !== N.near || te !== N.far) && (r.updateRenderState({
|
|
4562
4562
|
depthNear: N.near,
|
|
4563
4563
|
depthFar: N.far
|
|
4564
|
-
}),
|
|
4564
|
+
}), P = N.near, te = N.far), N.layers.mask = e.layers.mask | 6, A.layers.mask = N.layers.mask & -5, M.layers.mask = N.layers.mask & -3;
|
|
4565
4565
|
let i = e.parent, a = N.cameras;
|
|
4566
|
-
|
|
4567
|
-
for (let e = 0; e < a.length; e++)
|
|
4568
|
-
a.length === 2 ?
|
|
4566
|
+
se(N, i);
|
|
4567
|
+
for (let e = 0; e < a.length; e++) se(a[e], i);
|
|
4568
|
+
a.length === 2 ? I(N, A, M) : N.projectionMatrix.copy(A.projectionMatrix), R(e, N, i);
|
|
4569
4569
|
};
|
|
4570
4570
|
function R(e, t, n) {
|
|
4571
|
-
n === null ? e.matrix.copy(t.matrixWorld) : (e.matrix.copy(n.matrixWorld), e.matrix.invert(), e.matrix.multiply(t.matrixWorld)), e.matrix.decompose(e.position, e.quaternion, e.scale), e.updateMatrixWorld(!0), e.projectionMatrix.copy(t.projectionMatrix), e.projectionMatrixInverse.copy(t.projectionMatrixInverse), e.isPerspectiveCamera && (e.fov =
|
|
4571
|
+
n === null ? e.matrix.copy(t.matrixWorld) : (e.matrix.copy(n.matrixWorld), e.matrix.invert(), e.matrix.multiply(t.matrixWorld)), e.matrix.decompose(e.position, e.quaternion, e.scale), e.updateMatrixWorld(!0), e.projectionMatrix.copy(t.projectionMatrix), e.projectionMatrixInverse.copy(t.projectionMatrixInverse), e.isPerspectiveCamera && (e.fov = Ze * 2 * Math.atan(1 / e.projectionMatrix.elements[5]), e.zoom = 1);
|
|
4572
4572
|
}
|
|
4573
4573
|
this.getCamera = function() {
|
|
4574
4574
|
return N;
|
|
@@ -4577,17 +4577,17 @@ var Di = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Oi = "
|
|
|
4577
4577
|
}, this.setFoveation = function(e) {
|
|
4578
4578
|
s = e, f !== null && (f.fixedFoveation = e), p !== null && p.fixedFoveation !== void 0 && (p.fixedFoveation = e);
|
|
4579
4579
|
}, this.hasDepthSensing = function() {
|
|
4580
|
-
return
|
|
4580
|
+
return x.texture !== null;
|
|
4581
4581
|
}, this.getDepthSensingMesh = function() {
|
|
4582
|
-
return
|
|
4582
|
+
return x.getMesh(N);
|
|
4583
4583
|
}, this.getCameraTexture = function(e) {
|
|
4584
|
-
return
|
|
4584
|
+
return S[e];
|
|
4585
4585
|
};
|
|
4586
|
-
let
|
|
4587
|
-
function
|
|
4588
|
-
if (l = i.getViewerPose(c || a),
|
|
4586
|
+
let ce = null;
|
|
4587
|
+
function le(t, i) {
|
|
4588
|
+
if (l = i.getViewerPose(c || a), y = i, l !== null) {
|
|
4589
4589
|
let t = l.views;
|
|
4590
|
-
p !== null && (e.setRenderTargetFramebuffer(
|
|
4590
|
+
p !== null && (e.setRenderTargetFramebuffer(T, p.framebuffer), e.setRenderTarget(T));
|
|
4591
4591
|
let i = !1;
|
|
4592
4592
|
t.length !== N.cameras.length && (N.cameras.length = 0, i = !0);
|
|
4593
4593
|
for (let n = 0; n < t.length; n++) {
|
|
@@ -4595,52 +4595,52 @@ var Di = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Oi = "
|
|
|
4595
4595
|
if (p !== null) a = p.getViewport(r);
|
|
4596
4596
|
else {
|
|
4597
4597
|
let t = d.getViewSubImage(f, r);
|
|
4598
|
-
a = t.viewport, n === 0 && (e.setRenderTargetTextures(
|
|
4598
|
+
a = t.viewport, n === 0 && (e.setRenderTargetTextures(T, t.colorTexture, t.depthStencilTexture), e.setRenderTarget(T));
|
|
4599
4599
|
}
|
|
4600
|
-
let o =
|
|
4601
|
-
o === void 0 && (o = new
|
|
4600
|
+
let o = ee[n];
|
|
4601
|
+
o === void 0 && (o = new H(), o.layers.enable(n), o.viewport = new tt(), ee[n] = o), o.matrix.fromArray(r.transform.matrix), o.matrix.decompose(o.position, o.quaternion, o.scale), o.projectionMatrix.fromArray(r.projectionMatrix), o.projectionMatrixInverse.copy(o.projectionMatrix).invert(), o.viewport.set(a.x, a.y, a.width, a.height), n === 0 && (N.matrix.copy(o.matrix), N.matrix.decompose(N.position, N.quaternion, N.scale)), i === !0 && N.cameras.push(o);
|
|
4602
4602
|
}
|
|
4603
4603
|
let a = r.enabledFeatures;
|
|
4604
|
-
if (a && a.includes("depth-sensing") && r.depthUsage == "gpu-optimized" &&
|
|
4604
|
+
if (a && a.includes("depth-sensing") && r.depthUsage == "gpu-optimized" && b) {
|
|
4605
4605
|
d = n.getBinding();
|
|
4606
4606
|
let e = d.getDepthInformation(t[0]);
|
|
4607
|
-
e && e.isValid && e.texture &&
|
|
4607
|
+
e && e.isValid && e.texture && x.init(e, r.renderState);
|
|
4608
4608
|
}
|
|
4609
|
-
if (a && a.includes("camera-access") &&
|
|
4609
|
+
if (a && a.includes("camera-access") && b) {
|
|
4610
4610
|
e.state.unbindTexture(), d = n.getBinding();
|
|
4611
4611
|
for (let e = 0; e < t.length; e++) {
|
|
4612
4612
|
let n = t[e].camera;
|
|
4613
4613
|
if (n) {
|
|
4614
|
-
let e =
|
|
4615
|
-
e || (e = new u(),
|
|
4614
|
+
let e = S[n];
|
|
4615
|
+
e || (e = new u(), S[n] = e);
|
|
4616
4616
|
let t = d.getCameraImage(n);
|
|
4617
4617
|
e.sourceTexture = t;
|
|
4618
4618
|
}
|
|
4619
4619
|
}
|
|
4620
4620
|
}
|
|
4621
4621
|
}
|
|
4622
|
-
for (let e = 0; e <
|
|
4623
|
-
let t =
|
|
4622
|
+
for (let e = 0; e < E.length; e++) {
|
|
4623
|
+
let t = D[e], n = E[e];
|
|
4624
4624
|
t !== null && n !== void 0 && n.update(t, i, c || a);
|
|
4625
4625
|
}
|
|
4626
|
-
|
|
4626
|
+
ce && ce(t, i), i.detectedPlanes && n.dispatchEvent({
|
|
4627
4627
|
type: "planesdetected",
|
|
4628
4628
|
data: i
|
|
4629
|
-
}),
|
|
4629
|
+
}), y = null;
|
|
4630
4630
|
}
|
|
4631
|
-
let
|
|
4632
|
-
|
|
4633
|
-
|
|
4631
|
+
let ue = new St();
|
|
4632
|
+
ue.setAnimationLoop(le), this.setAnimationLoop = function(e) {
|
|
4633
|
+
ce = e;
|
|
4634
4634
|
}, this.dispose = function() {};
|
|
4635
4635
|
}
|
|
4636
|
-
}, ji = /*@__PURE__*/ new
|
|
4636
|
+
}, ji = /*@__PURE__*/ new E(), Mi = /*@__PURE__*/ new q();
|
|
4637
4637
|
Mi.set(-1, 0, 0, 0, 1, 0, 0, 0, 1);
|
|
4638
4638
|
function Ni(e, t) {
|
|
4639
4639
|
function n(e, t) {
|
|
4640
4640
|
e.matrixAutoUpdate === !0 && e.updateMatrix(), t.value.copy(e.matrix);
|
|
4641
4641
|
}
|
|
4642
4642
|
function r(t, n) {
|
|
4643
|
-
n.color.getRGB(t.fogColor.value,
|
|
4643
|
+
n.color.getRGB(t.fogColor.value, P(e)), n.isFog ? (t.fogNear.value = n.near, t.fogFar.value = n.far) : n.isFogExp2 && (t.fogDensity.value = n.density);
|
|
4644
4644
|
}
|
|
4645
4645
|
function i(e, t, n, r, i) {
|
|
4646
4646
|
t.isNodeMaterial ? t.uniformsNeedUpdate = !1 : t.isMeshBasicMaterial ? a(e, t) : t.isMeshLambertMaterial ? (a(e, t), t.envMap && (e.envMapIntensity.value = t.envMapIntensity)) : t.isMeshToonMaterial ? (a(e, t), d(e, t)) : t.isMeshPhongMaterial ? (a(e, t), u(e, t), t.envMap && (e.envMapIntensity.value = t.envMapIntensity)) : t.isMeshStandardMaterial ? (a(e, t), f(e, t), t.isMeshPhysicalMaterial && p(e, t, i)) : t.isMeshMatcapMaterial ? (a(e, t), m(e, t)) : t.isMeshDepthMaterial ? a(e, t) : t.isMeshDistanceMaterial ? (a(e, t), h(e, t)) : t.isMeshNormalMaterial ? a(e, t) : t.isLineBasicMaterial ? (o(e, t), t.isLineDashedMaterial && s(e, t)) : t.isPointsMaterial ? c(e, t, n, r) : t.isSpriteMaterial ? l(e, t) : t.isShadowMaterial ? (e.color.value.copy(t.color), e.opacity.value = t.opacity) : t.isShaderMaterial && (t.uniformsNeedUpdate = !1);
|
|
@@ -4694,49 +4694,49 @@ function Pi(e, t, n, r) {
|
|
|
4694
4694
|
}
|
|
4695
4695
|
function l(e, n) {
|
|
4696
4696
|
let o = i[e.id];
|
|
4697
|
-
o === void 0 && (
|
|
4697
|
+
o === void 0 && (g(e), o = u(e), i[e.id] = o, e.addEventListener("dispose", v));
|
|
4698
4698
|
let s = n.program;
|
|
4699
4699
|
r.updateUBOMapping(e, s);
|
|
4700
4700
|
let c = t.render.frame;
|
|
4701
|
-
a[e.id] !== c && (
|
|
4701
|
+
a[e.id] !== c && (f(e), a[e.id] = c);
|
|
4702
4702
|
}
|
|
4703
4703
|
function u(t) {
|
|
4704
|
-
let n =
|
|
4704
|
+
let n = d();
|
|
4705
4705
|
t.__bindingPointIndex = n;
|
|
4706
4706
|
let r = e.createBuffer(), i = t.__size, a = t.usage;
|
|
4707
4707
|
return e.bindBuffer(e.UNIFORM_BUFFER, r), e.bufferData(e.UNIFORM_BUFFER, i, a), e.bindBuffer(e.UNIFORM_BUFFER, null), e.bindBufferBase(e.UNIFORM_BUFFER, n, r), r;
|
|
4708
4708
|
}
|
|
4709
|
-
function
|
|
4709
|
+
function d() {
|
|
4710
4710
|
for (let e = 0; e < s; e++) if (o.indexOf(e) === -1) return o.push(e), e;
|
|
4711
|
-
return
|
|
4711
|
+
return U("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."), 0;
|
|
4712
4712
|
}
|
|
4713
|
-
function
|
|
4713
|
+
function f(t) {
|
|
4714
4714
|
let n = i[t.id], r = t.uniforms, a = t.__cache;
|
|
4715
4715
|
e.bindBuffer(e.UNIFORM_BUFFER, n);
|
|
4716
4716
|
for (let e = 0, t = r.length; e < t; e++) {
|
|
4717
4717
|
let t = r[e];
|
|
4718
|
-
if (Array.isArray(t)) for (let n = 0, r = t.length; n < r; n++)
|
|
4719
|
-
else
|
|
4718
|
+
if (Array.isArray(t)) for (let n = 0, r = t.length; n < r; n++) p(t[n], e, n, a);
|
|
4719
|
+
else p(t, e, 0, a);
|
|
4720
4720
|
}
|
|
4721
4721
|
e.bindBuffer(e.UNIFORM_BUFFER, null);
|
|
4722
4722
|
}
|
|
4723
|
-
function
|
|
4724
|
-
if (
|
|
4723
|
+
function p(t, n, r, i) {
|
|
4724
|
+
if (h(t, n, r, i) === !0) {
|
|
4725
4725
|
let n = t.__offset, r = t.value;
|
|
4726
4726
|
if (Array.isArray(r)) {
|
|
4727
4727
|
let e = 0;
|
|
4728
4728
|
for (let n = 0; n < r.length; n++) {
|
|
4729
|
-
let i = r[n], a =
|
|
4730
|
-
|
|
4729
|
+
let i = r[n], a = _(i);
|
|
4730
|
+
m(i, t.__data, e), typeof i != "number" && typeof i != "boolean" && !i.isMatrix3 && !ArrayBuffer.isView(i) && (e += a.storage / Float32Array.BYTES_PER_ELEMENT);
|
|
4731
4731
|
}
|
|
4732
|
-
} else
|
|
4732
|
+
} else m(r, t.__data, 0);
|
|
4733
4733
|
e.bufferSubData(e.UNIFORM_BUFFER, n, t.__data);
|
|
4734
4734
|
}
|
|
4735
4735
|
}
|
|
4736
|
-
function
|
|
4736
|
+
function m(e, t, n) {
|
|
4737
4737
|
typeof e == "number" || typeof e == "boolean" ? t[0] = e : e.isMatrix3 ? (t[0] = e.elements[0], t[1] = e.elements[1], t[2] = e.elements[2], t[3] = 0, t[4] = e.elements[3], t[5] = e.elements[4], t[6] = e.elements[5], t[7] = 0, t[8] = e.elements[6], t[9] = e.elements[7], t[10] = e.elements[8], t[11] = 0) : ArrayBuffer.isView(e) ? t.set(new e.constructor(e.buffer, e.byteOffset, t.length)) : e.toArray(t, n);
|
|
4738
4738
|
}
|
|
4739
|
-
function
|
|
4739
|
+
function h(e, t, n, r) {
|
|
4740
4740
|
let i = e.value, a = t + "_" + n;
|
|
4741
4741
|
if (r[a] === void 0) return r[a] = typeof i == "number" || typeof i == "boolean" ? i : ArrayBuffer.isView(i) ? i.slice() : i.clone(), !0;
|
|
4742
4742
|
{
|
|
@@ -4748,14 +4748,14 @@ function Pi(e, t, n, r) {
|
|
|
4748
4748
|
}
|
|
4749
4749
|
return !1;
|
|
4750
4750
|
}
|
|
4751
|
-
function
|
|
4751
|
+
function g(e) {
|
|
4752
4752
|
let t = e.uniforms, n = 0;
|
|
4753
4753
|
for (let e = 0, r = t.length; e < r; e++) {
|
|
4754
4754
|
let r = Array.isArray(t[e]) ? t[e] : [t[e]];
|
|
4755
4755
|
for (let e = 0, t = r.length; e < t; e++) {
|
|
4756
4756
|
let t = r[e], i = Array.isArray(t.value) ? t.value : [t.value];
|
|
4757
4757
|
for (let e = 0, r = i.length; e < r; e++) {
|
|
4758
|
-
let r = i[e], a =
|
|
4758
|
+
let r = i[e], a = _(r), o = n % 16, s = o % a.boundary, c = o + s;
|
|
4759
4759
|
n += s, c !== 0 && 16 - c < a.storage && (n += 16 - c), t.__data = new Float32Array(a.storage / Float32Array.BYTES_PER_ELEMENT), t.__offset = n, n += a.storage;
|
|
4760
4760
|
}
|
|
4761
4761
|
}
|
|
@@ -4763,27 +4763,27 @@ function Pi(e, t, n, r) {
|
|
|
4763
4763
|
let r = n % 16;
|
|
4764
4764
|
return r > 0 && (n += 16 - r), e.__size = n, e.__cache = {}, this;
|
|
4765
4765
|
}
|
|
4766
|
-
function
|
|
4766
|
+
function _(e) {
|
|
4767
4767
|
let t = {
|
|
4768
4768
|
boundary: 0,
|
|
4769
4769
|
storage: 0
|
|
4770
4770
|
};
|
|
4771
|
-
return typeof e == "number" || typeof e == "boolean" ? (t.boundary = 4, t.storage = 4) : e.isVector2 ? (t.boundary = 8, t.storage = 8) : e.isVector3 || e.isColor ? (t.boundary = 16, t.storage = 12) : e.isVector4 ? (t.boundary = 16, t.storage = 16) : e.isMatrix3 ? (t.boundary = 48, t.storage = 48) : e.isMatrix4 ? (t.boundary = 64, t.storage = 64) : e.isTexture ?
|
|
4771
|
+
return typeof e == "number" || typeof e == "boolean" ? (t.boundary = 4, t.storage = 4) : e.isVector2 ? (t.boundary = 8, t.storage = 8) : e.isVector3 || e.isColor ? (t.boundary = 16, t.storage = 12) : e.isVector4 ? (t.boundary = 16, t.storage = 16) : e.isMatrix3 ? (t.boundary = 48, t.storage = 48) : e.isMatrix4 ? (t.boundary = 64, t.storage = 64) : e.isTexture ? j("WebGLRenderer: Texture samplers can not be part of an uniforms group.") : ArrayBuffer.isView(e) ? (t.boundary = 16, t.storage = e.byteLength) : j("WebGLRenderer: Unsupported uniform value type.", e), t;
|
|
4772
4772
|
}
|
|
4773
|
-
function
|
|
4773
|
+
function v(t) {
|
|
4774
4774
|
let n = t.target;
|
|
4775
|
-
n.removeEventListener("dispose",
|
|
4775
|
+
n.removeEventListener("dispose", v);
|
|
4776
4776
|
let r = o.indexOf(n.__bindingPointIndex);
|
|
4777
4777
|
o.splice(r, 1), e.deleteBuffer(i[n.id]), delete i[n.id], delete a[n.id];
|
|
4778
4778
|
}
|
|
4779
|
-
function
|
|
4779
|
+
function y() {
|
|
4780
4780
|
for (let t in i) e.deleteBuffer(i[t]);
|
|
4781
4781
|
o = [], i = {}, a = {};
|
|
4782
4782
|
}
|
|
4783
4783
|
return {
|
|
4784
4784
|
bind: c,
|
|
4785
4785
|
update: l,
|
|
4786
|
-
dispose:
|
|
4786
|
+
dispose: y
|
|
4787
4787
|
};
|
|
4788
4788
|
}
|
|
4789
4789
|
var Fi = new Uint16Array([
|
|
@@ -5301,47 +5301,47 @@ var Fi = new Uint16Array([
|
|
|
5301
5301
|
1183
|
|
5302
5302
|
]), Ii = null;
|
|
5303
5303
|
function Li() {
|
|
5304
|
-
return Ii === null && (Ii = new et(Fi, 16, 16,
|
|
5304
|
+
return Ii === null && (Ii = new et(Fi, 16, 16, S, A), Ii.name = "DFG_LUT", Ii.minFilter = f, Ii.magFilter = f, Ii.wrapS = ke, Ii.wrapT = ke, Ii.generateMipmaps = !1, Ii.needsUpdate = !0), Ii;
|
|
5305
5305
|
}
|
|
5306
5306
|
var Ri = class {
|
|
5307
5307
|
constructor(e = {}) {
|
|
5308
|
-
let { canvas: t =
|
|
5308
|
+
let { canvas: t = Fe(), context: n = null, depth: r = !0, stencil: i = !1, alpha: a = !1, antialias: o = !1, premultipliedAlpha: s = !0, preserveDrawingBuffer: c = !1, powerPreference: l = "default", failIfMajorPerformanceCaveat: u = !1, reversedDepthBuffer: d = !1, outputBufferType: f = Le } = e;
|
|
5309
5309
|
this.isWebGLRenderer = !0;
|
|
5310
|
-
let
|
|
5310
|
+
let p;
|
|
5311
5311
|
if (n !== null) {
|
|
5312
5312
|
if (typeof WebGLRenderingContext < "u" && n instanceof WebGLRenderingContext) throw Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");
|
|
5313
|
-
|
|
5314
|
-
} else
|
|
5315
|
-
let
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
]),
|
|
5320
|
-
|
|
5321
|
-
me,
|
|
5322
|
-
ye,
|
|
5323
|
-
De,
|
|
5313
|
+
p = n.getContextAttributes().alpha;
|
|
5314
|
+
} else p = a;
|
|
5315
|
+
let h = f, g = /* @__PURE__ */ new Set([
|
|
5316
|
+
Ae,
|
|
5317
|
+
k,
|
|
5318
|
+
pe
|
|
5319
|
+
]), _ = /* @__PURE__ */ new Set([
|
|
5320
|
+
Le,
|
|
5324
5321
|
$e,
|
|
5325
|
-
|
|
5326
|
-
|
|
5322
|
+
rt,
|
|
5323
|
+
Oe,
|
|
5324
|
+
at,
|
|
5325
|
+
be
|
|
5326
|
+
]), y = /* @__PURE__ */ new Uint32Array(4), b = /* @__PURE__ */ new Int32Array(4), x = new m(), S = null, C = null, w = [], D = [], O = null;
|
|
5327
5327
|
this.domElement = t, this.debug = {
|
|
5328
5328
|
checkShaderErrors: !0,
|
|
5329
5329
|
onShaderError: null
|
|
5330
5330
|
}, this.autoClear = !0, this.autoClearColor = !0, this.autoClearDepth = !0, this.autoClearStencil = !0, this.sortObjects = !0, this.clippingPlanes = [], this.localClippingEnabled = !1, this.toneMapping = 0, this.toneMappingExposure = 1, this.transmissionResolutionScale = 1;
|
|
5331
|
-
let M = this,
|
|
5332
|
-
this._outputColorSpace =
|
|
5333
|
-
let
|
|
5331
|
+
let M = this, ee = !1, P = null, te = null, F = null, re = null;
|
|
5332
|
+
this._outputColorSpace = Ge;
|
|
5333
|
+
let ie = 0, ae = 0, I = null, L = -1, oe = null, R = new tt(), ce = new tt(), ue = null, de = new V(0), fe = 0, z = t.width, me = t.height, he = 1, ge = null, _e = null, ve = new tt(0, 0, z, me), ye = new tt(0, 0, z, me), xe = !1, Se = new N(), Ce = !1, we = !1, Te = new E(), Ee = new m(), De = new tt(), ke = {
|
|
5334
5334
|
background: null,
|
|
5335
5335
|
fog: null,
|
|
5336
5336
|
environment: null,
|
|
5337
5337
|
overrideMaterial: null,
|
|
5338
5338
|
isScene: !0
|
|
5339
|
-
},
|
|
5340
|
-
function
|
|
5341
|
-
return
|
|
5339
|
+
}, je = !1;
|
|
5340
|
+
function Me() {
|
|
5341
|
+
return I === null ? he : 1;
|
|
5342
5342
|
}
|
|
5343
|
-
let
|
|
5344
|
-
function
|
|
5343
|
+
let H = n;
|
|
5344
|
+
function Ne(e, n) {
|
|
5345
5345
|
return t.getContext(e, n);
|
|
5346
5346
|
}
|
|
5347
5347
|
try {
|
|
@@ -5355,97 +5355,97 @@ var Ri = class {
|
|
|
5355
5355
|
powerPreference: l,
|
|
5356
5356
|
failIfMajorPerformanceCaveat: u
|
|
5357
5357
|
};
|
|
5358
|
-
if ("setAttribute" in t && t.setAttribute("data-engine", "three.js r185"), t.addEventListener("webglcontextlost",
|
|
5358
|
+
if ("setAttribute" in t && t.setAttribute("data-engine", "three.js r185"), t.addEventListener("webglcontextlost", st, !1), t.addEventListener("webglcontextrestored", ct, !1), t.addEventListener("webglcontextcreationerror", Y, !1), H === null) {
|
|
5359
5359
|
let t = "webgl2";
|
|
5360
|
-
if (
|
|
5360
|
+
if (H = Ne(t, e), H === null) throw Ne(t) ? Error("THREE.WebGLRenderer: Error creating WebGL context with your selected attributes.") : Error("THREE.WebGLRenderer: Error creating WebGL context.");
|
|
5361
5361
|
}
|
|
5362
5362
|
} catch (e) {
|
|
5363
|
-
throw
|
|
5363
|
+
throw U("WebGLRenderer: " + e.message), e;
|
|
5364
5364
|
}
|
|
5365
|
-
let
|
|
5366
|
-
function
|
|
5367
|
-
|
|
5365
|
+
let Pe, Ie, W, Re, G, K, ze, Be, Ve, He, q, Ue, We, Ke, qe, Je, Ye, Xe, Ze, Qe, et, nt, it;
|
|
5366
|
+
function ot() {
|
|
5367
|
+
Pe = new tn(H), Pe.init(), et = new Ei(H, Pe), Ie = new jt(H, Pe, e, et), W = new wi(H, Pe), Ie.reversedDepthBuffer && d && W.buffers.depth.setReversed(!0), te = H.createFramebuffer(), F = H.createFramebuffer(), re = H.createFramebuffer(), Re = new an(H), G = new ii(), K = new Ti(H, Pe, W, G, Ie, et, Re), ze = new en(M), Be = new Ct(H), nt = new kt(H, Be), Ve = new nn(H, Be, Re, nt), He = new sn(H, Ve, Be, nt, Re), Xe = new on(H, Ie, K), qe = new Mt(G), q = new ri(M, ze, Pe, Ie, nt, qe), Ue = new Ni(M, G), We = new ci(), Ke = new hi(Pe), Ye = new Ot(M, ze, W, He, p, s), Je = new Ci(M, He, Ie), it = new Pi(H, Re, Ie, W), Ze = new At(H, Pe, Re), Qe = new rn(H, Pe, Re), Re.programs = q.programs, M.capabilities = Ie, M.extensions = Pe, M.properties = G, M.renderLists = We, M.shadowMap = Je, M.state = W, M.info = Re;
|
|
5368
5368
|
}
|
|
5369
|
-
|
|
5370
|
-
let
|
|
5371
|
-
this.xr =
|
|
5372
|
-
return
|
|
5369
|
+
ot(), h !== 1009 && (O = new ln(h, t.width, t.height, o, r, i));
|
|
5370
|
+
let J = new Ai(M, H);
|
|
5371
|
+
this.xr = J, this.getContext = function() {
|
|
5372
|
+
return H;
|
|
5373
5373
|
}, this.getContextAttributes = function() {
|
|
5374
|
-
return
|
|
5374
|
+
return H.getContextAttributes();
|
|
5375
5375
|
}, this.forceContextLoss = function() {
|
|
5376
|
-
let e =
|
|
5376
|
+
let e = Pe.get("WEBGL_lose_context");
|
|
5377
5377
|
e && e.loseContext();
|
|
5378
5378
|
}, this.forceContextRestore = function() {
|
|
5379
|
-
let e =
|
|
5379
|
+
let e = Pe.get("WEBGL_lose_context");
|
|
5380
5380
|
e && e.restoreContext();
|
|
5381
5381
|
}, this.getPixelRatio = function() {
|
|
5382
5382
|
return he;
|
|
5383
5383
|
}, this.setPixelRatio = function(e) {
|
|
5384
|
-
e !== void 0 && (he = e, this.setSize(
|
|
5384
|
+
e !== void 0 && (he = e, this.setSize(z, me, !1));
|
|
5385
5385
|
}, this.getSize = function(e) {
|
|
5386
|
-
return e.set(
|
|
5386
|
+
return e.set(z, me);
|
|
5387
5387
|
}, this.setSize = function(e, n, r = !0) {
|
|
5388
|
-
if (
|
|
5389
|
-
|
|
5388
|
+
if (J.isPresenting) {
|
|
5389
|
+
j("WebGLRenderer: Can't change size while VR device is presenting.");
|
|
5390
5390
|
return;
|
|
5391
5391
|
}
|
|
5392
|
-
|
|
5392
|
+
z = e, me = n, t.width = Math.floor(e * he), t.height = Math.floor(n * he), r === !0 && (t.style.width = e + "px", t.style.height = n + "px"), O !== null && O.setSize(t.width, t.height), this.setViewport(0, 0, e, n);
|
|
5393
5393
|
}, this.getDrawingBufferSize = function(e) {
|
|
5394
|
-
return e.set(
|
|
5394
|
+
return e.set(z * he, me * he).floor();
|
|
5395
5395
|
}, this.setDrawingBufferSize = function(e, n, r) {
|
|
5396
|
-
|
|
5396
|
+
z = e, me = n, he = r, t.width = Math.floor(e * r), t.height = Math.floor(n * r), this.setViewport(0, 0, e, n);
|
|
5397
5397
|
}, this.setEffects = function(e) {
|
|
5398
|
-
if (
|
|
5399
|
-
|
|
5398
|
+
if (h === 1009) {
|
|
5399
|
+
U("WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");
|
|
5400
5400
|
return;
|
|
5401
5401
|
}
|
|
5402
5402
|
if (e) {
|
|
5403
5403
|
for (let t = 0; t < e.length; t++) if (e[t].isOutputPass === !0) {
|
|
5404
|
-
|
|
5404
|
+
j("WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");
|
|
5405
5405
|
break;
|
|
5406
5406
|
}
|
|
5407
5407
|
}
|
|
5408
|
-
|
|
5408
|
+
O.setEffects(e || []);
|
|
5409
5409
|
}, this.getCurrentViewport = function(e) {
|
|
5410
|
-
return e.copy(
|
|
5410
|
+
return e.copy(R);
|
|
5411
5411
|
}, this.getViewport = function(e) {
|
|
5412
5412
|
return e.copy(ve);
|
|
5413
5413
|
}, this.setViewport = function(e, t, n, r) {
|
|
5414
|
-
e.isVector4 ? ve.set(e.x, e.y, e.z, e.w) : ve.set(e, t, n, r),
|
|
5414
|
+
e.isVector4 ? ve.set(e.x, e.y, e.z, e.w) : ve.set(e, t, n, r), W.viewport(R.copy(ve).multiplyScalar(he).round());
|
|
5415
5415
|
}, this.getScissor = function(e) {
|
|
5416
|
-
return e.copy(
|
|
5416
|
+
return e.copy(ye);
|
|
5417
5417
|
}, this.setScissor = function(e, t, n, r) {
|
|
5418
|
-
e.isVector4 ?
|
|
5418
|
+
e.isVector4 ? ye.set(e.x, e.y, e.z, e.w) : ye.set(e, t, n, r), W.scissor(ce.copy(ye).multiplyScalar(he).round());
|
|
5419
5419
|
}, this.getScissorTest = function() {
|
|
5420
5420
|
return xe;
|
|
5421
5421
|
}, this.setScissorTest = function(e) {
|
|
5422
|
-
|
|
5422
|
+
W.setScissorTest(xe = e);
|
|
5423
5423
|
}, this.setOpaqueSort = function(e) {
|
|
5424
5424
|
ge = e;
|
|
5425
5425
|
}, this.setTransparentSort = function(e) {
|
|
5426
5426
|
_e = e;
|
|
5427
5427
|
}, this.getClearColor = function(e) {
|
|
5428
|
-
return e.copy(
|
|
5428
|
+
return e.copy(Ye.getClearColor());
|
|
5429
5429
|
}, this.setClearColor = function() {
|
|
5430
|
-
|
|
5430
|
+
Ye.setClearColor(...arguments);
|
|
5431
5431
|
}, this.getClearAlpha = function() {
|
|
5432
|
-
return
|
|
5432
|
+
return Ye.getClearAlpha();
|
|
5433
5433
|
}, this.setClearAlpha = function() {
|
|
5434
|
-
|
|
5434
|
+
Ye.setClearAlpha(...arguments);
|
|
5435
5435
|
}, this.clear = function(e = !0, t = !0, n = !0) {
|
|
5436
5436
|
let r = 0;
|
|
5437
5437
|
if (e) {
|
|
5438
5438
|
let e = !1;
|
|
5439
|
-
if (
|
|
5440
|
-
let t =
|
|
5441
|
-
e =
|
|
5439
|
+
if (I !== null) {
|
|
5440
|
+
let t = I.texture.format;
|
|
5441
|
+
e = g.has(t);
|
|
5442
5442
|
}
|
|
5443
5443
|
if (e) {
|
|
5444
|
-
let e =
|
|
5445
|
-
t ? (
|
|
5446
|
-
} else r |=
|
|
5444
|
+
let e = I.texture.type, t = _.has(e), n = Ye.getClearColor(), r = Ye.getClearAlpha(), i = n.r, a = n.g, o = n.b;
|
|
5445
|
+
t ? (y[0] = i, y[1] = a, y[2] = o, y[3] = r, H.clearBufferuiv(H.COLOR, 0, y)) : (b[0] = i, b[1] = a, b[2] = o, b[3] = r, H.clearBufferiv(H.COLOR, 0, b));
|
|
5446
|
+
} else r |= H.COLOR_BUFFER_BIT;
|
|
5447
5447
|
}
|
|
5448
|
-
t && (r |=
|
|
5448
|
+
t && (r |= H.DEPTH_BUFFER_BIT, this.state.buffers.depth.setMask(!0)), n && (r |= H.STENCIL_BUFFER_BIT, this.state.buffers.stencil.setMask(4294967295)), r !== 0 && H.clear(r);
|
|
5449
5449
|
}, this.clearColor = function() {
|
|
5450
5450
|
this.clear(!0, !1, !1);
|
|
5451
5451
|
}, this.clearDepth = function() {
|
|
@@ -5455,57 +5455,57 @@ var Ri = class {
|
|
|
5455
5455
|
}, this.setNodesHandler = function(e) {
|
|
5456
5456
|
e.setRenderer(this), P = e;
|
|
5457
5457
|
}, this.dispose = function() {
|
|
5458
|
-
t.removeEventListener("webglcontextlost",
|
|
5458
|
+
t.removeEventListener("webglcontextlost", st, !1), t.removeEventListener("webglcontextrestored", ct, !1), t.removeEventListener("webglcontextcreationerror", Y, !1), Ye.dispose(), We.dispose(), Ke.dispose(), G.dispose(), ze.dispose(), He.dispose(), nt.dispose(), it.dispose(), q.dispose(), J.dispose(), J.removeEventListener("sessionstart", ht), J.removeEventListener("sessionend", X), gt.stop();
|
|
5459
5459
|
};
|
|
5460
|
-
function
|
|
5461
|
-
e.preventDefault(),
|
|
5462
|
-
}
|
|
5463
|
-
function st() {
|
|
5464
|
-
te("WebGLRenderer: Context Restored."), N = !1;
|
|
5465
|
-
let e = Fe.autoReset, t = Ye.enabled, n = Ye.autoUpdate, r = Ye.needsUpdate, i = Ye.type;
|
|
5466
|
-
at(), Fe.autoReset = e, Ye.enabled = t, Ye.autoUpdate = n, Ye.needsUpdate = r, Ye.type = i;
|
|
5460
|
+
function st(e) {
|
|
5461
|
+
e.preventDefault(), ne("WebGLRenderer: Context Lost."), ee = !0;
|
|
5467
5462
|
}
|
|
5468
|
-
function
|
|
5469
|
-
|
|
5463
|
+
function ct() {
|
|
5464
|
+
ne("WebGLRenderer: Context Restored."), ee = !1;
|
|
5465
|
+
let e = Re.autoReset, t = Je.enabled, n = Je.autoUpdate, r = Je.needsUpdate, i = Je.type;
|
|
5466
|
+
ot(), Re.autoReset = e, Je.enabled = t, Je.autoUpdate = n, Je.needsUpdate = r, Je.type = i;
|
|
5470
5467
|
}
|
|
5471
|
-
function
|
|
5472
|
-
|
|
5473
|
-
t.removeEventListener("dispose", ct), lt(t);
|
|
5468
|
+
function Y(e) {
|
|
5469
|
+
U("WebGLRenderer: A WebGL context could not be created. Reason: ", e.statusMessage);
|
|
5474
5470
|
}
|
|
5475
5471
|
function lt(e) {
|
|
5476
|
-
|
|
5472
|
+
let t = e.target;
|
|
5473
|
+
t.removeEventListener("dispose", lt), ut(t);
|
|
5477
5474
|
}
|
|
5478
5475
|
function ut(e) {
|
|
5479
|
-
|
|
5476
|
+
dt(e), G.remove(e);
|
|
5477
|
+
}
|
|
5478
|
+
function dt(e) {
|
|
5479
|
+
let t = G.get(e).programs;
|
|
5480
5480
|
t !== void 0 && (t.forEach(function(e) {
|
|
5481
|
-
|
|
5482
|
-
}), e.isShaderMaterial &&
|
|
5481
|
+
q.releaseProgram(e);
|
|
5482
|
+
}), e.isShaderMaterial && q.releaseShaderCache(e));
|
|
5483
5483
|
}
|
|
5484
5484
|
this.renderBufferDirect = function(e, t, n, r, i, a) {
|
|
5485
5485
|
t === null && (t = ke);
|
|
5486
5486
|
let o = i.isMesh && i.matrixWorld.determinantAffine() < 0, s = Et(e, t, n, r, i);
|
|
5487
|
-
|
|
5487
|
+
W.setMaterial(r, o);
|
|
5488
5488
|
let c = n.index, l = 1;
|
|
5489
5489
|
if (r.wireframe === !0) {
|
|
5490
|
-
if (c =
|
|
5490
|
+
if (c = Ve.getWireframeAttribute(n), c === void 0) return;
|
|
5491
5491
|
l = 2;
|
|
5492
5492
|
}
|
|
5493
5493
|
let u = n.drawRange, d = n.attributes.position, f = u.start * l, p = (u.start + u.count) * l;
|
|
5494
5494
|
a !== null && (f = Math.max(f, a.start * l), p = Math.min(p, (a.start + a.count) * l)), c === null ? d != null && (f = Math.max(f, 0), p = Math.min(p, d.count)) : (f = Math.max(f, 0), p = Math.min(p, c.count));
|
|
5495
5495
|
let m = p - f;
|
|
5496
5496
|
if (m < 0 || m === Infinity) return;
|
|
5497
|
-
|
|
5498
|
-
let h, g =
|
|
5499
|
-
if (c !== null && (h = Be.get(c), g =
|
|
5497
|
+
nt.setup(i, r, s, n, c);
|
|
5498
|
+
let h, g = Ze;
|
|
5499
|
+
if (c !== null && (h = Be.get(c), g = Qe, g.setIndex(h)), i.isMesh) r.wireframe === !0 ? (W.setLineWidth(r.wireframeLinewidth * Me()), g.setMode(H.LINES)) : g.setMode(H.TRIANGLES);
|
|
5500
5500
|
else if (i.isLine) {
|
|
5501
5501
|
let e = r.linewidth;
|
|
5502
|
-
e === void 0 && (e = 1),
|
|
5503
|
-
} else i.isPoints ? g.setMode(
|
|
5502
|
+
e === void 0 && (e = 1), W.setLineWidth(e * Me()), i.isLineSegments ? g.setMode(H.LINES) : i.isLineLoop ? g.setMode(H.LINE_LOOP) : g.setMode(H.LINE_STRIP);
|
|
5503
|
+
} else i.isPoints ? g.setMode(H.POINTS) : i.isSprite && g.setMode(H.TRIANGLES);
|
|
5504
5504
|
if (i.isBatchedMesh) {
|
|
5505
|
-
if (
|
|
5505
|
+
if (Pe.get("WEBGL_multi_draw")) g.renderMultiDraw(i._multiDrawStarts, i._multiDrawCounts, i._multiDrawCount);
|
|
5506
5506
|
else {
|
|
5507
|
-
let e = i._multiDrawStarts, t = i._multiDrawCounts, n = i._multiDrawCount, a = c ? Be.get(c).bytesPerElement : 1, o =
|
|
5508
|
-
for (let r = 0; r < n; r++) o.setValue(
|
|
5507
|
+
let e = i._multiDrawStarts, t = i._multiDrawCounts, n = i._multiDrawCount, a = c ? Be.get(c).bytesPerElement : 1, o = G.get(r).currentProgram.getUniforms();
|
|
5508
|
+
for (let r = 0; r < n; r++) o.setValue(H, "_gl_DrawID", r), g.render(e[r] / a, t[r]);
|
|
5509
5509
|
}
|
|
5510
5510
|
} else if (i.isInstancedMesh) g.renderInstances(f, m, i.count);
|
|
5511
5511
|
else if (n.isInstancedBufferGeometry) {
|
|
@@ -5513,15 +5513,15 @@ var Ri = class {
|
|
|
5513
5513
|
g.renderInstances(f, m, t);
|
|
5514
5514
|
} else g.render(f, m);
|
|
5515
5515
|
};
|
|
5516
|
-
function
|
|
5516
|
+
function ft(e, t, n) {
|
|
5517
5517
|
e.transparent === !0 && e.side === 2 && e.forceSinglePass === !1 ? (e.side = 1, e.needsUpdate = !0, Z(e, t, n), e.side = 0, e.needsUpdate = !0, Z(e, t, n), e.side = 2) : Z(e, t, n);
|
|
5518
5518
|
}
|
|
5519
5519
|
this.compile = function(e, t, n = null) {
|
|
5520
|
-
n === null && (n = e),
|
|
5521
|
-
e.isLight && e.layers.test(t.layers) && (
|
|
5520
|
+
n === null && (n = e), C = Ke.get(n), C.init(t), D.push(C), n.traverseVisible(function(e) {
|
|
5521
|
+
e.isLight && e.layers.test(t.layers) && (C.pushLight(e), e.castShadow && C.pushShadow(e));
|
|
5522
5522
|
}), e !== n && e.traverseVisible(function(e) {
|
|
5523
|
-
e.isLight && e.layers.test(t.layers) && (
|
|
5524
|
-
}),
|
|
5523
|
+
e.isLight && e.layers.test(t.layers) && (C.pushLight(e), e.castShadow && C.pushShadow(e));
|
|
5524
|
+
}), C.setupLights();
|
|
5525
5525
|
let r = /* @__PURE__ */ new Set();
|
|
5526
5526
|
return e.traverse(function(e) {
|
|
5527
5527
|
if (!(e.isMesh || e.isPoints || e.isLine || e.isSprite)) return;
|
|
@@ -5529,92 +5529,92 @@ var Ri = class {
|
|
|
5529
5529
|
if (t) {
|
|
5530
5530
|
if (Array.isArray(t)) for (let i = 0; i < t.length; i++) {
|
|
5531
5531
|
let a = t[i];
|
|
5532
|
-
|
|
5532
|
+
ft(a, n, e), r.add(a);
|
|
5533
5533
|
}
|
|
5534
|
-
else
|
|
5534
|
+
else ft(t, n, e), r.add(t);
|
|
5535
5535
|
}
|
|
5536
|
-
}),
|
|
5536
|
+
}), C = D.pop(), r;
|
|
5537
5537
|
}, this.compileAsync = function(e, t, n = null) {
|
|
5538
5538
|
let r = this.compile(e, t, n);
|
|
5539
5539
|
return new Promise((t) => {
|
|
5540
5540
|
function n() {
|
|
5541
5541
|
if (r.forEach(function(e) {
|
|
5542
|
-
|
|
5542
|
+
G.get(e).currentProgram.isReady() && r.delete(e);
|
|
5543
5543
|
}), r.size === 0) {
|
|
5544
5544
|
t(e);
|
|
5545
5545
|
return;
|
|
5546
5546
|
}
|
|
5547
5547
|
setTimeout(n, 10);
|
|
5548
5548
|
}
|
|
5549
|
-
|
|
5549
|
+
Pe.get("KHR_parallel_shader_compile") === null ? setTimeout(n, 10) : n();
|
|
5550
5550
|
});
|
|
5551
5551
|
};
|
|
5552
|
-
let
|
|
5553
|
-
function
|
|
5554
|
-
|
|
5552
|
+
let pt = null;
|
|
5553
|
+
function mt(e) {
|
|
5554
|
+
pt && pt(e);
|
|
5555
5555
|
}
|
|
5556
|
-
function
|
|
5556
|
+
function ht() {
|
|
5557
5557
|
gt.stop();
|
|
5558
5558
|
}
|
|
5559
|
-
function
|
|
5559
|
+
function X() {
|
|
5560
5560
|
gt.start();
|
|
5561
5561
|
}
|
|
5562
5562
|
let gt = new St();
|
|
5563
|
-
gt.setAnimationLoop(
|
|
5564
|
-
|
|
5565
|
-
},
|
|
5563
|
+
gt.setAnimationLoop(mt), typeof self < "u" && gt.setContext(self), this.setAnimationLoop = function(e) {
|
|
5564
|
+
pt = e, J.setAnimationLoop(e), e === null ? gt.stop() : gt.start();
|
|
5565
|
+
}, J.addEventListener("sessionstart", ht), J.addEventListener("sessionend", X), this.render = function(e, t) {
|
|
5566
5566
|
if (t !== void 0 && t.isCamera !== !0) {
|
|
5567
|
-
|
|
5567
|
+
U("WebGLRenderer.render: camera is not an instance of THREE.Camera.");
|
|
5568
5568
|
return;
|
|
5569
5569
|
}
|
|
5570
|
-
if (
|
|
5570
|
+
if (ee === !0) return;
|
|
5571
5571
|
P !== null && P.renderStart(e, t);
|
|
5572
|
-
let n =
|
|
5573
|
-
if (e.matrixWorldAutoUpdate === !0 && e.updateMatrixWorld(), t.parent === null && t.matrixWorldAutoUpdate === !0 && t.updateMatrixWorld(),
|
|
5572
|
+
let n = J.enabled === !0 && J.isPresenting === !0, r = O !== null && (I === null || n) && O.begin(M, I);
|
|
5573
|
+
if (e.matrixWorldAutoUpdate === !0 && e.updateMatrixWorld(), t.parent === null && t.matrixWorldAutoUpdate === !0 && t.updateMatrixWorld(), J.enabled === !0 && J.isPresenting === !0 && (O === null || O.isCompositing() === !1) && (J.cameraAutoUpdate === !0 && J.updateCamera(t), t = J.getCamera()), e.isScene === !0 && e.onBeforeRender(M, e, t, I), C = Ke.get(e, D.length), C.init(t), C.state.textureUnits = K.getTextureUnits(), D.push(C), Te.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse), Se.setFromProjectionMatrix(Te, se, t.reversedDepth), we = this.localClippingEnabled, Ce = qe.init(this.clippingPlanes, we), S = We.get(e, w.length), S.init(), w.push(S), J.enabled === !0 && J.isPresenting === !0) {
|
|
5574
5574
|
let e = M.xr.getDepthSensingMesh();
|
|
5575
5575
|
e !== null && _t(e, t, -Infinity, M.sortObjects);
|
|
5576
5576
|
}
|
|
5577
|
-
_t(e, t, 0, M.sortObjects),
|
|
5578
|
-
let i =
|
|
5579
|
-
if (
|
|
5580
|
-
let n =
|
|
5581
|
-
if (
|
|
5577
|
+
_t(e, t, 0, M.sortObjects), S.finish(), M.sortObjects === !0 && S.sort(ge, _e, t.reversedDepth), je = J.enabled === !1 || J.isPresenting === !1 || J.hasDepthSensing() === !1, je && Ye.addToRenderList(S, e), this.info.render.frame++, this.info.autoReset === !0 && this.info.reset(), Ce === !0 && qe.beginShadows();
|
|
5578
|
+
let i = C.state.shadowsArray;
|
|
5579
|
+
if (Je.render(i, e, t), Ce === !0 && qe.endShadows(), (r && O.hasRenderPass()) === !1) {
|
|
5580
|
+
let n = S.opaque, r = S.transmissive;
|
|
5581
|
+
if (C.setupLights(), t.isArrayCamera) {
|
|
5582
5582
|
let i = t.cameras;
|
|
5583
5583
|
if (r.length > 0) for (let t = 0, a = i.length; t < a; t++) {
|
|
5584
5584
|
let a = i[t];
|
|
5585
5585
|
yt(n, r, e, a);
|
|
5586
5586
|
}
|
|
5587
|
-
|
|
5587
|
+
je && Ye.render(e);
|
|
5588
5588
|
for (let t = 0, n = i.length; t < n; t++) {
|
|
5589
5589
|
let n = i[t];
|
|
5590
|
-
vt(
|
|
5590
|
+
vt(S, e, n, n.viewport);
|
|
5591
5591
|
}
|
|
5592
|
-
} else r.length > 0 && yt(n, r, e, t),
|
|
5592
|
+
} else r.length > 0 && yt(n, r, e, t), je && Ye.render(e), vt(S, e, t);
|
|
5593
5593
|
}
|
|
5594
|
-
|
|
5594
|
+
I !== null && ae === 0 && (K.updateMultisampleRenderTarget(I), K.updateRenderTargetMipmap(I)), r && O.end(M), e.isScene === !0 && e.onAfterRender(M, e, t), nt.resetDefaultState(), L = -1, oe = null, D.pop(), D.length > 0 ? (C = D[D.length - 1], K.setTextureUnits(C.state.textureUnits), Ce === !0 && qe.setGlobalState(M.clippingPlanes, C.state.camera)) : C = null, w.pop(), S = w.length > 0 ? w[w.length - 1] : null, P !== null && P.renderEnd();
|
|
5595
5595
|
};
|
|
5596
5596
|
function _t(e, t, n, r) {
|
|
5597
5597
|
if (e.visible === !1) return;
|
|
5598
5598
|
if (e.layers.test(t.layers)) {
|
|
5599
5599
|
if (e.isGroup) n = e.renderOrder;
|
|
5600
5600
|
else if (e.isLOD) e.autoUpdate === !0 && e.update(t);
|
|
5601
|
-
else if (e.isLightProbeGrid)
|
|
5602
|
-
else if (e.isLight)
|
|
5601
|
+
else if (e.isLightProbeGrid) C.pushLightProbeGrid(e);
|
|
5602
|
+
else if (e.isLight) C.pushLight(e), e.castShadow && C.pushShadow(e);
|
|
5603
5603
|
else if (e.isSprite) {
|
|
5604
5604
|
if (!e.frustumCulled || Se.intersectsSprite(e)) {
|
|
5605
|
-
r &&
|
|
5606
|
-
let t =
|
|
5607
|
-
i.visible &&
|
|
5605
|
+
r && De.setFromMatrixPosition(e.matrixWorld).applyMatrix4(Te);
|
|
5606
|
+
let t = He.update(e), i = e.material;
|
|
5607
|
+
i.visible && S.push(e, t, i, n, De.z, null);
|
|
5608
5608
|
}
|
|
5609
5609
|
} else if ((e.isMesh || e.isLine || e.isPoints) && (!e.frustumCulled || Se.intersectsObject(e))) {
|
|
5610
|
-
let t =
|
|
5611
|
-
if (r && (e.boundingSphere === void 0 ? (t.boundingSphere === null && t.computeBoundingSphere(),
|
|
5610
|
+
let t = He.update(e), i = e.material;
|
|
5611
|
+
if (r && (e.boundingSphere === void 0 ? (t.boundingSphere === null && t.computeBoundingSphere(), De.copy(t.boundingSphere.center)) : (e.boundingSphere === null && e.computeBoundingSphere(), De.copy(e.boundingSphere.center)), De.applyMatrix4(e.matrixWorld).applyMatrix4(Te)), Array.isArray(i)) {
|
|
5612
5612
|
let r = t.groups;
|
|
5613
5613
|
for (let a = 0, o = r.length; a < o; a++) {
|
|
5614
5614
|
let o = r[a], s = i[o.materialIndex];
|
|
5615
|
-
s && s.visible &&
|
|
5615
|
+
s && s.visible && S.push(e, t, s, n, De.z, o);
|
|
5616
5616
|
}
|
|
5617
|
-
} else i.visible &&
|
|
5617
|
+
} else i.visible && S.push(e, t, i, n, De.z, null);
|
|
5618
5618
|
}
|
|
5619
5619
|
}
|
|
5620
5620
|
let i = e.children;
|
|
@@ -5622,31 +5622,31 @@ var Ri = class {
|
|
|
5622
5622
|
}
|
|
5623
5623
|
function vt(e, t, n, r) {
|
|
5624
5624
|
let { opaque: i, transmissive: a, transparent: o } = e;
|
|
5625
|
-
|
|
5625
|
+
C.setupLightsView(n), Ce === !0 && qe.setGlobalState(M.clippingPlanes, n), r && W.viewport(R.copy(r)), i.length > 0 && bt(i, t, n), a.length > 0 && bt(a, t, n), o.length > 0 && bt(o, t, n), W.buffers.depth.setTest(!0), W.buffers.depth.setMask(!0), W.buffers.color.setMask(!0), W.setPolygonOffset(!1);
|
|
5626
5626
|
}
|
|
5627
5627
|
function yt(e, t, n, r) {
|
|
5628
5628
|
if ((n.isScene === !0 ? n.overrideMaterial : null) !== null) return;
|
|
5629
|
-
if (
|
|
5630
|
-
let e =
|
|
5631
|
-
|
|
5629
|
+
if (C.state.transmissionRenderTarget[r.id] === void 0) {
|
|
5630
|
+
let e = Pe.has("EXT_color_buffer_half_float") || Pe.has("EXT_color_buffer_float");
|
|
5631
|
+
C.state.transmissionRenderTarget[r.id] = new v(1, 1, {
|
|
5632
5632
|
generateMipmaps: !0,
|
|
5633
|
-
type: e ?
|
|
5634
|
-
minFilter:
|
|
5635
|
-
samples: Math.max(4,
|
|
5633
|
+
type: e ? A : Le,
|
|
5634
|
+
minFilter: le,
|
|
5635
|
+
samples: Math.max(4, Ie.samples),
|
|
5636
5636
|
stencilBuffer: i,
|
|
5637
5637
|
resolveDepthBuffer: !1,
|
|
5638
5638
|
resolveStencilBuffer: !1,
|
|
5639
|
-
colorSpace:
|
|
5639
|
+
colorSpace: B.workingColorSpace
|
|
5640
5640
|
});
|
|
5641
5641
|
}
|
|
5642
|
-
let a =
|
|
5642
|
+
let a = C.state.transmissionRenderTarget[r.id], o = r.viewport || R;
|
|
5643
5643
|
a.setSize(o.z * M.transmissionResolutionScale, o.w * M.transmissionResolutionScale);
|
|
5644
5644
|
let s = M.getRenderTarget(), c = M.getActiveCubeFace(), l = M.getActiveMipmapLevel();
|
|
5645
|
-
M.setRenderTarget(a), M.getClearColor(
|
|
5645
|
+
M.setRenderTarget(a), M.getClearColor(de), fe = M.getClearAlpha(), fe < 1 && M.setClearColor(16777215, .5), M.clear(), je && Ye.render(n);
|
|
5646
5646
|
let u = M.toneMapping;
|
|
5647
5647
|
M.toneMapping = 0;
|
|
5648
5648
|
let d = r.viewport;
|
|
5649
|
-
if (r.viewport !== void 0 && (r.viewport = void 0),
|
|
5649
|
+
if (r.viewport !== void 0 && (r.viewport = void 0), C.setupLightsView(r), Ce === !0 && qe.setGlobalState(M.clippingPlanes, r), bt(e, n, r), K.updateMultisampleRenderTarget(a), K.updateRenderTargetMipmap(a), Pe.has("WEBGL_multisampled_render_to_texture") === !1) {
|
|
5650
5650
|
let e = !1;
|
|
5651
5651
|
for (let i = 0, a = t.length; i < a; i++) {
|
|
5652
5652
|
let { object: a, geometry: o, material: s, group: c } = t[i];
|
|
@@ -5655,9 +5655,9 @@ var Ri = class {
|
|
|
5655
5655
|
s.side = 1, s.needsUpdate = !0, xt(a, n, r, o, s, c), s.side = t, s.needsUpdate = !0, e = !0;
|
|
5656
5656
|
}
|
|
5657
5657
|
}
|
|
5658
|
-
e === !0 && (
|
|
5658
|
+
e === !0 && (K.updateMultisampleRenderTarget(a), K.updateRenderTargetMipmap(a));
|
|
5659
5659
|
}
|
|
5660
|
-
M.setRenderTarget(s, c, l), M.setClearColor(
|
|
5660
|
+
M.setRenderTarget(s, c, l), M.setClearColor(de, fe), d !== void 0 && (r.viewport = d), M.toneMapping = u;
|
|
5661
5661
|
}
|
|
5662
5662
|
function bt(e, t, n) {
|
|
5663
5663
|
let r = t.isScene === !0 ? t.overrideMaterial : null;
|
|
@@ -5671,16 +5671,16 @@ var Ri = class {
|
|
|
5671
5671
|
}
|
|
5672
5672
|
function Z(e, t, n) {
|
|
5673
5673
|
t.isScene !== !0 && (t = ke);
|
|
5674
|
-
let r =
|
|
5674
|
+
let r = G.get(e), i = C.state.lights, a = C.state.shadowsArray, o = i.state.version, s = q.getParameters(e, i.state, a, t, n, C.state.lightProbeGridArray), c = q.getProgramCacheKey(s), l = r.programs;
|
|
5675
5675
|
r.environment = e.isMeshStandardMaterial || e.isMeshLambertMaterial || e.isMeshPhongMaterial ? t.environment : null, r.fog = t.fog;
|
|
5676
5676
|
let u = e.isMeshStandardMaterial || e.isMeshLambertMaterial && !e.envMap || e.isMeshPhongMaterial && !e.envMap;
|
|
5677
|
-
r.envMap =
|
|
5677
|
+
r.envMap = ze.get(e.envMap || r.environment, u), r.envMapRotation = r.environment !== null && e.envMap === null ? t.environmentRotation : e.envMapRotation, l === void 0 && (e.addEventListener("dispose", lt), l = /* @__PURE__ */ new Map(), r.programs = l);
|
|
5678
5678
|
let d = l.get(c);
|
|
5679
5679
|
if (d !== void 0) {
|
|
5680
5680
|
if (r.currentProgram === d && r.lightsStateVersion === o) return wt(e, s), d;
|
|
5681
|
-
} else s.uniforms =
|
|
5681
|
+
} else s.uniforms = q.getUniforms(e), P !== null && e.isNodeMaterial && P.build(e, n, s), e.onBeforeCompile(s, M), d = q.acquireProgram(s, c), l.set(c, d), r.uniforms = s.uniforms;
|
|
5682
5682
|
let f = r.uniforms;
|
|
5683
|
-
return (!e.isShaderMaterial && !e.isRawShaderMaterial || e.clipping === !0) && (f.clippingPlanes =
|
|
5683
|
+
return (!e.isShaderMaterial && !e.isRawShaderMaterial || e.clipping === !0) && (f.clippingPlanes = qe.uniform), wt(e, s), r.needsLights = Nt(e), r.lightsStateVersion = o, r.needsLights && (f.ambientLightColor.value = i.state.ambient, f.lightProbe.value = i.state.probe, f.directionalLights.value = i.state.directional, f.directionalLightShadows.value = i.state.directionalShadow, f.spotLights.value = i.state.spot, f.spotLightShadows.value = i.state.spotShadow, f.rectAreaLights.value = i.state.rectArea, f.ltc_1.value = i.state.rectAreaLTC1, f.ltc_2.value = i.state.rectAreaLTC2, f.pointLights.value = i.state.point, f.pointLightShadows.value = i.state.pointShadow, f.hemisphereLights.value = i.state.hemi, f.directionalShadowMatrix.value = i.state.directionalShadowMatrix, f.spotLightMatrix.value = i.state.spotLightMatrix, f.spotLightMap.value = i.state.spotLightMap, f.pointShadowMatrix.value = i.state.pointShadowMatrix), r.lightProbeGrid = C.state.lightProbeGridArray.length > 0, r.currentProgram = d, r.uniformsList = null, d;
|
|
5684
5684
|
}
|
|
5685
5685
|
function Q(e) {
|
|
5686
5686
|
if (e.uniformsList === null) {
|
|
@@ -5690,61 +5690,61 @@ var Ri = class {
|
|
|
5690
5690
|
return e.uniformsList;
|
|
5691
5691
|
}
|
|
5692
5692
|
function wt(e, t) {
|
|
5693
|
-
let n =
|
|
5693
|
+
let n = G.get(e);
|
|
5694
5694
|
n.outputColorSpace = t.outputColorSpace, n.batching = t.batching, n.batchingColor = t.batchingColor, n.instancing = t.instancing, n.instancingColor = t.instancingColor, n.instancingMorph = t.instancingMorph, n.skinning = t.skinning, n.morphTargets = t.morphTargets, n.morphNormals = t.morphNormals, n.morphColors = t.morphColors, n.morphTargetsCount = t.morphTargetsCount, n.numClippingPlanes = t.numClippingPlanes, n.numIntersection = t.numClipIntersection, n.vertexAlphas = t.vertexAlphas, n.vertexTangents = t.vertexTangents, n.toneMapping = t.toneMapping;
|
|
5695
5695
|
}
|
|
5696
5696
|
function Tt(e, t) {
|
|
5697
5697
|
if (e.length === 0) return null;
|
|
5698
5698
|
if (e.length === 1) return e[0].texture === null ? null : e[0];
|
|
5699
|
-
|
|
5699
|
+
x.setFromMatrixPosition(t.matrixWorld);
|
|
5700
5700
|
for (let t = 0, n = e.length; t < n; t++) {
|
|
5701
5701
|
let n = e[t];
|
|
5702
|
-
if (n.texture !== null && n.boundingBox.containsPoint(
|
|
5702
|
+
if (n.texture !== null && n.boundingBox.containsPoint(x)) return n;
|
|
5703
5703
|
}
|
|
5704
5704
|
return null;
|
|
5705
5705
|
}
|
|
5706
5706
|
function Et(e, t, n, r, i) {
|
|
5707
|
-
t.isScene !== !0 && (t = ke),
|
|
5708
|
-
let a = t.fog, o = r.isMeshStandardMaterial || r.isMeshLambertMaterial || r.isMeshPhongMaterial ? t.environment : null, s =
|
|
5709
|
-
r.toneMapped && (
|
|
5710
|
-
let g = n.morphAttributes.position || n.morphAttributes.normal || n.morphAttributes.color, _ = g === void 0 ? 0 : g.length, v =
|
|
5711
|
-
if (Ce === !0 && (we === !0 || e !==
|
|
5712
|
-
let t = e ===
|
|
5713
|
-
|
|
5707
|
+
t.isScene !== !0 && (t = ke), K.resetTextureUnits();
|
|
5708
|
+
let a = t.fog, o = r.isMeshStandardMaterial || r.isMeshLambertMaterial || r.isMeshPhongMaterial ? t.environment : null, s = I === null ? M.outputColorSpace : I.isXRRenderTarget === !0 ? I.texture.colorSpace : B.workingColorSpace, c = r.isMeshStandardMaterial || r.isMeshLambertMaterial && !r.envMap || r.isMeshPhongMaterial && !r.envMap, l = ze.get(r.envMap || o, c), u = r.vertexColors === !0 && !!n.attributes.color && n.attributes.color.itemSize === 4, d = !!n.attributes.tangent && (!!r.normalMap || r.anisotropy > 0), f = !!n.morphAttributes.position, p = !!n.morphAttributes.normal, m = !!n.morphAttributes.color, h = 0;
|
|
5709
|
+
r.toneMapped && (I === null || I.isXRRenderTarget === !0) && (h = M.toneMapping);
|
|
5710
|
+
let g = n.morphAttributes.position || n.morphAttributes.normal || n.morphAttributes.color, _ = g === void 0 ? 0 : g.length, v = G.get(r), y = C.state.lights;
|
|
5711
|
+
if (Ce === !0 && (we === !0 || e !== oe)) {
|
|
5712
|
+
let t = e === oe && r.id === L;
|
|
5713
|
+
qe.setState(r, e, t);
|
|
5714
5714
|
}
|
|
5715
5715
|
let b = !1;
|
|
5716
|
-
r.version === v.__version ? v.needsLights && v.lightsStateVersion !== y.state.version ? b = !0 : v.outputColorSpace === s ? i.isBatchedMesh && v.batching === !1 || !i.isBatchedMesh && v.batching === !0 || i.isBatchedMesh && v.batchingColor === !0 && i.colorTexture === null || i.isBatchedMesh && v.batchingColor === !1 && i.colorTexture !== null || i.isInstancedMesh && v.instancing === !1 || !i.isInstancedMesh && v.instancing === !0 || i.isSkinnedMesh && v.skinning === !1 || !i.isSkinnedMesh && v.skinning === !0 || i.isInstancedMesh && v.instancingColor === !0 && i.instanceColor === null || i.isInstancedMesh && v.instancingColor === !1 && i.instanceColor !== null || i.isInstancedMesh && v.instancingMorph === !0 && i.morphTexture === null || i.isInstancedMesh && v.instancingMorph === !1 && i.morphTexture !== null ? b = !0 : v.envMap === l ? r.fog === !0 && v.fog !== a || v.numClippingPlanes !== void 0 && (v.numClippingPlanes !==
|
|
5716
|
+
r.version === v.__version ? v.needsLights && v.lightsStateVersion !== y.state.version ? b = !0 : v.outputColorSpace === s ? i.isBatchedMesh && v.batching === !1 || !i.isBatchedMesh && v.batching === !0 || i.isBatchedMesh && v.batchingColor === !0 && i.colorTexture === null || i.isBatchedMesh && v.batchingColor === !1 && i.colorTexture !== null || i.isInstancedMesh && v.instancing === !1 || !i.isInstancedMesh && v.instancing === !0 || i.isSkinnedMesh && v.skinning === !1 || !i.isSkinnedMesh && v.skinning === !0 || i.isInstancedMesh && v.instancingColor === !0 && i.instanceColor === null || i.isInstancedMesh && v.instancingColor === !1 && i.instanceColor !== null || i.isInstancedMesh && v.instancingMorph === !0 && i.morphTexture === null || i.isInstancedMesh && v.instancingMorph === !1 && i.morphTexture !== null ? b = !0 : v.envMap === l ? r.fog === !0 && v.fog !== a || v.numClippingPlanes !== void 0 && (v.numClippingPlanes !== qe.numPlanes || v.numIntersection !== qe.numIntersection) ? b = !0 : v.vertexAlphas === u && v.vertexTangents === d && v.morphTargets === f && v.morphNormals === p && v.morphColors === m && v.toneMapping === h && v.morphTargetsCount === _ ? !!v.lightProbeGrid != C.state.lightProbeGridArray.length > 0 && (b = !0) : b = !0 : b = !0 : b = !0 : (b = !0, v.__version = r.version);
|
|
5717
5717
|
let x = v.currentProgram;
|
|
5718
5718
|
b === !0 && (x = Z(r, t, i), P && r.isNodeMaterial && P.onUpdateProgram(r, x, v));
|
|
5719
|
-
let S = !1,
|
|
5720
|
-
if (
|
|
5721
|
-
let e = Tt(
|
|
5722
|
-
v.lightProbeGrid !== e && (v.lightProbeGrid = e,
|
|
5719
|
+
let S = !1, w = !1, T = !1, E = x.getUniforms(), D = v.uniforms;
|
|
5720
|
+
if (W.useProgram(x.program) && (S = !0, w = !0, T = !0), r.id !== L && (L = r.id, w = !0), v.needsLights) {
|
|
5721
|
+
let e = Tt(C.state.lightProbeGridArray, i);
|
|
5722
|
+
v.lightProbeGrid !== e && (v.lightProbeGrid = e, w = !0);
|
|
5723
5723
|
}
|
|
5724
|
-
if (S ||
|
|
5725
|
-
|
|
5726
|
-
let t =
|
|
5727
|
-
t !== void 0 && t.setValue(
|
|
5724
|
+
if (S || oe !== e) {
|
|
5725
|
+
W.buffers.depth.getReversed() && e.reversedDepth !== !0 && (e._reversedDepth = !0, e.updateProjectionMatrix()), E.setValue(H, "projectionMatrix", e.projectionMatrix), E.setValue(H, "viewMatrix", e.matrixWorldInverse);
|
|
5726
|
+
let t = E.map.cameraPosition;
|
|
5727
|
+
t !== void 0 && t.setValue(H, Ee.setFromMatrixPosition(e.matrixWorld)), Ie.logarithmicDepthBuffer && E.setValue(H, "logDepthBufFC", 2 / (Math.log(e.far + 1) / Math.LN2)), (r.isMeshPhongMaterial || r.isMeshToonMaterial || r.isMeshLambertMaterial || r.isMeshBasicMaterial || r.isMeshStandardMaterial || r.isShaderMaterial) && E.setValue(H, "isOrthographic", e.isOrthographicCamera === !0), oe !== e && (oe = e, w = !0, T = !0);
|
|
5728
5728
|
}
|
|
5729
|
-
if (v.needsLights && (y.state.directionalShadowMap.length > 0 &&
|
|
5730
|
-
|
|
5729
|
+
if (v.needsLights && (y.state.directionalShadowMap.length > 0 && E.setValue(H, "directionalShadowMap", y.state.directionalShadowMap, K), y.state.spotShadowMap.length > 0 && E.setValue(H, "spotShadowMap", y.state.spotShadowMap, K), y.state.pointShadowMap.length > 0 && E.setValue(H, "pointShadowMap", y.state.pointShadowMap, K)), i.isSkinnedMesh) {
|
|
5730
|
+
E.setOptional(H, i, "bindMatrix"), E.setOptional(H, i, "bindMatrixInverse");
|
|
5731
5731
|
let e = i.skeleton;
|
|
5732
|
-
e && (e.boneTexture === null && e.computeBoneTexture(),
|
|
5732
|
+
e && (e.boneTexture === null && e.computeBoneTexture(), E.setValue(H, "boneTexture", e.boneTexture, K));
|
|
5733
5733
|
}
|
|
5734
|
-
i.isBatchedMesh && (
|
|
5735
|
-
let
|
|
5736
|
-
if ((
|
|
5737
|
-
if (
|
|
5734
|
+
i.isBatchedMesh && (E.setOptional(H, i, "batchingTexture"), E.setValue(H, "batchingTexture", i._matricesTexture, K), E.setOptional(H, i, "batchingIdTexture"), E.setValue(H, "batchingIdTexture", i._indirectTexture, K), E.setOptional(H, i, "batchingColorTexture"), i._colorsTexture !== null && E.setValue(H, "batchingColorTexture", i._colorsTexture, K));
|
|
5735
|
+
let O = n.morphAttributes;
|
|
5736
|
+
if ((O.position !== void 0 || O.normal !== void 0 || O.color !== void 0) && Xe.update(i, n, x), (w || v.receiveShadow !== i.receiveShadow) && (v.receiveShadow = i.receiveShadow, E.setValue(H, "receiveShadow", i.receiveShadow)), (r.isMeshStandardMaterial || r.isMeshLambertMaterial || r.isMeshPhongMaterial) && r.envMap === null && t.environment !== null && (D.envMapIntensity.value = t.environmentIntensity), D.dfgLUT !== void 0 && (D.dfgLUT.value = Li()), w) {
|
|
5737
|
+
if (E.setValue(H, "toneMappingExposure", M.toneMappingExposure), v.needsLights && Dt(D, T), a && r.fog === !0 && Ue.refreshFogUniforms(D, a), Ue.refreshMaterialUniforms(D, r, he, me, C.state.transmissionRenderTarget[e.id]), v.needsLights && v.lightProbeGrid) {
|
|
5738
5738
|
let e = v.lightProbeGrid;
|
|
5739
|
-
|
|
5739
|
+
D.probesSH.value = e.texture, D.probesMin.value.copy(e.boundingBox.min), D.probesMax.value.copy(e.boundingBox.max), D.probesResolution.value.copy(e.resolution);
|
|
5740
5740
|
}
|
|
5741
|
-
gr.upload(
|
|
5741
|
+
gr.upload(H, Q(v), D, K);
|
|
5742
5742
|
}
|
|
5743
|
-
if (r.isShaderMaterial && r.uniformsNeedUpdate === !0 && (gr.upload(
|
|
5743
|
+
if (r.isShaderMaterial && r.uniformsNeedUpdate === !0 && (gr.upload(H, Q(v), D, K), r.uniformsNeedUpdate = !1), r.isSpriteMaterial && E.setValue(H, "center", i.center), E.setValue(H, "modelViewMatrix", i.modelViewMatrix), E.setValue(H, "normalMatrix", i.normalMatrix), E.setValue(H, "modelMatrix", i.matrixWorld), r.uniformsGroups !== void 0) {
|
|
5744
5744
|
let e = r.uniformsGroups;
|
|
5745
5745
|
for (let t = 0, n = e.length; t < n; t++) {
|
|
5746
5746
|
let n = e[t];
|
|
5747
|
-
|
|
5747
|
+
it.update(n, x), it.bind(n, x);
|
|
5748
5748
|
}
|
|
5749
5749
|
}
|
|
5750
5750
|
return x;
|
|
@@ -5756,99 +5756,99 @@ var Ri = class {
|
|
|
5756
5756
|
return e.isMeshLambertMaterial || e.isMeshToonMaterial || e.isMeshPhongMaterial || e.isMeshStandardMaterial || e.isShadowMaterial || e.isShaderMaterial && e.lights === !0;
|
|
5757
5757
|
}
|
|
5758
5758
|
this.getActiveCubeFace = function() {
|
|
5759
|
-
return
|
|
5759
|
+
return ie;
|
|
5760
5760
|
}, this.getActiveMipmapLevel = function() {
|
|
5761
|
-
return
|
|
5761
|
+
return ae;
|
|
5762
5762
|
}, this.getRenderTarget = function() {
|
|
5763
|
-
return
|
|
5763
|
+
return I;
|
|
5764
5764
|
}, this.setRenderTargetTextures = function(e, t, n) {
|
|
5765
|
-
let r =
|
|
5766
|
-
r.__autoAllocateDepthBuffer = e.resolveDepthBuffer === !1, r.__autoAllocateDepthBuffer === !1 && (r.__useRenderToTexture = !1),
|
|
5765
|
+
let r = G.get(e);
|
|
5766
|
+
r.__autoAllocateDepthBuffer = e.resolveDepthBuffer === !1, r.__autoAllocateDepthBuffer === !1 && (r.__useRenderToTexture = !1), G.get(e.texture).__webglTexture = t, G.get(e.depthTexture).__webglTexture = r.__autoAllocateDepthBuffer ? void 0 : n, r.__hasExternalTextures = !0;
|
|
5767
5767
|
}, this.setRenderTargetFramebuffer = function(e, t) {
|
|
5768
|
-
let n =
|
|
5768
|
+
let n = G.get(e);
|
|
5769
5769
|
n.__webglFramebuffer = t, n.__useDefaultFramebuffer = t === void 0;
|
|
5770
5770
|
}, this.setRenderTarget = function(e, t = 0, n = 0) {
|
|
5771
|
-
|
|
5771
|
+
I = e, ie = t, ae = n;
|
|
5772
5772
|
let r = null, i = !1, a = !1;
|
|
5773
5773
|
if (e) {
|
|
5774
|
-
let o =
|
|
5774
|
+
let o = G.get(e);
|
|
5775
5775
|
if (o.__useDefaultFramebuffer !== void 0) {
|
|
5776
|
-
|
|
5776
|
+
W.bindFramebuffer(H.FRAMEBUFFER, o.__webglFramebuffer), R.copy(e.viewport), ce.copy(e.scissor), ue = e.scissorTest, W.viewport(R), W.scissor(ce), W.setScissorTest(ue), L = -1;
|
|
5777
5777
|
return;
|
|
5778
5778
|
}
|
|
5779
|
-
if (o.__webglFramebuffer === void 0)
|
|
5780
|
-
else if (o.__hasExternalTextures)
|
|
5779
|
+
if (o.__webglFramebuffer === void 0) K.setupRenderTarget(e);
|
|
5780
|
+
else if (o.__hasExternalTextures) K.rebindTextures(e, G.get(e.texture).__webglTexture, G.get(e.depthTexture).__webglTexture);
|
|
5781
5781
|
else if (e.depthBuffer) {
|
|
5782
5782
|
let t = e.depthTexture;
|
|
5783
5783
|
if (o.__boundDepthTexture !== t) {
|
|
5784
|
-
if (t !== null &&
|
|
5785
|
-
|
|
5784
|
+
if (t !== null && G.has(t) && (e.width !== t.image.width || e.height !== t.image.height)) throw Error("THREE.WebGLRenderer: Attached DepthTexture is initialized to the incorrect size.");
|
|
5785
|
+
K.setupDepthRenderbuffer(e);
|
|
5786
5786
|
}
|
|
5787
5787
|
}
|
|
5788
5788
|
let s = e.texture;
|
|
5789
5789
|
(s.isData3DTexture || s.isDataArrayTexture || s.isCompressedArrayTexture) && (a = !0);
|
|
5790
|
-
let c =
|
|
5791
|
-
e.isWebGLCubeRenderTarget ? (r = Array.isArray(c[t]) ? c[t][n] : c[t], i = !0) : r = e.samples > 0 &&
|
|
5792
|
-
} else
|
|
5793
|
-
if (n !== 0 && (r =
|
|
5794
|
-
let r =
|
|
5795
|
-
|
|
5790
|
+
let c = G.get(e).__webglFramebuffer;
|
|
5791
|
+
e.isWebGLCubeRenderTarget ? (r = Array.isArray(c[t]) ? c[t][n] : c[t], i = !0) : r = e.samples > 0 && K.useMultisampledRTT(e) === !1 ? G.get(e).__webglMultisampledFramebuffer : Array.isArray(c) ? c[n] : c, R.copy(e.viewport), ce.copy(e.scissor), ue = e.scissorTest;
|
|
5792
|
+
} else R.copy(ve).multiplyScalar(he).floor(), ce.copy(ye).multiplyScalar(he).floor(), ue = xe;
|
|
5793
|
+
if (n !== 0 && (r = te), W.bindFramebuffer(H.FRAMEBUFFER, r) && W.drawBuffers(e, r), W.viewport(R), W.scissor(ce), W.setScissorTest(ue), i) {
|
|
5794
|
+
let r = G.get(e.texture);
|
|
5795
|
+
H.framebufferTexture2D(H.FRAMEBUFFER, H.COLOR_ATTACHMENT0, H.TEXTURE_CUBE_MAP_POSITIVE_X + t, r.__webglTexture, n);
|
|
5796
5796
|
} else if (a) {
|
|
5797
5797
|
let r = t;
|
|
5798
5798
|
for (let t = 0; t < e.textures.length; t++) {
|
|
5799
|
-
let i =
|
|
5800
|
-
|
|
5799
|
+
let i = G.get(e.textures[t]);
|
|
5800
|
+
H.framebufferTextureLayer(H.FRAMEBUFFER, H.COLOR_ATTACHMENT0 + t, i.__webglTexture, n, r);
|
|
5801
5801
|
}
|
|
5802
5802
|
} else if (e !== null && n !== 0) {
|
|
5803
|
-
let t =
|
|
5804
|
-
|
|
5803
|
+
let t = G.get(e.texture);
|
|
5804
|
+
H.framebufferTexture2D(H.FRAMEBUFFER, H.COLOR_ATTACHMENT0, H.TEXTURE_2D, t.__webglTexture, n);
|
|
5805
5805
|
}
|
|
5806
|
-
|
|
5806
|
+
L = -1;
|
|
5807
5807
|
}, this.readRenderTargetPixels = function(e, t, n, r, i, a, o, s = 0) {
|
|
5808
5808
|
if (!(e && e.isWebGLRenderTarget)) {
|
|
5809
|
-
|
|
5809
|
+
U("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
|
|
5810
5810
|
return;
|
|
5811
5811
|
}
|
|
5812
|
-
let c =
|
|
5812
|
+
let c = G.get(e).__webglFramebuffer;
|
|
5813
5813
|
if (e.isWebGLCubeRenderTarget && o !== void 0 && (c = c[o]), c) {
|
|
5814
|
-
|
|
5814
|
+
W.bindFramebuffer(H.FRAMEBUFFER, c);
|
|
5815
5815
|
try {
|
|
5816
5816
|
let o = e.textures[s], c = o.format, l = o.type;
|
|
5817
|
-
if (e.textures.length > 1 &&
|
|
5818
|
-
|
|
5817
|
+
if (e.textures.length > 1 && H.readBuffer(H.COLOR_ATTACHMENT0 + s), !Ie.textureFormatReadable(c)) {
|
|
5818
|
+
U("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
|
|
5819
5819
|
return;
|
|
5820
5820
|
}
|
|
5821
|
-
if (!
|
|
5822
|
-
|
|
5821
|
+
if (!Ie.textureTypeReadable(l)) {
|
|
5822
|
+
U("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
|
|
5823
5823
|
return;
|
|
5824
5824
|
}
|
|
5825
|
-
t >= 0 && t <= e.width - r && n >= 0 && n <= e.height - i &&
|
|
5825
|
+
t >= 0 && t <= e.width - r && n >= 0 && n <= e.height - i && H.readPixels(t, n, r, i, et.convert(c), et.convert(l), a);
|
|
5826
5826
|
} finally {
|
|
5827
|
-
let e =
|
|
5828
|
-
|
|
5827
|
+
let e = I === null ? null : G.get(I).__webglFramebuffer;
|
|
5828
|
+
W.bindFramebuffer(H.FRAMEBUFFER, e);
|
|
5829
5829
|
}
|
|
5830
5830
|
}
|
|
5831
5831
|
}, this.readRenderTargetPixelsAsync = async function(e, t, n, r, i, a, o, s = 0) {
|
|
5832
5832
|
if (!(e && e.isWebGLRenderTarget)) throw Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
|
|
5833
|
-
let c =
|
|
5833
|
+
let c = G.get(e).__webglFramebuffer;
|
|
5834
5834
|
if (e.isWebGLCubeRenderTarget && o !== void 0 && (c = c[o]), c) {
|
|
5835
5835
|
if (t >= 0 && t <= e.width - r && n >= 0 && n <= e.height - i) {
|
|
5836
|
-
|
|
5836
|
+
W.bindFramebuffer(H.FRAMEBUFFER, c);
|
|
5837
5837
|
let o = e.textures[s], l = o.format, u = o.type;
|
|
5838
|
-
if (e.textures.length > 1 &&
|
|
5839
|
-
if (!
|
|
5840
|
-
let d =
|
|
5841
|
-
|
|
5842
|
-
let f =
|
|
5843
|
-
|
|
5844
|
-
let p =
|
|
5845
|
-
return
|
|
5838
|
+
if (e.textures.length > 1 && H.readBuffer(H.COLOR_ATTACHMENT0 + s), !Ie.textureFormatReadable(l)) throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");
|
|
5839
|
+
if (!Ie.textureTypeReadable(u)) throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");
|
|
5840
|
+
let d = H.createBuffer();
|
|
5841
|
+
H.bindBuffer(H.PIXEL_PACK_BUFFER, d), H.bufferData(H.PIXEL_PACK_BUFFER, a.byteLength, H.STREAM_READ), H.readPixels(t, n, r, i, et.convert(l), et.convert(u), 0);
|
|
5842
|
+
let f = I === null ? null : G.get(I).__webglFramebuffer;
|
|
5843
|
+
W.bindFramebuffer(H.FRAMEBUFFER, f);
|
|
5844
|
+
let p = H.fenceSync(H.SYNC_GPU_COMMANDS_COMPLETE, 0);
|
|
5845
|
+
return H.flush(), await T(H, p, 4), H.bindBuffer(H.PIXEL_PACK_BUFFER, d), H.getBufferSubData(H.PIXEL_PACK_BUFFER, 0, a), H.deleteBuffer(d), H.deleteSync(p), a;
|
|
5846
5846
|
}
|
|
5847
5847
|
throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.");
|
|
5848
5848
|
}
|
|
5849
5849
|
}, this.copyFramebufferToTexture = function(e, t = null, n = 0) {
|
|
5850
5850
|
let r = 2 ** -n, i = Math.floor(e.image.width * r), a = Math.floor(e.image.height * r), o = t === null ? 0 : t.x, s = t === null ? 0 : t.y;
|
|
5851
|
-
|
|
5851
|
+
K.setTexture2D(e, 0), H.copyTexSubImage2D(H.TEXTURE_2D, n, 0, 0, o, s, i, a), W.unbindTexture();
|
|
5852
5852
|
}, this.copyTextureToTexture = function(e, t, n = null, r = null, i = 0, a = 0) {
|
|
5853
5853
|
let o, s, c, l, u, d, f, p, m, h = e.isCompressedTexture ? e.mipmaps[a] : e.image;
|
|
5854
5854
|
if (n !== null) o = n.max.x - n.min.x, s = n.max.y - n.min.y, c = n.isBox3 ? n.max.z - n.min.z : 1, l = n.min.x, u = n.min.y, d = n.isBox3 ? n.min.z : 0;
|
|
@@ -5857,33 +5857,33 @@ var Ri = class {
|
|
|
5857
5857
|
o = Math.floor(h.width * t), s = Math.floor(h.height * t), c = e.isDataArrayTexture ? h.depth : e.isData3DTexture ? Math.floor(h.depth * t) : 1, l = 0, u = 0, d = 0;
|
|
5858
5858
|
}
|
|
5859
5859
|
r === null ? (f = 0, p = 0, m = 0) : (f = r.x, p = r.y, m = r.z);
|
|
5860
|
-
let g =
|
|
5861
|
-
t.isData3DTexture ? (
|
|
5862
|
-
let y =
|
|
5863
|
-
|
|
5860
|
+
let g = et.convert(t.format), _ = et.convert(t.type), v;
|
|
5861
|
+
t.isData3DTexture ? (K.setTexture3D(t, 0), v = H.TEXTURE_3D) : t.isDataArrayTexture || t.isCompressedArrayTexture ? (K.setTexture2DArray(t, 0), v = H.TEXTURE_2D_ARRAY) : (K.setTexture2D(t, 0), v = H.TEXTURE_2D), W.activeTexture(H.TEXTURE0), W.pixelStorei(H.UNPACK_FLIP_Y_WEBGL, t.flipY), W.pixelStorei(H.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha), W.pixelStorei(H.UNPACK_ALIGNMENT, t.unpackAlignment);
|
|
5862
|
+
let y = W.getParameter(H.UNPACK_ROW_LENGTH), b = W.getParameter(H.UNPACK_IMAGE_HEIGHT), x = W.getParameter(H.UNPACK_SKIP_PIXELS), S = W.getParameter(H.UNPACK_SKIP_ROWS), C = W.getParameter(H.UNPACK_SKIP_IMAGES);
|
|
5863
|
+
W.pixelStorei(H.UNPACK_ROW_LENGTH, h.width), W.pixelStorei(H.UNPACK_IMAGE_HEIGHT, h.height), W.pixelStorei(H.UNPACK_SKIP_PIXELS, l), W.pixelStorei(H.UNPACK_SKIP_ROWS, u), W.pixelStorei(H.UNPACK_SKIP_IMAGES, d);
|
|
5864
5864
|
let w = e.isDataArrayTexture || e.isData3DTexture, T = t.isDataArrayTexture || t.isData3DTexture;
|
|
5865
5865
|
if (e.isDepthTexture) {
|
|
5866
|
-
let n =
|
|
5867
|
-
|
|
5868
|
-
for (let n = 0; n < c; n++) w && (
|
|
5869
|
-
|
|
5870
|
-
} else if (i !== 0 || e.isRenderTargetTexture ||
|
|
5871
|
-
let n =
|
|
5872
|
-
|
|
5873
|
-
for (let e = 0; e < c; e++) w ?
|
|
5874
|
-
|
|
5875
|
-
} else T ? e.isDataTexture || e.isData3DTexture ?
|
|
5876
|
-
|
|
5866
|
+
let n = G.get(e), r = G.get(t), h = G.get(n.__renderTarget), g = G.get(r.__renderTarget);
|
|
5867
|
+
W.bindFramebuffer(H.READ_FRAMEBUFFER, h.__webglFramebuffer), W.bindFramebuffer(H.DRAW_FRAMEBUFFER, g.__webglFramebuffer);
|
|
5868
|
+
for (let n = 0; n < c; n++) w && (H.framebufferTextureLayer(H.READ_FRAMEBUFFER, H.COLOR_ATTACHMENT0, G.get(e).__webglTexture, i, d + n), H.framebufferTextureLayer(H.DRAW_FRAMEBUFFER, H.COLOR_ATTACHMENT0, G.get(t).__webglTexture, a, m + n)), H.blitFramebuffer(l, u, o, s, f, p, o, s, H.DEPTH_BUFFER_BIT, H.NEAREST);
|
|
5869
|
+
W.bindFramebuffer(H.READ_FRAMEBUFFER, null), W.bindFramebuffer(H.DRAW_FRAMEBUFFER, null);
|
|
5870
|
+
} else if (i !== 0 || e.isRenderTargetTexture || G.has(e)) {
|
|
5871
|
+
let n = G.get(e), r = G.get(t);
|
|
5872
|
+
W.bindFramebuffer(H.READ_FRAMEBUFFER, F), W.bindFramebuffer(H.DRAW_FRAMEBUFFER, re);
|
|
5873
|
+
for (let e = 0; e < c; e++) w ? H.framebufferTextureLayer(H.READ_FRAMEBUFFER, H.COLOR_ATTACHMENT0, n.__webglTexture, i, d + e) : H.framebufferTexture2D(H.READ_FRAMEBUFFER, H.COLOR_ATTACHMENT0, H.TEXTURE_2D, n.__webglTexture, i), T ? H.framebufferTextureLayer(H.DRAW_FRAMEBUFFER, H.COLOR_ATTACHMENT0, r.__webglTexture, a, m + e) : H.framebufferTexture2D(H.DRAW_FRAMEBUFFER, H.COLOR_ATTACHMENT0, H.TEXTURE_2D, r.__webglTexture, a), i === 0 ? T ? H.copyTexSubImage3D(v, a, f, p, m + e, l, u, o, s) : H.copyTexSubImage2D(v, a, f, p, l, u, o, s) : H.blitFramebuffer(l, u, o, s, f, p, o, s, H.COLOR_BUFFER_BIT, H.NEAREST);
|
|
5874
|
+
W.bindFramebuffer(H.READ_FRAMEBUFFER, null), W.bindFramebuffer(H.DRAW_FRAMEBUFFER, null);
|
|
5875
|
+
} else T ? e.isDataTexture || e.isData3DTexture ? H.texSubImage3D(v, a, f, p, m, o, s, c, g, _, h.data) : t.isCompressedArrayTexture ? H.compressedTexSubImage3D(v, a, f, p, m, o, s, c, g, h.data) : H.texSubImage3D(v, a, f, p, m, o, s, c, g, _, h) : e.isDataTexture ? H.texSubImage2D(H.TEXTURE_2D, a, f, p, o, s, g, _, h.data) : e.isCompressedTexture ? H.compressedTexSubImage2D(H.TEXTURE_2D, a, f, p, h.width, h.height, g, h.data) : H.texSubImage2D(H.TEXTURE_2D, a, f, p, o, s, g, _, h);
|
|
5876
|
+
W.pixelStorei(H.UNPACK_ROW_LENGTH, y), W.pixelStorei(H.UNPACK_IMAGE_HEIGHT, b), W.pixelStorei(H.UNPACK_SKIP_PIXELS, x), W.pixelStorei(H.UNPACK_SKIP_ROWS, S), W.pixelStorei(H.UNPACK_SKIP_IMAGES, C), a === 0 && t.generateMipmaps && H.generateMipmap(v), W.unbindTexture();
|
|
5877
5877
|
}, this.initRenderTarget = function(e) {
|
|
5878
|
-
|
|
5878
|
+
G.get(e).__webglFramebuffer === void 0 && K.setupRenderTarget(e);
|
|
5879
5879
|
}, this.initTexture = function(e) {
|
|
5880
|
-
e.isCubeTexture ?
|
|
5880
|
+
e.isCubeTexture ? K.setTextureCube(e, 0) : e.isData3DTexture ? K.setTexture3D(e, 0) : e.isDataArrayTexture || e.isCompressedArrayTexture ? K.setTexture2DArray(e, 0) : K.setTexture2D(e, 0), W.unbindTexture();
|
|
5881
5881
|
}, this.resetState = function() {
|
|
5882
|
-
|
|
5882
|
+
ie = 0, ae = 0, I = null, W.reset(), nt.reset();
|
|
5883
5883
|
}, typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe", { detail: this }));
|
|
5884
5884
|
}
|
|
5885
5885
|
get coordinateSystem() {
|
|
5886
|
-
return
|
|
5886
|
+
return se;
|
|
5887
5887
|
}
|
|
5888
5888
|
get outputColorSpace() {
|
|
5889
5889
|
return this._outputColorSpace;
|
|
@@ -5891,9 +5891,9 @@ var Ri = class {
|
|
|
5891
5891
|
set outputColorSpace(e) {
|
|
5892
5892
|
this._outputColorSpace = e;
|
|
5893
5893
|
let t = this.getContext();
|
|
5894
|
-
t.drawingBufferColorSpace =
|
|
5894
|
+
t.drawingBufferColorSpace = B._getDrawingBufferColorSpace(e), t.unpackColorSpace = B._getUnpackColorSpace();
|
|
5895
5895
|
}
|
|
5896
|
-
}, zi = { type: "change" }, Bi = { type: "start" }, Vi = { type: "end" }, Hi = new
|
|
5896
|
+
}, zi = { type: "change" }, Bi = { type: "start" }, Vi = { type: "end" }, Hi = new D(), Ui = new ve(), Wi = Math.cos(70 * O.DEG2RAD), Gi = new m(), Ki = 2 * Math.PI, $ = {
|
|
5897
5897
|
NONE: -1,
|
|
5898
5898
|
ROTATE: 0,
|
|
5899
5899
|
DOLLY: 1,
|
|
@@ -5904,19 +5904,19 @@ var Ri = class {
|
|
|
5904
5904
|
TOUCH_DOLLY_ROTATE: 6
|
|
5905
5905
|
}, qi = 1e-6, Ji = class extends Qe {
|
|
5906
5906
|
constructor(e, t = null) {
|
|
5907
|
-
super(e, t), this.state = $.NONE, this.target = new
|
|
5907
|
+
super(e, t), this.state = $.NONE, this.target = new m(), this.cursor = new m(), this.minDistance = 0, this.maxDistance = Infinity, this.minZoom = 0, this.maxZoom = Infinity, this.minTargetRadius = 0, this.maxTargetRadius = Infinity, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -Infinity, this.maxAzimuthAngle = Infinity, this.enableDamping = !1, this.dampingFactor = .05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = {
|
|
5908
5908
|
LEFT: "ArrowLeft",
|
|
5909
5909
|
UP: "ArrowUp",
|
|
5910
5910
|
RIGHT: "ArrowRight",
|
|
5911
5911
|
BOTTOM: "ArrowDown"
|
|
5912
5912
|
}, this.mouseButtons = {
|
|
5913
|
-
LEFT:
|
|
5914
|
-
MIDDLE:
|
|
5915
|
-
RIGHT:
|
|
5913
|
+
LEFT: x.ROTATE,
|
|
5914
|
+
MIDDLE: x.DOLLY,
|
|
5915
|
+
RIGHT: x.PAN
|
|
5916
5916
|
}, this.touches = {
|
|
5917
|
-
ONE:
|
|
5918
|
-
TWO:
|
|
5919
|
-
}, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._cursorStyle = "auto", this._domElementKeyEvents = null, this._lastPosition = new
|
|
5917
|
+
ONE: W.ROTATE,
|
|
5918
|
+
TWO: W.DOLLY_PAN
|
|
5919
|
+
}, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._cursorStyle = "auto", this._domElementKeyEvents = null, this._lastPosition = new m(), this._lastQuaternion = new Se(), this._lastTargetPosition = new m(), this._quat = new Se().setFromUnitVectors(e.up, new m(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new xe(), this._sphericalDelta = new xe(), this._scale = 1, this._panOffset = new m(), this._rotateStart = new L(), this._rotateEnd = new L(), this._rotateDelta = new L(), this._panStart = new L(), this._panEnd = new L(), this._panDelta = new L(), this._dollyStart = new L(), this._dollyEnd = new L(), this._dollyDelta = new L(), this._dollyDirection = new m(), this._mouse = new L(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Xi.bind(this), this._onPointerDown = Yi.bind(this), this._onPointerUp = Zi.bind(this), this._onContextMenu = ia.bind(this), this._onMouseWheel = ea.bind(this), this._onKeyDown = ta.bind(this), this._onTouchStart = na.bind(this), this._onTouchMove = ra.bind(this), this._onMouseDown = Qi.bind(this), this._onMouseMove = $i.bind(this), this._interceptControlDown = aa.bind(this), this._interceptControlUp = oa.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
|
|
5920
5920
|
}
|
|
5921
5921
|
set cursorStyle(e) {
|
|
5922
5922
|
this._cursorStyle = e, e === "grab" ? this.domElement.style.cursor = "grab" : this.domElement.style.cursor = "auto";
|
|
@@ -5991,11 +5991,11 @@ var Ri = class {
|
|
|
5991
5991
|
let n = t - e;
|
|
5992
5992
|
this.object.position.addScaledVector(this._dollyDirection, n), this.object.updateMatrixWorld(), i = !!n;
|
|
5993
5993
|
} else if (this.object.isOrthographicCamera) {
|
|
5994
|
-
let t = new
|
|
5994
|
+
let t = new m(this._mouse.x, this._mouse.y, 0);
|
|
5995
5995
|
t.unproject(this.object);
|
|
5996
5996
|
let n = this.object.zoom;
|
|
5997
5997
|
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), i = n !== this.object.zoom;
|
|
5998
|
-
let r = new
|
|
5998
|
+
let r = new m(this._mouse.x, this._mouse.y, 0);
|
|
5999
5999
|
r.unproject(this.object), this.object.position.sub(r).add(t), this.object.updateMatrixWorld(), e = Gi.length();
|
|
6000
6000
|
} else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
6001
6001
|
e !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(e).add(this.object.position) : (Hi.origin.copy(this.object.position), Hi.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(Hi.direction)) < Wi ? this.object.lookAt(this.target) : (Ui.setFromNormalAndCoplanarPoint(this.object.up, this.target), Hi.intersectPlane(Ui, this.target))));
|
|
@@ -6157,7 +6157,7 @@ var Ri = class {
|
|
|
6157
6157
|
}
|
|
6158
6158
|
_trackPointer(e) {
|
|
6159
6159
|
let t = this._pointerPositions[e.pointerId];
|
|
6160
|
-
t === void 0 && (t = new
|
|
6160
|
+
t === void 0 && (t = new L(), this._pointerPositions[e.pointerId] = t), t.set(e.pageX, e.pageY);
|
|
6161
6161
|
}
|
|
6162
6162
|
_getSecondPointerPosition(e) {
|
|
6163
6163
|
let t = e.pointerId === this._pointers[0] ? this._pointers[1] : this._pointers[0];
|
|
@@ -6213,11 +6213,11 @@ function Qi(e) {
|
|
|
6213
6213
|
default: t = -1;
|
|
6214
6214
|
}
|
|
6215
6215
|
switch (t) {
|
|
6216
|
-
case
|
|
6216
|
+
case x.DOLLY:
|
|
6217
6217
|
if (this.enableZoom === !1) return;
|
|
6218
6218
|
this._handleMouseDownDolly(e), this.state = $.DOLLY;
|
|
6219
6219
|
break;
|
|
6220
|
-
case
|
|
6220
|
+
case x.ROTATE:
|
|
6221
6221
|
if (e.ctrlKey || e.metaKey || e.shiftKey) {
|
|
6222
6222
|
if (this.enablePan === !1) return;
|
|
6223
6223
|
this._handleMouseDownPan(e), this.state = $.PAN;
|
|
@@ -6226,7 +6226,7 @@ function Qi(e) {
|
|
|
6226
6226
|
this._handleMouseDownRotate(e), this.state = $.ROTATE;
|
|
6227
6227
|
}
|
|
6228
6228
|
break;
|
|
6229
|
-
case
|
|
6229
|
+
case x.PAN:
|
|
6230
6230
|
if (e.ctrlKey || e.metaKey || e.shiftKey) {
|
|
6231
6231
|
if (this.enableRotate === !1) return;
|
|
6232
6232
|
this._handleMouseDownRotate(e), this.state = $.ROTATE;
|
|
@@ -6264,11 +6264,11 @@ function na(e) {
|
|
|
6264
6264
|
switch (this._trackPointer(e), this._pointers.length) {
|
|
6265
6265
|
case 1:
|
|
6266
6266
|
switch (this.touches.ONE) {
|
|
6267
|
-
case
|
|
6267
|
+
case W.ROTATE:
|
|
6268
6268
|
if (this.enableRotate === !1) return;
|
|
6269
6269
|
this._handleTouchStartRotate(e), this.state = $.TOUCH_ROTATE;
|
|
6270
6270
|
break;
|
|
6271
|
-
case
|
|
6271
|
+
case W.PAN:
|
|
6272
6272
|
if (this.enablePan === !1) return;
|
|
6273
6273
|
this._handleTouchStartPan(e), this.state = $.TOUCH_PAN;
|
|
6274
6274
|
break;
|
|
@@ -6277,11 +6277,11 @@ function na(e) {
|
|
|
6277
6277
|
break;
|
|
6278
6278
|
case 2:
|
|
6279
6279
|
switch (this.touches.TWO) {
|
|
6280
|
-
case
|
|
6280
|
+
case W.DOLLY_PAN:
|
|
6281
6281
|
if (this.enableZoom === !1 && this.enablePan === !1) return;
|
|
6282
6282
|
this._handleTouchStartDollyPan(e), this.state = $.TOUCH_DOLLY_PAN;
|
|
6283
6283
|
break;
|
|
6284
|
-
case
|
|
6284
|
+
case W.DOLLY_ROTATE:
|
|
6285
6285
|
if (this.enableZoom === !1 && this.enableRotate === !1) return;
|
|
6286
6286
|
this._handleTouchStartDollyRotate(e), this.state = $.TOUCH_DOLLY_ROTATE;
|
|
6287
6287
|
break;
|
|
@@ -6472,7 +6472,7 @@ var sa = bt({
|
|
|
6472
6472
|
key: 4,
|
|
6473
6473
|
class: "notice output",
|
|
6474
6474
|
"data-testid": "shapescript-output"
|
|
6475
|
-
}, ya = { class: "script-source" }, ba = ["aria-label"], xa = ["disabled"], Sa = 1710618, Ca = 6e4, wa = /*@__PURE__*/
|
|
6475
|
+
}, ya = { class: "script-source" }, ba = ["aria-label"], xa = ["disabled"], Sa = 1710618, Ca = 6e4, wa = /*@__PURE__*/ ut({
|
|
6476
6476
|
__name: "View",
|
|
6477
6477
|
props: { selectedResult: {} },
|
|
6478
6478
|
emits: ["updateResult"],
|
|
@@ -6486,22 +6486,22 @@ var sa = bt({
|
|
|
6486
6486
|
z: r
|
|
6487
6487
|
} : null;
|
|
6488
6488
|
}
|
|
6489
|
-
let s = r, c = a, l = sa(), { dispatch: u } = xt(), d =
|
|
6490
|
-
|
|
6491
|
-
|
|
6492
|
-
|
|
6493
|
-
}),
|
|
6489
|
+
let s = r, c = a, l = sa(), { dispatch: u } = xt(), d = ht(s.selectedResult.data?.script ?? ""), f = ht(null), p = ht(null), m = ht([]), h = ht([]), g = ht(null), _ = ht(null), v = ht(!1), b = 0, x = ht(!1), S = ht(!0), C = J(() => d.value !== s.selectedResult.data?.script), T = J(() => !v.value && !p.value && !C.value && !!s.selectedResult.data?.script), E, D, O, k, A, j, M = [], ee = null, N = null;
|
|
6490
|
+
ft(() => {
|
|
6491
|
+
F(), ae(), I(), dt(() => {
|
|
6492
|
+
oe();
|
|
6493
|
+
}), P();
|
|
6494
6494
|
});
|
|
6495
|
-
async function
|
|
6495
|
+
async function P() {
|
|
6496
6496
|
let e = s.selectedResult.data?.filePath;
|
|
6497
6497
|
if (!e) return;
|
|
6498
|
-
let t = ++
|
|
6498
|
+
let t = ++b;
|
|
6499
6499
|
try {
|
|
6500
6500
|
let { script: n } = await u({
|
|
6501
6501
|
kind: "loadShape",
|
|
6502
6502
|
path: e
|
|
6503
|
-
},
|
|
6504
|
-
if (t !==
|
|
6503
|
+
}, w);
|
|
6504
|
+
if (t !== b || n === s.selectedResult.data?.script) return;
|
|
6505
6505
|
d.value = n, c("updateResult", {
|
|
6506
6506
|
...s.selectedResult,
|
|
6507
6507
|
data: {
|
|
@@ -6511,8 +6511,8 @@ var sa = bt({
|
|
|
6511
6511
|
});
|
|
6512
6512
|
} catch {}
|
|
6513
6513
|
}
|
|
6514
|
-
|
|
6515
|
-
|
|
6514
|
+
pt(() => {
|
|
6515
|
+
z();
|
|
6516
6516
|
}), vt(() => s.selectedResult.data?.script, () => {
|
|
6517
6517
|
ae();
|
|
6518
6518
|
}), vt(x, () => {
|
|
@@ -6520,35 +6520,35 @@ var sa = bt({
|
|
|
6520
6520
|
}), vt(S, (e) => {
|
|
6521
6521
|
j && (j.visible = e);
|
|
6522
6522
|
});
|
|
6523
|
-
function
|
|
6523
|
+
function F() {
|
|
6524
6524
|
if (!f.value) return;
|
|
6525
|
-
E = new
|
|
6525
|
+
E = new _e(), E.background = new V(Sa);
|
|
6526
6526
|
let e = f.value.clientWidth, t = f.value.clientHeight;
|
|
6527
|
-
D = new
|
|
6528
|
-
let n = new
|
|
6527
|
+
D = new H(50, e / t, .1, 1e3), D.position.set(5, 5, 10), D.lookAt(0, 0, 0), O = new Ri({ antialias: !0 }), O.setSize(e, t), O.setPixelRatio(window.devicePixelRatio), f.value.appendChild(O.domElement), k = new Ji(D, O.domElement), k.enableDamping = !0, k.dampingFactor = .05, k.addEventListener("change", R);
|
|
6528
|
+
let n = new Ie(16777215, .6);
|
|
6529
6529
|
E.add(n);
|
|
6530
|
-
let r = new
|
|
6531
|
-
r.position.set(10, 10, 10), E.add(r), j = new
|
|
6532
|
-
|
|
6533
|
-
}),
|
|
6530
|
+
let r = new te(16777215, .8);
|
|
6531
|
+
r.position.set(10, 10, 10), E.add(r), j = new y(20, 20, 4473924, 2236962), j.visible = S.value, E.add(j), window.addEventListener("resize", ne), N = new ResizeObserver(() => {
|
|
6532
|
+
ne();
|
|
6533
|
+
}), N.observe(f.value);
|
|
6534
6534
|
}
|
|
6535
|
-
function
|
|
6535
|
+
function ne() {
|
|
6536
6536
|
if (!f.value) return;
|
|
6537
6537
|
let e = f.value.clientWidth, t = f.value.clientHeight;
|
|
6538
6538
|
D.aspect = e / t, D.updateProjectionMatrix(), O.setSize(e, t);
|
|
6539
6539
|
}
|
|
6540
6540
|
function re() {
|
|
6541
|
-
M.forEach((e) =>
|
|
6541
|
+
M.forEach((e) => K(E, e)), M = [];
|
|
6542
6542
|
}
|
|
6543
6543
|
function ie(e) {
|
|
6544
|
-
let t =
|
|
6544
|
+
let t = We(qe(e), { wireframe: x.value });
|
|
6545
6545
|
E.add(t), M.push(t);
|
|
6546
|
-
let n =
|
|
6547
|
-
m.value = n.warnings, h.value = n.logs, E.background = n.background ? new
|
|
6546
|
+
let n = je(t);
|
|
6547
|
+
m.value = n.warnings, h.value = n.logs, E.background = n.background ? new V(n.background[0], n.background[1], n.background[2]) : new V(Sa);
|
|
6548
6548
|
}
|
|
6549
6549
|
function ae() {
|
|
6550
6550
|
try {
|
|
6551
|
-
re(), m.value = [], h.value = [], E.background = new
|
|
6551
|
+
re(), m.value = [], h.value = [], E.background = new V(Sa);
|
|
6552
6552
|
let e = s.selectedResult.data?.script;
|
|
6553
6553
|
e && ie(e), p.value = null;
|
|
6554
6554
|
} catch (e) {
|
|
@@ -6558,17 +6558,17 @@ var sa = bt({
|
|
|
6558
6558
|
function I() {
|
|
6559
6559
|
A = requestAnimationFrame(I), k.update(), O.render(E, D);
|
|
6560
6560
|
}
|
|
6561
|
-
function
|
|
6561
|
+
function L() {
|
|
6562
6562
|
D.position.set(5, 5, 10), D.lookAt(0, 0, 0), k.reset();
|
|
6563
6563
|
}
|
|
6564
|
-
function
|
|
6564
|
+
function oe() {
|
|
6565
6565
|
if (!D || !k || !s.selectedResult?.viewState?.cameraState) return;
|
|
6566
6566
|
let e = s.selectedResult.viewState.cameraState, t = o(e.position);
|
|
6567
6567
|
t && D.position.set(t.x, t.y, t.z);
|
|
6568
6568
|
let n = o(e.target);
|
|
6569
6569
|
n && k.target.set(n.x, n.y, n.z), D.updateProjectionMatrix(), k.update();
|
|
6570
6570
|
}
|
|
6571
|
-
function
|
|
6571
|
+
function se() {
|
|
6572
6572
|
return {
|
|
6573
6573
|
position: {
|
|
6574
6574
|
x: D.position.x,
|
|
@@ -6583,30 +6583,30 @@ var sa = bt({
|
|
|
6583
6583
|
};
|
|
6584
6584
|
}
|
|
6585
6585
|
function R() {
|
|
6586
|
-
|
|
6587
|
-
|
|
6586
|
+
ee !== null && clearTimeout(ee), ee = window.setTimeout(() => {
|
|
6587
|
+
le();
|
|
6588
6588
|
}, 500);
|
|
6589
6589
|
}
|
|
6590
|
-
function
|
|
6590
|
+
function le() {
|
|
6591
6591
|
let e = {
|
|
6592
6592
|
...s.selectedResult,
|
|
6593
6593
|
viewState: {
|
|
6594
6594
|
...s.selectedResult.viewState,
|
|
6595
|
-
cameraState:
|
|
6595
|
+
cameraState: se()
|
|
6596
6596
|
}
|
|
6597
6597
|
};
|
|
6598
6598
|
c("updateResult", e);
|
|
6599
6599
|
}
|
|
6600
|
-
function
|
|
6600
|
+
function ue(e, t) {
|
|
6601
6601
|
let n = URL.createObjectURL(new Blob([e], { type: i })), r = document.createElement("a");
|
|
6602
6602
|
r.href = n, r.download = t, r.click(), window.setTimeout(() => URL.revokeObjectURL(n), Ca);
|
|
6603
6603
|
}
|
|
6604
|
-
async function
|
|
6604
|
+
async function de() {
|
|
6605
6605
|
let r = s.selectedResult.data?.script;
|
|
6606
|
-
if (!(!r || !
|
|
6606
|
+
if (!(!r || !T.value)) {
|
|
6607
6607
|
v.value = !0, _.value = null;
|
|
6608
6608
|
try {
|
|
6609
|
-
|
|
6609
|
+
ue(await e(r), `${t(s.selectedResult.title)}${n}`);
|
|
6610
6610
|
} catch (e) {
|
|
6611
6611
|
_.value = e instanceof Error ? e.message : String(e);
|
|
6612
6612
|
} finally {
|
|
@@ -6614,39 +6614,39 @@ var sa = bt({
|
|
|
6614
6614
|
}
|
|
6615
6615
|
}
|
|
6616
6616
|
}
|
|
6617
|
-
function
|
|
6617
|
+
function fe() {
|
|
6618
6618
|
x.value = !x.value;
|
|
6619
6619
|
}
|
|
6620
|
-
function
|
|
6620
|
+
function pe() {
|
|
6621
6621
|
S.value = !S.value;
|
|
6622
6622
|
}
|
|
6623
|
-
function
|
|
6624
|
-
|
|
6623
|
+
function z() {
|
|
6624
|
+
ee !== null && clearTimeout(ee), M.forEach((e) => K(E, e)), M = [], A && cancelAnimationFrame(A), O && O.dispose(), k && (k.removeEventListener("change", R), k.dispose()), N && N.disconnect(), window.removeEventListener("resize", ne);
|
|
6625
6625
|
}
|
|
6626
|
-
function
|
|
6627
|
-
|
|
6626
|
+
function me() {
|
|
6627
|
+
b++;
|
|
6628
6628
|
}
|
|
6629
|
-
async function
|
|
6629
|
+
async function he() {
|
|
6630
6630
|
let e = d.value;
|
|
6631
6631
|
try {
|
|
6632
|
-
|
|
6632
|
+
ge(We(qe(e)));
|
|
6633
6633
|
} catch (e) {
|
|
6634
6634
|
p.value = e instanceof Error ? e.message : "Invalid ShapeScript", console.error("Script validation failed:", e);
|
|
6635
6635
|
return;
|
|
6636
6636
|
}
|
|
6637
6637
|
p.value = null;
|
|
6638
|
-
let t = s.selectedResult.data?.filePath, n = ++
|
|
6638
|
+
let t = s.selectedResult.data?.filePath, n = ++b;
|
|
6639
6639
|
if (t) try {
|
|
6640
6640
|
await u({
|
|
6641
6641
|
kind: "saveShape",
|
|
6642
6642
|
path: t,
|
|
6643
6643
|
script: e
|
|
6644
|
-
},
|
|
6644
|
+
}, ce);
|
|
6645
6645
|
} catch (e) {
|
|
6646
6646
|
g.value = e instanceof Error ? e.message : String(e);
|
|
6647
6647
|
return;
|
|
6648
6648
|
}
|
|
6649
|
-
if (n !==
|
|
6649
|
+
if (n !== b) return;
|
|
6650
6650
|
g.value = null;
|
|
6651
6651
|
let r = {
|
|
6652
6652
|
...s.selectedResult,
|
|
@@ -6660,55 +6660,55 @@ var sa = bt({
|
|
|
6660
6660
|
return vt(() => s.selectedResult.data?.script, (e) => {
|
|
6661
6661
|
e !== void 0 && (d.value = e);
|
|
6662
6662
|
}), vt(() => s.selectedResult, () => {
|
|
6663
|
-
|
|
6664
|
-
|
|
6663
|
+
dt(() => {
|
|
6664
|
+
oe();
|
|
6665
6665
|
});
|
|
6666
|
-
}), (e, t) => (
|
|
6667
|
-
|
|
6668
|
-
|
|
6666
|
+
}), (e, t) => (mt(), ct("div", ca, [
|
|
6667
|
+
Y("div", la, [Y("h1", null, X(r.selectedResult.title || gt(l).untitled), 1), Y("div", ua, [
|
|
6668
|
+
Y("button", {
|
|
6669
6669
|
class: "control-btn",
|
|
6670
|
-
onClick:
|
|
6671
|
-
}, [t[1] ||=
|
|
6672
|
-
|
|
6670
|
+
onClick: L
|
|
6671
|
+
}, [t[1] ||= Y("span", { class: "material-icons" }, "refresh", -1), lt(" " + X(gt(l).resetCamera), 1)]),
|
|
6672
|
+
Y("button", {
|
|
6673
6673
|
class: "control-btn",
|
|
6674
|
-
onClick:
|
|
6675
|
-
}, [
|
|
6676
|
-
|
|
6674
|
+
onClick: fe
|
|
6675
|
+
}, [Y("span", da, X(x.value ? "grid_off" : "grid_on"), 1), lt(" " + X(gt(l).wireframe), 1)]),
|
|
6676
|
+
Y("button", {
|
|
6677
6677
|
class: "control-btn",
|
|
6678
|
-
onClick:
|
|
6679
|
-
}, [
|
|
6680
|
-
|
|
6678
|
+
onClick: pe
|
|
6679
|
+
}, [Y("span", fa, X(S.value ? "visibility_off" : "visibility"), 1), lt(" " + X(gt(l).grid), 1)]),
|
|
6680
|
+
Y("button", {
|
|
6681
6681
|
class: "control-btn",
|
|
6682
|
-
disabled: !
|
|
6682
|
+
disabled: !T.value,
|
|
6683
6683
|
"data-testid": "shapescript-download-usdz",
|
|
6684
|
-
onClick:
|
|
6685
|
-
}, [t[2] ||=
|
|
6684
|
+
onClick: de
|
|
6685
|
+
}, [t[2] ||= Y("span", { class: "material-icons" }, "download", -1), lt(" " + X(gt(l).downloadUsdz), 1)], 8, pa)
|
|
6686
6686
|
])]),
|
|
6687
|
-
p.value ? (
|
|
6688
|
-
g.value ? (
|
|
6689
|
-
_.value ? (
|
|
6690
|
-
m.value.length ? (
|
|
6691
|
-
h.value.length ? (
|
|
6692
|
-
|
|
6687
|
+
p.value ? (mt(), ct("div", ma, [Y("strong", null, X(gt(l).parseError), 1), lt(" " + X(p.value), 1)])) : st("", !0),
|
|
6688
|
+
g.value ? (mt(), ct("div", ha, [Y("strong", null, X(gt(l).saveError), 1), lt(" " + X(g.value), 1)])) : st("", !0),
|
|
6689
|
+
_.value ? (mt(), ct("div", ga, [Y("strong", null, X(gt(l).exportError), 1), lt(" " + X(_.value), 1)])) : st("", !0),
|
|
6690
|
+
m.value.length ? (mt(), ct("div", _a, [Y("strong", null, X(gt(l).sceneWarnings), 1), lt(" " + X(m.value.join(" · ")), 1)])) : st("", !0),
|
|
6691
|
+
h.value.length ? (mt(), ct("pre", va, [Y("strong", null, X(gt(l).printOutput), 1), lt(" " + X(h.value.join("\n")), 1)])) : st("", !0),
|
|
6692
|
+
Y("div", {
|
|
6693
6693
|
ref_key: "viewport",
|
|
6694
6694
|
ref: f,
|
|
6695
6695
|
class: "viewport",
|
|
6696
6696
|
"data-testid": "shapescript-viewport"
|
|
6697
6697
|
}, null, 512),
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
yt(
|
|
6698
|
+
Y("details", ya, [
|
|
6699
|
+
Y("summary", null, X(gt(l).editSource), 1),
|
|
6700
|
+
yt(Y("textarea", {
|
|
6701
6701
|
"onUpdate:modelValue": t[0] ||= (e) => d.value = e,
|
|
6702
6702
|
class: "script-editor",
|
|
6703
6703
|
spellcheck: "false",
|
|
6704
6704
|
"aria-label": gt(l).scriptEditorLabel,
|
|
6705
|
-
onInput:
|
|
6705
|
+
onInput: me
|
|
6706
6706
|
}, null, 40, ba), [[_t, d.value]]),
|
|
6707
|
-
|
|
6707
|
+
Y("button", {
|
|
6708
6708
|
class: "apply-btn",
|
|
6709
6709
|
disabled: !C.value,
|
|
6710
|
-
onClick:
|
|
6711
|
-
},
|
|
6710
|
+
onClick: he
|
|
6711
|
+
}, X(gt(l).applyChanges), 9, xa)
|
|
6712
6712
|
])
|
|
6713
6713
|
]));
|
|
6714
6714
|
}
|
|
@@ -6719,14 +6719,14 @@ var sa = bt({
|
|
|
6719
6719
|
}, Ea = /*#__PURE__*/ Ta(wa, [["__scopeId", "data-v-792dc725"]]), Da = {
|
|
6720
6720
|
class: "preview-container",
|
|
6721
6721
|
"data-testid": "shapescript-preview"
|
|
6722
|
-
}, Oa = { class: "preview-title" }, ka = 2763322, Aa = /*#__PURE__*/ Ta(/* @__PURE__ */
|
|
6722
|
+
}, Oa = { class: "preview-title" }, ka = 2763322, Aa = /*#__PURE__*/ Ta(/* @__PURE__ */ ut({
|
|
6723
6723
|
__name: "Preview",
|
|
6724
6724
|
props: { result: {} },
|
|
6725
6725
|
setup(e) {
|
|
6726
|
-
let t = e, n = sa(), r =
|
|
6727
|
-
|
|
6726
|
+
let t = e, n = sa(), r = J(() => t.result.title || n.value.untitled), i = ht(null), a, o, s, c, l = null;
|
|
6727
|
+
ft(() => {
|
|
6728
6728
|
u();
|
|
6729
|
-
}),
|
|
6729
|
+
}), pt(() => {
|
|
6730
6730
|
p();
|
|
6731
6731
|
}), vt(() => t.result.data?.script, () => {
|
|
6732
6732
|
f();
|
|
@@ -6734,15 +6734,15 @@ var sa = bt({
|
|
|
6734
6734
|
function u() {
|
|
6735
6735
|
if (i.value) {
|
|
6736
6736
|
try {
|
|
6737
|
-
a = new
|
|
6737
|
+
a = new _e(), a.background = new V(ka);
|
|
6738
6738
|
let e = i.value.clientWidth || 200, t = i.value.clientHeight || 150;
|
|
6739
|
-
o = new
|
|
6739
|
+
o = new H(50, e / t, .1, 1e3), o.position.set(4, 4, 8), o.lookAt(0, 0, 0), s = new Ri({
|
|
6740
6740
|
antialias: !0,
|
|
6741
6741
|
alpha: !1
|
|
6742
6742
|
}), s.setSize(e, t), s.setPixelRatio(Math.min(window.devicePixelRatio, 2)), i.value.appendChild(s.domElement);
|
|
6743
|
-
let n = new
|
|
6743
|
+
let n = new Ie(16777215, .6);
|
|
6744
6744
|
a.add(n);
|
|
6745
|
-
let r = new
|
|
6745
|
+
let r = new te(16777215, .8);
|
|
6746
6746
|
r.position.set(5, 5, 5), a.add(r);
|
|
6747
6747
|
} catch (e) {
|
|
6748
6748
|
console.error("Preview render error:", e);
|
|
@@ -6760,23 +6760,23 @@ var sa = bt({
|
|
|
6760
6760
|
if (!a) return;
|
|
6761
6761
|
let e = t.result.data?.script;
|
|
6762
6762
|
try {
|
|
6763
|
-
if (
|
|
6764
|
-
let t =
|
|
6765
|
-
l =
|
|
6766
|
-
let { background: n } =
|
|
6767
|
-
a.background = n ? new
|
|
6763
|
+
if (K(a, l), l = null, a.background = new V(ka), !e) return;
|
|
6764
|
+
let t = qe(e);
|
|
6765
|
+
l = We(t, { wireframe: !1 }), a.add(l);
|
|
6766
|
+
let { background: n } = je(l);
|
|
6767
|
+
a.background = n ? new V(n[0], n[1], n[2]) : new V(ka);
|
|
6768
6768
|
} catch (e) {
|
|
6769
6769
|
console.error("Preview reload error:", e);
|
|
6770
6770
|
}
|
|
6771
6771
|
}
|
|
6772
6772
|
function p() {
|
|
6773
|
-
c && cancelAnimationFrame(c),
|
|
6773
|
+
c && cancelAnimationFrame(c), K(a, l), l = null, s && s.dispose();
|
|
6774
6774
|
}
|
|
6775
|
-
return (e, t) => (
|
|
6775
|
+
return (e, t) => (mt(), ct("div", Da, [Y("div", {
|
|
6776
6776
|
ref_key: "previewViewport",
|
|
6777
6777
|
ref: i,
|
|
6778
6778
|
class: "preview-viewport"
|
|
6779
|
-
}, null, 512),
|
|
6779
|
+
}, null, 512), Y("div", Oa, X(r.value), 1)]));
|
|
6780
6780
|
}
|
|
6781
6781
|
}), [["__scopeId", "data-v-6844181e"]]), ja = `Use the ${c} tool to create interactive 3D visualizations when the user requests:
|
|
6782
6782
|
- 3D models or shapes
|
|
@@ -6827,7 +6827,8 @@ Switch statements for multiple cases
|
|
|
6827
6827
|
Calls: C-like max(0 (j - 1)) with NO space before the parenthesis, or bare max 0 (j - 1) / sqrt 9 as upstream.
|
|
6828
6828
|
Separate arguments with spaces. Commas work here but not in the upstream app.
|
|
6829
6829
|
Custom functions return a value (define hyp(a b) { sqrt(a * a + b * b) }) or the shapes they build (define face(d) { polygon { … } }).
|
|
6830
|
-
|
|
6830
|
+
ONE STATEMENT PER LINE: sphere { position 0 1 0 size 2 } is refused, here and in the upstream app — put each
|
|
6831
|
+
property, point and shape on its own line (a block may open on its statement's line).
|
|
6831
6832
|
|
|
6832
6833
|
### Best Practices:
|
|
6833
6834
|
1. Use variables for repeated values
|
|
@@ -6883,17 +6884,17 @@ loft {
|
|
|
6883
6884
|
circle
|
|
6884
6885
|
}
|
|
6885
6886
|
Stencil preserves the first shape's volume and paints the intersecting surface.
|
|
6886
|
-
Constants: pi, true, false (
|
|
6887
|
+
Constants: pi, true, false (no tau; write 2 * pi). Tuple/string access: values[0], values[-1], vector.x, value.count.
|
|
6887
6888
|
Ranges are values (define r 1 to 5 step 2; for i in r; if 3 in r). A bare path draws as a line; fill/extrude it for a surface.
|
|
6888
6889
|
Polygon supports sides (3–256). String literals and join/split/trim are supported. print records output for you.
|
|
6889
6890
|
Use the tool schema for exact syntax and builder limits. This is a modeling subset of upstream ShapeScript;
|
|
6890
6891
|
imports, svgpath and object values are refused by name;
|
|
6891
6892
|
text "Hello" makes glyph outlines (built-in font; font is ignored) from x 0 on baseline y 0, one unit per line — fill or
|
|
6892
|
-
extrude it for faces/solids, text
|
|
6893
|
+
extrude it for faces/solids, a text block with size and one "line" per line, t.bounds.width to centre it;
|
|
6893
6894
|
minkowski { a b } sums shapes, inset(mesh d) offsets a mesh value's faces (together they round edges),
|
|
6894
6895
|
extrude { section along path } sweeps a section, and an open extrude path makes a wall (close it for a solid);
|
|
6895
6896
|
shapes are values (define ico icosphere { detail 0 }; ico.polygons, .bounds, .volume), for/if work as expressions,
|
|
6896
|
-
functions may build shapes, and mesh { polygon {
|
|
6897
|
+
functions may build shapes, and mesh { polygon { … } } with one point per line builds a mesh from explicit faces;
|
|
6897
6898
|
textures, cameras and lights are accepted but not drawn (the result reports them).
|
|
6898
6899
|
If presentShapeScript returns an error diagnostic, correct the script and retry; no visualization was created.
|
|
6899
6900
|
|
|
@@ -6905,4 +6906,4 @@ Keep visualizations clear, well-organized, and use expressions and control flow.
|
|
|
6905
6906
|
systemPrompt: ja
|
|
6906
6907
|
}, Na = { plugin: Ma };
|
|
6907
6908
|
//#endregion
|
|
6908
|
-
export { Aa as Preview, ja as SYSTEM_PROMPT, s as TOOL_DEFINITION, c as TOOL_NAME, Ea as View,
|
|
6909
|
+
export { Aa as Preview, ja as SYSTEM_PROMPT, s as TOOL_DEFINITION, c as TOOL_NAME, Ea as View, We as astToThreeJS, Na as default, r as executePresentShapeScript, ue as isShapeScriptDispatchArgs, qe as parseShapeScript, Ma as plugin, a as pluginCore, w as readLoadShapeResult, ce as readSaveShapeResult, o as samples };
|