@shopware-ag/dive 2.3.3 → 2.3.5

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.
Files changed (42) hide show
  1. package/build/chunks/AssetCache-DttAo0pU.cjs +1 -0
  2. package/build/chunks/{AssetCache-DdUtVfGq.mjs → AssetCache-kb8UDcP9.mjs} +4 -3
  3. package/build/chunks/{AssetLoader-CNeU4PUY.mjs → AssetLoader-CVnGc8ew.mjs} +6 -5
  4. package/build/chunks/AssetLoader-CnLydpHL.cjs +5 -0
  5. package/build/chunks/DIVEShaderMaterial-Bt0d8oJB.mjs +3468 -0
  6. package/build/chunks/DIVEShaderMaterial-DE8YRWj9.cjs +1554 -0
  7. package/build/chunks/FileTypes-CKWhR_0s.cjs +33 -0
  8. package/build/chunks/{FileTypes-Cexyn_dj.mjs → FileTypes-D5DAP02R.mjs} +283 -256
  9. package/build/chunks/{isFileTypeSupported-DfpEEKa6.cjs → isFileTypeSupported-C-N7j2WF.cjs} +1 -1
  10. package/build/chunks/{isFileTypeSupported-Bs33wicI.mjs → isFileTypeSupported-sf2q0yiH.mjs} +1 -1
  11. package/build/components/grid/Grid.d.ts +15 -3
  12. package/build/constants/GridColors.d.ts +2 -2
  13. package/build/dive.cjs +1 -1
  14. package/build/dive.mjs +11 -11
  15. package/build/engine/scene/Scene.d.ts +13 -0
  16. package/build/plugins/ar/index.cjs +1 -1
  17. package/build/plugins/ar/index.mjs +1 -1
  18. package/build/plugins/assetcache/index.cjs +1 -1
  19. package/build/plugins/assetcache/index.mjs +1 -1
  20. package/build/plugins/assetloader/index.cjs +1 -1
  21. package/build/plugins/assetloader/index.mjs +2 -2
  22. package/build/plugins/orbitcontroller/index.cjs +1 -1
  23. package/build/plugins/orbitcontroller/index.mjs +1 -1
  24. package/build/plugins/orientationdisplay/index.cjs +1 -1
  25. package/build/plugins/orientationdisplay/index.mjs +4 -3
  26. package/build/plugins/quickview/index.cjs +1 -1
  27. package/build/plugins/quickview/index.mjs +6 -5
  28. package/build/plugins/shader/index.cjs +1 -0
  29. package/build/plugins/shader/index.d.ts +1 -0
  30. package/build/plugins/shader/index.mjs +5 -0
  31. package/build/plugins/shader/src/index.d.ts +3 -0
  32. package/build/plugins/shader/src/material/DIVEShaderMaterial.d.ts +5 -0
  33. package/build/plugins/shader/src/shaders/DIVEShaderLib.d.ts +2 -0
  34. package/build/plugins/shader/src/shaders/grid/index.d.ts +40 -0
  35. package/build/plugins/state/index.cjs +1 -1
  36. package/build/plugins/state/index.mjs +501 -500
  37. package/build/plugins/toolbox/index.cjs +1 -1
  38. package/build/plugins/toolbox/index.mjs +10 -9
  39. package/package.json +6 -1
  40. package/build/chunks/AssetCache-HN9PKZuL.cjs +0 -1
  41. package/build/chunks/AssetLoader-DYNhFhnl.cjs +0 -5
  42. package/build/chunks/FileTypes-vMPAX_0H.cjs +0 -33
@@ -0,0 +1,3468 @@
1
+ import { Color as O, ShaderMaterial as ie } from "three";
2
+ const ne = (
3
+ /* glsl */
4
+ `
5
+ varying vec2 vUv;
6
+ uniform mat3 uvTransform;
7
+
8
+ void main() {
9
+
10
+ vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
11
+
12
+ gl_Position = vec4( position.xy, 1.0, 1.0 );
13
+
14
+ }
15
+ `
16
+ ), re = (
17
+ /* glsl */
18
+ `
19
+ uniform sampler2D t2D;
20
+ uniform float backgroundIntensity;
21
+
22
+ varying vec2 vUv;
23
+
24
+ void main() {
25
+
26
+ vec4 texColor = texture2D( t2D, vUv );
27
+
28
+ #ifdef DECODE_VIDEO_TEXTURE
29
+
30
+ // use inline sRGB decode until browsers properly support SRGB8_APLHA8 with video textures
31
+
32
+ texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );
33
+
34
+ #endif
35
+
36
+ texColor.rgb *= backgroundIntensity;
37
+
38
+ gl_FragColor = texColor;
39
+
40
+ #include <tonemapping_fragment>
41
+ #include <colorspace_fragment>
42
+
43
+ }
44
+ `
45
+ ), ae = (
46
+ /* glsl */
47
+ `
48
+ varying vec3 vWorldDirection;
49
+
50
+ #include <common>
51
+
52
+ void main() {
53
+
54
+ vWorldDirection = transformDirection( position, modelMatrix );
55
+
56
+ #include <begin_vertex>
57
+ #include <project_vertex>
58
+
59
+ gl_Position.z = gl_Position.w; // set z to camera.far
60
+
61
+ }
62
+ `
63
+ ), se = (
64
+ /* glsl */
65
+ `
66
+
67
+ #ifdef ENVMAP_TYPE_CUBE
68
+
69
+ uniform samplerCube envMap;
70
+
71
+ #elif defined( ENVMAP_TYPE_CUBE_UV )
72
+
73
+ uniform sampler2D envMap;
74
+
75
+ #endif
76
+
77
+ uniform float flipEnvMap;
78
+ uniform float backgroundBlurriness;
79
+ uniform float backgroundIntensity;
80
+ uniform mat3 backgroundRotation;
81
+
82
+ varying vec3 vWorldDirection;
83
+
84
+ #include <cube_uv_reflection_fragment>
85
+
86
+ void main() {
87
+
88
+ #ifdef ENVMAP_TYPE_CUBE
89
+
90
+ vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );
91
+
92
+ #elif defined( ENVMAP_TYPE_CUBE_UV )
93
+
94
+ vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );
95
+
96
+ #else
97
+
98
+ vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );
99
+
100
+ #endif
101
+
102
+ texColor.rgb *= backgroundIntensity;
103
+
104
+ gl_FragColor = texColor;
105
+
106
+ #include <tonemapping_fragment>
107
+ #include <colorspace_fragment>
108
+
109
+ }
110
+ `
111
+ ), le = (
112
+ /* glsl */
113
+ `
114
+ varying vec3 vWorldDirection;
115
+
116
+ #include <common>
117
+
118
+ void main() {
119
+
120
+ vWorldDirection = transformDirection( position, modelMatrix );
121
+
122
+ #include <begin_vertex>
123
+ #include <project_vertex>
124
+
125
+ gl_Position.z = gl_Position.w; // set z to camera.far
126
+
127
+ }
128
+ `
129
+ ), oe = (
130
+ /* glsl */
131
+ `
132
+ uniform samplerCube tCube;
133
+ uniform float tFlip;
134
+ uniform float opacity;
135
+
136
+ varying vec3 vWorldDirection;
137
+
138
+ void main() {
139
+
140
+ vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );
141
+
142
+ gl_FragColor = texColor;
143
+ gl_FragColor.a *= opacity;
144
+
145
+ #include <tonemapping_fragment>
146
+ #include <colorspace_fragment>
147
+
148
+ }
149
+ `
150
+ ), ce = (
151
+ /* glsl */
152
+ `
153
+ #include <common>
154
+ #include <batching_pars_vertex>
155
+ #include <uv_pars_vertex>
156
+ #include <displacementmap_pars_vertex>
157
+ #include <morphtarget_pars_vertex>
158
+ #include <skinning_pars_vertex>
159
+ #include <logdepthbuf_pars_vertex>
160
+ #include <clipping_planes_pars_vertex>
161
+
162
+ // This is used for computing an equivalent of gl_FragCoord.z that is as high precision as possible.
163
+ // Some platforms compute gl_FragCoord at a lower precision which makes the manually computed value better for
164
+ // depth-based postprocessing effects. Reproduced on iPad with A10 processor / iPadOS 13.3.1.
165
+ varying vec2 vHighPrecisionZW;
166
+
167
+ void main() {
168
+
169
+ #include <uv_vertex>
170
+
171
+ #include <batching_vertex>
172
+ #include <skinbase_vertex>
173
+
174
+ #include <morphinstance_vertex>
175
+
176
+ #ifdef USE_DISPLACEMENTMAP
177
+
178
+ #include <beginnormal_vertex>
179
+ #include <morphnormal_vertex>
180
+ #include <skinnormal_vertex>
181
+
182
+ #endif
183
+
184
+ #include <begin_vertex>
185
+ #include <morphtarget_vertex>
186
+ #include <skinning_vertex>
187
+ #include <displacementmap_vertex>
188
+ #include <project_vertex>
189
+ #include <logdepthbuf_vertex>
190
+ #include <clipping_planes_vertex>
191
+
192
+ vHighPrecisionZW = gl_Position.zw;
193
+
194
+ }
195
+ `
196
+ ), ue = (
197
+ /* glsl */
198
+ `
199
+ #if DEPTH_PACKING == 3200
200
+
201
+ uniform float opacity;
202
+
203
+ #endif
204
+
205
+ #include <common>
206
+ #include <packing>
207
+ #include <uv_pars_fragment>
208
+ #include <map_pars_fragment>
209
+ #include <alphamap_pars_fragment>
210
+ #include <alphatest_pars_fragment>
211
+ #include <alphahash_pars_fragment>
212
+ #include <logdepthbuf_pars_fragment>
213
+ #include <clipping_planes_pars_fragment>
214
+
215
+ varying vec2 vHighPrecisionZW;
216
+
217
+ void main() {
218
+
219
+ vec4 diffuseColor = vec4( 1.0 );
220
+ #include <clipping_planes_fragment>
221
+
222
+ #if DEPTH_PACKING == 3200
223
+
224
+ diffuseColor.a = opacity;
225
+
226
+ #endif
227
+
228
+ #include <map_fragment>
229
+ #include <alphamap_fragment>
230
+ #include <alphatest_fragment>
231
+ #include <alphahash_fragment>
232
+
233
+ #include <logdepthbuf_fragment>
234
+
235
+ // Higher precision equivalent of gl_FragCoord.z. This assumes depthRange has been left to its default values.
236
+ float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;
237
+
238
+ #if DEPTH_PACKING == 3200
239
+
240
+ gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
241
+
242
+ #elif DEPTH_PACKING == 3201
243
+
244
+ gl_FragColor = packDepthToRGBA( fragCoordZ );
245
+
246
+ #endif
247
+
248
+ }
249
+ `
250
+ ), he = (
251
+ /* glsl */
252
+ `
253
+ #define DISTANCE
254
+
255
+ varying vec3 vWorldPosition;
256
+
257
+ #include <common>
258
+ #include <batching_pars_vertex>
259
+ #include <uv_pars_vertex>
260
+ #include <displacementmap_pars_vertex>
261
+ #include <morphtarget_pars_vertex>
262
+ #include <skinning_pars_vertex>
263
+ #include <clipping_planes_pars_vertex>
264
+
265
+ void main() {
266
+
267
+ #include <uv_vertex>
268
+
269
+ #include <batching_vertex>
270
+ #include <skinbase_vertex>
271
+
272
+ #include <morphinstance_vertex>
273
+
274
+ #ifdef USE_DISPLACEMENTMAP
275
+
276
+ #include <beginnormal_vertex>
277
+ #include <morphnormal_vertex>
278
+ #include <skinnormal_vertex>
279
+
280
+ #endif
281
+
282
+ #include <begin_vertex>
283
+ #include <morphtarget_vertex>
284
+ #include <skinning_vertex>
285
+ #include <displacementmap_vertex>
286
+ #include <project_vertex>
287
+ #include <worldpos_vertex>
288
+ #include <clipping_planes_vertex>
289
+
290
+ vWorldPosition = worldPosition.xyz;
291
+
292
+ }
293
+ `
294
+ ), de = (
295
+ /* glsl */
296
+ `
297
+ #define DISTANCE
298
+
299
+ uniform vec3 referencePosition;
300
+ uniform float nearDistance;
301
+ uniform float farDistance;
302
+ varying vec3 vWorldPosition;
303
+
304
+ #include <common>
305
+ #include <packing>
306
+ #include <uv_pars_fragment>
307
+ #include <map_pars_fragment>
308
+ #include <alphamap_pars_fragment>
309
+ #include <alphatest_pars_fragment>
310
+ #include <alphahash_pars_fragment>
311
+ #include <clipping_planes_pars_fragment>
312
+
313
+ void main () {
314
+
315
+ vec4 diffuseColor = vec4( 1.0 );
316
+ #include <clipping_planes_fragment>
317
+
318
+ #include <map_fragment>
319
+ #include <alphamap_fragment>
320
+ #include <alphatest_fragment>
321
+ #include <alphahash_fragment>
322
+
323
+ float dist = length( vWorldPosition - referencePosition );
324
+ dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
325
+ dist = saturate( dist ); // clamp to [ 0, 1 ]
326
+
327
+ gl_FragColor = packDepthToRGBA( dist );
328
+
329
+ }
330
+ `
331
+ ), me = (
332
+ /* glsl */
333
+ `
334
+ varying vec3 vWorldDirection;
335
+
336
+ #include <common>
337
+
338
+ void main() {
339
+
340
+ vWorldDirection = transformDirection( position, modelMatrix );
341
+
342
+ #include <begin_vertex>
343
+ #include <project_vertex>
344
+
345
+ }
346
+ `
347
+ ), pe = (
348
+ /* glsl */
349
+ `
350
+ uniform sampler2D tEquirect;
351
+
352
+ varying vec3 vWorldDirection;
353
+
354
+ #include <common>
355
+
356
+ void main() {
357
+
358
+ vec3 direction = normalize( vWorldDirection );
359
+
360
+ vec2 sampleUV = equirectUv( direction );
361
+
362
+ gl_FragColor = texture2D( tEquirect, sampleUV );
363
+
364
+ #include <tonemapping_fragment>
365
+ #include <colorspace_fragment>
366
+
367
+ }
368
+ `
369
+ ), _e = (
370
+ /* glsl */
371
+ `
372
+ uniform float scale;
373
+ attribute float lineDistance;
374
+
375
+ varying float vLineDistance;
376
+
377
+ #include <common>
378
+ #include <uv_pars_vertex>
379
+ #include <color_pars_vertex>
380
+ #include <fog_pars_vertex>
381
+ #include <morphtarget_pars_vertex>
382
+ #include <logdepthbuf_pars_vertex>
383
+ #include <clipping_planes_pars_vertex>
384
+
385
+ void main() {
386
+
387
+ vLineDistance = scale * lineDistance;
388
+
389
+ #include <uv_vertex>
390
+ #include <color_vertex>
391
+ #include <morphinstance_vertex>
392
+ #include <morphcolor_vertex>
393
+ #include <begin_vertex>
394
+ #include <morphtarget_vertex>
395
+ #include <project_vertex>
396
+ #include <logdepthbuf_vertex>
397
+ #include <clipping_planes_vertex>
398
+ #include <fog_vertex>
399
+
400
+ }
401
+ `
402
+ ), ge = (
403
+ /* glsl */
404
+ `
405
+ uniform vec3 diffuse;
406
+ uniform float opacity;
407
+
408
+ uniform float dashSize;
409
+ uniform float totalSize;
410
+
411
+ varying float vLineDistance;
412
+
413
+ #include <common>
414
+ #include <color_pars_fragment>
415
+ #include <uv_pars_fragment>
416
+ #include <map_pars_fragment>
417
+ #include <fog_pars_fragment>
418
+ #include <logdepthbuf_pars_fragment>
419
+ #include <clipping_planes_pars_fragment>
420
+
421
+ void main() {
422
+
423
+ vec4 diffuseColor = vec4( diffuse, opacity );
424
+ #include <clipping_planes_fragment>
425
+
426
+ if ( mod( vLineDistance, totalSize ) > dashSize ) {
427
+
428
+ discard;
429
+
430
+ }
431
+
432
+ vec3 outgoingLight = vec3( 0.0 );
433
+
434
+ #include <logdepthbuf_fragment>
435
+ #include <map_fragment>
436
+ #include <color_fragment>
437
+
438
+ outgoingLight = diffuseColor.rgb; // simple shader
439
+
440
+ #include <opaque_fragment>
441
+ #include <tonemapping_fragment>
442
+ #include <colorspace_fragment>
443
+ #include <fog_fragment>
444
+ #include <premultiplied_alpha_fragment>
445
+
446
+ }
447
+ `
448
+ ), fe = (
449
+ /* glsl */
450
+ `
451
+ #include <common>
452
+ #include <batching_pars_vertex>
453
+ #include <uv_pars_vertex>
454
+ #include <envmap_pars_vertex>
455
+ #include <color_pars_vertex>
456
+ #include <fog_pars_vertex>
457
+ #include <morphtarget_pars_vertex>
458
+ #include <skinning_pars_vertex>
459
+ #include <logdepthbuf_pars_vertex>
460
+ #include <clipping_planes_pars_vertex>
461
+
462
+ void main() {
463
+
464
+ #include <uv_vertex>
465
+ #include <color_vertex>
466
+ #include <morphinstance_vertex>
467
+ #include <morphcolor_vertex>
468
+ #include <batching_vertex>
469
+
470
+ #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )
471
+
472
+ #include <beginnormal_vertex>
473
+ #include <morphnormal_vertex>
474
+ #include <skinbase_vertex>
475
+ #include <skinnormal_vertex>
476
+ #include <defaultnormal_vertex>
477
+
478
+ #endif
479
+
480
+ #include <begin_vertex>
481
+ #include <morphtarget_vertex>
482
+ #include <skinning_vertex>
483
+ #include <project_vertex>
484
+ #include <logdepthbuf_vertex>
485
+ #include <clipping_planes_vertex>
486
+
487
+ #include <worldpos_vertex>
488
+ #include <envmap_vertex>
489
+ #include <fog_vertex>
490
+
491
+ }
492
+ `
493
+ ), ve = (
494
+ /* glsl */
495
+ `
496
+ uniform vec3 diffuse;
497
+ uniform float opacity;
498
+
499
+ #ifndef FLAT_SHADED
500
+
501
+ varying vec3 vNormal;
502
+
503
+ #endif
504
+
505
+ #include <common>
506
+ #include <dithering_pars_fragment>
507
+ #include <color_pars_fragment>
508
+ #include <uv_pars_fragment>
509
+ #include <map_pars_fragment>
510
+ #include <alphamap_pars_fragment>
511
+ #include <alphatest_pars_fragment>
512
+ #include <alphahash_pars_fragment>
513
+ #include <aomap_pars_fragment>
514
+ #include <lightmap_pars_fragment>
515
+ #include <envmap_common_pars_fragment>
516
+ #include <envmap_pars_fragment>
517
+ #include <fog_pars_fragment>
518
+ #include <specularmap_pars_fragment>
519
+ #include <logdepthbuf_pars_fragment>
520
+ #include <clipping_planes_pars_fragment>
521
+
522
+ void main() {
523
+
524
+ vec4 diffuseColor = vec4( diffuse, opacity );
525
+ #include <clipping_planes_fragment>
526
+
527
+ #include <logdepthbuf_fragment>
528
+ #include <map_fragment>
529
+ #include <color_fragment>
530
+ #include <alphamap_fragment>
531
+ #include <alphatest_fragment>
532
+ #include <alphahash_fragment>
533
+ #include <specularmap_fragment>
534
+
535
+ ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
536
+
537
+ // accumulation (baked indirect lighting only)
538
+ #ifdef USE_LIGHTMAP
539
+
540
+ vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
541
+ reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;
542
+
543
+ #else
544
+
545
+ reflectedLight.indirectDiffuse += vec3( 1.0 );
546
+
547
+ #endif
548
+
549
+ // modulation
550
+ #include <aomap_fragment>
551
+
552
+ reflectedLight.indirectDiffuse *= diffuseColor.rgb;
553
+
554
+ vec3 outgoingLight = reflectedLight.indirectDiffuse;
555
+
556
+ #include <envmap_fragment>
557
+
558
+ #include <opaque_fragment>
559
+ #include <tonemapping_fragment>
560
+ #include <colorspace_fragment>
561
+ #include <fog_fragment>
562
+ #include <premultiplied_alpha_fragment>
563
+ #include <dithering_fragment>
564
+
565
+ }
566
+ `
567
+ ), xe = (
568
+ /* glsl */
569
+ `
570
+ #define LAMBERT
571
+
572
+ varying vec3 vViewPosition;
573
+
574
+ #include <common>
575
+ #include <batching_pars_vertex>
576
+ #include <uv_pars_vertex>
577
+ #include <displacementmap_pars_vertex>
578
+ #include <envmap_pars_vertex>
579
+ #include <color_pars_vertex>
580
+ #include <fog_pars_vertex>
581
+ #include <normal_pars_vertex>
582
+ #include <morphtarget_pars_vertex>
583
+ #include <skinning_pars_vertex>
584
+ #include <shadowmap_pars_vertex>
585
+ #include <logdepthbuf_pars_vertex>
586
+ #include <clipping_planes_pars_vertex>
587
+
588
+ void main() {
589
+
590
+ #include <uv_vertex>
591
+ #include <color_vertex>
592
+ #include <morphinstance_vertex>
593
+ #include <morphcolor_vertex>
594
+ #include <batching_vertex>
595
+
596
+ #include <beginnormal_vertex>
597
+ #include <morphnormal_vertex>
598
+ #include <skinbase_vertex>
599
+ #include <skinnormal_vertex>
600
+ #include <defaultnormal_vertex>
601
+ #include <normal_vertex>
602
+
603
+ #include <begin_vertex>
604
+ #include <morphtarget_vertex>
605
+ #include <skinning_vertex>
606
+ #include <displacementmap_vertex>
607
+ #include <project_vertex>
608
+ #include <logdepthbuf_vertex>
609
+ #include <clipping_planes_vertex>
610
+
611
+ vViewPosition = - mvPosition.xyz;
612
+
613
+ #include <worldpos_vertex>
614
+ #include <envmap_vertex>
615
+ #include <shadowmap_vertex>
616
+ #include <fog_vertex>
617
+
618
+ }
619
+ `
620
+ ), ye = (
621
+ /* glsl */
622
+ `
623
+ #define LAMBERT
624
+
625
+ uniform vec3 diffuse;
626
+ uniform vec3 emissive;
627
+ uniform float opacity;
628
+
629
+ #include <common>
630
+ #include <packing>
631
+ #include <dithering_pars_fragment>
632
+ #include <color_pars_fragment>
633
+ #include <uv_pars_fragment>
634
+ #include <map_pars_fragment>
635
+ #include <alphamap_pars_fragment>
636
+ #include <alphatest_pars_fragment>
637
+ #include <alphahash_pars_fragment>
638
+ #include <aomap_pars_fragment>
639
+ #include <lightmap_pars_fragment>
640
+ #include <emissivemap_pars_fragment>
641
+ #include <envmap_common_pars_fragment>
642
+ #include <envmap_pars_fragment>
643
+ #include <fog_pars_fragment>
644
+ #include <bsdfs>
645
+ #include <lights_pars_begin>
646
+ #include <normal_pars_fragment>
647
+ #include <lights_lambert_pars_fragment>
648
+ #include <shadowmap_pars_fragment>
649
+ #include <bumpmap_pars_fragment>
650
+ #include <normalmap_pars_fragment>
651
+ #include <specularmap_pars_fragment>
652
+ #include <logdepthbuf_pars_fragment>
653
+ #include <clipping_planes_pars_fragment>
654
+
655
+ void main() {
656
+
657
+ vec4 diffuseColor = vec4( diffuse, opacity );
658
+ #include <clipping_planes_fragment>
659
+
660
+ ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
661
+ vec3 totalEmissiveRadiance = emissive;
662
+
663
+ #include <logdepthbuf_fragment>
664
+ #include <map_fragment>
665
+ #include <color_fragment>
666
+ #include <alphamap_fragment>
667
+ #include <alphatest_fragment>
668
+ #include <alphahash_fragment>
669
+ #include <specularmap_fragment>
670
+ #include <normal_fragment_begin>
671
+ #include <normal_fragment_maps>
672
+ #include <emissivemap_fragment>
673
+
674
+ // accumulation
675
+ #include <lights_lambert_fragment>
676
+ #include <lights_fragment_begin>
677
+ #include <lights_fragment_maps>
678
+ #include <lights_fragment_end>
679
+
680
+ // modulation
681
+ #include <aomap_fragment>
682
+
683
+ vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
684
+
685
+ #include <envmap_fragment>
686
+ #include <opaque_fragment>
687
+ #include <tonemapping_fragment>
688
+ #include <colorspace_fragment>
689
+ #include <fog_fragment>
690
+ #include <premultiplied_alpha_fragment>
691
+ #include <dithering_fragment>
692
+
693
+ }
694
+ `
695
+ ), be = (
696
+ /* glsl */
697
+ `
698
+ #define MATCAP
699
+
700
+ varying vec3 vViewPosition;
701
+
702
+ #include <common>
703
+ #include <batching_pars_vertex>
704
+ #include <uv_pars_vertex>
705
+ #include <color_pars_vertex>
706
+ #include <displacementmap_pars_vertex>
707
+ #include <fog_pars_vertex>
708
+ #include <normal_pars_vertex>
709
+ #include <morphtarget_pars_vertex>
710
+ #include <skinning_pars_vertex>
711
+
712
+ #include <logdepthbuf_pars_vertex>
713
+ #include <clipping_planes_pars_vertex>
714
+
715
+ void main() {
716
+
717
+ #include <uv_vertex>
718
+ #include <color_vertex>
719
+ #include <morphinstance_vertex>
720
+ #include <morphcolor_vertex>
721
+ #include <batching_vertex>
722
+
723
+ #include <beginnormal_vertex>
724
+ #include <morphnormal_vertex>
725
+ #include <skinbase_vertex>
726
+ #include <skinnormal_vertex>
727
+ #include <defaultnormal_vertex>
728
+ #include <normal_vertex>
729
+
730
+ #include <begin_vertex>
731
+ #include <morphtarget_vertex>
732
+ #include <skinning_vertex>
733
+ #include <displacementmap_vertex>
734
+ #include <project_vertex>
735
+
736
+ #include <logdepthbuf_vertex>
737
+ #include <clipping_planes_vertex>
738
+ #include <fog_vertex>
739
+
740
+ vViewPosition = - mvPosition.xyz;
741
+
742
+ }
743
+ `
744
+ ), Me = (
745
+ /* glsl */
746
+ `
747
+ #define MATCAP
748
+
749
+ uniform vec3 diffuse;
750
+ uniform float opacity;
751
+ uniform sampler2D matcap;
752
+
753
+ varying vec3 vViewPosition;
754
+
755
+ #include <common>
756
+ #include <dithering_pars_fragment>
757
+ #include <color_pars_fragment>
758
+ #include <uv_pars_fragment>
759
+ #include <map_pars_fragment>
760
+ #include <alphamap_pars_fragment>
761
+ #include <alphatest_pars_fragment>
762
+ #include <alphahash_pars_fragment>
763
+ #include <fog_pars_fragment>
764
+ #include <normal_pars_fragment>
765
+ #include <bumpmap_pars_fragment>
766
+ #include <normalmap_pars_fragment>
767
+ #include <logdepthbuf_pars_fragment>
768
+ #include <clipping_planes_pars_fragment>
769
+
770
+ void main() {
771
+
772
+ vec4 diffuseColor = vec4( diffuse, opacity );
773
+ #include <clipping_planes_fragment>
774
+
775
+ #include <logdepthbuf_fragment>
776
+ #include <map_fragment>
777
+ #include <color_fragment>
778
+ #include <alphamap_fragment>
779
+ #include <alphatest_fragment>
780
+ #include <alphahash_fragment>
781
+ #include <normal_fragment_begin>
782
+ #include <normal_fragment_maps>
783
+
784
+ vec3 viewDir = normalize( vViewPosition );
785
+ vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );
786
+ vec3 y = cross( viewDir, x );
787
+ vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; // 0.495 to remove artifacts caused by undersized matcap disks
788
+
789
+ #ifdef USE_MATCAP
790
+
791
+ vec4 matcapColor = texture2D( matcap, uv );
792
+
793
+ #else
794
+
795
+ vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); // default if matcap is missing
796
+
797
+ #endif
798
+
799
+ vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;
800
+
801
+ #include <opaque_fragment>
802
+ #include <tonemapping_fragment>
803
+ #include <colorspace_fragment>
804
+ #include <fog_fragment>
805
+ #include <premultiplied_alpha_fragment>
806
+ #include <dithering_fragment>
807
+
808
+ }
809
+ `
810
+ ), we = (
811
+ /* glsl */
812
+ `
813
+ #define NORMAL
814
+
815
+ #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
816
+
817
+ varying vec3 vViewPosition;
818
+
819
+ #endif
820
+
821
+ #include <common>
822
+ #include <batching_pars_vertex>
823
+ #include <uv_pars_vertex>
824
+ #include <displacementmap_pars_vertex>
825
+ #include <normal_pars_vertex>
826
+ #include <morphtarget_pars_vertex>
827
+ #include <skinning_pars_vertex>
828
+ #include <logdepthbuf_pars_vertex>
829
+ #include <clipping_planes_pars_vertex>
830
+
831
+ void main() {
832
+
833
+ #include <uv_vertex>
834
+ #include <batching_vertex>
835
+
836
+ #include <beginnormal_vertex>
837
+ #include <morphinstance_vertex>
838
+ #include <morphnormal_vertex>
839
+ #include <skinbase_vertex>
840
+ #include <skinnormal_vertex>
841
+ #include <defaultnormal_vertex>
842
+ #include <normal_vertex>
843
+
844
+ #include <begin_vertex>
845
+ #include <morphtarget_vertex>
846
+ #include <skinning_vertex>
847
+ #include <displacementmap_vertex>
848
+ #include <project_vertex>
849
+ #include <logdepthbuf_vertex>
850
+ #include <clipping_planes_vertex>
851
+
852
+ #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
853
+
854
+ vViewPosition = - mvPosition.xyz;
855
+
856
+ #endif
857
+
858
+ }
859
+ `
860
+ ), Ce = (
861
+ /* glsl */
862
+ `
863
+ #define NORMAL
864
+
865
+ uniform float opacity;
866
+
867
+ #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
868
+
869
+ varying vec3 vViewPosition;
870
+
871
+ #endif
872
+
873
+ #include <packing>
874
+ #include <uv_pars_fragment>
875
+ #include <normal_pars_fragment>
876
+ #include <bumpmap_pars_fragment>
877
+ #include <normalmap_pars_fragment>
878
+ #include <logdepthbuf_pars_fragment>
879
+ #include <clipping_planes_pars_fragment>
880
+
881
+ void main() {
882
+
883
+ vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );
884
+
885
+ #include <clipping_planes_fragment>
886
+ #include <logdepthbuf_fragment>
887
+ #include <normal_fragment_begin>
888
+ #include <normal_fragment_maps>
889
+
890
+ gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );
891
+
892
+ #ifdef OPAQUE
893
+
894
+ gl_FragColor.a = 1.0;
895
+
896
+ #endif
897
+
898
+ }
899
+ `
900
+ ), Se = (
901
+ /* glsl */
902
+ `
903
+ #define PHONG
904
+
905
+ varying vec3 vViewPosition;
906
+
907
+ #include <common>
908
+ #include <batching_pars_vertex>
909
+ #include <uv_pars_vertex>
910
+ #include <displacementmap_pars_vertex>
911
+ #include <envmap_pars_vertex>
912
+ #include <color_pars_vertex>
913
+ #include <fog_pars_vertex>
914
+ #include <normal_pars_vertex>
915
+ #include <morphtarget_pars_vertex>
916
+ #include <skinning_pars_vertex>
917
+ #include <shadowmap_pars_vertex>
918
+ #include <logdepthbuf_pars_vertex>
919
+ #include <clipping_planes_pars_vertex>
920
+
921
+ void main() {
922
+
923
+ #include <uv_vertex>
924
+ #include <color_vertex>
925
+ #include <morphcolor_vertex>
926
+ #include <batching_vertex>
927
+
928
+ #include <beginnormal_vertex>
929
+ #include <morphinstance_vertex>
930
+ #include <morphnormal_vertex>
931
+ #include <skinbase_vertex>
932
+ #include <skinnormal_vertex>
933
+ #include <defaultnormal_vertex>
934
+ #include <normal_vertex>
935
+
936
+ #include <begin_vertex>
937
+ #include <morphtarget_vertex>
938
+ #include <skinning_vertex>
939
+ #include <displacementmap_vertex>
940
+ #include <project_vertex>
941
+ #include <logdepthbuf_vertex>
942
+ #include <clipping_planes_vertex>
943
+
944
+ vViewPosition = - mvPosition.xyz;
945
+
946
+ #include <worldpos_vertex>
947
+ #include <envmap_vertex>
948
+ #include <shadowmap_vertex>
949
+ #include <fog_vertex>
950
+
951
+ }
952
+ `
953
+ ), Fe = (
954
+ /* glsl */
955
+ `
956
+ #define PHONG
957
+
958
+ uniform vec3 diffuse;
959
+ uniform vec3 emissive;
960
+ uniform vec3 specular;
961
+ uniform float shininess;
962
+ uniform float opacity;
963
+
964
+ #include <common>
965
+ #include <packing>
966
+ #include <dithering_pars_fragment>
967
+ #include <color_pars_fragment>
968
+ #include <uv_pars_fragment>
969
+ #include <map_pars_fragment>
970
+ #include <alphamap_pars_fragment>
971
+ #include <alphatest_pars_fragment>
972
+ #include <alphahash_pars_fragment>
973
+ #include <aomap_pars_fragment>
974
+ #include <lightmap_pars_fragment>
975
+ #include <emissivemap_pars_fragment>
976
+ #include <envmap_common_pars_fragment>
977
+ #include <envmap_pars_fragment>
978
+ #include <fog_pars_fragment>
979
+ #include <bsdfs>
980
+ #include <lights_pars_begin>
981
+ #include <normal_pars_fragment>
982
+ #include <lights_phong_pars_fragment>
983
+ #include <shadowmap_pars_fragment>
984
+ #include <bumpmap_pars_fragment>
985
+ #include <normalmap_pars_fragment>
986
+ #include <specularmap_pars_fragment>
987
+ #include <logdepthbuf_pars_fragment>
988
+ #include <clipping_planes_pars_fragment>
989
+
990
+ void main() {
991
+
992
+ vec4 diffuseColor = vec4( diffuse, opacity );
993
+ #include <clipping_planes_fragment>
994
+
995
+ ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
996
+ vec3 totalEmissiveRadiance = emissive;
997
+
998
+ #include <logdepthbuf_fragment>
999
+ #include <map_fragment>
1000
+ #include <color_fragment>
1001
+ #include <alphamap_fragment>
1002
+ #include <alphatest_fragment>
1003
+ #include <alphahash_fragment>
1004
+ #include <specularmap_fragment>
1005
+ #include <normal_fragment_begin>
1006
+ #include <normal_fragment_maps>
1007
+ #include <emissivemap_fragment>
1008
+
1009
+ // accumulation
1010
+ #include <lights_phong_fragment>
1011
+ #include <lights_fragment_begin>
1012
+ #include <lights_fragment_maps>
1013
+ #include <lights_fragment_end>
1014
+
1015
+ // modulation
1016
+ #include <aomap_fragment>
1017
+
1018
+ vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
1019
+
1020
+ #include <envmap_fragment>
1021
+ #include <opaque_fragment>
1022
+ #include <tonemapping_fragment>
1023
+ #include <colorspace_fragment>
1024
+ #include <fog_fragment>
1025
+ #include <premultiplied_alpha_fragment>
1026
+ #include <dithering_fragment>
1027
+
1028
+ }
1029
+ `
1030
+ ), ze = (
1031
+ /* glsl */
1032
+ `
1033
+ #define STANDARD
1034
+
1035
+ varying vec3 vViewPosition;
1036
+
1037
+ #ifdef USE_TRANSMISSION
1038
+
1039
+ varying vec3 vWorldPosition;
1040
+
1041
+ #endif
1042
+
1043
+ #include <common>
1044
+ #include <batching_pars_vertex>
1045
+ #include <uv_pars_vertex>
1046
+ #include <displacementmap_pars_vertex>
1047
+ #include <color_pars_vertex>
1048
+ #include <fog_pars_vertex>
1049
+ #include <normal_pars_vertex>
1050
+ #include <morphtarget_pars_vertex>
1051
+ #include <skinning_pars_vertex>
1052
+ #include <shadowmap_pars_vertex>
1053
+ #include <logdepthbuf_pars_vertex>
1054
+ #include <clipping_planes_pars_vertex>
1055
+
1056
+ void main() {
1057
+
1058
+ #include <uv_vertex>
1059
+ #include <color_vertex>
1060
+ #include <morphinstance_vertex>
1061
+ #include <morphcolor_vertex>
1062
+ #include <batching_vertex>
1063
+
1064
+ #include <beginnormal_vertex>
1065
+ #include <morphnormal_vertex>
1066
+ #include <skinbase_vertex>
1067
+ #include <skinnormal_vertex>
1068
+ #include <defaultnormal_vertex>
1069
+ #include <normal_vertex>
1070
+
1071
+ #include <begin_vertex>
1072
+ #include <morphtarget_vertex>
1073
+ #include <skinning_vertex>
1074
+ #include <displacementmap_vertex>
1075
+ #include <project_vertex>
1076
+ #include <logdepthbuf_vertex>
1077
+ #include <clipping_planes_vertex>
1078
+
1079
+ vViewPosition = - mvPosition.xyz;
1080
+
1081
+ #include <worldpos_vertex>
1082
+ #include <shadowmap_vertex>
1083
+ #include <fog_vertex>
1084
+
1085
+ #ifdef USE_TRANSMISSION
1086
+
1087
+ vWorldPosition = worldPosition.xyz;
1088
+
1089
+ #endif
1090
+ }
1091
+ `
1092
+ ), Ee = (
1093
+ /* glsl */
1094
+ `
1095
+ #define STANDARD
1096
+
1097
+ #ifdef PHYSICAL
1098
+ #define IOR
1099
+ #define USE_SPECULAR
1100
+ #endif
1101
+
1102
+ uniform vec3 diffuse;
1103
+ uniform vec3 emissive;
1104
+ uniform float roughness;
1105
+ uniform float metalness;
1106
+ uniform float opacity;
1107
+
1108
+ #ifdef IOR
1109
+ uniform float ior;
1110
+ #endif
1111
+
1112
+ #ifdef USE_SPECULAR
1113
+ uniform float specularIntensity;
1114
+ uniform vec3 specularColor;
1115
+
1116
+ #ifdef USE_SPECULAR_COLORMAP
1117
+ uniform sampler2D specularColorMap;
1118
+ #endif
1119
+
1120
+ #ifdef USE_SPECULAR_INTENSITYMAP
1121
+ uniform sampler2D specularIntensityMap;
1122
+ #endif
1123
+ #endif
1124
+
1125
+ #ifdef USE_CLEARCOAT
1126
+ uniform float clearcoat;
1127
+ uniform float clearcoatRoughness;
1128
+ #endif
1129
+
1130
+ #ifdef USE_IRIDESCENCE
1131
+ uniform float iridescence;
1132
+ uniform float iridescenceIOR;
1133
+ uniform float iridescenceThicknessMinimum;
1134
+ uniform float iridescenceThicknessMaximum;
1135
+ #endif
1136
+
1137
+ #ifdef USE_SHEEN
1138
+ uniform vec3 sheenColor;
1139
+ uniform float sheenRoughness;
1140
+
1141
+ #ifdef USE_SHEEN_COLORMAP
1142
+ uniform sampler2D sheenColorMap;
1143
+ #endif
1144
+
1145
+ #ifdef USE_SHEEN_ROUGHNESSMAP
1146
+ uniform sampler2D sheenRoughnessMap;
1147
+ #endif
1148
+ #endif
1149
+
1150
+ #ifdef USE_ANISOTROPY
1151
+ uniform vec2 anisotropyVector;
1152
+
1153
+ #ifdef USE_ANISOTROPYMAP
1154
+ uniform sampler2D anisotropyMap;
1155
+ #endif
1156
+ #endif
1157
+
1158
+ varying vec3 vViewPosition;
1159
+
1160
+ #include <common>
1161
+ #include <packing>
1162
+ #include <dithering_pars_fragment>
1163
+ #include <color_pars_fragment>
1164
+ #include <uv_pars_fragment>
1165
+ #include <map_pars_fragment>
1166
+ #include <alphamap_pars_fragment>
1167
+ #include <alphatest_pars_fragment>
1168
+ #include <alphahash_pars_fragment>
1169
+ #include <aomap_pars_fragment>
1170
+ #include <lightmap_pars_fragment>
1171
+ #include <emissivemap_pars_fragment>
1172
+ #include <iridescence_fragment>
1173
+ #include <cube_uv_reflection_fragment>
1174
+ #include <envmap_common_pars_fragment>
1175
+ #include <envmap_physical_pars_fragment>
1176
+ #include <fog_pars_fragment>
1177
+ #include <lights_pars_begin>
1178
+ #include <normal_pars_fragment>
1179
+ #include <lights_physical_pars_fragment>
1180
+ #include <transmission_pars_fragment>
1181
+ #include <shadowmap_pars_fragment>
1182
+ #include <bumpmap_pars_fragment>
1183
+ #include <normalmap_pars_fragment>
1184
+ #include <clearcoat_pars_fragment>
1185
+ #include <iridescence_pars_fragment>
1186
+ #include <roughnessmap_pars_fragment>
1187
+ #include <metalnessmap_pars_fragment>
1188
+ #include <logdepthbuf_pars_fragment>
1189
+ #include <clipping_planes_pars_fragment>
1190
+
1191
+ void main() {
1192
+
1193
+ vec4 diffuseColor = vec4( diffuse, opacity );
1194
+ #include <clipping_planes_fragment>
1195
+
1196
+ ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
1197
+ vec3 totalEmissiveRadiance = emissive;
1198
+
1199
+ #include <logdepthbuf_fragment>
1200
+ #include <map_fragment>
1201
+ #include <color_fragment>
1202
+ #include <alphamap_fragment>
1203
+ #include <alphatest_fragment>
1204
+ #include <alphahash_fragment>
1205
+ #include <roughnessmap_fragment>
1206
+ #include <metalnessmap_fragment>
1207
+ #include <normal_fragment_begin>
1208
+ #include <normal_fragment_maps>
1209
+ #include <clearcoat_normal_fragment_begin>
1210
+ #include <clearcoat_normal_fragment_maps>
1211
+ #include <emissivemap_fragment>
1212
+
1213
+ // accumulation
1214
+ #include <lights_physical_fragment>
1215
+ #include <lights_fragment_begin>
1216
+ #include <lights_fragment_maps>
1217
+ #include <lights_fragment_end>
1218
+
1219
+ // modulation
1220
+ #include <aomap_fragment>
1221
+
1222
+ vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
1223
+ vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;
1224
+
1225
+ #include <transmission_fragment>
1226
+
1227
+ vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
1228
+
1229
+ #ifdef USE_SHEEN
1230
+
1231
+ // Sheen energy compensation approximation calculation can be found at the end of
1232
+ // https://drive.google.com/file/d/1T0D1VSyR4AllqIJTQAraEIzjlb5h4FKH/view?usp=sharing
1233
+ float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );
1234
+
1235
+ outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;
1236
+
1237
+ #endif
1238
+
1239
+ #ifdef USE_CLEARCOAT
1240
+
1241
+ float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );
1242
+
1243
+ vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
1244
+
1245
+ outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;
1246
+
1247
+ #endif
1248
+
1249
+ #include <opaque_fragment>
1250
+ #include <tonemapping_fragment>
1251
+ #include <colorspace_fragment>
1252
+ #include <fog_fragment>
1253
+ #include <premultiplied_alpha_fragment>
1254
+ #include <dithering_fragment>
1255
+
1256
+ }
1257
+ `
1258
+ ), Ae = (
1259
+ /* glsl */
1260
+ `
1261
+ #define TOON
1262
+
1263
+ varying vec3 vViewPosition;
1264
+
1265
+ #include <common>
1266
+ #include <batching_pars_vertex>
1267
+ #include <uv_pars_vertex>
1268
+ #include <displacementmap_pars_vertex>
1269
+ #include <color_pars_vertex>
1270
+ #include <fog_pars_vertex>
1271
+ #include <normal_pars_vertex>
1272
+ #include <morphtarget_pars_vertex>
1273
+ #include <skinning_pars_vertex>
1274
+ #include <shadowmap_pars_vertex>
1275
+ #include <logdepthbuf_pars_vertex>
1276
+ #include <clipping_planes_pars_vertex>
1277
+
1278
+ void main() {
1279
+
1280
+ #include <uv_vertex>
1281
+ #include <color_vertex>
1282
+ #include <morphinstance_vertex>
1283
+ #include <morphcolor_vertex>
1284
+ #include <batching_vertex>
1285
+
1286
+ #include <beginnormal_vertex>
1287
+ #include <morphnormal_vertex>
1288
+ #include <skinbase_vertex>
1289
+ #include <skinnormal_vertex>
1290
+ #include <defaultnormal_vertex>
1291
+ #include <normal_vertex>
1292
+
1293
+ #include <begin_vertex>
1294
+ #include <morphtarget_vertex>
1295
+ #include <skinning_vertex>
1296
+ #include <displacementmap_vertex>
1297
+ #include <project_vertex>
1298
+ #include <logdepthbuf_vertex>
1299
+ #include <clipping_planes_vertex>
1300
+
1301
+ vViewPosition = - mvPosition.xyz;
1302
+
1303
+ #include <worldpos_vertex>
1304
+ #include <shadowmap_vertex>
1305
+ #include <fog_vertex>
1306
+
1307
+ }
1308
+ `
1309
+ ), ke = (
1310
+ /* glsl */
1311
+ `
1312
+ #define TOON
1313
+
1314
+ uniform vec3 diffuse;
1315
+ uniform vec3 emissive;
1316
+ uniform float opacity;
1317
+
1318
+ #include <common>
1319
+ #include <packing>
1320
+ #include <dithering_pars_fragment>
1321
+ #include <color_pars_fragment>
1322
+ #include <uv_pars_fragment>
1323
+ #include <map_pars_fragment>
1324
+ #include <alphamap_pars_fragment>
1325
+ #include <alphatest_pars_fragment>
1326
+ #include <alphahash_pars_fragment>
1327
+ #include <aomap_pars_fragment>
1328
+ #include <lightmap_pars_fragment>
1329
+ #include <emissivemap_pars_fragment>
1330
+ #include <gradientmap_pars_fragment>
1331
+ #include <fog_pars_fragment>
1332
+ #include <bsdfs>
1333
+ #include <lights_pars_begin>
1334
+ #include <normal_pars_fragment>
1335
+ #include <lights_toon_pars_fragment>
1336
+ #include <shadowmap_pars_fragment>
1337
+ #include <bumpmap_pars_fragment>
1338
+ #include <normalmap_pars_fragment>
1339
+ #include <logdepthbuf_pars_fragment>
1340
+ #include <clipping_planes_pars_fragment>
1341
+
1342
+ void main() {
1343
+
1344
+ vec4 diffuseColor = vec4( diffuse, opacity );
1345
+ #include <clipping_planes_fragment>
1346
+
1347
+ ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
1348
+ vec3 totalEmissiveRadiance = emissive;
1349
+
1350
+ #include <logdepthbuf_fragment>
1351
+ #include <map_fragment>
1352
+ #include <color_fragment>
1353
+ #include <alphamap_fragment>
1354
+ #include <alphatest_fragment>
1355
+ #include <alphahash_fragment>
1356
+ #include <normal_fragment_begin>
1357
+ #include <normal_fragment_maps>
1358
+ #include <emissivemap_fragment>
1359
+
1360
+ // accumulation
1361
+ #include <lights_toon_fragment>
1362
+ #include <lights_fragment_begin>
1363
+ #include <lights_fragment_maps>
1364
+ #include <lights_fragment_end>
1365
+
1366
+ // modulation
1367
+ #include <aomap_fragment>
1368
+
1369
+ vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
1370
+
1371
+ #include <opaque_fragment>
1372
+ #include <tonemapping_fragment>
1373
+ #include <colorspace_fragment>
1374
+ #include <fog_fragment>
1375
+ #include <premultiplied_alpha_fragment>
1376
+ #include <dithering_fragment>
1377
+
1378
+ }
1379
+ `
1380
+ ), De = (
1381
+ /* glsl */
1382
+ `
1383
+ uniform float size;
1384
+ uniform float scale;
1385
+
1386
+ #include <common>
1387
+ #include <color_pars_vertex>
1388
+ #include <fog_pars_vertex>
1389
+ #include <morphtarget_pars_vertex>
1390
+ #include <logdepthbuf_pars_vertex>
1391
+ #include <clipping_planes_pars_vertex>
1392
+
1393
+ #ifdef USE_POINTS_UV
1394
+
1395
+ varying vec2 vUv;
1396
+ uniform mat3 uvTransform;
1397
+
1398
+ #endif
1399
+
1400
+ void main() {
1401
+
1402
+ #ifdef USE_POINTS_UV
1403
+
1404
+ vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
1405
+
1406
+ #endif
1407
+
1408
+ #include <color_vertex>
1409
+ #include <morphinstance_vertex>
1410
+ #include <morphcolor_vertex>
1411
+ #include <begin_vertex>
1412
+ #include <morphtarget_vertex>
1413
+ #include <project_vertex>
1414
+
1415
+ gl_PointSize = size;
1416
+
1417
+ #ifdef USE_SIZEATTENUATION
1418
+
1419
+ bool isPerspective = isPerspectiveMatrix( projectionMatrix );
1420
+
1421
+ if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
1422
+
1423
+ #endif
1424
+
1425
+ #include <logdepthbuf_vertex>
1426
+ #include <clipping_planes_vertex>
1427
+ #include <worldpos_vertex>
1428
+ #include <fog_vertex>
1429
+
1430
+ }
1431
+ `
1432
+ ), Pe = (
1433
+ /* glsl */
1434
+ `
1435
+ uniform vec3 diffuse;
1436
+ uniform float opacity;
1437
+
1438
+ #include <common>
1439
+ #include <color_pars_fragment>
1440
+ #include <map_particle_pars_fragment>
1441
+ #include <alphatest_pars_fragment>
1442
+ #include <alphahash_pars_fragment>
1443
+ #include <fog_pars_fragment>
1444
+ #include <logdepthbuf_pars_fragment>
1445
+ #include <clipping_planes_pars_fragment>
1446
+
1447
+ void main() {
1448
+
1449
+ vec4 diffuseColor = vec4( diffuse, opacity );
1450
+ #include <clipping_planes_fragment>
1451
+
1452
+ vec3 outgoingLight = vec3( 0.0 );
1453
+
1454
+ #include <logdepthbuf_fragment>
1455
+ #include <map_particle_fragment>
1456
+ #include <color_fragment>
1457
+ #include <alphatest_fragment>
1458
+ #include <alphahash_fragment>
1459
+
1460
+ outgoingLight = diffuseColor.rgb;
1461
+
1462
+ #include <opaque_fragment>
1463
+ #include <tonemapping_fragment>
1464
+ #include <colorspace_fragment>
1465
+ #include <fog_fragment>
1466
+ #include <premultiplied_alpha_fragment>
1467
+
1468
+ }
1469
+ `
1470
+ ), Te = (
1471
+ /* glsl */
1472
+ `
1473
+ #include <common>
1474
+ #include <batching_pars_vertex>
1475
+ #include <fog_pars_vertex>
1476
+ #include <morphtarget_pars_vertex>
1477
+ #include <skinning_pars_vertex>
1478
+ #include <logdepthbuf_pars_vertex>
1479
+ #include <shadowmap_pars_vertex>
1480
+
1481
+ void main() {
1482
+
1483
+ #include <batching_vertex>
1484
+
1485
+ #include <beginnormal_vertex>
1486
+ #include <morphinstance_vertex>
1487
+ #include <morphnormal_vertex>
1488
+ #include <skinbase_vertex>
1489
+ #include <skinnormal_vertex>
1490
+ #include <defaultnormal_vertex>
1491
+
1492
+ #include <begin_vertex>
1493
+ #include <morphtarget_vertex>
1494
+ #include <skinning_vertex>
1495
+ #include <project_vertex>
1496
+ #include <logdepthbuf_vertex>
1497
+
1498
+ #include <worldpos_vertex>
1499
+ #include <shadowmap_vertex>
1500
+ #include <fog_vertex>
1501
+
1502
+ }
1503
+ `
1504
+ ), Le = (
1505
+ /* glsl */
1506
+ `
1507
+ uniform vec3 color;
1508
+ uniform float opacity;
1509
+
1510
+ #include <common>
1511
+ #include <packing>
1512
+ #include <fog_pars_fragment>
1513
+ #include <bsdfs>
1514
+ #include <lights_pars_begin>
1515
+ #include <logdepthbuf_pars_fragment>
1516
+ #include <shadowmap_pars_fragment>
1517
+ #include <shadowmask_pars_fragment>
1518
+
1519
+ void main() {
1520
+
1521
+ #include <logdepthbuf_fragment>
1522
+
1523
+ gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
1524
+
1525
+ #include <tonemapping_fragment>
1526
+ #include <colorspace_fragment>
1527
+ #include <fog_fragment>
1528
+
1529
+ }
1530
+ `
1531
+ ), Re = (
1532
+ /* glsl */
1533
+ `
1534
+ uniform float rotation;
1535
+ uniform vec2 center;
1536
+
1537
+ #include <common>
1538
+ #include <uv_pars_vertex>
1539
+ #include <fog_pars_vertex>
1540
+ #include <logdepthbuf_pars_vertex>
1541
+ #include <clipping_planes_pars_vertex>
1542
+
1543
+ void main() {
1544
+
1545
+ #include <uv_vertex>
1546
+
1547
+ vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );
1548
+
1549
+ vec2 scale;
1550
+ scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );
1551
+ scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );
1552
+
1553
+ #ifndef USE_SIZEATTENUATION
1554
+
1555
+ bool isPerspective = isPerspectiveMatrix( projectionMatrix );
1556
+
1557
+ if ( isPerspective ) scale *= - mvPosition.z;
1558
+
1559
+ #endif
1560
+
1561
+ vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;
1562
+
1563
+ vec2 rotatedPosition;
1564
+ rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
1565
+ rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
1566
+
1567
+ mvPosition.xy += rotatedPosition;
1568
+
1569
+ gl_Position = projectionMatrix * mvPosition;
1570
+
1571
+ #include <logdepthbuf_vertex>
1572
+ #include <clipping_planes_vertex>
1573
+ #include <fog_vertex>
1574
+
1575
+ }
1576
+ `
1577
+ ), Be = (
1578
+ /* glsl */
1579
+ `
1580
+ uniform vec3 diffuse;
1581
+ uniform float opacity;
1582
+
1583
+ #include <common>
1584
+ #include <uv_pars_fragment>
1585
+ #include <map_pars_fragment>
1586
+ #include <alphamap_pars_fragment>
1587
+ #include <alphatest_pars_fragment>
1588
+ #include <alphahash_pars_fragment>
1589
+ #include <fog_pars_fragment>
1590
+ #include <logdepthbuf_pars_fragment>
1591
+ #include <clipping_planes_pars_fragment>
1592
+
1593
+ void main() {
1594
+
1595
+ vec4 diffuseColor = vec4( diffuse, opacity );
1596
+ #include <clipping_planes_fragment>
1597
+
1598
+ vec3 outgoingLight = vec3( 0.0 );
1599
+
1600
+ #include <logdepthbuf_fragment>
1601
+ #include <map_fragment>
1602
+ #include <alphamap_fragment>
1603
+ #include <alphatest_fragment>
1604
+ #include <alphahash_fragment>
1605
+
1606
+ outgoingLight = diffuseColor.rgb;
1607
+
1608
+ #include <opaque_fragment>
1609
+ #include <tonemapping_fragment>
1610
+ #include <colorspace_fragment>
1611
+ #include <fog_fragment>
1612
+
1613
+ }
1614
+ `
1615
+ ), g = {
1616
+ background_vert: ne,
1617
+ background_frag: re,
1618
+ backgroundCube_vert: ae,
1619
+ backgroundCube_frag: se,
1620
+ cube_vert: le,
1621
+ cube_frag: oe,
1622
+ depth_vert: ce,
1623
+ depth_frag: ue,
1624
+ distanceRGBA_vert: he,
1625
+ distanceRGBA_frag: de,
1626
+ equirect_vert: me,
1627
+ equirect_frag: pe,
1628
+ linedashed_vert: _e,
1629
+ linedashed_frag: ge,
1630
+ meshbasic_vert: fe,
1631
+ meshbasic_frag: ve,
1632
+ meshlambert_vert: xe,
1633
+ meshlambert_frag: ye,
1634
+ meshmatcap_vert: be,
1635
+ meshmatcap_frag: Me,
1636
+ meshnormal_vert: we,
1637
+ meshnormal_frag: Ce,
1638
+ meshphong_vert: Se,
1639
+ meshphong_frag: Fe,
1640
+ meshphysical_vert: ze,
1641
+ meshphysical_frag: Ee,
1642
+ meshtoon_vert: Ae,
1643
+ meshtoon_frag: ke,
1644
+ points_vert: De,
1645
+ points_frag: Pe,
1646
+ shadow_vert: Te,
1647
+ shadow_frag: Le,
1648
+ sprite_vert: Re,
1649
+ sprite_frag: Be
1650
+ }, Ie = "", E = "srgb", W = "srgb-linear", Ne = "display-p3", ee = "display-p3-linear", H = "linear", Y = "srgb", Z = "rec709", Q = "p3";
1651
+ class f {
1652
+ constructor(e, t, i, n, r, l, o, h, a) {
1653
+ f.prototype.isMatrix3 = !0, this.elements = [
1654
+ 1,
1655
+ 0,
1656
+ 0,
1657
+ 0,
1658
+ 1,
1659
+ 0,
1660
+ 0,
1661
+ 0,
1662
+ 1
1663
+ ], e !== void 0 && this.set(e, t, i, n, r, l, o, h, a);
1664
+ }
1665
+ set(e, t, i, n, r, l, o, h, a) {
1666
+ const s = this.elements;
1667
+ return s[0] = e, s[1] = n, s[2] = o, s[3] = t, s[4] = r, s[5] = h, s[6] = i, s[7] = l, s[8] = a, this;
1668
+ }
1669
+ identity() {
1670
+ return this.set(
1671
+ 1,
1672
+ 0,
1673
+ 0,
1674
+ 0,
1675
+ 1,
1676
+ 0,
1677
+ 0,
1678
+ 0,
1679
+ 1
1680
+ ), this;
1681
+ }
1682
+ copy(e) {
1683
+ const t = this.elements, i = e.elements;
1684
+ return t[0] = i[0], t[1] = i[1], t[2] = i[2], t[3] = i[3], t[4] = i[4], t[5] = i[5], t[6] = i[6], t[7] = i[7], t[8] = i[8], this;
1685
+ }
1686
+ extractBasis(e, t, i) {
1687
+ return e.setFromMatrix3Column(this, 0), t.setFromMatrix3Column(this, 1), i.setFromMatrix3Column(this, 2), this;
1688
+ }
1689
+ setFromMatrix4(e) {
1690
+ const t = e.elements;
1691
+ return this.set(
1692
+ t[0],
1693
+ t[4],
1694
+ t[8],
1695
+ t[1],
1696
+ t[5],
1697
+ t[9],
1698
+ t[2],
1699
+ t[6],
1700
+ t[10]
1701
+ ), this;
1702
+ }
1703
+ multiply(e) {
1704
+ return this.multiplyMatrices(this, e);
1705
+ }
1706
+ premultiply(e) {
1707
+ return this.multiplyMatrices(e, this);
1708
+ }
1709
+ multiplyMatrices(e, t) {
1710
+ const i = e.elements, n = t.elements, r = this.elements, l = i[0], o = i[3], h = i[6], a = i[1], s = i[4], u = i[7], p = i[2], d = i[5], _ = i[8], v = n[0], w = n[3], S = n[6], D = n[1], P = n[4], F = n[7], M = n[2], T = n[5], I = n[8];
1711
+ return r[0] = l * v + o * D + h * M, r[3] = l * w + o * P + h * T, r[6] = l * S + o * F + h * I, r[1] = a * v + s * D + u * M, r[4] = a * w + s * P + u * T, r[7] = a * S + s * F + u * I, r[2] = p * v + d * D + _ * M, r[5] = p * w + d * P + _ * T, r[8] = p * S + d * F + _ * I, this;
1712
+ }
1713
+ multiplyScalar(e) {
1714
+ const t = this.elements;
1715
+ return t[0] *= e, t[3] *= e, t[6] *= e, t[1] *= e, t[4] *= e, t[7] *= e, t[2] *= e, t[5] *= e, t[8] *= e, this;
1716
+ }
1717
+ determinant() {
1718
+ const e = this.elements, t = e[0], i = e[1], n = e[2], r = e[3], l = e[4], o = e[5], h = e[6], a = e[7], s = e[8];
1719
+ return t * l * s - t * o * a - i * r * s + i * o * h + n * r * a - n * l * h;
1720
+ }
1721
+ invert() {
1722
+ const e = this.elements, t = e[0], i = e[1], n = e[2], r = e[3], l = e[4], o = e[5], h = e[6], a = e[7], s = e[8], u = s * l - o * a, p = o * h - s * r, d = a * r - l * h, _ = t * u + i * p + n * d;
1723
+ if (_ === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);
1724
+ const v = 1 / _;
1725
+ return e[0] = u * v, e[1] = (n * a - s * i) * v, e[2] = (o * i - n * l) * v, e[3] = p * v, e[4] = (s * t - n * h) * v, e[5] = (n * r - o * t) * v, e[6] = d * v, e[7] = (i * h - a * t) * v, e[8] = (l * t - i * r) * v, this;
1726
+ }
1727
+ transpose() {
1728
+ let e;
1729
+ const t = this.elements;
1730
+ return e = t[1], t[1] = t[3], t[3] = e, e = t[2], t[2] = t[6], t[6] = e, e = t[5], t[5] = t[7], t[7] = e, this;
1731
+ }
1732
+ getNormalMatrix(e) {
1733
+ return this.setFromMatrix4(e).invert().transpose();
1734
+ }
1735
+ transposeIntoArray(e) {
1736
+ const t = this.elements;
1737
+ return e[0] = t[0], e[1] = t[3], e[2] = t[6], e[3] = t[1], e[4] = t[4], e[5] = t[7], e[6] = t[2], e[7] = t[5], e[8] = t[8], this;
1738
+ }
1739
+ setUvTransform(e, t, i, n, r, l, o) {
1740
+ const h = Math.cos(r), a = Math.sin(r);
1741
+ return this.set(
1742
+ i * h,
1743
+ i * a,
1744
+ -i * (h * l + a * o) + l + e,
1745
+ -n * a,
1746
+ n * h,
1747
+ -n * (-a * l + h * o) + o + t,
1748
+ 0,
1749
+ 0,
1750
+ 1
1751
+ ), this;
1752
+ }
1753
+ //
1754
+ scale(e, t) {
1755
+ return this.premultiply(N.makeScale(e, t)), this;
1756
+ }
1757
+ rotate(e) {
1758
+ return this.premultiply(N.makeRotation(-e)), this;
1759
+ }
1760
+ translate(e, t) {
1761
+ return this.premultiply(N.makeTranslation(e, t)), this;
1762
+ }
1763
+ // for 2D Transforms
1764
+ makeTranslation(e, t) {
1765
+ return e.isVector2 ? this.set(
1766
+ 1,
1767
+ 0,
1768
+ e.x,
1769
+ 0,
1770
+ 1,
1771
+ e.y,
1772
+ 0,
1773
+ 0,
1774
+ 1
1775
+ ) : this.set(
1776
+ 1,
1777
+ 0,
1778
+ e,
1779
+ 0,
1780
+ 1,
1781
+ t,
1782
+ 0,
1783
+ 0,
1784
+ 1
1785
+ ), this;
1786
+ }
1787
+ makeRotation(e) {
1788
+ const t = Math.cos(e), i = Math.sin(e);
1789
+ return this.set(
1790
+ t,
1791
+ -i,
1792
+ 0,
1793
+ i,
1794
+ t,
1795
+ 0,
1796
+ 0,
1797
+ 0,
1798
+ 1
1799
+ ), this;
1800
+ }
1801
+ makeScale(e, t) {
1802
+ return this.set(
1803
+ e,
1804
+ 0,
1805
+ 0,
1806
+ 0,
1807
+ t,
1808
+ 0,
1809
+ 0,
1810
+ 0,
1811
+ 1
1812
+ ), this;
1813
+ }
1814
+ //
1815
+ equals(e) {
1816
+ const t = this.elements, i = e.elements;
1817
+ for (let n = 0; n < 9; n++)
1818
+ if (t[n] !== i[n]) return !1;
1819
+ return !0;
1820
+ }
1821
+ fromArray(e, t = 0) {
1822
+ for (let i = 0; i < 9; i++)
1823
+ this.elements[i] = e[i + t];
1824
+ return this;
1825
+ }
1826
+ toArray(e = [], t = 0) {
1827
+ const i = this.elements;
1828
+ return e[t] = i[0], e[t + 1] = i[1], e[t + 2] = i[2], e[t + 3] = i[3], e[t + 4] = i[4], e[t + 5] = i[5], e[t + 6] = i[6], e[t + 7] = i[7], e[t + 8] = i[8], e;
1829
+ }
1830
+ clone() {
1831
+ return new this.constructor().fromArray(this.elements);
1832
+ }
1833
+ }
1834
+ const N = /* @__PURE__ */ new f(), X = /* @__PURE__ */ new f().set(
1835
+ 0.8224621,
1836
+ 0.177538,
1837
+ 0,
1838
+ 0.0331941,
1839
+ 0.9668058,
1840
+ 0,
1841
+ 0.0170827,
1842
+ 0.0723974,
1843
+ 0.9105199
1844
+ ), K = /* @__PURE__ */ new f().set(
1845
+ 1.2249401,
1846
+ -0.2249404,
1847
+ 0,
1848
+ -0.0420569,
1849
+ 1.0420571,
1850
+ 0,
1851
+ -0.0196376,
1852
+ -0.0786361,
1853
+ 1.0982735
1854
+ ), L = {
1855
+ [W]: {
1856
+ transfer: H,
1857
+ primaries: Z,
1858
+ toReference: (m) => m,
1859
+ fromReference: (m) => m
1860
+ },
1861
+ [E]: {
1862
+ transfer: Y,
1863
+ primaries: Z,
1864
+ toReference: (m) => m.convertSRGBToLinear(),
1865
+ fromReference: (m) => m.convertLinearToSRGB()
1866
+ },
1867
+ [ee]: {
1868
+ transfer: H,
1869
+ primaries: Q,
1870
+ toReference: (m) => m.applyMatrix3(K),
1871
+ fromReference: (m) => m.applyMatrix3(X)
1872
+ },
1873
+ [Ne]: {
1874
+ transfer: Y,
1875
+ primaries: Q,
1876
+ toReference: (m) => m.convertSRGBToLinear().applyMatrix3(K),
1877
+ fromReference: (m) => m.applyMatrix3(X).convertLinearToSRGB()
1878
+ }
1879
+ }, Ue = /* @__PURE__ */ new Set([W, ee]), C = {
1880
+ enabled: !0,
1881
+ _workingColorSpace: W,
1882
+ get workingColorSpace() {
1883
+ return this._workingColorSpace;
1884
+ },
1885
+ set workingColorSpace(m) {
1886
+ if (!Ue.has(m))
1887
+ throw new Error(`Unsupported working color space, "${m}".`);
1888
+ this._workingColorSpace = m;
1889
+ },
1890
+ convert: function(m, e, t) {
1891
+ if (this.enabled === !1 || e === t || !e || !t)
1892
+ return m;
1893
+ const i = L[e].toReference, n = L[t].fromReference;
1894
+ return n(i(m));
1895
+ },
1896
+ fromWorkingColorSpace: function(m, e) {
1897
+ return this.convert(m, this._workingColorSpace, e);
1898
+ },
1899
+ toWorkingColorSpace: function(m, e) {
1900
+ return this.convert(m, e, this._workingColorSpace);
1901
+ },
1902
+ getPrimaries: function(m) {
1903
+ return L[m].primaries;
1904
+ },
1905
+ getTransfer: function(m) {
1906
+ return m === Ie ? H : L[m].transfer;
1907
+ }
1908
+ };
1909
+ function U(m) {
1910
+ return m < 0.04045 ? m * 0.0773993808 : Math.pow(m * 0.9478672986 + 0.0521327014, 2.4);
1911
+ }
1912
+ function q(m) {
1913
+ return m < 31308e-7 ? m * 12.92 : 1.055 * Math.pow(m, 0.41666) - 0.055;
1914
+ }
1915
+ function qe(m) {
1916
+ const e = {};
1917
+ for (const t in m) {
1918
+ e[t] = {};
1919
+ for (const i in m[t]) {
1920
+ const n = m[t][i];
1921
+ n && (n.isColor || n.isMatrix3 || n.isMatrix4 || n.isVector2 || n.isVector3 || n.isVector4 || n.isTexture || n.isQuaternion) ? n.isRenderTargetTexture ? (console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."), e[t][i] = null) : e[t][i] = n.clone() : Array.isArray(n) ? e[t][i] = n.slice() : e[t][i] = n;
1922
+ }
1923
+ }
1924
+ return e;
1925
+ }
1926
+ function b(m) {
1927
+ const e = {};
1928
+ for (let t = 0; t < m.length; t++) {
1929
+ const i = qe(m[t]);
1930
+ for (const n in i)
1931
+ e[n] = i[n];
1932
+ }
1933
+ return e;
1934
+ }
1935
+ function A(m, e, t) {
1936
+ return Math.max(e, Math.min(t, m));
1937
+ }
1938
+ function Ge(m, e) {
1939
+ return (m % e + e) % e;
1940
+ }
1941
+ function G(m, e, t) {
1942
+ return (1 - t) * m + t * e;
1943
+ }
1944
+ class k {
1945
+ constructor(e = 0, t = 0) {
1946
+ k.prototype.isVector2 = !0, this.x = e, this.y = t;
1947
+ }
1948
+ get width() {
1949
+ return this.x;
1950
+ }
1951
+ set width(e) {
1952
+ this.x = e;
1953
+ }
1954
+ get height() {
1955
+ return this.y;
1956
+ }
1957
+ set height(e) {
1958
+ this.y = e;
1959
+ }
1960
+ set(e, t) {
1961
+ return this.x = e, this.y = t, this;
1962
+ }
1963
+ setScalar(e) {
1964
+ return this.x = e, this.y = e, this;
1965
+ }
1966
+ setX(e) {
1967
+ return this.x = e, this;
1968
+ }
1969
+ setY(e) {
1970
+ return this.y = e, this;
1971
+ }
1972
+ setComponent(e, t) {
1973
+ switch (e) {
1974
+ case 0:
1975
+ this.x = t;
1976
+ break;
1977
+ case 1:
1978
+ this.y = t;
1979
+ break;
1980
+ default:
1981
+ throw new Error("index is out of range: " + e);
1982
+ }
1983
+ return this;
1984
+ }
1985
+ getComponent(e) {
1986
+ switch (e) {
1987
+ case 0:
1988
+ return this.x;
1989
+ case 1:
1990
+ return this.y;
1991
+ default:
1992
+ throw new Error("index is out of range: " + e);
1993
+ }
1994
+ }
1995
+ clone() {
1996
+ return new this.constructor(this.x, this.y);
1997
+ }
1998
+ copy(e) {
1999
+ return this.x = e.x, this.y = e.y, this;
2000
+ }
2001
+ add(e) {
2002
+ return this.x += e.x, this.y += e.y, this;
2003
+ }
2004
+ addScalar(e) {
2005
+ return this.x += e, this.y += e, this;
2006
+ }
2007
+ addVectors(e, t) {
2008
+ return this.x = e.x + t.x, this.y = e.y + t.y, this;
2009
+ }
2010
+ addScaledVector(e, t) {
2011
+ return this.x += e.x * t, this.y += e.y * t, this;
2012
+ }
2013
+ sub(e) {
2014
+ return this.x -= e.x, this.y -= e.y, this;
2015
+ }
2016
+ subScalar(e) {
2017
+ return this.x -= e, this.y -= e, this;
2018
+ }
2019
+ subVectors(e, t) {
2020
+ return this.x = e.x - t.x, this.y = e.y - t.y, this;
2021
+ }
2022
+ multiply(e) {
2023
+ return this.x *= e.x, this.y *= e.y, this;
2024
+ }
2025
+ multiplyScalar(e) {
2026
+ return this.x *= e, this.y *= e, this;
2027
+ }
2028
+ divide(e) {
2029
+ return this.x /= e.x, this.y /= e.y, this;
2030
+ }
2031
+ divideScalar(e) {
2032
+ return this.multiplyScalar(1 / e);
2033
+ }
2034
+ applyMatrix3(e) {
2035
+ const t = this.x, i = this.y, n = e.elements;
2036
+ return this.x = n[0] * t + n[3] * i + n[6], this.y = n[1] * t + n[4] * i + n[7], this;
2037
+ }
2038
+ min(e) {
2039
+ return this.x = Math.min(this.x, e.x), this.y = Math.min(this.y, e.y), this;
2040
+ }
2041
+ max(e) {
2042
+ return this.x = Math.max(this.x, e.x), this.y = Math.max(this.y, e.y), this;
2043
+ }
2044
+ clamp(e, t) {
2045
+ return this.x = Math.max(e.x, Math.min(t.x, this.x)), this.y = Math.max(e.y, Math.min(t.y, this.y)), this;
2046
+ }
2047
+ clampScalar(e, t) {
2048
+ return this.x = Math.max(e, Math.min(t, this.x)), this.y = Math.max(e, Math.min(t, this.y)), this;
2049
+ }
2050
+ clampLength(e, t) {
2051
+ const i = this.length();
2052
+ return this.divideScalar(i || 1).multiplyScalar(Math.max(e, Math.min(t, i)));
2053
+ }
2054
+ floor() {
2055
+ return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this;
2056
+ }
2057
+ ceil() {
2058
+ return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this;
2059
+ }
2060
+ round() {
2061
+ return this.x = Math.round(this.x), this.y = Math.round(this.y), this;
2062
+ }
2063
+ roundToZero() {
2064
+ return this.x = Math.trunc(this.x), this.y = Math.trunc(this.y), this;
2065
+ }
2066
+ negate() {
2067
+ return this.x = -this.x, this.y = -this.y, this;
2068
+ }
2069
+ dot(e) {
2070
+ return this.x * e.x + this.y * e.y;
2071
+ }
2072
+ cross(e) {
2073
+ return this.x * e.y - this.y * e.x;
2074
+ }
2075
+ lengthSq() {
2076
+ return this.x * this.x + this.y * this.y;
2077
+ }
2078
+ length() {
2079
+ return Math.sqrt(this.x * this.x + this.y * this.y);
2080
+ }
2081
+ manhattanLength() {
2082
+ return Math.abs(this.x) + Math.abs(this.y);
2083
+ }
2084
+ normalize() {
2085
+ return this.divideScalar(this.length() || 1);
2086
+ }
2087
+ angle() {
2088
+ return Math.atan2(-this.y, -this.x) + Math.PI;
2089
+ }
2090
+ angleTo(e) {
2091
+ const t = Math.sqrt(this.lengthSq() * e.lengthSq());
2092
+ if (t === 0) return Math.PI / 2;
2093
+ const i = this.dot(e) / t;
2094
+ return Math.acos(A(i, -1, 1));
2095
+ }
2096
+ distanceTo(e) {
2097
+ return Math.sqrt(this.distanceToSquared(e));
2098
+ }
2099
+ distanceToSquared(e) {
2100
+ const t = this.x - e.x, i = this.y - e.y;
2101
+ return t * t + i * i;
2102
+ }
2103
+ manhattanDistanceTo(e) {
2104
+ return Math.abs(this.x - e.x) + Math.abs(this.y - e.y);
2105
+ }
2106
+ setLength(e) {
2107
+ return this.normalize().multiplyScalar(e);
2108
+ }
2109
+ lerp(e, t) {
2110
+ return this.x += (e.x - this.x) * t, this.y += (e.y - this.y) * t, this;
2111
+ }
2112
+ lerpVectors(e, t, i) {
2113
+ return this.x = e.x + (t.x - e.x) * i, this.y = e.y + (t.y - e.y) * i, this;
2114
+ }
2115
+ equals(e) {
2116
+ return e.x === this.x && e.y === this.y;
2117
+ }
2118
+ fromArray(e, t = 0) {
2119
+ return this.x = e[t], this.y = e[t + 1], this;
2120
+ }
2121
+ toArray(e = [], t = 0) {
2122
+ return e[t] = this.x, e[t + 1] = this.y, e;
2123
+ }
2124
+ fromBufferAttribute(e, t) {
2125
+ return this.x = e.getX(t), this.y = e.getY(t), this;
2126
+ }
2127
+ rotateAround(e, t) {
2128
+ const i = Math.cos(t), n = Math.sin(t), r = this.x - e.x, l = this.y - e.y;
2129
+ return this.x = r * i - l * n + e.x, this.y = r * n + l * i + e.y, this;
2130
+ }
2131
+ random() {
2132
+ return this.x = Math.random(), this.y = Math.random(), this;
2133
+ }
2134
+ *[Symbol.iterator]() {
2135
+ yield this.x, yield this.y;
2136
+ }
2137
+ }
2138
+ class Ve {
2139
+ constructor(e = 0, t = 0, i = 0, n = 1) {
2140
+ this.isQuaternion = !0, this._x = e, this._y = t, this._z = i, this._w = n;
2141
+ }
2142
+ static slerpFlat(e, t, i, n, r, l, o) {
2143
+ let h = i[n + 0], a = i[n + 1], s = i[n + 2], u = i[n + 3];
2144
+ const p = r[l + 0], d = r[l + 1], _ = r[l + 2], v = r[l + 3];
2145
+ if (o === 0) {
2146
+ e[t + 0] = h, e[t + 1] = a, e[t + 2] = s, e[t + 3] = u;
2147
+ return;
2148
+ }
2149
+ if (o === 1) {
2150
+ e[t + 0] = p, e[t + 1] = d, e[t + 2] = _, e[t + 3] = v;
2151
+ return;
2152
+ }
2153
+ if (u !== v || h !== p || a !== d || s !== _) {
2154
+ let w = 1 - o;
2155
+ const S = h * p + a * d + s * _ + u * v, D = S >= 0 ? 1 : -1, P = 1 - S * S;
2156
+ if (P > Number.EPSILON) {
2157
+ const M = Math.sqrt(P), T = Math.atan2(M, S * D);
2158
+ w = Math.sin(w * T) / M, o = Math.sin(o * T) / M;
2159
+ }
2160
+ const F = o * D;
2161
+ if (h = h * w + p * F, a = a * w + d * F, s = s * w + _ * F, u = u * w + v * F, w === 1 - o) {
2162
+ const M = 1 / Math.sqrt(h * h + a * a + s * s + u * u);
2163
+ h *= M, a *= M, s *= M, u *= M;
2164
+ }
2165
+ }
2166
+ e[t] = h, e[t + 1] = a, e[t + 2] = s, e[t + 3] = u;
2167
+ }
2168
+ static multiplyQuaternionsFlat(e, t, i, n, r, l) {
2169
+ const o = i[n], h = i[n + 1], a = i[n + 2], s = i[n + 3], u = r[l], p = r[l + 1], d = r[l + 2], _ = r[l + 3];
2170
+ return e[t] = o * _ + s * u + h * d - a * p, e[t + 1] = h * _ + s * p + a * u - o * d, e[t + 2] = a * _ + s * d + o * p - h * u, e[t + 3] = s * _ - o * u - h * p - a * d, e;
2171
+ }
2172
+ get x() {
2173
+ return this._x;
2174
+ }
2175
+ set x(e) {
2176
+ this._x = e, this._onChangeCallback();
2177
+ }
2178
+ get y() {
2179
+ return this._y;
2180
+ }
2181
+ set y(e) {
2182
+ this._y = e, this._onChangeCallback();
2183
+ }
2184
+ get z() {
2185
+ return this._z;
2186
+ }
2187
+ set z(e) {
2188
+ this._z = e, this._onChangeCallback();
2189
+ }
2190
+ get w() {
2191
+ return this._w;
2192
+ }
2193
+ set w(e) {
2194
+ this._w = e, this._onChangeCallback();
2195
+ }
2196
+ set(e, t, i, n) {
2197
+ return this._x = e, this._y = t, this._z = i, this._w = n, this._onChangeCallback(), this;
2198
+ }
2199
+ clone() {
2200
+ return new this.constructor(this._x, this._y, this._z, this._w);
2201
+ }
2202
+ copy(e) {
2203
+ return this._x = e.x, this._y = e.y, this._z = e.z, this._w = e.w, this._onChangeCallback(), this;
2204
+ }
2205
+ setFromEuler(e, t = !0) {
2206
+ const i = e._x, n = e._y, r = e._z, l = e._order, o = Math.cos, h = Math.sin, a = o(i / 2), s = o(n / 2), u = o(r / 2), p = h(i / 2), d = h(n / 2), _ = h(r / 2);
2207
+ switch (l) {
2208
+ case "XYZ":
2209
+ this._x = p * s * u + a * d * _, this._y = a * d * u - p * s * _, this._z = a * s * _ + p * d * u, this._w = a * s * u - p * d * _;
2210
+ break;
2211
+ case "YXZ":
2212
+ this._x = p * s * u + a * d * _, this._y = a * d * u - p * s * _, this._z = a * s * _ - p * d * u, this._w = a * s * u + p * d * _;
2213
+ break;
2214
+ case "ZXY":
2215
+ this._x = p * s * u - a * d * _, this._y = a * d * u + p * s * _, this._z = a * s * _ + p * d * u, this._w = a * s * u - p * d * _;
2216
+ break;
2217
+ case "ZYX":
2218
+ this._x = p * s * u - a * d * _, this._y = a * d * u + p * s * _, this._z = a * s * _ - p * d * u, this._w = a * s * u + p * d * _;
2219
+ break;
2220
+ case "YZX":
2221
+ this._x = p * s * u + a * d * _, this._y = a * d * u + p * s * _, this._z = a * s * _ - p * d * u, this._w = a * s * u - p * d * _;
2222
+ break;
2223
+ case "XZY":
2224
+ this._x = p * s * u - a * d * _, this._y = a * d * u - p * s * _, this._z = a * s * _ + p * d * u, this._w = a * s * u + p * d * _;
2225
+ break;
2226
+ default:
2227
+ console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + l);
2228
+ }
2229
+ return t === !0 && this._onChangeCallback(), this;
2230
+ }
2231
+ setFromAxisAngle(e, t) {
2232
+ const i = t / 2, n = Math.sin(i);
2233
+ return this._x = e.x * n, this._y = e.y * n, this._z = e.z * n, this._w = Math.cos(i), this._onChangeCallback(), this;
2234
+ }
2235
+ setFromRotationMatrix(e) {
2236
+ const t = e.elements, i = t[0], n = t[4], r = t[8], l = t[1], o = t[5], h = t[9], a = t[2], s = t[6], u = t[10], p = i + o + u;
2237
+ if (p > 0) {
2238
+ const d = 0.5 / Math.sqrt(p + 1);
2239
+ this._w = 0.25 / d, this._x = (s - h) * d, this._y = (r - a) * d, this._z = (l - n) * d;
2240
+ } else if (i > o && i > u) {
2241
+ const d = 2 * Math.sqrt(1 + i - o - u);
2242
+ this._w = (s - h) / d, this._x = 0.25 * d, this._y = (n + l) / d, this._z = (r + a) / d;
2243
+ } else if (o > u) {
2244
+ const d = 2 * Math.sqrt(1 + o - i - u);
2245
+ this._w = (r - a) / d, this._x = (n + l) / d, this._y = 0.25 * d, this._z = (h + s) / d;
2246
+ } else {
2247
+ const d = 2 * Math.sqrt(1 + u - i - o);
2248
+ this._w = (l - n) / d, this._x = (r + a) / d, this._y = (h + s) / d, this._z = 0.25 * d;
2249
+ }
2250
+ return this._onChangeCallback(), this;
2251
+ }
2252
+ setFromUnitVectors(e, t) {
2253
+ let i = e.dot(t) + 1;
2254
+ return i < Number.EPSILON ? (i = 0, Math.abs(e.x) > Math.abs(e.z) ? (this._x = -e.y, this._y = e.x, this._z = 0, this._w = i) : (this._x = 0, this._y = -e.z, this._z = e.y, this._w = i)) : (this._x = e.y * t.z - e.z * t.y, this._y = e.z * t.x - e.x * t.z, this._z = e.x * t.y - e.y * t.x, this._w = i), this.normalize();
2255
+ }
2256
+ angleTo(e) {
2257
+ return 2 * Math.acos(Math.abs(A(this.dot(e), -1, 1)));
2258
+ }
2259
+ rotateTowards(e, t) {
2260
+ const i = this.angleTo(e);
2261
+ if (i === 0) return this;
2262
+ const n = Math.min(1, t / i);
2263
+ return this.slerp(e, n), this;
2264
+ }
2265
+ identity() {
2266
+ return this.set(0, 0, 0, 1);
2267
+ }
2268
+ invert() {
2269
+ return this.conjugate();
2270
+ }
2271
+ conjugate() {
2272
+ return this._x *= -1, this._y *= -1, this._z *= -1, this._onChangeCallback(), this;
2273
+ }
2274
+ dot(e) {
2275
+ return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w;
2276
+ }
2277
+ lengthSq() {
2278
+ return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;
2279
+ }
2280
+ length() {
2281
+ return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w);
2282
+ }
2283
+ normalize() {
2284
+ let e = this.length();
2285
+ return e === 0 ? (this._x = 0, this._y = 0, this._z = 0, this._w = 1) : (e = 1 / e, this._x = this._x * e, this._y = this._y * e, this._z = this._z * e, this._w = this._w * e), this._onChangeCallback(), this;
2286
+ }
2287
+ multiply(e) {
2288
+ return this.multiplyQuaternions(this, e);
2289
+ }
2290
+ premultiply(e) {
2291
+ return this.multiplyQuaternions(e, this);
2292
+ }
2293
+ multiplyQuaternions(e, t) {
2294
+ const i = e._x, n = e._y, r = e._z, l = e._w, o = t._x, h = t._y, a = t._z, s = t._w;
2295
+ return this._x = i * s + l * o + n * a - r * h, this._y = n * s + l * h + r * o - i * a, this._z = r * s + l * a + i * h - n * o, this._w = l * s - i * o - n * h - r * a, this._onChangeCallback(), this;
2296
+ }
2297
+ slerp(e, t) {
2298
+ if (t === 0) return this;
2299
+ if (t === 1) return this.copy(e);
2300
+ const i = this._x, n = this._y, r = this._z, l = this._w;
2301
+ let o = l * e._w + i * e._x + n * e._y + r * e._z;
2302
+ if (o < 0 ? (this._w = -e._w, this._x = -e._x, this._y = -e._y, this._z = -e._z, o = -o) : this.copy(e), o >= 1)
2303
+ return this._w = l, this._x = i, this._y = n, this._z = r, this;
2304
+ const h = 1 - o * o;
2305
+ if (h <= Number.EPSILON) {
2306
+ const d = 1 - t;
2307
+ return this._w = d * l + t * this._w, this._x = d * i + t * this._x, this._y = d * n + t * this._y, this._z = d * r + t * this._z, this.normalize(), this;
2308
+ }
2309
+ const a = Math.sqrt(h), s = Math.atan2(a, o), u = Math.sin((1 - t) * s) / a, p = Math.sin(t * s) / a;
2310
+ return this._w = l * u + this._w * p, this._x = i * u + this._x * p, this._y = n * u + this._y * p, this._z = r * u + this._z * p, this._onChangeCallback(), this;
2311
+ }
2312
+ slerpQuaternions(e, t, i) {
2313
+ return this.copy(e).slerp(t, i);
2314
+ }
2315
+ random() {
2316
+ const e = 2 * Math.PI * Math.random(), t = 2 * Math.PI * Math.random(), i = Math.random(), n = Math.sqrt(1 - i), r = Math.sqrt(i);
2317
+ return this.set(
2318
+ n * Math.sin(e),
2319
+ n * Math.cos(e),
2320
+ r * Math.sin(t),
2321
+ r * Math.cos(t)
2322
+ );
2323
+ }
2324
+ equals(e) {
2325
+ return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w;
2326
+ }
2327
+ fromArray(e, t = 0) {
2328
+ return this._x = e[t], this._y = e[t + 1], this._z = e[t + 2], this._w = e[t + 3], this._onChangeCallback(), this;
2329
+ }
2330
+ toArray(e = [], t = 0) {
2331
+ return e[t] = this._x, e[t + 1] = this._y, e[t + 2] = this._z, e[t + 3] = this._w, e;
2332
+ }
2333
+ fromBufferAttribute(e, t) {
2334
+ return this._x = e.getX(t), this._y = e.getY(t), this._z = e.getZ(t), this._w = e.getW(t), this._onChangeCallback(), this;
2335
+ }
2336
+ toJSON() {
2337
+ return this.toArray();
2338
+ }
2339
+ _onChange(e) {
2340
+ return this._onChangeCallback = e, this;
2341
+ }
2342
+ _onChangeCallback() {
2343
+ }
2344
+ *[Symbol.iterator]() {
2345
+ yield this._x, yield this._y, yield this._z, yield this._w;
2346
+ }
2347
+ }
2348
+ class B {
2349
+ constructor(e = 0, t = 0, i = 0) {
2350
+ B.prototype.isVector3 = !0, this.x = e, this.y = t, this.z = i;
2351
+ }
2352
+ set(e, t, i) {
2353
+ return i === void 0 && (i = this.z), this.x = e, this.y = t, this.z = i, this;
2354
+ }
2355
+ setScalar(e) {
2356
+ return this.x = e, this.y = e, this.z = e, this;
2357
+ }
2358
+ setX(e) {
2359
+ return this.x = e, this;
2360
+ }
2361
+ setY(e) {
2362
+ return this.y = e, this;
2363
+ }
2364
+ setZ(e) {
2365
+ return this.z = e, this;
2366
+ }
2367
+ setComponent(e, t) {
2368
+ switch (e) {
2369
+ case 0:
2370
+ this.x = t;
2371
+ break;
2372
+ case 1:
2373
+ this.y = t;
2374
+ break;
2375
+ case 2:
2376
+ this.z = t;
2377
+ break;
2378
+ default:
2379
+ throw new Error("index is out of range: " + e);
2380
+ }
2381
+ return this;
2382
+ }
2383
+ getComponent(e) {
2384
+ switch (e) {
2385
+ case 0:
2386
+ return this.x;
2387
+ case 1:
2388
+ return this.y;
2389
+ case 2:
2390
+ return this.z;
2391
+ default:
2392
+ throw new Error("index is out of range: " + e);
2393
+ }
2394
+ }
2395
+ clone() {
2396
+ return new this.constructor(this.x, this.y, this.z);
2397
+ }
2398
+ copy(e) {
2399
+ return this.x = e.x, this.y = e.y, this.z = e.z, this;
2400
+ }
2401
+ add(e) {
2402
+ return this.x += e.x, this.y += e.y, this.z += e.z, this;
2403
+ }
2404
+ addScalar(e) {
2405
+ return this.x += e, this.y += e, this.z += e, this;
2406
+ }
2407
+ addVectors(e, t) {
2408
+ return this.x = e.x + t.x, this.y = e.y + t.y, this.z = e.z + t.z, this;
2409
+ }
2410
+ addScaledVector(e, t) {
2411
+ return this.x += e.x * t, this.y += e.y * t, this.z += e.z * t, this;
2412
+ }
2413
+ sub(e) {
2414
+ return this.x -= e.x, this.y -= e.y, this.z -= e.z, this;
2415
+ }
2416
+ subScalar(e) {
2417
+ return this.x -= e, this.y -= e, this.z -= e, this;
2418
+ }
2419
+ subVectors(e, t) {
2420
+ return this.x = e.x - t.x, this.y = e.y - t.y, this.z = e.z - t.z, this;
2421
+ }
2422
+ multiply(e) {
2423
+ return this.x *= e.x, this.y *= e.y, this.z *= e.z, this;
2424
+ }
2425
+ multiplyScalar(e) {
2426
+ return this.x *= e, this.y *= e, this.z *= e, this;
2427
+ }
2428
+ multiplyVectors(e, t) {
2429
+ return this.x = e.x * t.x, this.y = e.y * t.y, this.z = e.z * t.z, this;
2430
+ }
2431
+ applyEuler(e) {
2432
+ return this.applyQuaternion(J.setFromEuler(e));
2433
+ }
2434
+ applyAxisAngle(e, t) {
2435
+ return this.applyQuaternion(J.setFromAxisAngle(e, t));
2436
+ }
2437
+ applyMatrix3(e) {
2438
+ const t = this.x, i = this.y, n = this.z, r = e.elements;
2439
+ return this.x = r[0] * t + r[3] * i + r[6] * n, this.y = r[1] * t + r[4] * i + r[7] * n, this.z = r[2] * t + r[5] * i + r[8] * n, this;
2440
+ }
2441
+ applyNormalMatrix(e) {
2442
+ return this.applyMatrix3(e).normalize();
2443
+ }
2444
+ applyMatrix4(e) {
2445
+ const t = this.x, i = this.y, n = this.z, r = e.elements, l = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
2446
+ return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * l, this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * l, this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * l, this;
2447
+ }
2448
+ applyQuaternion(e) {
2449
+ const t = this.x, i = this.y, n = this.z, r = e.x, l = e.y, o = e.z, h = e.w, a = 2 * (l * n - o * i), s = 2 * (o * t - r * n), u = 2 * (r * i - l * t);
2450
+ return this.x = t + h * a + l * u - o * s, this.y = i + h * s + o * a - r * u, this.z = n + h * u + r * s - l * a, this;
2451
+ }
2452
+ project(e) {
2453
+ return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix);
2454
+ }
2455
+ unproject(e) {
2456
+ return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld);
2457
+ }
2458
+ transformDirection(e) {
2459
+ const t = this.x, i = this.y, n = this.z, r = e.elements;
2460
+ return this.x = r[0] * t + r[4] * i + r[8] * n, this.y = r[1] * t + r[5] * i + r[9] * n, this.z = r[2] * t + r[6] * i + r[10] * n, this.normalize();
2461
+ }
2462
+ divide(e) {
2463
+ return this.x /= e.x, this.y /= e.y, this.z /= e.z, this;
2464
+ }
2465
+ divideScalar(e) {
2466
+ return this.multiplyScalar(1 / e);
2467
+ }
2468
+ min(e) {
2469
+ return this.x = Math.min(this.x, e.x), this.y = Math.min(this.y, e.y), this.z = Math.min(this.z, e.z), this;
2470
+ }
2471
+ max(e) {
2472
+ return this.x = Math.max(this.x, e.x), this.y = Math.max(this.y, e.y), this.z = Math.max(this.z, e.z), this;
2473
+ }
2474
+ clamp(e, t) {
2475
+ return this.x = Math.max(e.x, Math.min(t.x, this.x)), this.y = Math.max(e.y, Math.min(t.y, this.y)), this.z = Math.max(e.z, Math.min(t.z, this.z)), this;
2476
+ }
2477
+ clampScalar(e, t) {
2478
+ return this.x = Math.max(e, Math.min(t, this.x)), this.y = Math.max(e, Math.min(t, this.y)), this.z = Math.max(e, Math.min(t, this.z)), this;
2479
+ }
2480
+ clampLength(e, t) {
2481
+ const i = this.length();
2482
+ return this.divideScalar(i || 1).multiplyScalar(Math.max(e, Math.min(t, i)));
2483
+ }
2484
+ floor() {
2485
+ return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this;
2486
+ }
2487
+ ceil() {
2488
+ return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this;
2489
+ }
2490
+ round() {
2491
+ return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this;
2492
+ }
2493
+ roundToZero() {
2494
+ return this.x = Math.trunc(this.x), this.y = Math.trunc(this.y), this.z = Math.trunc(this.z), this;
2495
+ }
2496
+ negate() {
2497
+ return this.x = -this.x, this.y = -this.y, this.z = -this.z, this;
2498
+ }
2499
+ dot(e) {
2500
+ return this.x * e.x + this.y * e.y + this.z * e.z;
2501
+ }
2502
+ // TODO lengthSquared?
2503
+ lengthSq() {
2504
+ return this.x * this.x + this.y * this.y + this.z * this.z;
2505
+ }
2506
+ length() {
2507
+ return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
2508
+ }
2509
+ manhattanLength() {
2510
+ return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z);
2511
+ }
2512
+ normalize() {
2513
+ return this.divideScalar(this.length() || 1);
2514
+ }
2515
+ setLength(e) {
2516
+ return this.normalize().multiplyScalar(e);
2517
+ }
2518
+ lerp(e, t) {
2519
+ return this.x += (e.x - this.x) * t, this.y += (e.y - this.y) * t, this.z += (e.z - this.z) * t, this;
2520
+ }
2521
+ lerpVectors(e, t, i) {
2522
+ return this.x = e.x + (t.x - e.x) * i, this.y = e.y + (t.y - e.y) * i, this.z = e.z + (t.z - e.z) * i, this;
2523
+ }
2524
+ cross(e) {
2525
+ return this.crossVectors(this, e);
2526
+ }
2527
+ crossVectors(e, t) {
2528
+ const i = e.x, n = e.y, r = e.z, l = t.x, o = t.y, h = t.z;
2529
+ return this.x = n * h - r * o, this.y = r * l - i * h, this.z = i * o - n * l, this;
2530
+ }
2531
+ projectOnVector(e) {
2532
+ const t = e.lengthSq();
2533
+ if (t === 0) return this.set(0, 0, 0);
2534
+ const i = e.dot(this) / t;
2535
+ return this.copy(e).multiplyScalar(i);
2536
+ }
2537
+ projectOnPlane(e) {
2538
+ return V.copy(this).projectOnVector(e), this.sub(V);
2539
+ }
2540
+ reflect(e) {
2541
+ return this.sub(V.copy(e).multiplyScalar(2 * this.dot(e)));
2542
+ }
2543
+ angleTo(e) {
2544
+ const t = Math.sqrt(this.lengthSq() * e.lengthSq());
2545
+ if (t === 0) return Math.PI / 2;
2546
+ const i = this.dot(e) / t;
2547
+ return Math.acos(A(i, -1, 1));
2548
+ }
2549
+ distanceTo(e) {
2550
+ return Math.sqrt(this.distanceToSquared(e));
2551
+ }
2552
+ distanceToSquared(e) {
2553
+ const t = this.x - e.x, i = this.y - e.y, n = this.z - e.z;
2554
+ return t * t + i * i + n * n;
2555
+ }
2556
+ manhattanDistanceTo(e) {
2557
+ return Math.abs(this.x - e.x) + Math.abs(this.y - e.y) + Math.abs(this.z - e.z);
2558
+ }
2559
+ setFromSpherical(e) {
2560
+ return this.setFromSphericalCoords(e.radius, e.phi, e.theta);
2561
+ }
2562
+ setFromSphericalCoords(e, t, i) {
2563
+ const n = Math.sin(t) * e;
2564
+ return this.x = n * Math.sin(i), this.y = Math.cos(t) * e, this.z = n * Math.cos(i), this;
2565
+ }
2566
+ setFromCylindrical(e) {
2567
+ return this.setFromCylindricalCoords(e.radius, e.theta, e.y);
2568
+ }
2569
+ setFromCylindricalCoords(e, t, i) {
2570
+ return this.x = e * Math.sin(t), this.y = i, this.z = e * Math.cos(t), this;
2571
+ }
2572
+ setFromMatrixPosition(e) {
2573
+ const t = e.elements;
2574
+ return this.x = t[12], this.y = t[13], this.z = t[14], this;
2575
+ }
2576
+ setFromMatrixScale(e) {
2577
+ const t = this.setFromMatrixColumn(e, 0).length(), i = this.setFromMatrixColumn(e, 1).length(), n = this.setFromMatrixColumn(e, 2).length();
2578
+ return this.x = t, this.y = i, this.z = n, this;
2579
+ }
2580
+ setFromMatrixColumn(e, t) {
2581
+ return this.fromArray(e.elements, t * 4);
2582
+ }
2583
+ setFromMatrix3Column(e, t) {
2584
+ return this.fromArray(e.elements, t * 3);
2585
+ }
2586
+ setFromEuler(e) {
2587
+ return this.x = e._x, this.y = e._y, this.z = e._z, this;
2588
+ }
2589
+ setFromColor(e) {
2590
+ return this.x = e.r, this.y = e.g, this.z = e.b, this;
2591
+ }
2592
+ equals(e) {
2593
+ return e.x === this.x && e.y === this.y && e.z === this.z;
2594
+ }
2595
+ fromArray(e, t = 0) {
2596
+ return this.x = e[t], this.y = e[t + 1], this.z = e[t + 2], this;
2597
+ }
2598
+ toArray(e = [], t = 0) {
2599
+ return e[t] = this.x, e[t + 1] = this.y, e[t + 2] = this.z, e;
2600
+ }
2601
+ fromBufferAttribute(e, t) {
2602
+ return this.x = e.getX(t), this.y = e.getY(t), this.z = e.getZ(t), this;
2603
+ }
2604
+ random() {
2605
+ return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this;
2606
+ }
2607
+ randomDirection() {
2608
+ const e = Math.random() * Math.PI * 2, t = Math.random() * 2 - 1, i = Math.sqrt(1 - t * t);
2609
+ return this.x = i * Math.cos(e), this.y = t, this.z = i * Math.sin(e), this;
2610
+ }
2611
+ *[Symbol.iterator]() {
2612
+ yield this.x, yield this.y, yield this.z;
2613
+ }
2614
+ }
2615
+ const V = /* @__PURE__ */ new B(), J = /* @__PURE__ */ new Ve(), te = {
2616
+ aliceblue: 15792383,
2617
+ antiquewhite: 16444375,
2618
+ aqua: 65535,
2619
+ aquamarine: 8388564,
2620
+ azure: 15794175,
2621
+ beige: 16119260,
2622
+ bisque: 16770244,
2623
+ black: 0,
2624
+ blanchedalmond: 16772045,
2625
+ blue: 255,
2626
+ blueviolet: 9055202,
2627
+ brown: 10824234,
2628
+ burlywood: 14596231,
2629
+ cadetblue: 6266528,
2630
+ chartreuse: 8388352,
2631
+ chocolate: 13789470,
2632
+ coral: 16744272,
2633
+ cornflowerblue: 6591981,
2634
+ cornsilk: 16775388,
2635
+ crimson: 14423100,
2636
+ cyan: 65535,
2637
+ darkblue: 139,
2638
+ darkcyan: 35723,
2639
+ darkgoldenrod: 12092939,
2640
+ darkgray: 11119017,
2641
+ darkgreen: 25600,
2642
+ darkgrey: 11119017,
2643
+ darkkhaki: 12433259,
2644
+ darkmagenta: 9109643,
2645
+ darkolivegreen: 5597999,
2646
+ darkorange: 16747520,
2647
+ darkorchid: 10040012,
2648
+ darkred: 9109504,
2649
+ darksalmon: 15308410,
2650
+ darkseagreen: 9419919,
2651
+ darkslateblue: 4734347,
2652
+ darkslategray: 3100495,
2653
+ darkslategrey: 3100495,
2654
+ darkturquoise: 52945,
2655
+ darkviolet: 9699539,
2656
+ deeppink: 16716947,
2657
+ deepskyblue: 49151,
2658
+ dimgray: 6908265,
2659
+ dimgrey: 6908265,
2660
+ dodgerblue: 2003199,
2661
+ firebrick: 11674146,
2662
+ floralwhite: 16775920,
2663
+ forestgreen: 2263842,
2664
+ fuchsia: 16711935,
2665
+ gainsboro: 14474460,
2666
+ ghostwhite: 16316671,
2667
+ gold: 16766720,
2668
+ goldenrod: 14329120,
2669
+ gray: 8421504,
2670
+ green: 32768,
2671
+ greenyellow: 11403055,
2672
+ grey: 8421504,
2673
+ honeydew: 15794160,
2674
+ hotpink: 16738740,
2675
+ indianred: 13458524,
2676
+ indigo: 4915330,
2677
+ ivory: 16777200,
2678
+ khaki: 15787660,
2679
+ lavender: 15132410,
2680
+ lavenderblush: 16773365,
2681
+ lawngreen: 8190976,
2682
+ lemonchiffon: 16775885,
2683
+ lightblue: 11393254,
2684
+ lightcoral: 15761536,
2685
+ lightcyan: 14745599,
2686
+ lightgoldenrodyellow: 16448210,
2687
+ lightgray: 13882323,
2688
+ lightgreen: 9498256,
2689
+ lightgrey: 13882323,
2690
+ lightpink: 16758465,
2691
+ lightsalmon: 16752762,
2692
+ lightseagreen: 2142890,
2693
+ lightskyblue: 8900346,
2694
+ lightslategray: 7833753,
2695
+ lightslategrey: 7833753,
2696
+ lightsteelblue: 11584734,
2697
+ lightyellow: 16777184,
2698
+ lime: 65280,
2699
+ limegreen: 3329330,
2700
+ linen: 16445670,
2701
+ magenta: 16711935,
2702
+ maroon: 8388608,
2703
+ mediumaquamarine: 6737322,
2704
+ mediumblue: 205,
2705
+ mediumorchid: 12211667,
2706
+ mediumpurple: 9662683,
2707
+ mediumseagreen: 3978097,
2708
+ mediumslateblue: 8087790,
2709
+ mediumspringgreen: 64154,
2710
+ mediumturquoise: 4772300,
2711
+ mediumvioletred: 13047173,
2712
+ midnightblue: 1644912,
2713
+ mintcream: 16121850,
2714
+ mistyrose: 16770273,
2715
+ moccasin: 16770229,
2716
+ navajowhite: 16768685,
2717
+ navy: 128,
2718
+ oldlace: 16643558,
2719
+ olive: 8421376,
2720
+ olivedrab: 7048739,
2721
+ orange: 16753920,
2722
+ orangered: 16729344,
2723
+ orchid: 14315734,
2724
+ palegoldenrod: 15657130,
2725
+ palegreen: 10025880,
2726
+ paleturquoise: 11529966,
2727
+ palevioletred: 14381203,
2728
+ papayawhip: 16773077,
2729
+ peachpuff: 16767673,
2730
+ peru: 13468991,
2731
+ pink: 16761035,
2732
+ plum: 14524637,
2733
+ powderblue: 11591910,
2734
+ purple: 8388736,
2735
+ rebeccapurple: 6697881,
2736
+ red: 16711680,
2737
+ rosybrown: 12357519,
2738
+ royalblue: 4286945,
2739
+ saddlebrown: 9127187,
2740
+ salmon: 16416882,
2741
+ sandybrown: 16032864,
2742
+ seagreen: 3050327,
2743
+ seashell: 16774638,
2744
+ sienna: 10506797,
2745
+ silver: 12632256,
2746
+ skyblue: 8900331,
2747
+ slateblue: 6970061,
2748
+ slategray: 7372944,
2749
+ slategrey: 7372944,
2750
+ snow: 16775930,
2751
+ springgreen: 65407,
2752
+ steelblue: 4620980,
2753
+ tan: 13808780,
2754
+ teal: 32896,
2755
+ thistle: 14204888,
2756
+ tomato: 16737095,
2757
+ turquoise: 4251856,
2758
+ violet: 15631086,
2759
+ wheat: 16113331,
2760
+ white: 16777215,
2761
+ whitesmoke: 16119285,
2762
+ yellow: 16776960,
2763
+ yellowgreen: 10145074
2764
+ }, z = { h: 0, s: 0, l: 0 }, R = { h: 0, s: 0, l: 0 };
2765
+ function j(m, e, t) {
2766
+ return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? m + (e - m) * 6 * t : t < 1 / 2 ? e : t < 2 / 3 ? m + (e - m) * 6 * (2 / 3 - t) : m;
2767
+ }
2768
+ class y {
2769
+ constructor(e, t, i) {
2770
+ return this.isColor = !0, this.r = 1, this.g = 1, this.b = 1, this.set(e, t, i);
2771
+ }
2772
+ set(e, t, i) {
2773
+ if (t === void 0 && i === void 0) {
2774
+ const n = e;
2775
+ n && n.isColor ? this.copy(n) : typeof n == "number" ? this.setHex(n) : typeof n == "string" && this.setStyle(n);
2776
+ } else
2777
+ this.setRGB(e, t, i);
2778
+ return this;
2779
+ }
2780
+ setScalar(e) {
2781
+ return this.r = e, this.g = e, this.b = e, this;
2782
+ }
2783
+ setHex(e, t = E) {
2784
+ return e = Math.floor(e), this.r = (e >> 16 & 255) / 255, this.g = (e >> 8 & 255) / 255, this.b = (e & 255) / 255, C.toWorkingColorSpace(this, t), this;
2785
+ }
2786
+ setRGB(e, t, i, n = C.workingColorSpace) {
2787
+ return this.r = e, this.g = t, this.b = i, C.toWorkingColorSpace(this, n), this;
2788
+ }
2789
+ setHSL(e, t, i, n = C.workingColorSpace) {
2790
+ if (e = Ge(e, 1), t = A(t, 0, 1), i = A(i, 0, 1), t === 0)
2791
+ this.r = this.g = this.b = i;
2792
+ else {
2793
+ const r = i <= 0.5 ? i * (1 + t) : i + t - i * t, l = 2 * i - r;
2794
+ this.r = j(l, r, e + 1 / 3), this.g = j(l, r, e), this.b = j(l, r, e - 1 / 3);
2795
+ }
2796
+ return C.toWorkingColorSpace(this, n), this;
2797
+ }
2798
+ setStyle(e, t = E) {
2799
+ function i(r) {
2800
+ r !== void 0 && parseFloat(r) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored.");
2801
+ }
2802
+ let n;
2803
+ if (n = /^(\w+)\(([^\)]*)\)/.exec(e)) {
2804
+ let r;
2805
+ const l = n[1], o = n[2];
2806
+ switch (l) {
2807
+ case "rgb":
2808
+ case "rgba":
2809
+ if (r = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))
2810
+ return i(r[4]), this.setRGB(
2811
+ Math.min(255, parseInt(r[1], 10)) / 255,
2812
+ Math.min(255, parseInt(r[2], 10)) / 255,
2813
+ Math.min(255, parseInt(r[3], 10)) / 255,
2814
+ t
2815
+ );
2816
+ if (r = /^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))
2817
+ return i(r[4]), this.setRGB(
2818
+ Math.min(100, parseInt(r[1], 10)) / 100,
2819
+ Math.min(100, parseInt(r[2], 10)) / 100,
2820
+ Math.min(100, parseInt(r[3], 10)) / 100,
2821
+ t
2822
+ );
2823
+ break;
2824
+ case "hsl":
2825
+ case "hsla":
2826
+ if (r = /^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))
2827
+ return i(r[4]), this.setHSL(
2828
+ parseFloat(r[1]) / 360,
2829
+ parseFloat(r[2]) / 100,
2830
+ parseFloat(r[3]) / 100,
2831
+ t
2832
+ );
2833
+ break;
2834
+ default:
2835
+ console.warn("THREE.Color: Unknown color model " + e);
2836
+ }
2837
+ } else if (n = /^\#([A-Fa-f\d]+)$/.exec(e)) {
2838
+ const r = n[1], l = r.length;
2839
+ if (l === 3)
2840
+ return this.setRGB(
2841
+ parseInt(r.charAt(0), 16) / 15,
2842
+ parseInt(r.charAt(1), 16) / 15,
2843
+ parseInt(r.charAt(2), 16) / 15,
2844
+ t
2845
+ );
2846
+ if (l === 6)
2847
+ return this.setHex(parseInt(r, 16), t);
2848
+ console.warn("THREE.Color: Invalid hex color " + e);
2849
+ } else if (e && e.length > 0)
2850
+ return this.setColorName(e, t);
2851
+ return this;
2852
+ }
2853
+ setColorName(e, t = E) {
2854
+ const i = te[e.toLowerCase()];
2855
+ return i !== void 0 ? this.setHex(i, t) : console.warn("THREE.Color: Unknown color " + e), this;
2856
+ }
2857
+ clone() {
2858
+ return new this.constructor(this.r, this.g, this.b);
2859
+ }
2860
+ copy(e) {
2861
+ return this.r = e.r, this.g = e.g, this.b = e.b, this;
2862
+ }
2863
+ copySRGBToLinear(e) {
2864
+ return this.r = U(e.r), this.g = U(e.g), this.b = U(e.b), this;
2865
+ }
2866
+ copyLinearToSRGB(e) {
2867
+ return this.r = q(e.r), this.g = q(e.g), this.b = q(e.b), this;
2868
+ }
2869
+ convertSRGBToLinear() {
2870
+ return this.copySRGBToLinear(this), this;
2871
+ }
2872
+ convertLinearToSRGB() {
2873
+ return this.copyLinearToSRGB(this), this;
2874
+ }
2875
+ getHex(e = E) {
2876
+ return C.fromWorkingColorSpace(x.copy(this), e), Math.round(A(x.r * 255, 0, 255)) * 65536 + Math.round(A(x.g * 255, 0, 255)) * 256 + Math.round(A(x.b * 255, 0, 255));
2877
+ }
2878
+ getHexString(e = E) {
2879
+ return ("000000" + this.getHex(e).toString(16)).slice(-6);
2880
+ }
2881
+ getHSL(e, t = C.workingColorSpace) {
2882
+ C.fromWorkingColorSpace(x.copy(this), t);
2883
+ const i = x.r, n = x.g, r = x.b, l = Math.max(i, n, r), o = Math.min(i, n, r);
2884
+ let h, a;
2885
+ const s = (o + l) / 2;
2886
+ if (o === l)
2887
+ h = 0, a = 0;
2888
+ else {
2889
+ const u = l - o;
2890
+ switch (a = s <= 0.5 ? u / (l + o) : u / (2 - l - o), l) {
2891
+ case i:
2892
+ h = (n - r) / u + (n < r ? 6 : 0);
2893
+ break;
2894
+ case n:
2895
+ h = (r - i) / u + 2;
2896
+ break;
2897
+ case r:
2898
+ h = (i - n) / u + 4;
2899
+ break;
2900
+ }
2901
+ h /= 6;
2902
+ }
2903
+ return e.h = h, e.s = a, e.l = s, e;
2904
+ }
2905
+ getRGB(e, t = C.workingColorSpace) {
2906
+ return C.fromWorkingColorSpace(x.copy(this), t), e.r = x.r, e.g = x.g, e.b = x.b, e;
2907
+ }
2908
+ getStyle(e = E) {
2909
+ C.fromWorkingColorSpace(x.copy(this), e);
2910
+ const t = x.r, i = x.g, n = x.b;
2911
+ return e !== E ? `color(${e} ${t.toFixed(3)} ${i.toFixed(3)} ${n.toFixed(3)})` : `rgb(${Math.round(t * 255)},${Math.round(i * 255)},${Math.round(n * 255)})`;
2912
+ }
2913
+ offsetHSL(e, t, i) {
2914
+ return this.getHSL(z), this.setHSL(z.h + e, z.s + t, z.l + i);
2915
+ }
2916
+ add(e) {
2917
+ return this.r += e.r, this.g += e.g, this.b += e.b, this;
2918
+ }
2919
+ addColors(e, t) {
2920
+ return this.r = e.r + t.r, this.g = e.g + t.g, this.b = e.b + t.b, this;
2921
+ }
2922
+ addScalar(e) {
2923
+ return this.r += e, this.g += e, this.b += e, this;
2924
+ }
2925
+ sub(e) {
2926
+ return this.r = Math.max(0, this.r - e.r), this.g = Math.max(0, this.g - e.g), this.b = Math.max(0, this.b - e.b), this;
2927
+ }
2928
+ multiply(e) {
2929
+ return this.r *= e.r, this.g *= e.g, this.b *= e.b, this;
2930
+ }
2931
+ multiplyScalar(e) {
2932
+ return this.r *= e, this.g *= e, this.b *= e, this;
2933
+ }
2934
+ lerp(e, t) {
2935
+ return this.r += (e.r - this.r) * t, this.g += (e.g - this.g) * t, this.b += (e.b - this.b) * t, this;
2936
+ }
2937
+ lerpColors(e, t, i) {
2938
+ return this.r = e.r + (t.r - e.r) * i, this.g = e.g + (t.g - e.g) * i, this.b = e.b + (t.b - e.b) * i, this;
2939
+ }
2940
+ lerpHSL(e, t) {
2941
+ this.getHSL(z), e.getHSL(R);
2942
+ const i = G(z.h, R.h, t), n = G(z.s, R.s, t), r = G(z.l, R.l, t);
2943
+ return this.setHSL(i, n, r), this;
2944
+ }
2945
+ setFromVector3(e) {
2946
+ return this.r = e.x, this.g = e.y, this.b = e.z, this;
2947
+ }
2948
+ applyMatrix3(e) {
2949
+ const t = this.r, i = this.g, n = this.b, r = e.elements;
2950
+ return this.r = r[0] * t + r[3] * i + r[6] * n, this.g = r[1] * t + r[4] * i + r[7] * n, this.b = r[2] * t + r[5] * i + r[8] * n, this;
2951
+ }
2952
+ equals(e) {
2953
+ return e.r === this.r && e.g === this.g && e.b === this.b;
2954
+ }
2955
+ fromArray(e, t = 0) {
2956
+ return this.r = e[t], this.g = e[t + 1], this.b = e[t + 2], this;
2957
+ }
2958
+ toArray(e = [], t = 0) {
2959
+ return e[t] = this.r, e[t + 1] = this.g, e[t + 2] = this.b, e;
2960
+ }
2961
+ fromBufferAttribute(e, t) {
2962
+ return this.r = e.getX(t), this.g = e.getY(t), this.b = e.getZ(t), this;
2963
+ }
2964
+ toJSON() {
2965
+ return this.getHex();
2966
+ }
2967
+ *[Symbol.iterator]() {
2968
+ yield this.r, yield this.g, yield this.b;
2969
+ }
2970
+ }
2971
+ const x = /* @__PURE__ */ new y();
2972
+ y.NAMES = te;
2973
+ const c = {
2974
+ common: {
2975
+ diffuse: { value: /* @__PURE__ */ new y(16777215) },
2976
+ opacity: { value: 1 },
2977
+ map: { value: null },
2978
+ mapTransform: { value: /* @__PURE__ */ new f() },
2979
+ alphaMap: { value: null },
2980
+ alphaMapTransform: { value: /* @__PURE__ */ new f() },
2981
+ alphaTest: { value: 0 }
2982
+ },
2983
+ specularmap: {
2984
+ specularMap: { value: null },
2985
+ specularMapTransform: { value: /* @__PURE__ */ new f() }
2986
+ },
2987
+ envmap: {
2988
+ envMap: { value: null },
2989
+ envMapRotation: { value: /* @__PURE__ */ new f() },
2990
+ flipEnvMap: { value: -1 },
2991
+ reflectivity: { value: 1 },
2992
+ // basic, lambert, phong
2993
+ ior: { value: 1.5 },
2994
+ // physical
2995
+ refractionRatio: { value: 0.98 }
2996
+ // basic, lambert, phong
2997
+ },
2998
+ aomap: {
2999
+ aoMap: { value: null },
3000
+ aoMapIntensity: { value: 1 },
3001
+ aoMapTransform: { value: /* @__PURE__ */ new f() }
3002
+ },
3003
+ lightmap: {
3004
+ lightMap: { value: null },
3005
+ lightMapIntensity: { value: 1 },
3006
+ lightMapTransform: { value: /* @__PURE__ */ new f() }
3007
+ },
3008
+ bumpmap: {
3009
+ bumpMap: { value: null },
3010
+ bumpMapTransform: { value: /* @__PURE__ */ new f() },
3011
+ bumpScale: { value: 1 }
3012
+ },
3013
+ normalmap: {
3014
+ normalMap: { value: null },
3015
+ normalMapTransform: { value: /* @__PURE__ */ new f() },
3016
+ normalScale: { value: /* @__PURE__ */ new k(1, 1) }
3017
+ },
3018
+ displacementmap: {
3019
+ displacementMap: { value: null },
3020
+ displacementMapTransform: { value: /* @__PURE__ */ new f() },
3021
+ displacementScale: { value: 1 },
3022
+ displacementBias: { value: 0 }
3023
+ },
3024
+ emissivemap: {
3025
+ emissiveMap: { value: null },
3026
+ emissiveMapTransform: { value: /* @__PURE__ */ new f() }
3027
+ },
3028
+ metalnessmap: {
3029
+ metalnessMap: { value: null },
3030
+ metalnessMapTransform: { value: /* @__PURE__ */ new f() }
3031
+ },
3032
+ roughnessmap: {
3033
+ roughnessMap: { value: null },
3034
+ roughnessMapTransform: { value: /* @__PURE__ */ new f() }
3035
+ },
3036
+ gradientmap: {
3037
+ gradientMap: { value: null }
3038
+ },
3039
+ fog: {
3040
+ fogDensity: { value: 25e-5 },
3041
+ fogNear: { value: 1 },
3042
+ fogFar: { value: 2e3 },
3043
+ fogColor: { value: /* @__PURE__ */ new y(16777215) }
3044
+ },
3045
+ lights: {
3046
+ ambientLightColor: { value: [] },
3047
+ lightProbe: { value: [] },
3048
+ directionalLights: { value: [], properties: {
3049
+ direction: {},
3050
+ color: {}
3051
+ } },
3052
+ directionalLightShadows: { value: [], properties: {
3053
+ shadowBias: {},
3054
+ shadowNormalBias: {},
3055
+ shadowRadius: {},
3056
+ shadowMapSize: {}
3057
+ } },
3058
+ directionalShadowMap: { value: [] },
3059
+ directionalShadowMatrix: { value: [] },
3060
+ spotLights: { value: [], properties: {
3061
+ color: {},
3062
+ position: {},
3063
+ direction: {},
3064
+ distance: {},
3065
+ coneCos: {},
3066
+ penumbraCos: {},
3067
+ decay: {}
3068
+ } },
3069
+ spotLightShadows: { value: [], properties: {
3070
+ shadowBias: {},
3071
+ shadowNormalBias: {},
3072
+ shadowRadius: {},
3073
+ shadowMapSize: {}
3074
+ } },
3075
+ spotLightMap: { value: [] },
3076
+ spotShadowMap: { value: [] },
3077
+ spotLightMatrix: { value: [] },
3078
+ pointLights: { value: [], properties: {
3079
+ color: {},
3080
+ position: {},
3081
+ decay: {},
3082
+ distance: {}
3083
+ } },
3084
+ pointLightShadows: { value: [], properties: {
3085
+ shadowBias: {},
3086
+ shadowNormalBias: {},
3087
+ shadowRadius: {},
3088
+ shadowMapSize: {},
3089
+ shadowCameraNear: {},
3090
+ shadowCameraFar: {}
3091
+ } },
3092
+ pointShadowMap: { value: [] },
3093
+ pointShadowMatrix: { value: [] },
3094
+ hemisphereLights: { value: [], properties: {
3095
+ direction: {},
3096
+ skyColor: {},
3097
+ groundColor: {}
3098
+ } },
3099
+ // TODO (abelnation): RectAreaLight BRDF data needs to be moved from example to main src
3100
+ rectAreaLights: { value: [], properties: {
3101
+ color: {},
3102
+ position: {},
3103
+ width: {},
3104
+ height: {}
3105
+ } },
3106
+ ltc_1: { value: null },
3107
+ ltc_2: { value: null }
3108
+ },
3109
+ points: {
3110
+ diffuse: { value: /* @__PURE__ */ new y(16777215) },
3111
+ opacity: { value: 1 },
3112
+ size: { value: 1 },
3113
+ scale: { value: 1 },
3114
+ map: { value: null },
3115
+ alphaMap: { value: null },
3116
+ alphaMapTransform: { value: /* @__PURE__ */ new f() },
3117
+ alphaTest: { value: 0 },
3118
+ uvTransform: { value: /* @__PURE__ */ new f() }
3119
+ },
3120
+ sprite: {
3121
+ diffuse: { value: /* @__PURE__ */ new y(16777215) },
3122
+ opacity: { value: 1 },
3123
+ center: { value: /* @__PURE__ */ new k(0.5, 0.5) },
3124
+ rotation: { value: 0 },
3125
+ map: { value: null },
3126
+ mapTransform: { value: /* @__PURE__ */ new f() },
3127
+ alphaMap: { value: null },
3128
+ alphaMapTransform: { value: /* @__PURE__ */ new f() },
3129
+ alphaTest: { value: 0 }
3130
+ }
3131
+ }, $ = {
3132
+ basic: {
3133
+ uniforms: /* @__PURE__ */ b([
3134
+ c.common,
3135
+ c.specularmap,
3136
+ c.envmap,
3137
+ c.aomap,
3138
+ c.lightmap,
3139
+ c.fog
3140
+ ]),
3141
+ vertexShader: g.meshbasic_vert,
3142
+ fragmentShader: g.meshbasic_frag
3143
+ },
3144
+ lambert: {
3145
+ uniforms: /* @__PURE__ */ b([
3146
+ c.common,
3147
+ c.specularmap,
3148
+ c.envmap,
3149
+ c.aomap,
3150
+ c.lightmap,
3151
+ c.emissivemap,
3152
+ c.bumpmap,
3153
+ c.normalmap,
3154
+ c.displacementmap,
3155
+ c.fog,
3156
+ c.lights,
3157
+ {
3158
+ emissive: { value: /* @__PURE__ */ new y(0) }
3159
+ }
3160
+ ]),
3161
+ vertexShader: g.meshlambert_vert,
3162
+ fragmentShader: g.meshlambert_frag
3163
+ },
3164
+ phong: {
3165
+ uniforms: /* @__PURE__ */ b([
3166
+ c.common,
3167
+ c.specularmap,
3168
+ c.envmap,
3169
+ c.aomap,
3170
+ c.lightmap,
3171
+ c.emissivemap,
3172
+ c.bumpmap,
3173
+ c.normalmap,
3174
+ c.displacementmap,
3175
+ c.fog,
3176
+ c.lights,
3177
+ {
3178
+ emissive: { value: /* @__PURE__ */ new y(0) },
3179
+ specular: { value: /* @__PURE__ */ new y(1118481) },
3180
+ shininess: { value: 30 }
3181
+ }
3182
+ ]),
3183
+ vertexShader: g.meshphong_vert,
3184
+ fragmentShader: g.meshphong_frag
3185
+ },
3186
+ standard: {
3187
+ uniforms: /* @__PURE__ */ b([
3188
+ c.common,
3189
+ c.envmap,
3190
+ c.aomap,
3191
+ c.lightmap,
3192
+ c.emissivemap,
3193
+ c.bumpmap,
3194
+ c.normalmap,
3195
+ c.displacementmap,
3196
+ c.roughnessmap,
3197
+ c.metalnessmap,
3198
+ c.fog,
3199
+ c.lights,
3200
+ {
3201
+ emissive: { value: /* @__PURE__ */ new y(0) },
3202
+ roughness: { value: 1 },
3203
+ metalness: { value: 0 },
3204
+ envMapIntensity: { value: 1 }
3205
+ }
3206
+ ]),
3207
+ vertexShader: g.meshphysical_vert,
3208
+ fragmentShader: g.meshphysical_frag
3209
+ },
3210
+ toon: {
3211
+ uniforms: /* @__PURE__ */ b([
3212
+ c.common,
3213
+ c.aomap,
3214
+ c.lightmap,
3215
+ c.emissivemap,
3216
+ c.bumpmap,
3217
+ c.normalmap,
3218
+ c.displacementmap,
3219
+ c.gradientmap,
3220
+ c.fog,
3221
+ c.lights,
3222
+ {
3223
+ emissive: { value: /* @__PURE__ */ new y(0) }
3224
+ }
3225
+ ]),
3226
+ vertexShader: g.meshtoon_vert,
3227
+ fragmentShader: g.meshtoon_frag
3228
+ },
3229
+ matcap: {
3230
+ uniforms: /* @__PURE__ */ b([
3231
+ c.common,
3232
+ c.bumpmap,
3233
+ c.normalmap,
3234
+ c.displacementmap,
3235
+ c.fog,
3236
+ {
3237
+ matcap: { value: null }
3238
+ }
3239
+ ]),
3240
+ vertexShader: g.meshmatcap_vert,
3241
+ fragmentShader: g.meshmatcap_frag
3242
+ },
3243
+ points: {
3244
+ uniforms: /* @__PURE__ */ b([
3245
+ c.points,
3246
+ c.fog
3247
+ ]),
3248
+ vertexShader: g.points_vert,
3249
+ fragmentShader: g.points_frag
3250
+ },
3251
+ dashed: {
3252
+ uniforms: /* @__PURE__ */ b([
3253
+ c.common,
3254
+ c.fog,
3255
+ {
3256
+ scale: { value: 1 },
3257
+ dashSize: { value: 1 },
3258
+ totalSize: { value: 2 }
3259
+ }
3260
+ ]),
3261
+ vertexShader: g.linedashed_vert,
3262
+ fragmentShader: g.linedashed_frag
3263
+ },
3264
+ depth: {
3265
+ uniforms: /* @__PURE__ */ b([
3266
+ c.common,
3267
+ c.displacementmap
3268
+ ]),
3269
+ vertexShader: g.depth_vert,
3270
+ fragmentShader: g.depth_frag
3271
+ },
3272
+ normal: {
3273
+ uniforms: /* @__PURE__ */ b([
3274
+ c.common,
3275
+ c.bumpmap,
3276
+ c.normalmap,
3277
+ c.displacementmap,
3278
+ {
3279
+ opacity: { value: 1 }
3280
+ }
3281
+ ]),
3282
+ vertexShader: g.meshnormal_vert,
3283
+ fragmentShader: g.meshnormal_frag
3284
+ },
3285
+ sprite: {
3286
+ uniforms: /* @__PURE__ */ b([
3287
+ c.sprite,
3288
+ c.fog
3289
+ ]),
3290
+ vertexShader: g.sprite_vert,
3291
+ fragmentShader: g.sprite_frag
3292
+ },
3293
+ background: {
3294
+ uniforms: {
3295
+ uvTransform: { value: /* @__PURE__ */ new f() },
3296
+ t2D: { value: null },
3297
+ backgroundIntensity: { value: 1 }
3298
+ },
3299
+ vertexShader: g.background_vert,
3300
+ fragmentShader: g.background_frag
3301
+ },
3302
+ backgroundCube: {
3303
+ uniforms: {
3304
+ envMap: { value: null },
3305
+ flipEnvMap: { value: -1 },
3306
+ backgroundBlurriness: { value: 0 },
3307
+ backgroundIntensity: { value: 1 },
3308
+ backgroundRotation: { value: /* @__PURE__ */ new f() }
3309
+ },
3310
+ vertexShader: g.backgroundCube_vert,
3311
+ fragmentShader: g.backgroundCube_frag
3312
+ },
3313
+ cube: {
3314
+ uniforms: {
3315
+ tCube: { value: null },
3316
+ tFlip: { value: -1 },
3317
+ opacity: { value: 1 }
3318
+ },
3319
+ vertexShader: g.cube_vert,
3320
+ fragmentShader: g.cube_frag
3321
+ },
3322
+ equirect: {
3323
+ uniforms: {
3324
+ tEquirect: { value: null }
3325
+ },
3326
+ vertexShader: g.equirect_vert,
3327
+ fragmentShader: g.equirect_frag
3328
+ },
3329
+ distanceRGBA: {
3330
+ uniforms: /* @__PURE__ */ b([
3331
+ c.common,
3332
+ c.displacementmap,
3333
+ {
3334
+ referencePosition: { value: /* @__PURE__ */ new B() },
3335
+ nearDistance: { value: 1 },
3336
+ farDistance: { value: 1e3 }
3337
+ }
3338
+ ]),
3339
+ vertexShader: g.distanceRGBA_vert,
3340
+ fragmentShader: g.distanceRGBA_frag
3341
+ },
3342
+ shadow: {
3343
+ uniforms: /* @__PURE__ */ b([
3344
+ c.lights,
3345
+ c.fog,
3346
+ {
3347
+ color: { value: /* @__PURE__ */ new y(0) },
3348
+ opacity: { value: 1 }
3349
+ }
3350
+ ]),
3351
+ vertexShader: g.shadow_vert,
3352
+ fragmentShader: g.shadow_frag
3353
+ }
3354
+ };
3355
+ $.physical = {
3356
+ uniforms: /* @__PURE__ */ b([
3357
+ $.standard.uniforms,
3358
+ {
3359
+ clearcoat: { value: 0 },
3360
+ clearcoatMap: { value: null },
3361
+ clearcoatMapTransform: { value: /* @__PURE__ */ new f() },
3362
+ clearcoatNormalMap: { value: null },
3363
+ clearcoatNormalMapTransform: { value: /* @__PURE__ */ new f() },
3364
+ clearcoatNormalScale: { value: /* @__PURE__ */ new k(1, 1) },
3365
+ clearcoatRoughness: { value: 0 },
3366
+ clearcoatRoughnessMap: { value: null },
3367
+ clearcoatRoughnessMapTransform: { value: /* @__PURE__ */ new f() },
3368
+ iridescence: { value: 0 },
3369
+ iridescenceMap: { value: null },
3370
+ iridescenceMapTransform: { value: /* @__PURE__ */ new f() },
3371
+ iridescenceIOR: { value: 1.3 },
3372
+ iridescenceThicknessMinimum: { value: 100 },
3373
+ iridescenceThicknessMaximum: { value: 400 },
3374
+ iridescenceThicknessMap: { value: null },
3375
+ iridescenceThicknessMapTransform: { value: /* @__PURE__ */ new f() },
3376
+ sheen: { value: 0 },
3377
+ sheenColor: { value: /* @__PURE__ */ new y(0) },
3378
+ sheenColorMap: { value: null },
3379
+ sheenColorMapTransform: { value: /* @__PURE__ */ new f() },
3380
+ sheenRoughness: { value: 1 },
3381
+ sheenRoughnessMap: { value: null },
3382
+ sheenRoughnessMapTransform: { value: /* @__PURE__ */ new f() },
3383
+ transmission: { value: 0 },
3384
+ transmissionMap: { value: null },
3385
+ transmissionMapTransform: { value: /* @__PURE__ */ new f() },
3386
+ transmissionSamplerSize: { value: /* @__PURE__ */ new k() },
3387
+ transmissionSamplerMap: { value: null },
3388
+ thickness: { value: 0 },
3389
+ thicknessMap: { value: null },
3390
+ thicknessMapTransform: { value: /* @__PURE__ */ new f() },
3391
+ attenuationDistance: { value: 0 },
3392
+ attenuationColor: { value: /* @__PURE__ */ new y(0) },
3393
+ specularColor: { value: /* @__PURE__ */ new y(1, 1, 1) },
3394
+ specularColorMap: { value: null },
3395
+ specularColorMapTransform: { value: /* @__PURE__ */ new f() },
3396
+ specularIntensity: { value: 1 },
3397
+ specularIntensityMap: { value: null },
3398
+ specularIntensityMapTransform: { value: /* @__PURE__ */ new f() },
3399
+ anisotropyVector: { value: /* @__PURE__ */ new k() },
3400
+ anisotropyMap: { value: null },
3401
+ anisotropyMapTransform: { value: /* @__PURE__ */ new f() }
3402
+ }
3403
+ ]),
3404
+ vertexShader: g.meshphysical_vert,
3405
+ fragmentShader: g.meshphysical_frag
3406
+ };
3407
+ const je = `varying vec3 vWorldPosition;
3408
+
3409
+ void main() {
3410
+ vec4 worldPos = modelMatrix * vec4(position, 1.0);
3411
+ vWorldPosition = worldPos.xyz;
3412
+ gl_Position = projectionMatrix * viewMatrix * worldPos;
3413
+ }`, He = `uniform float uGridSize;
3414
+ uniform float uMajorLineEvery;
3415
+ uniform vec3 uMinorLineColor;
3416
+ uniform vec3 uMajorLineColor;
3417
+ uniform float uFadeDistance;
3418
+
3419
+ varying vec3 vWorldPosition;
3420
+
3421
+ void main() {
3422
+ vec2 coord = vWorldPosition.xz;
3423
+
3424
+ // Minor grid
3425
+ vec2 minorCoord = coord / uGridSize;
3426
+ vec2 minorGrid = abs(fract(minorCoord - 0.5) - 0.5) / fwidth(minorCoord);
3427
+ float lineMinor = min(minorGrid.x, minorGrid.y);
3428
+
3429
+ // Major grid
3430
+ float majorSize = uGridSize * uMajorLineEvery;
3431
+ vec2 majorCoord = coord / majorSize;
3432
+ vec2 majorGrid = abs(fract(majorCoord - 0.5) - 0.5) / fwidth(majorCoord);
3433
+ float lineMajor = min(majorGrid.x, majorGrid.y);
3434
+
3435
+ // Line alpha: minor = 1px, major = 2px wide
3436
+ float minorAlpha = 1.0 - min(lineMinor, 1.0);
3437
+ float majorAlpha = 1.0 - min(lineMajor / 2.0, 1.0);
3438
+
3439
+ float alpha = max(minorAlpha, majorAlpha);
3440
+ vec3 color = mix(uMinorLineColor, uMajorLineColor, step(minorAlpha, majorAlpha));
3441
+
3442
+ // Radial fade from camera
3443
+ float dist = length(vWorldPosition.xz - cameraPosition.xz);
3444
+ alpha *= 1.0 - smoothstep(uFadeDistance * 0.5, uFadeDistance, dist);
3445
+
3446
+ if (alpha < 0.001) discard;
3447
+
3448
+ gl_FragColor = vec4(color, alpha);
3449
+ }`, $e = {
3450
+ uniforms: {
3451
+ uGridSize: { value: 1 },
3452
+ uMajorLineEvery: { value: 10 },
3453
+ uMinorLineColor: { value: new O("#dddddd") },
3454
+ uMajorLineColor: { value: new O("#888888") },
3455
+ uFadeDistance: { value: 10 }
3456
+ },
3457
+ vertexShader: je,
3458
+ fragmentShader: He
3459
+ }, Oe = {
3460
+ ...$,
3461
+ grid: $e
3462
+ };
3463
+ class Ye extends ie {
3464
+ }
3465
+ export {
3466
+ Oe as D,
3467
+ Ye as a
3468
+ };