@plastic-software/three 0.179.0 → 0.180.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/build/three.cjs +166 -106
  2. package/build/three.core.js +112 -20
  3. package/build/three.core.min.js +1 -1
  4. package/build/three.module.js +55 -89
  5. package/build/three.module.min.js +1 -1
  6. package/build/three.tsl.js +30 -5
  7. package/build/three.tsl.min.js +1 -1
  8. package/build/three.webgpu.js +2896 -1048
  9. package/build/three.webgpu.min.js +1 -1
  10. package/build/three.webgpu.nodes.js +2896 -1048
  11. package/build/three.webgpu.nodes.min.js +1 -1
  12. package/examples/jsm/Addons.js +1 -1
  13. package/examples/jsm/controls/ArcballControls.js +7 -7
  14. package/examples/jsm/controls/DragControls.js +6 -56
  15. package/examples/jsm/controls/FirstPersonControls.js +2 -2
  16. package/examples/jsm/controls/PointerLockControls.js +0 -8
  17. package/examples/jsm/exporters/GLTFExporter.js +30 -22
  18. package/examples/jsm/exporters/KTX2Exporter.js +4 -2
  19. package/examples/jsm/exporters/PLYExporter.js +1 -1
  20. package/examples/jsm/libs/ktx-parse.module.js +1 -1
  21. package/examples/jsm/lines/Line2.js +3 -3
  22. package/examples/jsm/lines/LineGeometry.js +1 -1
  23. package/examples/jsm/lines/LineSegments2.js +2 -2
  24. package/examples/jsm/lines/Wireframe.js +2 -2
  25. package/examples/jsm/lines/WireframeGeometry2.js +1 -1
  26. package/examples/jsm/lines/webgpu/LineSegments2.js +1 -1
  27. package/examples/jsm/lines/webgpu/Wireframe.js +1 -1
  28. package/examples/jsm/loaders/ColladaLoader.js +1 -1
  29. package/examples/jsm/loaders/EXRLoader.js +5 -5
  30. package/examples/jsm/loaders/GLTFLoader.js +9 -5
  31. package/examples/jsm/loaders/HDRCubeTextureLoader.js +5 -5
  32. package/examples/jsm/loaders/HDRLoader.js +486 -0
  33. package/examples/jsm/loaders/KTX2Loader.js +112 -32
  34. package/examples/jsm/loaders/RGBELoader.js +7 -473
  35. package/examples/jsm/loaders/TTFLoader.js +4 -4
  36. package/examples/jsm/loaders/UltraHDRLoader.js +1 -1
  37. package/examples/jsm/loaders/lwo/IFFParser.js +1 -1
  38. package/examples/jsm/materials/WoodNodeMaterial.js +533 -0
  39. package/examples/jsm/math/ColorSpaces.js +19 -1
  40. package/examples/jsm/math/ConvexHull.js +2 -2
  41. package/examples/jsm/math/Lut.js +2 -2
  42. package/examples/jsm/misc/MD2CharacterComplex.js +1 -1
  43. package/examples/jsm/misc/ProgressiveLightMap.js +1 -1
  44. package/examples/jsm/misc/Volume.js +1 -1
  45. package/examples/jsm/postprocessing/OutlinePass.js +1 -1
  46. package/examples/jsm/postprocessing/SSRPass.js +37 -8
  47. package/examples/jsm/shaders/UnpackDepthRGBAShader.js +1 -1
  48. package/examples/jsm/transpiler/GLSLDecoder.js +22 -19
  49. package/examples/jsm/transpiler/TSLEncoder.js +2 -10
  50. package/examples/jsm/transpiler/WGSLEncoder.js +24 -0
  51. package/examples/jsm/tsl/display/AnamorphicNode.js +27 -4
  52. package/examples/jsm/tsl/display/BloomNode.js +3 -3
  53. package/examples/jsm/tsl/display/ChromaticAberrationNode.js +2 -1
  54. package/examples/jsm/tsl/display/DepthOfFieldNode.js +439 -90
  55. package/examples/jsm/tsl/display/GTAONode.js +8 -0
  56. package/examples/jsm/tsl/display/GaussianBlurNode.js +47 -35
  57. package/examples/jsm/tsl/display/OutlineNode.js +2 -2
  58. package/examples/jsm/tsl/display/SSRNode.js +180 -65
  59. package/examples/jsm/tsl/display/TRAANode.js +1 -1
  60. package/examples/jsm/tsl/display/boxBlur.js +64 -0
  61. package/examples/jsm/tsl/display/hashBlur.js +15 -18
  62. package/examples/jsm/utils/BufferGeometryUtils.js +1 -1
  63. package/examples/jsm/utils/ShadowMapViewerGPU.js +12 -5
  64. package/examples/jsm/webxr/OculusHandModel.js +1 -1
  65. package/package.json +1 -1
  66. package/src/Three.Core.js +1 -0
  67. package/src/Three.TSL.js +29 -4
  68. package/src/animation/AnimationClip.js +17 -2
  69. package/src/constants.js +11 -3
  70. package/src/core/BufferGeometry.js +2 -2
  71. package/src/extras/TextureUtils.js +2 -1
  72. package/src/extras/lib/earcut.js +1 -1
  73. package/src/lights/webgpu/ProjectorLight.js +1 -1
  74. package/src/materials/Material.js +12 -0
  75. package/src/materials/MeshDistanceMaterial.js +1 -1
  76. package/src/materials/nodes/PointsNodeMaterial.js +81 -28
  77. package/src/materials/nodes/SpriteNodeMaterial.js +3 -15
  78. package/src/materials/nodes/manager/NodeMaterialObserver.js +1 -1
  79. package/src/math/ColorManagement.js +7 -1
  80. package/src/nodes/Nodes.js +3 -0
  81. package/src/nodes/TSL.js +3 -0
  82. package/src/nodes/accessors/BufferNode.js +1 -1
  83. package/src/nodes/accessors/Camera.js +133 -7
  84. package/src/nodes/accessors/ClippingNode.js +6 -5
  85. package/src/nodes/accessors/CubeTextureNode.js +2 -2
  86. package/src/nodes/accessors/InstanceNode.js +3 -1
  87. package/src/nodes/accessors/Object3DNode.js +1 -1
  88. package/src/nodes/accessors/ReferenceBaseNode.js +1 -1
  89. package/src/nodes/accessors/ReferenceNode.js +1 -1
  90. package/src/nodes/accessors/Texture3DNode.js +13 -0
  91. package/src/nodes/accessors/TextureNode.js +71 -19
  92. package/src/nodes/code/FunctionCallNode.js +19 -0
  93. package/src/nodes/code/FunctionNode.js +23 -0
  94. package/src/nodes/core/AssignNode.js +4 -3
  95. package/src/nodes/core/ContextNode.js +24 -0
  96. package/src/nodes/core/Node.js +16 -20
  97. package/src/nodes/core/NodeBuilder.js +48 -14
  98. package/src/nodes/core/NodeFrame.js +1 -1
  99. package/src/nodes/core/NodeUniform.js +1 -1
  100. package/src/nodes/core/NodeUtils.js +1 -2
  101. package/src/nodes/core/StackNode.js +29 -4
  102. package/src/nodes/core/StructNode.js +5 -5
  103. package/src/nodes/core/StructTypeNode.js +1 -0
  104. package/src/nodes/core/SubBuildNode.js +2 -2
  105. package/src/nodes/core/UniformNode.js +16 -9
  106. package/src/nodes/core/VarNode.js +0 -21
  107. package/src/nodes/display/FrontFacingNode.js +4 -8
  108. package/src/nodes/display/PassNode.js +1 -1
  109. package/src/nodes/display/ScreenNode.js +42 -13
  110. package/src/nodes/display/ViewportDepthTextureNode.js +16 -4
  111. package/src/nodes/display/ViewportSharedTextureNode.js +12 -0
  112. package/src/nodes/display/ViewportTextureNode.js +42 -12
  113. package/src/nodes/gpgpu/SubgroupFunctionNode.js +430 -0
  114. package/src/nodes/lighting/LightsNode.js +1 -1
  115. package/src/nodes/math/BitcastNode.js +156 -0
  116. package/src/nodes/math/ConditionalNode.js +18 -2
  117. package/src/nodes/math/MathNode.js +3 -15
  118. package/src/nodes/math/OperatorNode.js +4 -3
  119. package/src/nodes/tsl/TSLCore.js +432 -152
  120. package/src/nodes/utils/JoinNode.js +3 -1
  121. package/src/nodes/utils/MemberNode.js +58 -7
  122. package/src/nodes/utils/RTTNode.js +1 -1
  123. package/src/nodes/utils/ReflectorNode.js +51 -7
  124. package/src/nodes/utils/SampleNode.js +12 -2
  125. package/src/nodes/utils/SplitNode.js +11 -0
  126. package/src/nodes/utils/Timer.js +0 -47
  127. package/src/objects/BatchedMesh.js +2 -2
  128. package/src/objects/LOD.js +1 -1
  129. package/src/objects/Sprite.js +2 -2
  130. package/src/renderers/WebGLRenderer.js +0 -9
  131. package/src/renderers/common/Attributes.js +1 -1
  132. package/src/renderers/common/Backend.js +19 -1
  133. package/src/renderers/common/Bindings.js +2 -0
  134. package/src/renderers/common/ChainMap.js +1 -1
  135. package/src/renderers/common/DataMap.js +1 -1
  136. package/src/renderers/common/Pipelines.js +1 -1
  137. package/src/renderers/common/RenderContext.js +2 -2
  138. package/src/renderers/common/RenderObject.js +14 -2
  139. package/src/renderers/common/Renderer.js +39 -19
  140. package/src/renderers/common/SampledTexture.js +1 -1
  141. package/src/renderers/common/Sampler.js +25 -13
  142. package/src/renderers/common/Textures.js +34 -12
  143. package/src/renderers/common/TimestampQueryPool.js +3 -3
  144. package/src/renderers/common/XRManager.js +35 -19
  145. package/src/renderers/common/nodes/NodeBuilderState.js +1 -1
  146. package/src/renderers/common/nodes/NodeLibrary.js +5 -5
  147. package/src/renderers/shaders/ShaderChunk/logdepthbuf_fragment.glsl.js +1 -1
  148. package/src/renderers/shaders/ShaderChunk/logdepthbuf_pars_fragment.glsl.js +1 -1
  149. package/src/renderers/shaders/ShaderChunk/logdepthbuf_pars_vertex.glsl.js +1 -1
  150. package/src/renderers/shaders/ShaderChunk/logdepthbuf_vertex.glsl.js +1 -1
  151. package/src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js +7 -15
  152. package/src/renderers/shaders/ShaderLib/depth.glsl.js +1 -1
  153. package/src/renderers/webgl/WebGLProgram.js +4 -4
  154. package/src/renderers/webgl/WebGLShadowMap.js +1 -1
  155. package/src/renderers/webgl/WebGLTextures.js +1 -0
  156. package/src/renderers/webgl/WebGLUtils.js +3 -2
  157. package/src/renderers/webgl-fallback/WebGLBackend.js +186 -135
  158. package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +110 -17
  159. package/src/renderers/webgl-fallback/utils/WebGLState.js +1 -1
  160. package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +52 -3
  161. package/src/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.js +9 -10
  162. package/src/renderers/webgl-fallback/utils/WebGLUtils.js +3 -2
  163. package/src/renderers/webgpu/WebGPUBackend.js +35 -31
  164. package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +124 -34
  165. package/src/renderers/webgpu/utils/WebGPUConstants.js +2 -2
  166. package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +9 -18
  167. package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +114 -25
  168. package/src/renderers/webgpu/utils/WebGPUTimestampQueryPool.js +3 -3
  169. package/src/renderers/webxr/WebXRManager.js +39 -24
  170. package/src/textures/ExternalTexture.js +15 -4
  171. package/src/textures/Source.js +1 -1
  172. package/src/textures/VideoTexture.js +0 -3
  173. package/examples/jsm/loaders/RGBMLoader.js +0 -1148
package/build/three.cjs CHANGED
@@ -5,7 +5,7 @@
5
5
  */
6
6
  'use strict';
7
7
 
8
- const REVISION = '179';
8
+ const REVISION = '180';
9
9
 
10
10
  /**
11
11
  * Represents mouse buttons and interaction types in context of controls.
@@ -731,6 +731,14 @@ const UnsignedInt248Type = 1020;
731
731
  */
732
732
  const UnsignedInt5999Type = 35902;
733
733
 
734
+ /**
735
+ * An unsigned int 10_11_11 (packed) data type for textures.
736
+ *
737
+ * @type {number}
738
+ * @constant
739
+ */
740
+ const UnsignedInt101111Type = 35899;
741
+
734
742
  /**
735
743
  * Discards the red, green and blue components and reads just the alpha component.
736
744
  *
@@ -1672,8 +1680,8 @@ const InterpolationSamplingMode = {
1672
1680
  * @property {string} NORMAL - Normal sampling mode.
1673
1681
  * @property {string} CENTROID - Centroid sampling mode.
1674
1682
  * @property {string} SAMPLE - Sample-specific sampling mode.
1675
- * @property {string} FLAT_FIRST - Flat interpolation using the first vertex.
1676
- * @property {string} FLAT_EITHER - Flat interpolation using either vertex.
1683
+ * @property {string} FIRST - Flat interpolation using the first vertex.
1684
+ * @property {string} EITHER - Flat interpolation using either vertex.
1677
1685
  */
1678
1686
 
1679
1687
  /**
@@ -6317,7 +6325,7 @@ function createColorManagement() {
6317
6325
  * - luminanceCoefficients: RGB luminance coefficients
6318
6326
  *
6319
6327
  * Optional:
6320
- * - outputColorSpaceConfig: { drawingBufferColorSpace: ColorSpace }
6328
+ * - outputColorSpaceConfig: { drawingBufferColorSpace: ColorSpace, toneMappingMode: 'extended' | 'standard' }
6321
6329
  * - workingColorSpaceConfig: { unpackColorSpace: ColorSpace }
6322
6330
  *
6323
6331
  * Reference:
@@ -6386,6 +6394,12 @@ function createColorManagement() {
6386
6394
 
6387
6395
  },
6388
6396
 
6397
+ getToneMappingMode: function ( colorSpace ) {
6398
+
6399
+ return this.spaces[ colorSpace ].outputColorSpaceConfig.toneMappingMode || 'standard';
6400
+
6401
+ },
6402
+
6389
6403
  getLuminanceCoefficients: function ( target, colorSpace = this.workingColorSpace ) {
6390
6404
 
6391
6405
  return target.fromArray( this.spaces[ colorSpace ].luminanceCoefficients );
@@ -6706,7 +6720,7 @@ class Source {
6706
6720
 
6707
6721
  const data = this.data;
6708
6722
 
6709
- if ( data instanceof HTMLVideoElement ) {
6723
+ if ( ( typeof HTMLVideoElement !== 'undefined' ) && ( data instanceof HTMLVideoElement ) ) {
6710
6724
 
6711
6725
  target.set( data.videoWidth, data.videoHeight, 0 );
6712
6726
 
@@ -16917,6 +16931,18 @@ class Material extends EventDispatcher {
16917
16931
 
16918
16932
  }
16919
16933
 
16934
+ if ( this.sheenColorMap && this.sheenColorMap.isTexture ) {
16935
+
16936
+ data.sheenColorMap = this.sheenColorMap.toJSON( meta ).uuid;
16937
+
16938
+ }
16939
+
16940
+ if ( this.sheenRoughnessMap && this.sheenRoughnessMap.isTexture ) {
16941
+
16942
+ data.sheenRoughnessMap = this.sheenRoughnessMap.toJSON( meta ).uuid;
16943
+
16944
+ }
16945
+
16920
16946
  if ( this.dispersion !== undefined ) data.dispersion = this.dispersion;
16921
16947
 
16922
16948
  if ( this.iridescence !== undefined ) data.iridescence = this.iridescence;
@@ -18874,7 +18900,7 @@ class BufferGeometry extends EventDispatcher {
18874
18900
  /**
18875
18901
  * Bounding box for the geometry which can be calculated with `computeBoundingBox()`.
18876
18902
  *
18877
- * @type {Box3}
18903
+ * @type {?Box3}
18878
18904
  * @default null
18879
18905
  */
18880
18906
  this.boundingBox = null;
@@ -18882,7 +18908,7 @@ class BufferGeometry extends EventDispatcher {
18882
18908
  /**
18883
18909
  * Bounding sphere for the geometry which can be calculated with `computeBoundingSphere()`.
18884
18910
  *
18885
- * @type {Sphere}
18911
+ * @type {?Sphere}
18886
18912
  * @default null
18887
18913
  */
18888
18914
  this.boundingSphere = null;
@@ -24156,7 +24182,7 @@ class Sprite extends Object3D {
24156
24182
  /**
24157
24183
  * Constructs a new sprite.
24158
24184
  *
24159
- * @param {SpriteMaterial} [material] - The sprite material.
24185
+ * @param {(SpriteMaterial|SpriteNodeMaterial)} [material] - The sprite material.
24160
24186
  */
24161
24187
  constructor( material = new SpriteMaterial() ) {
24162
24188
 
@@ -24202,7 +24228,7 @@ class Sprite extends Object3D {
24202
24228
  /**
24203
24229
  * The sprite material.
24204
24230
  *
24205
- * @type {SpriteMaterial}
24231
+ * @type {(SpriteMaterial|SpriteNodeMaterial)}
24206
24232
  */
24207
24233
  this.material = material;
24208
24234
 
@@ -24531,7 +24557,7 @@ class LOD extends Object3D {
24531
24557
  * the given distance.
24532
24558
  *
24533
24559
  * @param {number} distance - The LOD distance.
24534
- * @return {Object3D|null} The found 3D object. `null` if no 3D object has been found.
24560
+ * @return {?Object3D} The found 3D object. `null` if no 3D object has been found.
24535
24561
  */
24536
24562
  getObjectForDistance( distance ) {
24537
24563
 
@@ -27810,7 +27836,7 @@ class BatchedMesh extends Mesh {
27810
27836
  *
27811
27837
  * @param {number} geometryId - The ID of the geometry to return the bounding box for.
27812
27838
  * @param {Box3} target - The target object that is used to store the method's result.
27813
- * @return {Box3|null} The geometry's bounding box. Returns `null` if no geometry has been found for the given ID.
27839
+ * @return {?Box3} The geometry's bounding box. Returns `null` if no geometry has been found for the given ID.
27814
27840
  */
27815
27841
  getBoundingBoxAt( geometryId, target ) {
27816
27842
 
@@ -27855,7 +27881,7 @@ class BatchedMesh extends Mesh {
27855
27881
  *
27856
27882
  * @param {number} geometryId - The ID of the geometry to return the bounding sphere for.
27857
27883
  * @param {Sphere} target - The target object that is used to store the method's result.
27858
- * @return {Sphere|null} The geometry's bounding sphere. Returns `null` if no geometry has been found for the given ID.
27884
+ * @return {?Sphere} The geometry's bounding sphere. Returns `null` if no geometry has been found for the given ID.
27859
27885
  */
27860
27886
  getBoundingSphereAt( geometryId, target ) {
27861
27887
 
@@ -29489,9 +29515,6 @@ class VideoTexture extends Texture {
29489
29515
 
29490
29516
  }
29491
29517
 
29492
- /**
29493
- * @override
29494
- */
29495
29518
  dispose() {
29496
29519
 
29497
29520
  if ( this._requestVideoFrameCallbackId !== 0 ) {
@@ -30009,6 +30032,59 @@ class DepthTexture extends Texture {
30009
30032
 
30010
30033
  }
30011
30034
 
30035
+ /**
30036
+ * Represents a texture created externally with the same renderer context.
30037
+ *
30038
+ * This may be a texture from a protected media stream, device camera feed,
30039
+ * or other data feeds like a depth sensor.
30040
+ *
30041
+ * Note that this class is only supported in {@link WebGLRenderer}, and in
30042
+ * the {@link WebGPURenderer} WebGPU backend.
30043
+ *
30044
+ * @augments Texture
30045
+ */
30046
+ class ExternalTexture extends Texture {
30047
+
30048
+ /**
30049
+ * Creates a new raw texture.
30050
+ *
30051
+ * @param {?(WebGLTexture|GPUTexture)} [sourceTexture=null] - The external texture.
30052
+ */
30053
+ constructor( sourceTexture = null ) {
30054
+
30055
+ super();
30056
+
30057
+ /**
30058
+ * The external source texture.
30059
+ *
30060
+ * @type {?(WebGLTexture|GPUTexture)}
30061
+ * @default null
30062
+ */
30063
+ this.sourceTexture = sourceTexture;
30064
+
30065
+ /**
30066
+ * This flag can be used for type testing.
30067
+ *
30068
+ * @type {boolean}
30069
+ * @readonly
30070
+ * @default true
30071
+ */
30072
+ this.isExternalTexture = true;
30073
+
30074
+ }
30075
+
30076
+ copy( source ) {
30077
+
30078
+ super.copy( source );
30079
+
30080
+ this.sourceTexture = source.sourceTexture;
30081
+
30082
+ return this;
30083
+
30084
+ }
30085
+
30086
+ }
30087
+
30012
30088
  /**
30013
30089
  * A geometry class for representing a capsule.
30014
30090
  *
@@ -34746,7 +34822,7 @@ function pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, px, py) {
34746
34822
 
34747
34823
  // check if a diagonal between two polygon nodes is valid (lies in polygon interior)
34748
34824
  function isValidDiagonal(a, b) {
34749
- return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // dones't intersect other edges
34825
+ return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // doesn't intersect other edges
34750
34826
  (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible
34751
34827
  (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors
34752
34828
  equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); // special zero-length case
@@ -40291,7 +40367,7 @@ class MeshDepthMaterial extends Material {
40291
40367
  * Can also be used to customize the shadow casting of an object by assigning
40292
40368
  * an instance of `MeshDistanceMaterial` to {@link Object3D#customDistanceMaterial}.
40293
40369
  * The following examples demonstrates this approach in order to ensure
40294
- * transparent parts of objects do no cast shadows.
40370
+ * transparent parts of objects do not cast shadows.
40295
40371
  *
40296
40372
  * @augments Material
40297
40373
  */
@@ -42672,6 +42748,14 @@ class AnimationClip {
42672
42748
  */
42673
42749
  this.uuid = generateUUID();
42674
42750
 
42751
+ /**
42752
+ * An object that can be used to store custom data about the animation clip.
42753
+ * It should not hold references to functions as these will not be cloned.
42754
+ *
42755
+ * @type {Object}
42756
+ */
42757
+ this.userData = {};
42758
+
42675
42759
  // this means it should figure out its duration by scanning the tracks
42676
42760
  if ( this.duration < 0 ) {
42677
42761
 
@@ -42703,6 +42787,8 @@ class AnimationClip {
42703
42787
  const clip = new this( json.name, json.duration, tracks, json.blendMode );
42704
42788
  clip.uuid = json.uuid;
42705
42789
 
42790
+ clip.userData = JSON.parse( json.userData || '{}' );
42791
+
42706
42792
  return clip;
42707
42793
 
42708
42794
  }
@@ -42725,7 +42811,8 @@ class AnimationClip {
42725
42811
  'duration': clip.duration,
42726
42812
  'tracks': tracks,
42727
42813
  'uuid': clip.uuid,
42728
- 'blendMode': clip.blendMode
42814
+ 'blendMode': clip.blendMode,
42815
+ 'userData': JSON.stringify( clip.userData ),
42729
42816
 
42730
42817
  };
42731
42818
 
@@ -43120,7 +43207,11 @@ class AnimationClip {
43120
43207
 
43121
43208
  }
43122
43209
 
43123
- return new this.constructor( this.name, this.duration, tracks, this.blendMode );
43210
+ const clip = new this.constructor( this.name, this.duration, tracks, this.blendMode );
43211
+
43212
+ clip.userData = JSON.parse( JSON.stringify( this.userData ) );
43213
+
43214
+ return clip;
43124
43215
 
43125
43216
  }
43126
43217
 
@@ -58589,6 +58680,7 @@ function getTextureTypeByteLength( type ) {
58589
58680
  case FloatType:
58590
58681
  return { byteLength: 4, components: 1 };
58591
58682
  case UnsignedInt5999Type:
58683
+ case UnsignedInt101111Type:
58592
58684
  return { byteLength: 4, components: 3 };
58593
58685
 
58594
58686
  }
@@ -59084,13 +59176,13 @@ var lights_fragment_maps = "#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGH
59084
59176
 
59085
59177
  var lights_fragment_end = "#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif";
59086
59178
 
59087
- var logdepthbuf_fragment = "#if defined( USE_LOGDEPTHBUF )\n\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif";
59179
+ var logdepthbuf_fragment = "#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )\n\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif";
59088
59180
 
59089
- var logdepthbuf_pars_fragment = "#if defined( USE_LOGDEPTHBUF )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif";
59181
+ var logdepthbuf_pars_fragment = "#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif";
59090
59182
 
59091
- var logdepthbuf_pars_vertex = "#ifdef USE_LOGDEPTHBUF\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif";
59183
+ var logdepthbuf_pars_vertex = "#ifdef USE_LOGARITHMIC_DEPTH_BUFFER\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif";
59092
59184
 
59093
- var logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n\tvFragDepth = 1.0 + gl_Position.w;\n\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif";
59185
+ var logdepthbuf_vertex = "#ifdef USE_LOGARITHMIC_DEPTH_BUFFER\n\tvFragDepth = 1.0 + gl_Position.w;\n\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif";
59094
59186
 
59095
59187
  var map_fragment = "#ifdef USE_MAP\n\t#ifdef USE_MAP_TRIPLANAR\n\t\tvec4 sampledDiffuseColor = texture2DTriplanar( map, mapTransform, triplanarCoords, triplanarWeights );\n\t#else\n #if defined( USE_MAP_CYLINDRICAL )\n vec2 vMapUv = ( mapTransform * vec3( positionBasedUv, 1 ) ).xy;\n #endif\n\t\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#endif\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif";
59096
59188
 
@@ -59152,7 +59244,7 @@ var roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUG
59152
59244
 
59153
59245
  var roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif";
59154
59246
 
59155
- var shadowmap_pars_fragment = "#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\tfloat depth = unpackRGBAToDepth( texture2D( depths, uv ) );\n\t\t#ifdef USE_REVERSEDEPTHBUF\n\t\t\treturn step( depth, compare );\n\t\t#else\n\t\t\treturn step( compare, depth );\n\t\t#endif\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\t#ifdef USE_REVERSEDEPTHBUF\n\t\t\tfloat hard_shadow = step( distribution.x, compare );\n\t\t#else\n\t\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\t#endif\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tfloat shadow = 1.0;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\t\n\t\tfloat lightToPositionLength = length( lightToPosition );\n\t\tif ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n\t\t\tfloat dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\t\tdp += shadowBias;\n\t\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\t\tshadow = (\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t\t) * ( 1.0 / 9.0 );\n\t\t\t#else\n\t\t\t\tshadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n#endif";
59247
+ var shadowmap_pars_fragment = "#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\tfloat depth = unpackRGBAToDepth( texture2D( depths, uv ) );\n\t\t#ifdef USE_REVERSED_DEPTH_BUFFER\n\t\t\treturn step( depth, compare );\n\t\t#else\n\t\t\treturn step( compare, depth );\n\t\t#endif\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow( sampler2D shadow, vec2 uv, float compare ) {\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\t#ifdef USE_REVERSED_DEPTH_BUFFER\n\t\t\tfloat hard_shadow = step( distribution.x, compare );\n\t\t#else\n\t\t\tfloat hard_shadow = step( compare, distribution.x );\n\t\t#endif\n\t\tif ( hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tfloat shadow = 1.0;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\t\n\t\tfloat lightToPositionLength = length( lightToPosition );\n\t\tif ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n\t\t\tfloat dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\t\tdp += shadowBias;\n\t\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\t\tshadow = (\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t\t) * ( 1.0 / 9.0 );\n\t\t\t#else\n\t\t\t\tshadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n#endif";
59156
59248
 
59157
59249
  var shadowmap_pars_vertex = "#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif";
59158
59250
 
@@ -59202,7 +59294,7 @@ const fragment$f = "uniform samplerCube tCube;\nuniform float tFlip;\nuniform fl
59202
59294
 
59203
59295
  const vertex$e = "#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <batching_vertex>\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}";
59204
59296
 
59205
- const fragment$e = "#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <triplanar_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_REVERSEDEPTHBUF\n\t\tfloat fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];\n\t#else\n\t\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5;\n\t#endif\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#elif DEPTH_PACKING == 3202\n\t\tgl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n\t#elif DEPTH_PACKING == 3203\n\t\tgl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n\t#endif\n}";
59297
+ const fragment$e = "#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <triplanar_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_REVERSED_DEPTH_BUFFER\n\t\tfloat fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];\n\t#else\n\t\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5;\n\t#endif\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#elif DEPTH_PACKING == 3202\n\t\tgl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n\t#elif DEPTH_PACKING == 3203\n\t\tgl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n\t#endif\n}";
59206
59298
 
59207
59299
  const vertex$d = "#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <batching_vertex>\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}";
59208
59300
 
@@ -64921,8 +65013,8 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
64921
65013
 
64922
65014
  parameters.numLightProbes > 0 ? '#define USE_LIGHT_PROBES' : '',
64923
65015
 
64924
- parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',
64925
- parameters.reversedDepthBuffer ? '#define USE_REVERSEDEPTHBUF' : '',
65016
+ parameters.logarithmicDepthBuffer ? '#define USE_LOGARITHMIC_DEPTH_BUFFER' : '',
65017
+ parameters.reversedDepthBuffer ? '#define USE_REVERSED_DEPTH_BUFFER' : '',
64926
65018
 
64927
65019
  'uniform mat4 modelMatrix;',
64928
65020
  'uniform mat4 modelViewMatrix;',
@@ -65097,8 +65189,8 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
65097
65189
  parameters.decodeVideoTexture ? '#define DECODE_VIDEO_TEXTURE' : '',
65098
65190
  parameters.decodeVideoTextureEmissive ? '#define DECODE_VIDEO_TEXTURE_EMISSIVE' : '',
65099
65191
 
65100
- parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',
65101
- parameters.reversedDepthBuffer ? '#define USE_REVERSEDEPTHBUF' : '',
65192
+ parameters.logarithmicDepthBuffer ? '#define USE_LOGARITHMIC_DEPTH_BUFFER' : '',
65193
+ parameters.reversedDepthBuffer ? '#define USE_REVERSED_DEPTH_BUFFER' : '',
65102
65194
 
65103
65195
  'uniform mat4 modelViewMatrix;',
65104
65196
  'uniform mat4 viewMatrix;',
@@ -67197,7 +67289,7 @@ function WebGLShadowMap( renderer, objects, capabilities ) {
67197
67289
  // Set GL state for depth map.
67198
67290
  _state.setBlending( NoBlending );
67199
67291
 
67200
- if ( _state.buffers.depth.getReversed() ) {
67292
+ if ( _state.buffers.depth.getReversed() === true ) {
67201
67293
 
67202
67294
  _state.buffers.color.setClear( 0, 0, 0, 0 );
67203
67295
 
@@ -69066,6 +69158,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
69066
69158
  if ( glFormat === _gl.RGB ) {
69067
69159
 
69068
69160
  if ( glType === _gl.UNSIGNED_INT_5_9_9_9_REV ) internalFormat = _gl.RGB9_E5;
69161
+ if ( glType === _gl.UNSIGNED_INT_10F_11F_11F_REV ) internalFormat = _gl.R11F_G11F_B10F;
69069
69162
 
69070
69163
  }
69071
69164
 
@@ -71211,6 +71304,7 @@ function WebGLUtils( gl, extensions ) {
71211
71304
  if ( p === UnsignedShort4444Type ) return gl.UNSIGNED_SHORT_4_4_4_4;
71212
71305
  if ( p === UnsignedShort5551Type ) return gl.UNSIGNED_SHORT_5_5_5_1;
71213
71306
  if ( p === UnsignedInt5999Type ) return gl.UNSIGNED_INT_5_9_9_9_REV;
71307
+ if ( p === UnsignedInt101111Type ) return gl.UNSIGNED_INT_10F_11F_11F_REV;
71214
71308
 
71215
71309
  if ( p === ByteType ) return gl.BYTE;
71216
71310
  if ( p === ShortType ) return gl.SHORT;
@@ -71379,7 +71473,7 @@ function WebGLUtils( gl, extensions ) {
71379
71473
 
71380
71474
  if ( extension !== null ) {
71381
71475
 
71382
- if ( p === RGBA_BPTC_Format ) return extension.COMPRESSED_RED_RGTC1_EXT;
71476
+ if ( p === RED_RGTC1_Format ) return extension.COMPRESSED_RED_RGTC1_EXT;
71383
71477
  if ( p === SIGNED_RED_RGTC1_Format ) return extension.COMPRESSED_SIGNED_RED_RGTC1_EXT;
71384
71478
  if ( p === RED_GREEN_RGTC2_Format ) return extension.COMPRESSED_RED_GREEN_RGTC2_EXT;
71385
71479
  if ( p === SIGNED_RED_GREEN_RGTC2_Format ) return extension.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT;
@@ -71406,48 +71500,6 @@ function WebGLUtils( gl, extensions ) {
71406
71500
 
71407
71501
  }
71408
71502
 
71409
- /**
71410
- * Represents a texture created externally from the renderer context.
71411
- *
71412
- * This may be a texture from a protected media stream, device camera feed,
71413
- * or other data feeds like a depth sensor.
71414
- *
71415
- * Note that this class is only supported in {@link WebGLRenderer} right now.
71416
- *
71417
- * @augments Texture
71418
- */
71419
- class ExternalTexture extends Texture {
71420
-
71421
- /**
71422
- * Creates a new raw texture.
71423
- *
71424
- * @param {?WebGLTexture} [sourceTexture=null] - The external texture.
71425
- */
71426
- constructor( sourceTexture = null ) {
71427
-
71428
- super();
71429
-
71430
- /**
71431
- * The external source texture.
71432
- *
71433
- * @type {?WebGLTexture}
71434
- * @default null
71435
- */
71436
- this.sourceTexture = sourceTexture;
71437
-
71438
- /**
71439
- * This flag can be used for type testing.
71440
- *
71441
- * @type {boolean}
71442
- * @readonly
71443
- * @default true
71444
- */
71445
- this.isExternalTexture = true;
71446
-
71447
- }
71448
-
71449
- }
71450
-
71451
71503
  const _occlusion_vertex = `
71452
71504
  void main() {
71453
71505
 
@@ -71636,6 +71688,8 @@ class WebXRManager extends EventDispatcher {
71636
71688
  let glBaseLayer = null;
71637
71689
  let xrFrame = null;
71638
71690
 
71691
+ const supportsGlBinding = typeof XRWebGLBinding !== 'undefined';
71692
+
71639
71693
  const depthSensing = new WebXRDepthSensing();
71640
71694
  const cameraAccessTextures = {};
71641
71695
  const attributes = gl.getContextAttributes();
@@ -71913,6 +71967,9 @@ class WebXRManager extends EventDispatcher {
71913
71967
  /**
71914
71968
  * Returns the current base layer.
71915
71969
  *
71970
+ * This is an `XRProjectionLayer` when the targeted XR device supports the
71971
+ * WebXR Layers API, or an `XRWebGLLayer` otherwise.
71972
+ *
71916
71973
  * @return {?(XRWebGLLayer|XRProjectionLayer)} The XR base layer.
71917
71974
  */
71918
71975
  this.getBaseLayer = function () {
@@ -71924,10 +71981,19 @@ class WebXRManager extends EventDispatcher {
71924
71981
  /**
71925
71982
  * Returns the current XR binding.
71926
71983
  *
71927
- * @return {?XRWebGLBinding} The XR binding.
71984
+ * Creates a new binding if needed and the browser is
71985
+ * capable of doing so.
71986
+ *
71987
+ * @return {?XRWebGLBinding} The XR binding. Returns `null` if one cannot be created.
71928
71988
  */
71929
71989
  this.getBinding = function () {
71930
71990
 
71991
+ if ( glBinding === null && supportsGlBinding ) {
71992
+
71993
+ glBinding = new XRWebGLBinding( session, gl );
71994
+
71995
+ }
71996
+
71931
71997
  return glBinding;
71932
71998
 
71933
71999
  };
@@ -71989,17 +72055,12 @@ class WebXRManager extends EventDispatcher {
71989
72055
  currentPixelRatio = renderer.getPixelRatio();
71990
72056
  renderer.getSize( currentSize );
71991
72057
 
71992
- if ( typeof XRWebGLBinding !== 'undefined' ) {
71993
-
71994
- glBinding = new XRWebGLBinding( session, gl );
71995
-
71996
- }
71997
72058
 
71998
72059
  // Check that the browser implements the necessary APIs to use an
71999
72060
  // XRProjectionLayer rather than an XRWebGLLayer
72000
- const useLayers = glBinding !== null && 'createProjectionLayer' in XRWebGLBinding.prototype;
72061
+ const supportsLayers = supportsGlBinding && 'createProjectionLayer' in XRWebGLBinding.prototype;
72001
72062
 
72002
- if ( ! useLayers ) {
72063
+ if ( ! supportsLayers ) {
72003
72064
 
72004
72065
  const layerInit = {
72005
72066
  antialias: attributes.antialias,
@@ -72050,6 +72111,8 @@ class WebXRManager extends EventDispatcher {
72050
72111
  scaleFactor: framebufferScaleFactor
72051
72112
  };
72052
72113
 
72114
+ glBinding = this.getBinding();
72115
+
72053
72116
  glProjLayer = glBinding.createProjectionLayer( projectionlayerInit );
72054
72117
 
72055
72118
  session.updateRenderState( { layers: [ glProjLayer ] } );
@@ -72109,6 +72172,8 @@ class WebXRManager extends EventDispatcher {
72109
72172
  /**
72110
72173
  * Returns the current depth texture computed via depth sensing.
72111
72174
  *
72175
+ * See {@link WebXRDepthSensing#getDepthTexture}.
72176
+ *
72112
72177
  * @return {?Texture} The depth texture.
72113
72178
  */
72114
72179
  this.getDepthTexture = function () {
@@ -72279,7 +72344,7 @@ class WebXRManager extends EventDispatcher {
72279
72344
 
72280
72345
  /**
72281
72346
  * Updates the state of the XR camera. Use this method on app level if you
72282
- * set cameraAutoUpdate` to `false`. The method requires the non-XR
72347
+ * set `cameraAutoUpdate` to `false`. The method requires the non-XR
72283
72348
  * camera of the scene as a parameter. The passed in camera's transformation
72284
72349
  * is automatically adjusted to the position of the XR camera when calling
72285
72350
  * this method.
@@ -72456,6 +72521,8 @@ class WebXRManager extends EventDispatcher {
72456
72521
  /**
72457
72522
  * Returns the depth sensing mesh.
72458
72523
  *
72524
+ * See {@link WebXRDepthSensing#getMesh}.
72525
+ *
72459
72526
  * @return {Mesh} The depth sensing mesh.
72460
72527
  */
72461
72528
  this.getDepthSensingMesh = function () {
@@ -72576,7 +72643,9 @@ class WebXRManager extends EventDispatcher {
72576
72643
  enabledFeatures.includes( 'depth-sensing' ) &&
72577
72644
  session.depthUsage == 'gpu-optimized';
72578
72645
 
72579
- if ( gpuDepthSensingEnabled && glBinding ) {
72646
+ if ( gpuDepthSensingEnabled && supportsGlBinding ) {
72647
+
72648
+ glBinding = scope.getBinding();
72580
72649
 
72581
72650
  const depthData = glBinding.getDepthInformation( views[ 0 ] );
72582
72651
 
@@ -72591,32 +72660,30 @@ class WebXRManager extends EventDispatcher {
72591
72660
  const cameraAccessEnabled = enabledFeatures &&
72592
72661
  enabledFeatures.includes( 'camera-access' );
72593
72662
 
72594
- if ( cameraAccessEnabled ) {
72663
+ if ( cameraAccessEnabled && supportsGlBinding ) {
72595
72664
 
72596
72665
  renderer.state.unbindTexture();
72597
72666
 
72598
- if ( glBinding ) {
72667
+ glBinding = scope.getBinding();
72599
72668
 
72600
- for ( let i = 0; i < views.length; i ++ ) {
72669
+ for ( let i = 0; i < views.length; i ++ ) {
72601
72670
 
72602
- const camera = views[ i ].camera;
72671
+ const camera = views[ i ].camera;
72603
72672
 
72604
- if ( camera ) {
72673
+ if ( camera ) {
72605
72674
 
72606
- let cameraTex = cameraAccessTextures[ camera ];
72675
+ let cameraTex = cameraAccessTextures[ camera ];
72607
72676
 
72608
- if ( ! cameraTex ) {
72677
+ if ( ! cameraTex ) {
72609
72678
 
72610
- cameraTex = new ExternalTexture();
72611
- cameraAccessTextures[ camera ] = cameraTex;
72612
-
72613
- }
72614
-
72615
- const glTexture = glBinding.getCameraImage( camera );
72616
- cameraTex.sourceTexture = glTexture;
72679
+ cameraTex = new ExternalTexture();
72680
+ cameraAccessTextures[ camera ] = cameraTex;
72617
72681
 
72618
72682
  }
72619
72683
 
72684
+ const glTexture = glBinding.getCameraImage( camera );
72685
+ cameraTex.sourceTexture = glTexture;
72686
+
72620
72687
  }
72621
72688
 
72622
72689
  }
@@ -76914,15 +76981,6 @@ class WebGLRenderer {
76914
76981
 
76915
76982
  };
76916
76983
 
76917
- this.copyTextureToTexture3D = function ( srcTexture, dstTexture, srcRegion = null, dstPosition = null, level = 0 ) {
76918
-
76919
- // @deprecated, r170
76920
- warnOnce( 'WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.' );
76921
-
76922
- return this.copyTextureToTexture( srcTexture, dstTexture, srcRegion, dstPosition, level );
76923
-
76924
- };
76925
-
76926
76984
  /**
76927
76985
  * Initializes the given WebGLRenderTarget memory. Useful for initializing a render target so data
76928
76986
  * can be copied into it using {@link WebGLRenderer#copyTextureToTexture} before it has been
@@ -77147,6 +77205,7 @@ exports.EquirectangularReflectionMapping = EquirectangularReflectionMapping;
77147
77205
  exports.EquirectangularRefractionMapping = EquirectangularRefractionMapping;
77148
77206
  exports.Euler = Euler;
77149
77207
  exports.EventDispatcher = EventDispatcher;
77208
+ exports.ExternalTexture = ExternalTexture;
77150
77209
  exports.ExtrudeGeometry = ExtrudeGeometry;
77151
77210
  exports.FileLoader = FileLoader;
77152
77211
  exports.Float16BufferAttribute = Float16BufferAttribute;
@@ -77426,6 +77485,7 @@ exports.UniformsGroup = UniformsGroup;
77426
77485
  exports.UniformsLib = UniformsLib;
77427
77486
  exports.UniformsUtils = UniformsUtils;
77428
77487
  exports.UnsignedByteType = UnsignedByteType;
77488
+ exports.UnsignedInt101111Type = UnsignedInt101111Type;
77429
77489
  exports.UnsignedInt248Type = UnsignedInt248Type;
77430
77490
  exports.UnsignedInt5999Type = UnsignedInt5999Type;
77431
77491
  exports.UnsignedIntType = UnsignedIntType;