super-three 0.169.1 → 0.170.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/three.cjs +974 -562
- package/build/three.module.js +975 -559
- package/build/three.module.min.js +1 -1
- package/build/three.webgpu.js +8398 -9842
- package/build/three.webgpu.min.js +1 -1
- package/build/three.webgpu.nodes.js +8398 -9842
- package/build/three.webgpu.nodes.min.js +1 -1
- package/examples/jsm/Addons.js +3 -3
- package/examples/jsm/animation/MMDAnimationHelper.js +2 -0
- package/examples/jsm/animation/MMDPhysics.js +2 -0
- package/examples/jsm/controls/TransformControls.js +22 -6
- package/examples/jsm/csm/CSM.js +2 -2
- package/examples/jsm/csm/CSMFrustum.js +7 -4
- package/examples/jsm/csm/CSMHelper.js +2 -0
- package/examples/jsm/csm/CSMShadowNode.js +435 -0
- package/examples/jsm/curves/NURBSCurve.js +34 -3
- package/examples/jsm/exporters/GLTFExporter.js +138 -71
- package/examples/jsm/exporters/KTX2Exporter.js +35 -12
- package/examples/jsm/exporters/MMDExporter.js +6 -0
- package/examples/jsm/exporters/USDZExporter.js +21 -3
- package/examples/jsm/geometries/DecalGeometry.js +65 -20
- package/examples/jsm/geometries/InstancedPointsGeometry.js +2 -0
- package/examples/jsm/helpers/TextureHelperGPU.js +175 -0
- package/examples/jsm/interactive/HTMLMesh.js +1 -0
- package/examples/jsm/lighting/TiledLighting.js +18 -0
- package/examples/jsm/lights/RectAreaLightTexturesLib.js +1 -1
- package/examples/jsm/lines/LineMaterial.js +7 -2
- package/examples/jsm/lines/LineSegmentsGeometry.js +2 -0
- package/examples/jsm/lines/webgpu/LineSegments2.js +0 -15
- package/examples/jsm/lines/webgpu/Wireframe.js +56 -0
- package/examples/jsm/loaders/3DMLoader.js +1 -0
- package/examples/jsm/loaders/3MFLoader.js +91 -0
- package/examples/jsm/loaders/FBXLoader.js +12 -2
- package/examples/jsm/loaders/GLTFLoader.js +2 -0
- package/examples/jsm/loaders/KTX2Loader.js +140 -49
- package/examples/jsm/loaders/LDrawLoader.js +22 -136
- package/examples/jsm/loaders/LottieLoader.js +1 -0
- package/examples/jsm/loaders/MMDLoader.js +9 -2
- package/examples/jsm/materials/LDrawConditionalLineMaterial.js +143 -0
- package/examples/jsm/materials/LDrawConditionalLineNodeMaterial.js +114 -0
- package/examples/jsm/materials/MeshGouraudMaterial.js +6 -2
- package/examples/jsm/math/ColorSpaces.js +76 -0
- package/examples/jsm/misc/ProgressiveLightMap.js +52 -40
- package/examples/jsm/misc/ProgressiveLightMapGPU.js +293 -0
- package/examples/jsm/misc/VolumeSlice.js +1 -0
- package/examples/jsm/objects/WaterMesh.js +8 -8
- package/examples/jsm/postprocessing/AfterimagePass.js +14 -3
- package/examples/jsm/postprocessing/SSRPass.js +6 -0
- package/examples/jsm/renderers/CSS2DRenderer.js +6 -3
- package/examples/jsm/renderers/CSS3DRenderer.js +7 -4
- package/examples/jsm/shaders/FXAAShader.js +225 -224
- package/examples/jsm/transpiler/ShaderToyDecoder.js +1 -1
- package/{src/nodes → examples/jsm/tsl}/display/AfterImageNode.js +17 -20
- package/{src/nodes → examples/jsm/tsl}/display/AnaglyphPassNode.js +2 -6
- package/{src/nodes → examples/jsm/tsl}/display/AnamorphicNode.js +12 -18
- package/{src/nodes → examples/jsm/tsl}/display/BleachBypass.js +1 -3
- package/{src/nodes → examples/jsm/tsl}/display/BloomNode.js +11 -40
- package/{src/nodes → examples/jsm/tsl}/display/DenoiseNode.js +18 -41
- package/{src/nodes → examples/jsm/tsl}/display/DepthOfFieldNode.js +2 -8
- package/{src/nodes → examples/jsm/tsl}/display/DotScreenNode.js +2 -9
- package/examples/jsm/tsl/display/FXAANode.js +316 -0
- package/{src/nodes → examples/jsm/tsl}/display/FilmNode.js +2 -6
- package/{src/nodes → examples/jsm/tsl}/display/GTAONode.js +30 -70
- package/{src/nodes → examples/jsm/tsl}/display/GaussianBlurNode.js +74 -36
- package/examples/jsm/tsl/display/LensflareNode.js +161 -0
- package/{src/nodes → examples/jsm/tsl}/display/Lut3DNode.js +1 -4
- package/{src/nodes → examples/jsm/tsl}/display/MotionBlur.js +2 -3
- package/examples/jsm/tsl/display/OutlineNode.js +434 -0
- package/{src/nodes → examples/jsm/tsl}/display/ParallaxBarrierPassNode.js +1 -5
- package/{src/nodes → examples/jsm/tsl}/display/PixelationPassNode.js +3 -15
- package/{src/nodes → examples/jsm/tsl}/display/RGBShiftNode.js +1 -6
- package/examples/jsm/tsl/display/SMAANode.js +620 -0
- package/{src/nodes → examples/jsm/tsl}/display/SSAAPassNode.js +10 -25
- package/examples/jsm/tsl/display/SSRNode.js +343 -0
- package/{src/nodes → examples/jsm/tsl}/display/Sepia.js +1 -2
- package/{src/nodes → examples/jsm/tsl}/display/SobelOperatorNode.js +3 -11
- package/{src/nodes → examples/jsm/tsl}/display/StereoCompositePassNode.js +9 -11
- package/{src/nodes → examples/jsm/tsl}/display/StereoPassNode.js +10 -11
- package/examples/jsm/tsl/display/TRAAPassNode.js +355 -0
- package/{src/nodes → examples/jsm/tsl}/display/TransitionNode.js +1 -6
- package/examples/jsm/tsl/display/hashBlur.js +24 -0
- package/examples/jsm/tsl/lighting/TiledLightsNode.js +392 -0
- package/examples/jsm/utils/{TextureUtilsGPU.js → WebGPUTextureUtils.js} +2 -1
- package/examples/jsm/webxr/OculusHandPointerModel.js +21 -21
- package/examples/jsm/webxr/Text2D.js +6 -6
- package/package.json +2 -2
- package/src/Three.WebGPU.Nodes.js +4 -0
- package/src/Three.WebGPU.js +4 -0
- package/src/constants.js +1 -6
- package/src/core/BufferGeometry.js +44 -6
- package/src/geometries/CylinderGeometry.js +2 -2
- package/src/materials/LineBasicMaterial.js +6 -2
- package/src/materials/LineDashedMaterial.js +6 -2
- package/src/materials/Material.js +14 -1
- package/src/materials/MeshBasicMaterial.js +6 -2
- package/src/materials/MeshDepthMaterial.js +6 -2
- package/src/materials/MeshDistanceMaterial.js +6 -2
- package/src/materials/MeshLambertMaterial.js +6 -2
- package/src/materials/MeshMatcapMaterial.js +6 -2
- package/src/materials/MeshNormalMaterial.js +6 -2
- package/src/materials/MeshPhongMaterial.js +6 -2
- package/src/materials/MeshPhysicalMaterial.js +6 -2
- package/src/materials/MeshStandardMaterial.js +6 -2
- package/src/materials/MeshToonMaterial.js +6 -2
- package/src/materials/PointsMaterial.js +6 -2
- package/src/materials/RawShaderMaterial.js +6 -2
- package/src/materials/ShaderMaterial.js +6 -2
- package/src/materials/ShadowMaterial.js +6 -2
- package/src/materials/SpriteMaterial.js +6 -2
- package/src/materials/nodes/NodeMaterial.js +31 -9
- package/src/materials/nodes/SpriteNodeMaterial.js +11 -2
- package/src/materials/nodes/manager/NodeMaterialObserver.js +111 -2
- package/src/math/ColorManagement.js +118 -85
- package/src/math/Vector4.js +11 -0
- package/src/nodes/Nodes.js +1 -21
- package/src/nodes/TSL.js +6 -24
- package/src/nodes/accessors/Camera.js +0 -1
- package/src/nodes/accessors/SceneNode.js +35 -1
- package/src/nodes/accessors/StorageBufferNode.js +32 -10
- package/src/nodes/accessors/VelocityNode.js +13 -3
- package/src/nodes/code/FunctionCallNode.js +16 -5
- package/src/nodes/code/ScriptableNode.js +4 -4
- package/src/nodes/core/Node.js +1 -0
- package/src/nodes/core/NodeBuilder.js +29 -5
- package/src/nodes/core/VarNode.js +15 -3
- package/src/nodes/display/ColorAdjustment.js +53 -4
- package/src/nodes/display/ColorSpaceFunctions.js +5 -5
- package/src/nodes/display/ColorSpaceNode.js +27 -39
- package/src/nodes/display/PassNode.js +6 -4
- package/src/nodes/display/ToneMappingNode.js +1 -1
- package/src/nodes/display/ViewportDepthNode.js +33 -1
- package/src/nodes/functions/PhysicalLightingModel.js +21 -15
- package/src/nodes/functions/material/getAlphaHashThreshold.js +64 -0
- package/src/nodes/functions/material/getGeometryRoughness.js +8 -2
- package/src/nodes/functions/material/getParallaxCorrectNormal.js +22 -0
- package/src/nodes/gpgpu/ComputeNode.js +9 -1
- package/src/nodes/lighting/AnalyticLightNode.js +12 -416
- package/src/nodes/lighting/LightsNode.js +24 -12
- package/src/nodes/lighting/PointLightNode.js +36 -26
- package/src/nodes/lighting/RectAreaLightNode.js +3 -0
- package/src/nodes/lighting/ShadowNode.js +484 -0
- package/src/nodes/utils/LoopNode.js +2 -2
- package/src/nodes/utils/Oscillators.js +6 -0
- package/src/nodes/utils/PostProcessingUtils.js +89 -0
- package/src/nodes/utils/ReflectorNode.js +101 -15
- package/src/nodes/utils/Timer.js +29 -0
- package/src/objects/BatchedMesh.js +458 -241
- package/src/renderers/WebGLRenderer.js +120 -117
- package/src/renderers/common/Attributes.js +4 -0
- package/src/renderers/common/Backend.js +2 -0
- package/src/renderers/common/Background.js +14 -4
- package/src/renderers/common/Bindings.js +3 -2
- package/src/renderers/common/Constants.js +2 -1
- package/src/renderers/common/Geometries.js +20 -0
- package/src/renderers/common/IndirectStorageBufferAttribute.js +15 -0
- package/src/renderers/common/Lighting.js +45 -0
- package/src/renderers/common/PostProcessingUtils.js +86 -0
- package/src/renderers/common/RenderList.js +39 -11
- package/src/renderers/common/RenderLists.js +4 -2
- package/src/renderers/common/RenderObject.js +18 -1
- package/src/renderers/common/Renderer.js +165 -26
- package/src/renderers/common/Textures.js +30 -14
- package/src/renderers/common/nodes/NodeLibrary.js +1 -14
- package/src/renderers/common/nodes/Nodes.js +2 -2
- package/src/renderers/shaders/ShaderChunk/colorspace_pars_fragment.glsl.js +4 -24
- package/src/renderers/shaders/ShaderChunk/emissivemap_fragment.glsl.js +8 -0
- package/src/renderers/shaders/ShaderChunk/map_fragment.glsl.js +2 -2
- package/src/renderers/webgl/WebGLBufferRenderer.js +2 -6
- package/src/renderers/webgl/WebGLCapabilities.js +0 -7
- package/src/renderers/webgl/WebGLIndexedBufferRenderer.js +2 -6
- package/src/renderers/webgl/WebGLProgram.js +24 -28
- package/src/renderers/webgl/WebGLPrograms.js +5 -2
- package/src/renderers/webgl/WebGLState.js +37 -1
- package/src/renderers/webgl/WebGLTextures.js +29 -12
- package/src/renderers/webgl-fallback/WebGLBackend.js +98 -31
- package/src/renderers/webgl-fallback/WebGLBufferRenderer.js +2 -7
- package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +33 -8
- package/src/renderers/webgpu/WebGPUBackend.js +105 -25
- package/src/renderers/webgpu/WebGPURenderer.Nodes.js +1 -1
- package/src/renderers/webgpu/WebGPURenderer.js +1 -1
- package/src/renderers/webgpu/nodes/BasicNodeLibrary.js +0 -8
- package/src/renderers/webgpu/nodes/StandardNodeLibrary.js +0 -8
- package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +10 -20
- package/src/renderers/webgpu/nodes/WGSLNodeFunction.js +12 -4
- package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +29 -9
- package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +24 -6
- package/src/renderers/webgpu/utils/WebGPUUtils.js +0 -1
- package/src/renderers/webxr/WebXRManager.js +4 -4
- package/examples/jsm/cameras/CinematicCamera.js +0 -208
- package/src/nodes/display/FXAANode.js +0 -332
- package/src/nodes/utils/OscNode.js +0 -85
- package/src/nodes/utils/TimerNode.js +0 -97
- /package/examples/jsm/utils/{TextureUtils.js → WebGLTextureUtils.js} +0 -0
package/build/three.cjs
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
const REVISION = '
|
|
8
|
+
const REVISION = '170';
|
|
9
9
|
|
|
10
10
|
const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
|
|
11
11
|
const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
|
|
@@ -170,15 +170,10 @@ const ObjectSpaceNormalMap = 1;
|
|
|
170
170
|
const NoColorSpace = '';
|
|
171
171
|
const SRGBColorSpace = 'srgb';
|
|
172
172
|
const LinearSRGBColorSpace = 'srgb-linear';
|
|
173
|
-
const DisplayP3ColorSpace = 'display-p3';
|
|
174
|
-
const LinearDisplayP3ColorSpace = 'display-p3-linear';
|
|
175
173
|
|
|
176
174
|
const LinearTransfer = 'linear';
|
|
177
175
|
const SRGBTransfer = 'srgb';
|
|
178
176
|
|
|
179
|
-
const Rec709Primaries = 'rec709';
|
|
180
|
-
const P3Primaries = 'p3';
|
|
181
|
-
|
|
182
177
|
const ZeroStencilOp = 0;
|
|
183
178
|
const KeepStencilOp = 7680;
|
|
184
179
|
const ReplaceStencilOp = 7681;
|
|
@@ -1626,121 +1621,82 @@ function toReversedProjectionMatrix( projectionMatrix ) {
|
|
|
1626
1621
|
|
|
1627
1622
|
}
|
|
1628
1623
|
|
|
1629
|
-
/**
|
|
1630
|
-
* Matrices converting P3 <-> Rec. 709 primaries, without gamut mapping
|
|
1631
|
-
* or clipping. Based on W3C specifications for sRGB and Display P3,
|
|
1632
|
-
* and ICC specifications for the D50 connection space. Values in/out
|
|
1633
|
-
* are _linear_ sRGB and _linear_ Display P3.
|
|
1634
|
-
*
|
|
1635
|
-
* Note that both sRGB and Display P3 use the sRGB transfer functions.
|
|
1636
|
-
*
|
|
1637
|
-
* Reference:
|
|
1638
|
-
* - http://www.russellcottrell.com/photo/matrixCalculator.htm
|
|
1639
|
-
*/
|
|
1640
|
-
|
|
1641
|
-
const LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = /*@__PURE__*/ new Matrix3().set(
|
|
1642
|
-
0.8224621, 0.177538, 0.0,
|
|
1643
|
-
0.0331941, 0.9668058, 0.0,
|
|
1644
|
-
0.0170827, 0.0723974, 0.9105199,
|
|
1645
|
-
);
|
|
1646
|
-
|
|
1647
|
-
const LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = /*@__PURE__*/ new Matrix3().set(
|
|
1648
|
-
1.2249401, - 0.2249404, 0.0,
|
|
1649
|
-
- 0.0420569, 1.0420571, 0.0,
|
|
1650
|
-
- 0.0196376, - 0.0786361, 1.0982735
|
|
1651
|
-
);
|
|
1652
|
-
|
|
1653
|
-
/**
|
|
1654
|
-
* Defines supported color spaces by transfer function and primaries,
|
|
1655
|
-
* and provides conversions to/from the Linear-sRGB reference space.
|
|
1656
|
-
*/
|
|
1657
|
-
const COLOR_SPACES = {
|
|
1658
|
-
[ LinearSRGBColorSpace ]: {
|
|
1659
|
-
transfer: LinearTransfer,
|
|
1660
|
-
primaries: Rec709Primaries,
|
|
1661
|
-
luminanceCoefficients: [ 0.2126, 0.7152, 0.0722 ],
|
|
1662
|
-
toReference: ( color ) => color,
|
|
1663
|
-
fromReference: ( color ) => color,
|
|
1664
|
-
},
|
|
1665
|
-
[ SRGBColorSpace ]: {
|
|
1666
|
-
transfer: SRGBTransfer,
|
|
1667
|
-
primaries: Rec709Primaries,
|
|
1668
|
-
luminanceCoefficients: [ 0.2126, 0.7152, 0.0722 ],
|
|
1669
|
-
toReference: ( color ) => color.convertSRGBToLinear(),
|
|
1670
|
-
fromReference: ( color ) => color.convertLinearToSRGB(),
|
|
1671
|
-
},
|
|
1672
|
-
[ LinearDisplayP3ColorSpace ]: {
|
|
1673
|
-
transfer: LinearTransfer,
|
|
1674
|
-
primaries: P3Primaries,
|
|
1675
|
-
luminanceCoefficients: [ 0.2289, 0.6917, 0.0793 ],
|
|
1676
|
-
toReference: ( color ) => color.applyMatrix3( LINEAR_DISPLAY_P3_TO_LINEAR_SRGB ),
|
|
1677
|
-
fromReference: ( color ) => color.applyMatrix3( LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 ),
|
|
1678
|
-
},
|
|
1679
|
-
[ DisplayP3ColorSpace ]: {
|
|
1680
|
-
transfer: SRGBTransfer,
|
|
1681
|
-
primaries: P3Primaries,
|
|
1682
|
-
luminanceCoefficients: [ 0.2289, 0.6917, 0.0793 ],
|
|
1683
|
-
toReference: ( color ) => color.convertSRGBToLinear().applyMatrix3( LINEAR_DISPLAY_P3_TO_LINEAR_SRGB ),
|
|
1684
|
-
fromReference: ( color ) => color.applyMatrix3( LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 ).convertLinearToSRGB(),
|
|
1685
|
-
},
|
|
1686
|
-
};
|
|
1687
|
-
|
|
1688
|
-
const SUPPORTED_WORKING_COLOR_SPACES = new Set( [ LinearSRGBColorSpace, LinearDisplayP3ColorSpace ] );
|
|
1689
|
-
|
|
1690
1624
|
const ColorManagement = {
|
|
1691
1625
|
|
|
1692
1626
|
enabled: true,
|
|
1693
1627
|
|
|
1694
|
-
|
|
1628
|
+
workingColorSpace: LinearSRGBColorSpace,
|
|
1695
1629
|
|
|
1696
|
-
|
|
1630
|
+
/**
|
|
1631
|
+
* Implementations of supported color spaces.
|
|
1632
|
+
*
|
|
1633
|
+
* Required:
|
|
1634
|
+
* - primaries: chromaticity coordinates [ rx ry gx gy bx by ]
|
|
1635
|
+
* - whitePoint: reference white [ x y ]
|
|
1636
|
+
* - transfer: transfer function (pre-defined)
|
|
1637
|
+
* - toXYZ: Matrix3 RGB to XYZ transform
|
|
1638
|
+
* - fromXYZ: Matrix3 XYZ to RGB transform
|
|
1639
|
+
* - luminanceCoefficients: RGB luminance coefficients
|
|
1640
|
+
*
|
|
1641
|
+
* Optional:
|
|
1642
|
+
* - outputColorSpaceConfig: { drawingBufferColorSpace: ColorSpace }
|
|
1643
|
+
* - workingColorSpaceConfig: { unpackColorSpace: ColorSpace }
|
|
1644
|
+
*
|
|
1645
|
+
* Reference:
|
|
1646
|
+
* - https://www.russellcottrell.com/photo/matrixCalculator.htm
|
|
1647
|
+
*/
|
|
1648
|
+
spaces: {},
|
|
1697
1649
|
|
|
1698
|
-
|
|
1650
|
+
convert: function ( color, sourceColorSpace, targetColorSpace ) {
|
|
1699
1651
|
|
|
1700
|
-
|
|
1652
|
+
if ( this.enabled === false || sourceColorSpace === targetColorSpace || ! sourceColorSpace || ! targetColorSpace ) {
|
|
1701
1653
|
|
|
1702
|
-
|
|
1654
|
+
return color;
|
|
1703
1655
|
|
|
1704
|
-
|
|
1656
|
+
}
|
|
1705
1657
|
|
|
1706
|
-
|
|
1658
|
+
if ( this.spaces[ sourceColorSpace ].transfer === SRGBTransfer ) {
|
|
1659
|
+
|
|
1660
|
+
color.r = SRGBToLinear( color.r );
|
|
1661
|
+
color.g = SRGBToLinear( color.g );
|
|
1662
|
+
color.b = SRGBToLinear( color.b );
|
|
1707
1663
|
|
|
1708
1664
|
}
|
|
1709
1665
|
|
|
1710
|
-
this.
|
|
1666
|
+
if ( this.spaces[ sourceColorSpace ].primaries !== this.spaces[ targetColorSpace ].primaries ) {
|
|
1711
1667
|
|
|
1712
|
-
|
|
1668
|
+
color.applyMatrix3( this.spaces[ sourceColorSpace ].toXYZ );
|
|
1669
|
+
color.applyMatrix3( this.spaces[ targetColorSpace ].fromXYZ );
|
|
1713
1670
|
|
|
1714
|
-
|
|
1671
|
+
}
|
|
1715
1672
|
|
|
1716
|
-
if ( this.
|
|
1673
|
+
if ( this.spaces[ targetColorSpace ].transfer === SRGBTransfer ) {
|
|
1717
1674
|
|
|
1718
|
-
|
|
1675
|
+
color.r = LinearToSRGB( color.r );
|
|
1676
|
+
color.g = LinearToSRGB( color.g );
|
|
1677
|
+
color.b = LinearToSRGB( color.b );
|
|
1719
1678
|
|
|
1720
1679
|
}
|
|
1721
1680
|
|
|
1722
|
-
|
|
1723
|
-
const targetFromReference = COLOR_SPACES[ targetColorSpace ].fromReference;
|
|
1724
|
-
|
|
1725
|
-
return targetFromReference( sourceToReference( color ) );
|
|
1681
|
+
return color;
|
|
1726
1682
|
|
|
1727
1683
|
},
|
|
1728
1684
|
|
|
1729
1685
|
fromWorkingColorSpace: function ( color, targetColorSpace ) {
|
|
1730
1686
|
|
|
1731
|
-
return this.convert( color, this.
|
|
1687
|
+
return this.convert( color, this.workingColorSpace, targetColorSpace );
|
|
1732
1688
|
|
|
1733
1689
|
},
|
|
1734
1690
|
|
|
1735
1691
|
toWorkingColorSpace: function ( color, sourceColorSpace ) {
|
|
1736
1692
|
|
|
1737
|
-
return this.convert( color, sourceColorSpace, this.
|
|
1693
|
+
return this.convert( color, sourceColorSpace, this.workingColorSpace );
|
|
1738
1694
|
|
|
1739
1695
|
},
|
|
1740
1696
|
|
|
1741
1697
|
getPrimaries: function ( colorSpace ) {
|
|
1742
1698
|
|
|
1743
|
-
return
|
|
1699
|
+
return this.spaces[ colorSpace ].primaries;
|
|
1744
1700
|
|
|
1745
1701
|
},
|
|
1746
1702
|
|
|
@@ -1748,18 +1704,45 @@ const ColorManagement = {
|
|
|
1748
1704
|
|
|
1749
1705
|
if ( colorSpace === NoColorSpace ) return LinearTransfer;
|
|
1750
1706
|
|
|
1751
|
-
return
|
|
1707
|
+
return this.spaces[ colorSpace ].transfer;
|
|
1752
1708
|
|
|
1753
1709
|
},
|
|
1754
1710
|
|
|
1755
|
-
getLuminanceCoefficients: function ( target, colorSpace = this.
|
|
1711
|
+
getLuminanceCoefficients: function ( target, colorSpace = this.workingColorSpace ) {
|
|
1756
1712
|
|
|
1757
|
-
return target.fromArray(
|
|
1713
|
+
return target.fromArray( this.spaces[ colorSpace ].luminanceCoefficients );
|
|
1758
1714
|
|
|
1759
1715
|
},
|
|
1760
1716
|
|
|
1761
|
-
|
|
1717
|
+
define: function ( colorSpaces ) {
|
|
1718
|
+
|
|
1719
|
+
Object.assign( this.spaces, colorSpaces );
|
|
1720
|
+
|
|
1721
|
+
},
|
|
1762
1722
|
|
|
1723
|
+
// Internal APIs
|
|
1724
|
+
|
|
1725
|
+
_getMatrix: function ( targetMatrix, sourceColorSpace, targetColorSpace ) {
|
|
1726
|
+
|
|
1727
|
+
return targetMatrix
|
|
1728
|
+
.copy( this.spaces[ sourceColorSpace ].toXYZ )
|
|
1729
|
+
.multiply( this.spaces[ targetColorSpace ].fromXYZ );
|
|
1730
|
+
|
|
1731
|
+
},
|
|
1732
|
+
|
|
1733
|
+
_getDrawingBufferColorSpace: function ( colorSpace ) {
|
|
1734
|
+
|
|
1735
|
+
return this.spaces[ colorSpace ].outputColorSpaceConfig.drawingBufferColorSpace;
|
|
1736
|
+
|
|
1737
|
+
},
|
|
1738
|
+
|
|
1739
|
+
_getUnpackColorSpace: function ( colorSpace = this.workingColorSpace ) {
|
|
1740
|
+
|
|
1741
|
+
return this.spaces[ colorSpace ].workingColorSpaceConfig.unpackColorSpace;
|
|
1742
|
+
|
|
1743
|
+
}
|
|
1744
|
+
|
|
1745
|
+
};
|
|
1763
1746
|
|
|
1764
1747
|
function SRGBToLinear( c ) {
|
|
1765
1748
|
|
|
@@ -1773,6 +1756,51 @@ function LinearToSRGB( c ) {
|
|
|
1773
1756
|
|
|
1774
1757
|
}
|
|
1775
1758
|
|
|
1759
|
+
/******************************************************************************
|
|
1760
|
+
* sRGB definitions
|
|
1761
|
+
*/
|
|
1762
|
+
|
|
1763
|
+
const REC709_PRIMARIES = [ 0.640, 0.330, 0.300, 0.600, 0.150, 0.060 ];
|
|
1764
|
+
const REC709_LUMINANCE_COEFFICIENTS = [ 0.2126, 0.7152, 0.0722 ];
|
|
1765
|
+
const D65 = [ 0.3127, 0.3290 ];
|
|
1766
|
+
|
|
1767
|
+
const LINEAR_REC709_TO_XYZ = /*@__PURE__*/ new Matrix3().set(
|
|
1768
|
+
0.4123908, 0.3575843, 0.1804808,
|
|
1769
|
+
0.2126390, 0.7151687, 0.0721923,
|
|
1770
|
+
0.0193308, 0.1191948, 0.9505322
|
|
1771
|
+
);
|
|
1772
|
+
|
|
1773
|
+
const XYZ_TO_LINEAR_REC709 = /*@__PURE__*/ new Matrix3().set(
|
|
1774
|
+
3.2409699, - 1.5373832, - 0.4986108,
|
|
1775
|
+
- 0.9692436, 1.8759675, 0.0415551,
|
|
1776
|
+
0.0556301, - 0.2039770, 1.0569715
|
|
1777
|
+
);
|
|
1778
|
+
|
|
1779
|
+
ColorManagement.define( {
|
|
1780
|
+
|
|
1781
|
+
[ LinearSRGBColorSpace ]: {
|
|
1782
|
+
primaries: REC709_PRIMARIES,
|
|
1783
|
+
whitePoint: D65,
|
|
1784
|
+
transfer: LinearTransfer,
|
|
1785
|
+
toXYZ: LINEAR_REC709_TO_XYZ,
|
|
1786
|
+
fromXYZ: XYZ_TO_LINEAR_REC709,
|
|
1787
|
+
luminanceCoefficients: REC709_LUMINANCE_COEFFICIENTS,
|
|
1788
|
+
workingColorSpaceConfig: { unpackColorSpace: SRGBColorSpace },
|
|
1789
|
+
outputColorSpaceConfig: { drawingBufferColorSpace: SRGBColorSpace }
|
|
1790
|
+
},
|
|
1791
|
+
|
|
1792
|
+
[ SRGBColorSpace ]: {
|
|
1793
|
+
primaries: REC709_PRIMARIES,
|
|
1794
|
+
whitePoint: D65,
|
|
1795
|
+
transfer: SRGBTransfer,
|
|
1796
|
+
toXYZ: LINEAR_REC709_TO_XYZ,
|
|
1797
|
+
fromXYZ: XYZ_TO_LINEAR_REC709,
|
|
1798
|
+
luminanceCoefficients: REC709_LUMINANCE_COEFFICIENTS,
|
|
1799
|
+
outputColorSpaceConfig: { drawingBufferColorSpace: SRGBColorSpace }
|
|
1800
|
+
},
|
|
1801
|
+
|
|
1802
|
+
} );
|
|
1803
|
+
|
|
1776
1804
|
let _canvas;
|
|
1777
1805
|
|
|
1778
1806
|
class ImageUtils {
|
|
@@ -2575,6 +2603,17 @@ class Vector4 {
|
|
|
2575
2603
|
|
|
2576
2604
|
}
|
|
2577
2605
|
|
|
2606
|
+
divide( v ) {
|
|
2607
|
+
|
|
2608
|
+
this.x /= v.x;
|
|
2609
|
+
this.y /= v.y;
|
|
2610
|
+
this.z /= v.z;
|
|
2611
|
+
this.w /= v.w;
|
|
2612
|
+
|
|
2613
|
+
return this;
|
|
2614
|
+
|
|
2615
|
+
}
|
|
2616
|
+
|
|
2578
2617
|
divideScalar( scalar ) {
|
|
2579
2618
|
|
|
2580
2619
|
return this.multiplyScalar( 1 / scalar );
|
|
@@ -9162,6 +9201,20 @@ let _materialId = 0;
|
|
|
9162
9201
|
|
|
9163
9202
|
class Material extends EventDispatcher {
|
|
9164
9203
|
|
|
9204
|
+
static get type() {
|
|
9205
|
+
|
|
9206
|
+
return 'Material';
|
|
9207
|
+
|
|
9208
|
+
}
|
|
9209
|
+
|
|
9210
|
+
get type() {
|
|
9211
|
+
|
|
9212
|
+
return this.constructor.type;
|
|
9213
|
+
|
|
9214
|
+
}
|
|
9215
|
+
|
|
9216
|
+
set type( _value ) { /* */ }
|
|
9217
|
+
|
|
9165
9218
|
constructor() {
|
|
9166
9219
|
|
|
9167
9220
|
super();
|
|
@@ -9173,7 +9226,6 @@ class Material extends EventDispatcher {
|
|
|
9173
9226
|
this.uuid = generateUUID();
|
|
9174
9227
|
|
|
9175
9228
|
this.name = '';
|
|
9176
|
-
this.type = 'Material';
|
|
9177
9229
|
|
|
9178
9230
|
this.blending = NormalBlending;
|
|
9179
9231
|
this.side = FrontSide;
|
|
@@ -9685,14 +9737,18 @@ class Material extends EventDispatcher {
|
|
|
9685
9737
|
|
|
9686
9738
|
class MeshBasicMaterial extends Material {
|
|
9687
9739
|
|
|
9740
|
+
static get type() {
|
|
9741
|
+
|
|
9742
|
+
return 'MeshBasicMaterial';
|
|
9743
|
+
|
|
9744
|
+
}
|
|
9745
|
+
|
|
9688
9746
|
constructor( parameters ) {
|
|
9689
9747
|
|
|
9690
9748
|
super();
|
|
9691
9749
|
|
|
9692
9750
|
this.isMeshBasicMaterial = true;
|
|
9693
9751
|
|
|
9694
|
-
this.type = 'MeshBasicMaterial';
|
|
9695
|
-
|
|
9696
9752
|
this.color = new Color( 0xffffff ); // emissive
|
|
9697
9753
|
|
|
9698
9754
|
this.map = null;
|
|
@@ -10565,6 +10621,7 @@ class BufferGeometry extends EventDispatcher {
|
|
|
10565
10621
|
this.type = 'BufferGeometry';
|
|
10566
10622
|
|
|
10567
10623
|
this.index = null;
|
|
10624
|
+
this.indirect = null;
|
|
10568
10625
|
this.attributes = {};
|
|
10569
10626
|
|
|
10570
10627
|
this.morphAttributes = {};
|
|
@@ -10603,6 +10660,20 @@ class BufferGeometry extends EventDispatcher {
|
|
|
10603
10660
|
|
|
10604
10661
|
}
|
|
10605
10662
|
|
|
10663
|
+
setIndirect( indirect ) {
|
|
10664
|
+
|
|
10665
|
+
this.indirect = indirect;
|
|
10666
|
+
|
|
10667
|
+
return this;
|
|
10668
|
+
|
|
10669
|
+
}
|
|
10670
|
+
|
|
10671
|
+
getIndirect() {
|
|
10672
|
+
|
|
10673
|
+
return this.indirect;
|
|
10674
|
+
|
|
10675
|
+
}
|
|
10676
|
+
|
|
10606
10677
|
getAttribute( name ) {
|
|
10607
10678
|
|
|
10608
10679
|
return this.attributes[ name ];
|
|
@@ -10802,16 +10873,39 @@ class BufferGeometry extends EventDispatcher {
|
|
|
10802
10873
|
|
|
10803
10874
|
setFromPoints( points ) {
|
|
10804
10875
|
|
|
10805
|
-
const
|
|
10876
|
+
const positionAttribute = this.getAttribute( 'position' );
|
|
10806
10877
|
|
|
10807
|
-
|
|
10878
|
+
if ( positionAttribute === undefined ) {
|
|
10808
10879
|
|
|
10809
|
-
const
|
|
10810
|
-
position.push( point.x, point.y, point.z || 0 );
|
|
10880
|
+
const position = [];
|
|
10811
10881
|
|
|
10812
|
-
|
|
10882
|
+
for ( let i = 0, l = points.length; i < l; i ++ ) {
|
|
10883
|
+
|
|
10884
|
+
const point = points[ i ];
|
|
10885
|
+
position.push( point.x, point.y, point.z || 0 );
|
|
10813
10886
|
|
|
10814
|
-
|
|
10887
|
+
}
|
|
10888
|
+
|
|
10889
|
+
this.setAttribute( 'position', new Float32BufferAttribute( position, 3 ) );
|
|
10890
|
+
|
|
10891
|
+
} else {
|
|
10892
|
+
|
|
10893
|
+
for ( let i = 0, l = positionAttribute.count; i < l; i ++ ) {
|
|
10894
|
+
|
|
10895
|
+
const point = points[ i ];
|
|
10896
|
+
positionAttribute.setXYZ( i, point.x, point.y, point.z || 0 );
|
|
10897
|
+
|
|
10898
|
+
}
|
|
10899
|
+
|
|
10900
|
+
if ( points.length > positionAttribute.count ) {
|
|
10901
|
+
|
|
10902
|
+
console.warn( 'THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry.' );
|
|
10903
|
+
|
|
10904
|
+
}
|
|
10905
|
+
|
|
10906
|
+
positionAttribute.needsUpdate = true;
|
|
10907
|
+
|
|
10908
|
+
}
|
|
10815
10909
|
|
|
10816
10910
|
return this;
|
|
10817
10911
|
|
|
@@ -12291,14 +12385,18 @@ var default_fragment = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0
|
|
|
12291
12385
|
|
|
12292
12386
|
class ShaderMaterial extends Material {
|
|
12293
12387
|
|
|
12388
|
+
static get type() {
|
|
12389
|
+
|
|
12390
|
+
return 'ShaderMaterial';
|
|
12391
|
+
|
|
12392
|
+
}
|
|
12393
|
+
|
|
12294
12394
|
constructor( parameters ) {
|
|
12295
12395
|
|
|
12296
12396
|
super();
|
|
12297
12397
|
|
|
12298
12398
|
this.isShaderMaterial = true;
|
|
12299
12399
|
|
|
12300
|
-
this.type = 'ShaderMaterial';
|
|
12301
|
-
|
|
12302
12400
|
this.defines = {};
|
|
12303
12401
|
this.uniforms = {};
|
|
12304
12402
|
this.uniformsGroups = [];
|
|
@@ -13939,13 +14037,13 @@ var displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler
|
|
|
13939
14037
|
|
|
13940
14038
|
var displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif";
|
|
13941
14039
|
|
|
13942
|
-
var emissivemap_fragment = "#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif";
|
|
14040
|
+
var emissivemap_fragment = "#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE\n\t\temissiveColor = sRGBTransferEOTF( emissiveColor );\n\t#endif\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif";
|
|
13943
14041
|
|
|
13944
14042
|
var emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif";
|
|
13945
14043
|
|
|
13946
14044
|
var colorspace_fragment = "gl_FragColor = linearToOutputTexel( gl_FragColor );";
|
|
13947
14045
|
|
|
13948
|
-
var colorspace_pars_fragment = "
|
|
14046
|
+
var colorspace_pars_fragment = "vec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferEOTF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}";
|
|
13949
14047
|
|
|
13950
14048
|
var envmap_fragment = "#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif";
|
|
13951
14049
|
|
|
@@ -14003,7 +14101,7 @@ var logdepthbuf_pars_vertex = "#ifdef USE_LOGDEPTHBUF\n\tvarying float vFragDept
|
|
|
14003
14101
|
|
|
14004
14102
|
var logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n\tvFragDepth = 1.0 + gl_Position.w;\n\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif";
|
|
14005
14103
|
|
|
14006
|
-
var map_fragment = "#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor =
|
|
14104
|
+
var map_fragment = "#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif";
|
|
14007
14105
|
|
|
14008
14106
|
var map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif";
|
|
14009
14107
|
|
|
@@ -15811,15 +15909,11 @@ function WebGLBufferRenderer( gl, extensions, info ) {
|
|
|
15811
15909
|
let elementCount = 0;
|
|
15812
15910
|
for ( let i = 0; i < drawCount; i ++ ) {
|
|
15813
15911
|
|
|
15814
|
-
elementCount += counts[ i ];
|
|
15912
|
+
elementCount += counts[ i ] * primcount[ i ];
|
|
15815
15913
|
|
|
15816
15914
|
}
|
|
15817
15915
|
|
|
15818
|
-
|
|
15819
|
-
|
|
15820
|
-
info.update( elementCount, mode, primcount[ i ] );
|
|
15821
|
-
|
|
15822
|
-
}
|
|
15916
|
+
info.update( elementCount, mode, 1 );
|
|
15823
15917
|
|
|
15824
15918
|
}
|
|
15825
15919
|
|
|
@@ -15929,13 +16023,6 @@ function WebGLCapabilities( gl, extensions, parameters, utils ) {
|
|
|
15929
16023
|
const logarithmicDepthBuffer = parameters.logarithmicDepthBuffer === true;
|
|
15930
16024
|
const reverseDepthBuffer = parameters.reverseDepthBuffer === true && extensions.has( 'EXT_clip_control' );
|
|
15931
16025
|
|
|
15932
|
-
if ( reverseDepthBuffer === true ) {
|
|
15933
|
-
|
|
15934
|
-
const ext = extensions.get( 'EXT_clip_control' );
|
|
15935
|
-
ext.clipControlEXT( ext.LOWER_LEFT_EXT, ext.ZERO_TO_ONE_EXT );
|
|
15936
|
-
|
|
15937
|
-
}
|
|
15938
|
-
|
|
15939
16026
|
const maxTextures = gl.getParameter( gl.MAX_TEXTURE_IMAGE_UNITS );
|
|
15940
16027
|
const maxVertexTextures = gl.getParameter( gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS );
|
|
15941
16028
|
const maxTextureSize = gl.getParameter( gl.MAX_TEXTURE_SIZE );
|
|
@@ -17761,15 +17848,11 @@ function WebGLIndexedBufferRenderer( gl, extensions, info ) {
|
|
|
17761
17848
|
let elementCount = 0;
|
|
17762
17849
|
for ( let i = 0; i < drawCount; i ++ ) {
|
|
17763
17850
|
|
|
17764
|
-
elementCount += counts[ i ];
|
|
17851
|
+
elementCount += counts[ i ] * primcount[ i ];
|
|
17765
17852
|
|
|
17766
17853
|
}
|
|
17767
17854
|
|
|
17768
|
-
|
|
17769
|
-
|
|
17770
|
-
info.update( elementCount, mode, primcount[ i ] );
|
|
17771
|
-
|
|
17772
|
-
}
|
|
17855
|
+
info.update( elementCount, mode, 1 );
|
|
17773
17856
|
|
|
17774
17857
|
}
|
|
17775
17858
|
|
|
@@ -19449,40 +19532,25 @@ function handleSource( string, errorLine ) {
|
|
|
19449
19532
|
|
|
19450
19533
|
}
|
|
19451
19534
|
|
|
19452
|
-
|
|
19453
|
-
|
|
19454
|
-
const workingPrimaries = ColorManagement.getPrimaries( ColorManagement.workingColorSpace );
|
|
19455
|
-
const encodingPrimaries = ColorManagement.getPrimaries( colorSpace );
|
|
19456
|
-
|
|
19457
|
-
let gamutMapping;
|
|
19458
|
-
|
|
19459
|
-
if ( workingPrimaries === encodingPrimaries ) {
|
|
19460
|
-
|
|
19461
|
-
gamutMapping = '';
|
|
19535
|
+
const _m0 = /*@__PURE__*/ new Matrix3();
|
|
19462
19536
|
|
|
19463
|
-
|
|
19464
|
-
|
|
19465
|
-
gamutMapping = 'LinearDisplayP3ToLinearSRGB';
|
|
19466
|
-
|
|
19467
|
-
} else if ( workingPrimaries === Rec709Primaries && encodingPrimaries === P3Primaries ) {
|
|
19537
|
+
function getEncodingComponents( colorSpace ) {
|
|
19468
19538
|
|
|
19469
|
-
|
|
19539
|
+
ColorManagement._getMatrix( _m0, ColorManagement.workingColorSpace, colorSpace );
|
|
19470
19540
|
|
|
19471
|
-
}
|
|
19541
|
+
const encodingMatrix = `mat3( ${ _m0.elements.map( ( v ) => v.toFixed( 4 ) ) } )`;
|
|
19472
19542
|
|
|
19473
|
-
switch ( colorSpace ) {
|
|
19543
|
+
switch ( ColorManagement.getTransfer( colorSpace ) ) {
|
|
19474
19544
|
|
|
19475
|
-
case
|
|
19476
|
-
|
|
19477
|
-
return [ gamutMapping, 'LinearTransferOETF' ];
|
|
19545
|
+
case LinearTransfer:
|
|
19546
|
+
return [ encodingMatrix, 'LinearTransferOETF' ];
|
|
19478
19547
|
|
|
19479
|
-
case
|
|
19480
|
-
|
|
19481
|
-
return [ gamutMapping, 'sRGBTransferOETF' ];
|
|
19548
|
+
case SRGBTransfer:
|
|
19549
|
+
return [ encodingMatrix, 'sRGBTransferOETF' ];
|
|
19482
19550
|
|
|
19483
19551
|
default:
|
|
19484
|
-
console.warn( 'THREE.WebGLProgram: Unsupported color space:', colorSpace );
|
|
19485
|
-
return [
|
|
19552
|
+
console.warn( 'THREE.WebGLProgram: Unsupported color space: ', colorSpace );
|
|
19553
|
+
return [ encodingMatrix, 'LinearTransferOETF' ];
|
|
19486
19554
|
|
|
19487
19555
|
}
|
|
19488
19556
|
|
|
@@ -19515,7 +19583,16 @@ function getShaderErrors( gl, shader, type ) {
|
|
|
19515
19583
|
function getTexelEncodingFunction( functionName, colorSpace ) {
|
|
19516
19584
|
|
|
19517
19585
|
const components = getEncodingComponents( colorSpace );
|
|
19518
|
-
|
|
19586
|
+
|
|
19587
|
+
return [
|
|
19588
|
+
|
|
19589
|
+
`vec4 ${functionName}( vec4 value ) {`,
|
|
19590
|
+
|
|
19591
|
+
` return ${components[ 1 ]}( vec4( value.rgb * ${components[ 0 ]}, value.a ) );`,
|
|
19592
|
+
|
|
19593
|
+
'}',
|
|
19594
|
+
|
|
19595
|
+
].join( '\n' );
|
|
19519
19596
|
|
|
19520
19597
|
}
|
|
19521
19598
|
|
|
@@ -20243,6 +20320,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
|
|
|
20243
20320
|
parameters.numLightProbes > 0 ? '#define USE_LIGHT_PROBES' : '',
|
|
20244
20321
|
|
|
20245
20322
|
parameters.decodeVideoTexture ? '#define DECODE_VIDEO_TEXTURE' : '',
|
|
20323
|
+
parameters.decodeVideoTextureEmissive ? '#define DECODE_VIDEO_TEXTURE_EMISSIVE' : '',
|
|
20246
20324
|
|
|
20247
20325
|
parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',
|
|
20248
20326
|
parameters.reverseDepthBuffer ? '#define USE_REVERSEDEPTHBUF' : '',
|
|
@@ -20686,7 +20764,6 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
|
|
|
20686
20764
|
const programs = [];
|
|
20687
20765
|
|
|
20688
20766
|
const logarithmicDepthBuffer = capabilities.logarithmicDepthBuffer;
|
|
20689
|
-
const reverseDepthBuffer = capabilities.reverseDepthBuffer;
|
|
20690
20767
|
const SUPPORTS_VERTEX_TEXTURES = capabilities.vertexTextures;
|
|
20691
20768
|
|
|
20692
20769
|
let precision = capabilities.precision;
|
|
@@ -20781,6 +20858,7 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
|
|
|
20781
20858
|
}
|
|
20782
20859
|
|
|
20783
20860
|
const currentRenderTarget = renderer.getRenderTarget();
|
|
20861
|
+
const reverseDepthBuffer = renderer.state.buffers.depth.getReversed();
|
|
20784
20862
|
|
|
20785
20863
|
const numMultiviewViews = currentRenderTarget && currentRenderTarget.isWebGLMultiviewRenderTarget ? currentRenderTarget.numViews : 0;
|
|
20786
20864
|
|
|
@@ -21016,6 +21094,7 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
|
|
|
21016
21094
|
toneMapping: toneMapping,
|
|
21017
21095
|
|
|
21018
21096
|
decodeVideoTexture: HAS_MAP && ( material.map.isVideoTexture === true ) && ( ColorManagement.getTransfer( material.map.colorSpace ) === SRGBTransfer ),
|
|
21097
|
+
decodeVideoTextureEmissive: HAS_EMISSIVEMAP && ( material.emissiveMap.isVideoTexture === true ) && ( ColorManagement.getTransfer( material.emissiveMap.colorSpace ) === SRGBTransfer ),
|
|
21019
21098
|
|
|
21020
21099
|
premultipliedAlpha: material.premultipliedAlpha,
|
|
21021
21100
|
|
|
@@ -21233,8 +21312,10 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
|
|
|
21233
21312
|
_programLayers.enable( 18 );
|
|
21234
21313
|
if ( parameters.decodeVideoTexture )
|
|
21235
21314
|
_programLayers.enable( 19 );
|
|
21236
|
-
if ( parameters.
|
|
21315
|
+
if ( parameters.decodeVideoTextureEmissive )
|
|
21237
21316
|
_programLayers.enable( 20 );
|
|
21317
|
+
if ( parameters.alphaToCoverage )
|
|
21318
|
+
_programLayers.enable( 21 );
|
|
21238
21319
|
if ( parameters.numMultiviewViews )
|
|
21239
21320
|
_programLayers.enable( 21 );
|
|
21240
21321
|
|
|
@@ -22294,14 +22375,18 @@ function WebGLRenderStates( extensions ) {
|
|
|
22294
22375
|
|
|
22295
22376
|
class MeshDepthMaterial extends Material {
|
|
22296
22377
|
|
|
22378
|
+
static get type() {
|
|
22379
|
+
|
|
22380
|
+
return 'MeshDepthMaterial';
|
|
22381
|
+
|
|
22382
|
+
}
|
|
22383
|
+
|
|
22297
22384
|
constructor( parameters ) {
|
|
22298
22385
|
|
|
22299
22386
|
super();
|
|
22300
22387
|
|
|
22301
22388
|
this.isMeshDepthMaterial = true;
|
|
22302
22389
|
|
|
22303
|
-
this.type = 'MeshDepthMaterial';
|
|
22304
|
-
|
|
22305
22390
|
this.depthPacking = BasicDepthPacking;
|
|
22306
22391
|
|
|
22307
22392
|
this.map = null;
|
|
@@ -22344,14 +22429,18 @@ class MeshDepthMaterial extends Material {
|
|
|
22344
22429
|
|
|
22345
22430
|
class MeshDistanceMaterial extends Material {
|
|
22346
22431
|
|
|
22432
|
+
static get type() {
|
|
22433
|
+
|
|
22434
|
+
return 'MeshDistanceMaterial';
|
|
22435
|
+
|
|
22436
|
+
}
|
|
22437
|
+
|
|
22347
22438
|
constructor( parameters ) {
|
|
22348
22439
|
|
|
22349
22440
|
super();
|
|
22350
22441
|
|
|
22351
22442
|
this.isMeshDistanceMaterial = true;
|
|
22352
22443
|
|
|
22353
|
-
this.type = 'MeshDistanceMaterial';
|
|
22354
|
-
|
|
22355
22444
|
this.map = null;
|
|
22356
22445
|
|
|
22357
22446
|
this.alphaMap = null;
|
|
@@ -22806,7 +22895,7 @@ const reversedFuncs = {
|
|
|
22806
22895
|
[ GreaterEqualDepth ]: LessEqualDepth,
|
|
22807
22896
|
};
|
|
22808
22897
|
|
|
22809
|
-
function WebGLState( gl ) {
|
|
22898
|
+
function WebGLState( gl, extensions ) {
|
|
22810
22899
|
|
|
22811
22900
|
function ColorBuffer() {
|
|
22812
22901
|
|
|
@@ -22880,10 +22969,36 @@ function WebGLState( gl ) {
|
|
|
22880
22969
|
|
|
22881
22970
|
setReversed: function ( value ) {
|
|
22882
22971
|
|
|
22972
|
+
if ( reversed !== value ) {
|
|
22973
|
+
|
|
22974
|
+
const ext = extensions.get( 'EXT_clip_control' );
|
|
22975
|
+
|
|
22976
|
+
if ( reversed ) {
|
|
22977
|
+
|
|
22978
|
+
ext.clipControlEXT( ext.LOWER_LEFT_EXT, ext.ZERO_TO_ONE_EXT );
|
|
22979
|
+
|
|
22980
|
+
} else {
|
|
22981
|
+
|
|
22982
|
+
ext.clipControlEXT( ext.LOWER_LEFT_EXT, ext.NEGATIVE_ONE_TO_ONE_EXT );
|
|
22983
|
+
|
|
22984
|
+
}
|
|
22985
|
+
|
|
22986
|
+
const oldDepth = currentDepthClear;
|
|
22987
|
+
currentDepthClear = null;
|
|
22988
|
+
this.setClear( oldDepth );
|
|
22989
|
+
|
|
22990
|
+
}
|
|
22991
|
+
|
|
22883
22992
|
reversed = value;
|
|
22884
22993
|
|
|
22885
22994
|
},
|
|
22886
22995
|
|
|
22996
|
+
getReversed: function () {
|
|
22997
|
+
|
|
22998
|
+
return reversed;
|
|
22999
|
+
|
|
23000
|
+
},
|
|
23001
|
+
|
|
22887
23002
|
setTest: function ( depthTest ) {
|
|
22888
23003
|
|
|
22889
23004
|
if ( depthTest ) {
|
|
@@ -22979,6 +23094,12 @@ function WebGLState( gl ) {
|
|
|
22979
23094
|
|
|
22980
23095
|
if ( currentDepthClear !== depth ) {
|
|
22981
23096
|
|
|
23097
|
+
if ( reversed ) {
|
|
23098
|
+
|
|
23099
|
+
depth = 1 - depth;
|
|
23100
|
+
|
|
23101
|
+
}
|
|
23102
|
+
|
|
22982
23103
|
gl.clearDepth( depth );
|
|
22983
23104
|
currentDepthClear = depth;
|
|
22984
23105
|
|
|
@@ -22993,6 +23114,7 @@ function WebGLState( gl ) {
|
|
|
22993
23114
|
currentDepthMask = null;
|
|
22994
23115
|
currentDepthFunc = null;
|
|
22995
23116
|
currentDepthClear = null;
|
|
23117
|
+
reversed = false;
|
|
22996
23118
|
|
|
22997
23119
|
}
|
|
22998
23120
|
|
|
@@ -23963,6 +24085,9 @@ function WebGLState( gl ) {
|
|
|
23963
24085
|
|
|
23964
24086
|
gl.depthMask( true );
|
|
23965
24087
|
gl.depthFunc( gl.LESS );
|
|
24088
|
+
|
|
24089
|
+
depthBuffer.setReversed( false );
|
|
24090
|
+
|
|
23966
24091
|
gl.clearDepth( 1 );
|
|
23967
24092
|
|
|
23968
24093
|
gl.stencilMask( 0xffffffff );
|
|
@@ -24398,7 +24523,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
24398
24523
|
|
|
24399
24524
|
function textureNeedsGenerateMipmaps( texture ) {
|
|
24400
24525
|
|
|
24401
|
-
return texture.generateMipmaps
|
|
24526
|
+
return texture.generateMipmaps;
|
|
24402
24527
|
|
|
24403
24528
|
}
|
|
24404
24529
|
|
|
@@ -24408,6 +24533,15 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
24408
24533
|
|
|
24409
24534
|
}
|
|
24410
24535
|
|
|
24536
|
+
function getTargetType( texture ) {
|
|
24537
|
+
|
|
24538
|
+
if ( texture.isWebGLCubeRenderTarget ) return _gl.TEXTURE_CUBE_MAP;
|
|
24539
|
+
if ( texture.isWebGL3DRenderTarget ) return _gl.TEXTURE_3D;
|
|
24540
|
+
if ( texture.isWebGLArrayRenderTarget || texture.isCompressedArrayTexture ) return _gl.TEXTURE_2D_ARRAY;
|
|
24541
|
+
return _gl.TEXTURE_2D;
|
|
24542
|
+
|
|
24543
|
+
}
|
|
24544
|
+
|
|
24411
24545
|
function getInternalFormat( internalFormatName, glFormat, glType, colorSpace, forceLinearTransfer = false ) {
|
|
24412
24546
|
|
|
24413
24547
|
if ( internalFormatName !== null ) {
|
|
@@ -24667,6 +24801,8 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
24667
24801
|
|
|
24668
24802
|
renderTarget.depthTexture.dispose();
|
|
24669
24803
|
|
|
24804
|
+
properties.remove( renderTarget.depthTexture );
|
|
24805
|
+
|
|
24670
24806
|
}
|
|
24671
24807
|
|
|
24672
24808
|
if ( renderTarget.isWebGLCubeRenderTarget ) {
|
|
@@ -25216,7 +25352,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
25216
25352
|
layerIndex * layerByteLength / mipmap.data.BYTES_PER_ELEMENT,
|
|
25217
25353
|
( layerIndex + 1 ) * layerByteLength / mipmap.data.BYTES_PER_ELEMENT
|
|
25218
25354
|
);
|
|
25219
|
-
state.compressedTexSubImage3D( _gl.TEXTURE_2D_ARRAY, i, 0, 0, layerIndex, mipmap.width, mipmap.height, 1, glFormat, layerData
|
|
25355
|
+
state.compressedTexSubImage3D( _gl.TEXTURE_2D_ARRAY, i, 0, 0, layerIndex, mipmap.width, mipmap.height, 1, glFormat, layerData );
|
|
25220
25356
|
|
|
25221
25357
|
}
|
|
25222
25358
|
|
|
@@ -25224,7 +25360,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
25224
25360
|
|
|
25225
25361
|
} else {
|
|
25226
25362
|
|
|
25227
|
-
state.compressedTexSubImage3D( _gl.TEXTURE_2D_ARRAY, i, 0, 0, 0, mipmap.width, mipmap.height, image.depth, glFormat, mipmap.data
|
|
25363
|
+
state.compressedTexSubImage3D( _gl.TEXTURE_2D_ARRAY, i, 0, 0, 0, mipmap.width, mipmap.height, image.depth, glFormat, mipmap.data );
|
|
25228
25364
|
|
|
25229
25365
|
}
|
|
25230
25366
|
|
|
@@ -25740,6 +25876,9 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
25740
25876
|
const glType = utils.convert( texture.type );
|
|
25741
25877
|
const glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace );
|
|
25742
25878
|
const renderTargetProperties = properties.get( renderTarget );
|
|
25879
|
+
const textureProperties = properties.get( texture );
|
|
25880
|
+
|
|
25881
|
+
textureProperties.__renderTarget = renderTarget;
|
|
25743
25882
|
|
|
25744
25883
|
if ( ! renderTargetProperties.__hasExternalTextures ) {
|
|
25745
25884
|
|
|
@@ -25770,11 +25909,11 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
25770
25909
|
|
|
25771
25910
|
if ( multisampled ) {
|
|
25772
25911
|
|
|
25773
|
-
multiviewExt.framebufferTextureMultisampleMultiviewOVR( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0,
|
|
25912
|
+
multiviewExt.framebufferTextureMultisampleMultiviewOVR( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, textureProperties.__webglTexture, 0, getRenderTargetSamples( renderTarget ), 0, renderTarget.numViews );
|
|
25774
25913
|
|
|
25775
25914
|
} else {
|
|
25776
25915
|
|
|
25777
|
-
multiviewExt.framebufferTextureMultiviewOVR( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0,
|
|
25916
|
+
multiviewExt.framebufferTextureMultiviewOVR( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, textureProperties.__webglTexture, 0, 0, renderTarget.numViews );
|
|
25778
25917
|
|
|
25779
25918
|
}
|
|
25780
25919
|
|
|
@@ -25782,11 +25921,11 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
25782
25921
|
|
|
25783
25922
|
if ( multisampled ) {
|
|
25784
25923
|
|
|
25785
|
-
multisampledRTTExt.framebufferTexture2DMultisampleEXT( _gl.FRAMEBUFFER, attachment, textureTarget,
|
|
25924
|
+
multisampledRTTExt.framebufferTexture2DMultisampleEXT( _gl.FRAMEBUFFER, attachment, textureTarget, textureProperties.__webglTexture, 0, getRenderTargetSamples( renderTarget ) );
|
|
25786
25925
|
|
|
25787
25926
|
} else {
|
|
25788
25927
|
|
|
25789
|
-
_gl.framebufferTexture2D( _gl.FRAMEBUFFER, attachment, textureTarget,
|
|
25928
|
+
_gl.framebufferTexture2D( _gl.FRAMEBUFFER, attachment, textureTarget, textureProperties.__webglTexture, level );
|
|
25790
25929
|
|
|
25791
25930
|
}
|
|
25792
25931
|
|
|
@@ -25929,8 +26068,11 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
25929
26068
|
|
|
25930
26069
|
}
|
|
25931
26070
|
|
|
26071
|
+
const textureProperties = properties.get( renderTarget.depthTexture );
|
|
26072
|
+
textureProperties.__renderTarget = renderTarget;
|
|
26073
|
+
|
|
25932
26074
|
// upload an empty depth texture with framebuffer size
|
|
25933
|
-
if ( !
|
|
26075
|
+
if ( ! textureProperties.__webglTexture ||
|
|
25934
26076
|
renderTarget.depthTexture.image.width !== renderTarget.width ||
|
|
25935
26077
|
renderTarget.depthTexture.image.height !== renderTarget.height ) {
|
|
25936
26078
|
|
|
@@ -25951,7 +26093,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
25951
26093
|
|
|
25952
26094
|
}
|
|
25953
26095
|
|
|
25954
|
-
const webglDepthTexture =
|
|
26096
|
+
const webglDepthTexture = textureProperties.__webglTexture;
|
|
25955
26097
|
const samples = getRenderTargetSamples( renderTarget );
|
|
25956
26098
|
|
|
25957
26099
|
if ( renderTarget.isWebGLMultiviewRenderTarget === true ) {
|
|
@@ -26387,11 +26529,11 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
26387
26529
|
|
|
26388
26530
|
if ( textureNeedsGenerateMipmaps( texture ) ) {
|
|
26389
26531
|
|
|
26390
|
-
const
|
|
26532
|
+
const targetType = getTargetType( renderTarget );
|
|
26391
26533
|
const webglTexture = properties.get( texture ).__webglTexture;
|
|
26392
26534
|
|
|
26393
|
-
state.bindTexture(
|
|
26394
|
-
generateMipmap(
|
|
26535
|
+
state.bindTexture( targetType, webglTexture );
|
|
26536
|
+
generateMipmap( targetType );
|
|
26395
26537
|
state.unbindTexture();
|
|
26396
26538
|
|
|
26397
26539
|
}
|
|
@@ -27383,18 +27525,14 @@ class WebXRManager extends EventDispatcher {
|
|
|
27383
27525
|
//
|
|
27384
27526
|
|
|
27385
27527
|
const cameraL = new PerspectiveCamera();
|
|
27386
|
-
cameraL.layers.enable( 1 );
|
|
27387
27528
|
cameraL.viewport = new Vector4();
|
|
27388
27529
|
|
|
27389
27530
|
const cameraR = new PerspectiveCamera();
|
|
27390
|
-
cameraR.layers.enable( 2 );
|
|
27391
27531
|
cameraR.viewport = new Vector4();
|
|
27392
27532
|
|
|
27393
27533
|
const cameras = [ cameraL, cameraR ];
|
|
27394
27534
|
|
|
27395
27535
|
const cameraXR = new ArrayCamera();
|
|
27396
|
-
cameraXR.layers.enable( 1 );
|
|
27397
|
-
cameraXR.layers.enable( 2 );
|
|
27398
27536
|
|
|
27399
27537
|
let _currentDepthNear = null;
|
|
27400
27538
|
let _currentDepthFar = null;
|
|
@@ -27960,6 +28098,10 @@ class WebXRManager extends EventDispatcher {
|
|
|
27960
28098
|
|
|
27961
28099
|
}
|
|
27962
28100
|
|
|
28101
|
+
cameraL.layers.mask = camera.layers.mask | 0b010;
|
|
28102
|
+
cameraR.layers.mask = camera.layers.mask | 0b100;
|
|
28103
|
+
cameraXR.layers.mask = cameraL.layers.mask | cameraR.layers.mask;
|
|
28104
|
+
|
|
27963
28105
|
const cameras = cameraXR.cameras;
|
|
27964
28106
|
var object = poseTarget || camera;
|
|
27965
28107
|
const parent = object.parent;
|
|
@@ -29215,6 +29357,7 @@ class WebGLRenderer {
|
|
|
29215
29357
|
preserveDrawingBuffer = false,
|
|
29216
29358
|
powerPreference = 'default',
|
|
29217
29359
|
failIfMajorPerformanceCaveat = false,
|
|
29360
|
+
reverseDepthBuffer = false,
|
|
29218
29361
|
multiviewStereo = false,
|
|
29219
29362
|
} = parameters;
|
|
29220
29363
|
|
|
@@ -29435,9 +29578,13 @@ class WebGLRenderer {
|
|
|
29435
29578
|
|
|
29436
29579
|
capabilities = new WebGLCapabilities( _gl, extensions, parameters, utils );
|
|
29437
29580
|
|
|
29438
|
-
state = new WebGLState( _gl );
|
|
29581
|
+
state = new WebGLState( _gl, extensions );
|
|
29582
|
+
|
|
29583
|
+
if ( capabilities.reverseDepthBuffer && reverseDepthBuffer ) {
|
|
29439
29584
|
|
|
29440
|
-
|
|
29585
|
+
state.buffers.depth.setReversed( true );
|
|
29586
|
+
|
|
29587
|
+
}
|
|
29441
29588
|
|
|
29442
29589
|
info = new WebGLInfo( _gl );
|
|
29443
29590
|
properties = new WebGLProperties();
|
|
@@ -29742,7 +29889,6 @@ class WebGLRenderer {
|
|
|
29742
29889
|
if ( depth ) {
|
|
29743
29890
|
|
|
29744
29891
|
bits |= _gl.DEPTH_BUFFER_BIT;
|
|
29745
|
-
_gl.clearDepth( this.capabilities.reverseDepthBuffer ? 0 : 1 );
|
|
29746
29892
|
|
|
29747
29893
|
}
|
|
29748
29894
|
|
|
@@ -31150,7 +31296,9 @@ class WebGLRenderer {
|
|
|
31150
31296
|
|
|
31151
31297
|
} else {
|
|
31152
31298
|
|
|
31153
|
-
|
|
31299
|
+
const reverseDepthBuffer = state.buffers.depth.getReversed();
|
|
31300
|
+
|
|
31301
|
+
if ( reverseDepthBuffer ) {
|
|
31154
31302
|
|
|
31155
31303
|
_currentProjectionMatrix.copy( camera.projectionMatrix );
|
|
31156
31304
|
|
|
@@ -31782,21 +31930,27 @@ class WebGLRenderer {
|
|
|
31782
31930
|
|
|
31783
31931
|
}
|
|
31784
31932
|
|
|
31785
|
-
|
|
31786
|
-
let
|
|
31933
|
+
// gather the necessary dimensions to copy
|
|
31934
|
+
let width, height, depth, minX, minY, minZ;
|
|
31935
|
+
let dstX, dstY, dstZ;
|
|
31936
|
+
const image = srcTexture.isCompressedTexture ? srcTexture.mipmaps[ level ] : srcTexture.image;
|
|
31787
31937
|
if ( srcRegion !== null ) {
|
|
31788
31938
|
|
|
31789
31939
|
width = srcRegion.max.x - srcRegion.min.x;
|
|
31790
31940
|
height = srcRegion.max.y - srcRegion.min.y;
|
|
31941
|
+
depth = srcRegion.isBox3 ? srcRegion.max.z - srcRegion.min.z : 1;
|
|
31791
31942
|
minX = srcRegion.min.x;
|
|
31792
31943
|
minY = srcRegion.min.y;
|
|
31944
|
+
minZ = srcRegion.isBox3 ? srcRegion.min.z : 0;
|
|
31793
31945
|
|
|
31794
31946
|
} else {
|
|
31795
31947
|
|
|
31796
|
-
width =
|
|
31797
|
-
height =
|
|
31948
|
+
width = image.width;
|
|
31949
|
+
height = image.height;
|
|
31950
|
+
depth = image.depth || 1;
|
|
31798
31951
|
minX = 0;
|
|
31799
31952
|
minY = 0;
|
|
31953
|
+
minZ = 0;
|
|
31800
31954
|
|
|
31801
31955
|
}
|
|
31802
31956
|
|
|
@@ -31804,177 +31958,143 @@ class WebGLRenderer {
|
|
|
31804
31958
|
|
|
31805
31959
|
dstX = dstPosition.x;
|
|
31806
31960
|
dstY = dstPosition.y;
|
|
31961
|
+
dstZ = dstPosition.z;
|
|
31807
31962
|
|
|
31808
31963
|
} else {
|
|
31809
31964
|
|
|
31810
31965
|
dstX = 0;
|
|
31811
31966
|
dstY = 0;
|
|
31967
|
+
dstZ = 0;
|
|
31812
31968
|
|
|
31813
31969
|
}
|
|
31814
31970
|
|
|
31971
|
+
// Set up the destination target
|
|
31815
31972
|
const glFormat = utils.convert( dstTexture.format );
|
|
31816
31973
|
const glType = utils.convert( dstTexture.type );
|
|
31974
|
+
let glTarget;
|
|
31817
31975
|
|
|
31818
|
-
|
|
31976
|
+
if ( dstTexture.isData3DTexture ) {
|
|
31977
|
+
|
|
31978
|
+
textures.setTexture3D( dstTexture, 0 );
|
|
31979
|
+
glTarget = _gl.TEXTURE_3D;
|
|
31980
|
+
|
|
31981
|
+
} else if ( dstTexture.isDataArrayTexture || dstTexture.isCompressedArrayTexture ) {
|
|
31982
|
+
|
|
31983
|
+
textures.setTexture2DArray( dstTexture, 0 );
|
|
31984
|
+
glTarget = _gl.TEXTURE_2D_ARRAY;
|
|
31985
|
+
|
|
31986
|
+
} else {
|
|
31987
|
+
|
|
31988
|
+
textures.setTexture2D( dstTexture, 0 );
|
|
31989
|
+
glTarget = _gl.TEXTURE_2D;
|
|
31990
|
+
|
|
31991
|
+
}
|
|
31819
31992
|
|
|
31820
|
-
// As another texture upload may have changed pixelStorei
|
|
31821
|
-
// parameters, make sure they are correct for the dstTexture
|
|
31822
31993
|
_gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, dstTexture.flipY );
|
|
31823
31994
|
_gl.pixelStorei( _gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, dstTexture.premultiplyAlpha );
|
|
31824
31995
|
_gl.pixelStorei( _gl.UNPACK_ALIGNMENT, dstTexture.unpackAlignment );
|
|
31825
31996
|
|
|
31997
|
+
// used for copying data from cpu
|
|
31826
31998
|
const currentUnpackRowLen = _gl.getParameter( _gl.UNPACK_ROW_LENGTH );
|
|
31827
31999
|
const currentUnpackImageHeight = _gl.getParameter( _gl.UNPACK_IMAGE_HEIGHT );
|
|
31828
32000
|
const currentUnpackSkipPixels = _gl.getParameter( _gl.UNPACK_SKIP_PIXELS );
|
|
31829
32001
|
const currentUnpackSkipRows = _gl.getParameter( _gl.UNPACK_SKIP_ROWS );
|
|
31830
32002
|
const currentUnpackSkipImages = _gl.getParameter( _gl.UNPACK_SKIP_IMAGES );
|
|
31831
32003
|
|
|
31832
|
-
const image = srcTexture.isCompressedTexture ? srcTexture.mipmaps[ level ] : srcTexture.image;
|
|
31833
|
-
|
|
31834
32004
|
_gl.pixelStorei( _gl.UNPACK_ROW_LENGTH, image.width );
|
|
31835
32005
|
_gl.pixelStorei( _gl.UNPACK_IMAGE_HEIGHT, image.height );
|
|
31836
32006
|
_gl.pixelStorei( _gl.UNPACK_SKIP_PIXELS, minX );
|
|
31837
32007
|
_gl.pixelStorei( _gl.UNPACK_SKIP_ROWS, minY );
|
|
32008
|
+
_gl.pixelStorei( _gl.UNPACK_SKIP_IMAGES, minZ );
|
|
31838
32009
|
|
|
31839
|
-
|
|
31840
|
-
|
|
31841
|
-
|
|
31842
|
-
|
|
31843
|
-
} else {
|
|
31844
|
-
|
|
31845
|
-
if ( srcTexture.isCompressedTexture ) {
|
|
31846
|
-
|
|
31847
|
-
_gl.compressedTexSubImage2D( _gl.TEXTURE_2D, level, dstX, dstY, image.width, image.height, glFormat, image.data );
|
|
31848
|
-
|
|
31849
|
-
} else {
|
|
31850
|
-
|
|
31851
|
-
_gl.texSubImage2D( _gl.TEXTURE_2D, level, dstX, dstY, width, height, glFormat, glType, image );
|
|
32010
|
+
// set up the src texture
|
|
32011
|
+
const isSrc3D = srcTexture.isDataArrayTexture || srcTexture.isData3DTexture;
|
|
32012
|
+
const isDst3D = dstTexture.isDataArrayTexture || dstTexture.isData3DTexture;
|
|
32013
|
+
if ( srcTexture.isRenderTargetTexture || srcTexture.isDepthTexture ) {
|
|
31852
32014
|
|
|
31853
|
-
|
|
32015
|
+
const srcTextureProperties = properties.get( srcTexture );
|
|
32016
|
+
const dstTextureProperties = properties.get( dstTexture );
|
|
32017
|
+
const srcRenderTargetProperties = properties.get( srcTextureProperties.__renderTarget );
|
|
32018
|
+
const dstRenderTargetProperties = properties.get( dstTextureProperties.__renderTarget );
|
|
31854
32019
|
|
|
31855
|
-
|
|
32020
|
+
state.bindFramebuffer( _gl.READ_FRAMEBUFFER, srcRenderTargetProperties.__webglFramebuffer );
|
|
32021
|
+
state.bindFramebuffer( _gl.DRAW_FRAMEBUFFER, dstRenderTargetProperties.__webglFramebuffer );
|
|
31856
32022
|
|
|
31857
|
-
|
|
31858
|
-
_gl.pixelStorei( _gl.UNPACK_IMAGE_HEIGHT, currentUnpackImageHeight );
|
|
31859
|
-
_gl.pixelStorei( _gl.UNPACK_SKIP_PIXELS, currentUnpackSkipPixels );
|
|
31860
|
-
_gl.pixelStorei( _gl.UNPACK_SKIP_ROWS, currentUnpackSkipRows );
|
|
31861
|
-
_gl.pixelStorei( _gl.UNPACK_SKIP_IMAGES, currentUnpackSkipImages );
|
|
32023
|
+
for ( let i = 0; i < depth; i ++ ) {
|
|
31862
32024
|
|
|
31863
|
-
|
|
31864
|
-
|
|
32025
|
+
// if the source or destination are a 3d target then a layer needs to be bound
|
|
32026
|
+
if ( isSrc3D ) {
|
|
31865
32027
|
|
|
31866
|
-
|
|
32028
|
+
_gl.framebufferTextureLayer( _gl.READ_FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, properties.get( srcTexture ).__webglTexture, level, minZ + i );
|
|
31867
32029
|
|
|
31868
|
-
|
|
32030
|
+
}
|
|
31869
32031
|
|
|
31870
|
-
|
|
32032
|
+
if ( srcTexture.isDepthTexture ) {
|
|
31871
32033
|
|
|
31872
|
-
|
|
31873
|
-
if ( srcTexture.isTexture !== true ) {
|
|
32034
|
+
if ( isDst3D ) {
|
|
31874
32035
|
|
|
31875
|
-
|
|
31876
|
-
warnOnce( 'WebGLRenderer: copyTextureToTexture3D function signature has changed.' );
|
|
32036
|
+
_gl.framebufferTextureLayer( _gl.DRAW_FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, properties.get( dstTexture ).__webglTexture, level, dstZ + i );
|
|
31877
32037
|
|
|
31878
|
-
|
|
31879
|
-
dstPosition = arguments[ 1 ] || null;
|
|
31880
|
-
srcTexture = arguments[ 2 ];
|
|
31881
|
-
dstTexture = arguments[ 3 ];
|
|
31882
|
-
level = arguments[ 4 ] || 0;
|
|
32038
|
+
}
|
|
31883
32039
|
|
|
31884
|
-
|
|
32040
|
+
_gl.blitFramebuffer( minX, minY, width, height, dstX, dstY, width, height, _gl.DEPTH_BUFFER_BIT, _gl.NEAREST );
|
|
31885
32041
|
|
|
31886
|
-
|
|
31887
|
-
let dstX, dstY, dstZ;
|
|
31888
|
-
const image = srcTexture.isCompressedTexture ? srcTexture.mipmaps[ level ] : srcTexture.image;
|
|
31889
|
-
if ( srcRegion !== null ) {
|
|
32042
|
+
} else if ( isDst3D ) {
|
|
31890
32043
|
|
|
31891
|
-
|
|
31892
|
-
height = srcRegion.max.y - srcRegion.min.y;
|
|
31893
|
-
depth = srcRegion.max.z - srcRegion.min.z;
|
|
31894
|
-
minX = srcRegion.min.x;
|
|
31895
|
-
minY = srcRegion.min.y;
|
|
31896
|
-
minZ = srcRegion.min.z;
|
|
32044
|
+
_gl.copyTexSubImage3D( glTarget, level, dstX, dstY, dstZ + i, minX, minY, width, height );
|
|
31897
32045
|
|
|
31898
|
-
|
|
32046
|
+
} else {
|
|
31899
32047
|
|
|
31900
|
-
|
|
31901
|
-
height = image.height;
|
|
31902
|
-
depth = image.depth;
|
|
31903
|
-
minX = 0;
|
|
31904
|
-
minY = 0;
|
|
31905
|
-
minZ = 0;
|
|
32048
|
+
_gl.copyTexSubImage2D( glTarget, level, dstX, dstY, dstZ + i, minX, minY, width, height );
|
|
31906
32049
|
|
|
31907
|
-
|
|
32050
|
+
}
|
|
31908
32051
|
|
|
31909
|
-
|
|
32052
|
+
}
|
|
31910
32053
|
|
|
31911
|
-
|
|
31912
|
-
|
|
31913
|
-
dstZ = dstPosition.z;
|
|
32054
|
+
state.bindFramebuffer( _gl.READ_FRAMEBUFFER, null );
|
|
32055
|
+
state.bindFramebuffer( _gl.DRAW_FRAMEBUFFER, null );
|
|
31914
32056
|
|
|
31915
32057
|
} else {
|
|
31916
32058
|
|
|
31917
|
-
|
|
31918
|
-
dstY = 0;
|
|
31919
|
-
dstZ = 0;
|
|
31920
|
-
|
|
31921
|
-
}
|
|
31922
|
-
|
|
31923
|
-
const glFormat = utils.convert( dstTexture.format );
|
|
31924
|
-
const glType = utils.convert( dstTexture.type );
|
|
31925
|
-
let glTarget;
|
|
31926
|
-
|
|
31927
|
-
if ( dstTexture.isData3DTexture ) {
|
|
31928
|
-
|
|
31929
|
-
textures.setTexture3D( dstTexture, 0 );
|
|
31930
|
-
glTarget = _gl.TEXTURE_3D;
|
|
32059
|
+
if ( isDst3D ) {
|
|
31931
32060
|
|
|
31932
|
-
|
|
32061
|
+
// copy data into the 3d texture
|
|
32062
|
+
if ( srcTexture.isDataTexture || srcTexture.isData3DTexture ) {
|
|
31933
32063
|
|
|
31934
|
-
|
|
31935
|
-
glTarget = _gl.TEXTURE_2D_ARRAY;
|
|
32064
|
+
_gl.texSubImage3D( glTarget, level, dstX, dstY, dstZ, width, height, depth, glFormat, glType, image.data );
|
|
31936
32065
|
|
|
31937
|
-
|
|
32066
|
+
} else if ( dstTexture.isCompressedArrayTexture ) {
|
|
31938
32067
|
|
|
31939
|
-
|
|
31940
|
-
return;
|
|
32068
|
+
_gl.compressedTexSubImage3D( glTarget, level, dstX, dstY, dstZ, width, height, depth, glFormat, image.data );
|
|
31941
32069
|
|
|
31942
|
-
|
|
32070
|
+
} else {
|
|
31943
32071
|
|
|
31944
|
-
|
|
31945
|
-
_gl.pixelStorei( _gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, dstTexture.premultiplyAlpha );
|
|
31946
|
-
_gl.pixelStorei( _gl.UNPACK_ALIGNMENT, dstTexture.unpackAlignment );
|
|
32072
|
+
_gl.texSubImage3D( glTarget, level, dstX, dstY, dstZ, width, height, depth, glFormat, glType, image );
|
|
31947
32073
|
|
|
31948
|
-
|
|
31949
|
-
const currentUnpackImageHeight = _gl.getParameter( _gl.UNPACK_IMAGE_HEIGHT );
|
|
31950
|
-
const currentUnpackSkipPixels = _gl.getParameter( _gl.UNPACK_SKIP_PIXELS );
|
|
31951
|
-
const currentUnpackSkipRows = _gl.getParameter( _gl.UNPACK_SKIP_ROWS );
|
|
31952
|
-
const currentUnpackSkipImages = _gl.getParameter( _gl.UNPACK_SKIP_IMAGES );
|
|
32074
|
+
}
|
|
31953
32075
|
|
|
31954
|
-
|
|
31955
|
-
_gl.pixelStorei( _gl.UNPACK_IMAGE_HEIGHT, image.height );
|
|
31956
|
-
_gl.pixelStorei( _gl.UNPACK_SKIP_PIXELS, minX );
|
|
31957
|
-
_gl.pixelStorei( _gl.UNPACK_SKIP_ROWS, minY );
|
|
31958
|
-
_gl.pixelStorei( _gl.UNPACK_SKIP_IMAGES, minZ );
|
|
32076
|
+
} else {
|
|
31959
32077
|
|
|
31960
|
-
|
|
32078
|
+
// copy data into the 2d texture
|
|
32079
|
+
if ( srcTexture.isDataTexture ) {
|
|
31961
32080
|
|
|
31962
|
-
|
|
32081
|
+
_gl.texSubImage2D( _gl.TEXTURE_2D, level, dstX, dstY, width, height, glFormat, glType, image.data );
|
|
31963
32082
|
|
|
31964
|
-
|
|
32083
|
+
} else if ( srcTexture.isCompressedTexture ) {
|
|
31965
32084
|
|
|
31966
|
-
|
|
32085
|
+
_gl.compressedTexSubImage2D( _gl.TEXTURE_2D, level, dstX, dstY, image.width, image.height, glFormat, image.data );
|
|
31967
32086
|
|
|
31968
|
-
|
|
32087
|
+
} else {
|
|
31969
32088
|
|
|
31970
|
-
|
|
32089
|
+
_gl.texSubImage2D( _gl.TEXTURE_2D, level, dstX, dstY, width, height, glFormat, glType, image );
|
|
31971
32090
|
|
|
31972
|
-
|
|
32091
|
+
}
|
|
31973
32092
|
|
|
31974
32093
|
}
|
|
31975
32094
|
|
|
31976
32095
|
}
|
|
31977
32096
|
|
|
32097
|
+
// reset values
|
|
31978
32098
|
_gl.pixelStorei( _gl.UNPACK_ROW_LENGTH, currentUnpackRowLen );
|
|
31979
32099
|
_gl.pixelStorei( _gl.UNPACK_IMAGE_HEIGHT, currentUnpackImageHeight );
|
|
31980
32100
|
_gl.pixelStorei( _gl.UNPACK_SKIP_PIXELS, currentUnpackSkipPixels );
|
|
@@ -31982,12 +32102,39 @@ class WebGLRenderer {
|
|
|
31982
32102
|
_gl.pixelStorei( _gl.UNPACK_SKIP_IMAGES, currentUnpackSkipImages );
|
|
31983
32103
|
|
|
31984
32104
|
// Generate mipmaps only when copying level 0
|
|
31985
|
-
if ( level === 0 && dstTexture.generateMipmaps )
|
|
32105
|
+
if ( level === 0 && dstTexture.generateMipmaps ) {
|
|
32106
|
+
|
|
32107
|
+
_gl.generateMipmap( glTarget );
|
|
32108
|
+
|
|
32109
|
+
}
|
|
31986
32110
|
|
|
31987
32111
|
state.unbindTexture();
|
|
31988
32112
|
|
|
31989
32113
|
};
|
|
31990
32114
|
|
|
32115
|
+
this.copyTextureToTexture3D = function ( srcTexture, dstTexture, srcRegion = null, dstPosition = null, level = 0 ) {
|
|
32116
|
+
|
|
32117
|
+
// support previous signature with source box first
|
|
32118
|
+
if ( srcTexture.isTexture !== true ) {
|
|
32119
|
+
|
|
32120
|
+
// @deprecated, r165
|
|
32121
|
+
warnOnce( 'WebGLRenderer: copyTextureToTexture3D function signature has changed.' );
|
|
32122
|
+
|
|
32123
|
+
srcRegion = arguments[ 0 ] || null;
|
|
32124
|
+
dstPosition = arguments[ 1 ] || null;
|
|
32125
|
+
srcTexture = arguments[ 2 ];
|
|
32126
|
+
dstTexture = arguments[ 3 ];
|
|
32127
|
+
level = arguments[ 4 ] || 0;
|
|
32128
|
+
|
|
32129
|
+
}
|
|
32130
|
+
|
|
32131
|
+
// @deprecated, r170
|
|
32132
|
+
warnOnce( 'WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.' );
|
|
32133
|
+
|
|
32134
|
+
return this.copyTextureToTexture( srcTexture, dstTexture, srcRegion, dstPosition, level );
|
|
32135
|
+
|
|
32136
|
+
};
|
|
32137
|
+
|
|
31991
32138
|
this.initRenderTarget = function ( target ) {
|
|
31992
32139
|
|
|
31993
32140
|
if ( properties.get( target ).__webglFramebuffer === undefined ) {
|
|
@@ -32058,8 +32205,8 @@ class WebGLRenderer {
|
|
|
32058
32205
|
this._outputColorSpace = colorSpace;
|
|
32059
32206
|
|
|
32060
32207
|
const gl = this.getContext();
|
|
32061
|
-
gl.
|
|
32062
|
-
gl.unpackColorSpace = ColorManagement.
|
|
32208
|
+
gl.drawingBufferColorspace = ColorManagement._getDrawingBufferColorSpace( colorSpace );
|
|
32209
|
+
gl.unpackColorSpace = ColorManagement._getUnpackColorSpace();
|
|
32063
32210
|
|
|
32064
32211
|
}
|
|
32065
32212
|
|
|
@@ -32705,14 +32852,18 @@ class InterleavedBufferAttribute {
|
|
|
32705
32852
|
|
|
32706
32853
|
class SpriteMaterial extends Material {
|
|
32707
32854
|
|
|
32855
|
+
static get type() {
|
|
32856
|
+
|
|
32857
|
+
return 'SpriteMaterial';
|
|
32858
|
+
|
|
32859
|
+
}
|
|
32860
|
+
|
|
32708
32861
|
constructor( parameters ) {
|
|
32709
32862
|
|
|
32710
32863
|
super();
|
|
32711
32864
|
|
|
32712
32865
|
this.isSpriteMaterial = true;
|
|
32713
32866
|
|
|
32714
|
-
this.type = 'SpriteMaterial';
|
|
32715
|
-
|
|
32716
32867
|
this.color = new Color( 0xffffff );
|
|
32717
32868
|
|
|
32718
32869
|
this.map = null;
|
|
@@ -33433,7 +33584,7 @@ class DataTexture extends Texture {
|
|
|
33433
33584
|
}
|
|
33434
33585
|
|
|
33435
33586
|
const _offsetMatrix = /*@__PURE__*/ new Matrix4();
|
|
33436
|
-
const _identityMatrix
|
|
33587
|
+
const _identityMatrix = /*@__PURE__*/ new Matrix4();
|
|
33437
33588
|
|
|
33438
33589
|
class Skeleton {
|
|
33439
33590
|
|
|
@@ -33562,7 +33713,7 @@ class Skeleton {
|
|
|
33562
33713
|
|
|
33563
33714
|
// compute the offset between the current and the original transform
|
|
33564
33715
|
|
|
33565
|
-
const matrix = bones[ i ] ? bones[ i ].matrixWorld : _identityMatrix
|
|
33716
|
+
const matrix = bones[ i ] ? bones[ i ].matrixWorld : _identityMatrix;
|
|
33566
33717
|
|
|
33567
33718
|
_offsetMatrix.multiplyMatrices( matrix, boneInverses[ i ] );
|
|
33568
33719
|
_offsetMatrix.toArray( boneMatrices, i * 16 );
|
|
@@ -34003,6 +34154,12 @@ class InstancedMesh extends Mesh {
|
|
|
34003
34154
|
|
|
34004
34155
|
}
|
|
34005
34156
|
|
|
34157
|
+
function ascIdSort( a, b ) {
|
|
34158
|
+
|
|
34159
|
+
return a - b;
|
|
34160
|
+
|
|
34161
|
+
}
|
|
34162
|
+
|
|
34006
34163
|
function sortOpaque( a, b ) {
|
|
34007
34164
|
|
|
34008
34165
|
return a.z - b.z;
|
|
@@ -34025,7 +34182,7 @@ class MultiDrawRenderList {
|
|
|
34025
34182
|
|
|
34026
34183
|
}
|
|
34027
34184
|
|
|
34028
|
-
push(
|
|
34185
|
+
push( start, count, z, index ) {
|
|
34029
34186
|
|
|
34030
34187
|
const pool = this.pool;
|
|
34031
34188
|
const list = this.list;
|
|
@@ -34046,8 +34203,8 @@ class MultiDrawRenderList {
|
|
|
34046
34203
|
list.push( item );
|
|
34047
34204
|
this.index ++;
|
|
34048
34205
|
|
|
34049
|
-
item.start =
|
|
34050
|
-
item.count =
|
|
34206
|
+
item.start = start;
|
|
34207
|
+
item.count = count;
|
|
34051
34208
|
item.z = z;
|
|
34052
34209
|
item.index = index;
|
|
34053
34210
|
|
|
@@ -34063,10 +34220,7 @@ class MultiDrawRenderList {
|
|
|
34063
34220
|
}
|
|
34064
34221
|
|
|
34065
34222
|
const _matrix$1 = /*@__PURE__*/ new Matrix4();
|
|
34066
|
-
const _invMatrixWorld = /*@__PURE__*/ new Matrix4();
|
|
34067
|
-
const _identityMatrix = /*@__PURE__*/ new Matrix4();
|
|
34068
34223
|
const _whiteColor = /*@__PURE__*/ new Color( 1, 1, 1 );
|
|
34069
|
-
const _projScreenMatrix$2 = /*@__PURE__*/ new Matrix4();
|
|
34070
34224
|
const _frustum = /*@__PURE__*/ new Frustum();
|
|
34071
34225
|
const _box$1 = /*@__PURE__*/ new Box3();
|
|
34072
34226
|
const _sphere$2 = /*@__PURE__*/ new Sphere();
|
|
@@ -34077,13 +34231,6 @@ const _renderList = /*@__PURE__*/ new MultiDrawRenderList();
|
|
|
34077
34231
|
const _mesh = /*@__PURE__*/ new Mesh();
|
|
34078
34232
|
const _batchIntersects = [];
|
|
34079
34233
|
|
|
34080
|
-
// @TODO: SkinnedMesh support?
|
|
34081
|
-
// @TODO: geometry.groups support?
|
|
34082
|
-
// @TODO: geometry.drawRange support?
|
|
34083
|
-
// @TODO: geometry.morphAttributes support?
|
|
34084
|
-
// @TODO: Support uniform parameter per geometry
|
|
34085
|
-
// @TODO: Add an "optimize" function to pack geometry and remove data gaps
|
|
34086
|
-
|
|
34087
34234
|
// copies data from attribute "src" into "target" starting at "targetOffset"
|
|
34088
34235
|
function copyAttributeData( src, target, targetOffset = 0 ) {
|
|
34089
34236
|
|
|
@@ -34114,6 +34261,29 @@ function copyAttributeData( src, target, targetOffset = 0 ) {
|
|
|
34114
34261
|
|
|
34115
34262
|
}
|
|
34116
34263
|
|
|
34264
|
+
// safely copies array contents to a potentially smaller array
|
|
34265
|
+
function copyArrayContents( src, target ) {
|
|
34266
|
+
|
|
34267
|
+
if ( src.constructor !== target.constructor ) {
|
|
34268
|
+
|
|
34269
|
+
// if arrays are of a different type (eg due to index size increasing) then data must be per-element copied
|
|
34270
|
+
const len = Math.min( src.length, target.length );
|
|
34271
|
+
for ( let i = 0; i < len; i ++ ) {
|
|
34272
|
+
|
|
34273
|
+
target[ i ] = src[ i ];
|
|
34274
|
+
|
|
34275
|
+
}
|
|
34276
|
+
|
|
34277
|
+
} else {
|
|
34278
|
+
|
|
34279
|
+
// if the arrays use the same data layout we can use a fast block copy
|
|
34280
|
+
const len = Math.min( src.length, target.length );
|
|
34281
|
+
target.set( new src.constructor( src.buffer, 0, len ) );
|
|
34282
|
+
|
|
34283
|
+
}
|
|
34284
|
+
|
|
34285
|
+
}
|
|
34286
|
+
|
|
34117
34287
|
class BatchedMesh extends Mesh {
|
|
34118
34288
|
|
|
34119
34289
|
get maxInstanceCount() {
|
|
@@ -34122,6 +34292,24 @@ class BatchedMesh extends Mesh {
|
|
|
34122
34292
|
|
|
34123
34293
|
}
|
|
34124
34294
|
|
|
34295
|
+
get instanceCount() {
|
|
34296
|
+
|
|
34297
|
+
return this._instanceInfo.length - this._availableInstanceIds.length;
|
|
34298
|
+
|
|
34299
|
+
}
|
|
34300
|
+
|
|
34301
|
+
get unusedVertexCount() {
|
|
34302
|
+
|
|
34303
|
+
return this._maxVertexCount - this._nextVertexStart;
|
|
34304
|
+
|
|
34305
|
+
}
|
|
34306
|
+
|
|
34307
|
+
get unusedIndexCount() {
|
|
34308
|
+
|
|
34309
|
+
return this._maxIndexCount - this._nextIndexStart;
|
|
34310
|
+
|
|
34311
|
+
}
|
|
34312
|
+
|
|
34125
34313
|
constructor( maxInstanceCount, maxVertexCount, maxIndexCount = maxVertexCount * 2, material ) {
|
|
34126
34314
|
|
|
34127
34315
|
super( new BufferGeometry(), material );
|
|
@@ -34133,28 +34321,33 @@ class BatchedMesh extends Mesh {
|
|
|
34133
34321
|
this.boundingSphere = null;
|
|
34134
34322
|
this.customSort = null;
|
|
34135
34323
|
|
|
34136
|
-
// stores visible, active, and geometry id per
|
|
34137
|
-
this.
|
|
34324
|
+
// stores visible, active, and geometry id per instance and reserved buffer ranges for geometries
|
|
34325
|
+
this._instanceInfo = [];
|
|
34326
|
+
this._geometryInfo = [];
|
|
34138
34327
|
|
|
34139
|
-
// instance ids that have been set as inactive, and are available to be overwritten
|
|
34328
|
+
// instance, geometry ids that have been set as inactive, and are available to be overwritten
|
|
34140
34329
|
this._availableInstanceIds = [];
|
|
34330
|
+
this._availableGeometryIds = [];
|
|
34331
|
+
|
|
34332
|
+
// used to track where the next point is that geometry should be inserted
|
|
34333
|
+
this._nextIndexStart = 0;
|
|
34334
|
+
this._nextVertexStart = 0;
|
|
34335
|
+
this._geometryCount = 0;
|
|
34141
34336
|
|
|
34142
|
-
//
|
|
34143
|
-
this.
|
|
34144
|
-
this.
|
|
34145
|
-
this._bounds = [];
|
|
34337
|
+
// flags
|
|
34338
|
+
this._visibilityChanged = true;
|
|
34339
|
+
this._geometryInitialized = false;
|
|
34146
34340
|
|
|
34341
|
+
// cached user options
|
|
34147
34342
|
this._maxInstanceCount = maxInstanceCount;
|
|
34148
34343
|
this._maxVertexCount = maxVertexCount;
|
|
34149
34344
|
this._maxIndexCount = maxIndexCount;
|
|
34150
34345
|
|
|
34151
|
-
|
|
34152
|
-
this._geometryCount = 0;
|
|
34346
|
+
// buffers for multi draw
|
|
34153
34347
|
this._multiDrawCounts = new Int32Array( maxInstanceCount );
|
|
34154
34348
|
this._multiDrawStarts = new Int32Array( maxInstanceCount );
|
|
34155
34349
|
this._multiDrawCount = 0;
|
|
34156
34350
|
this._multiDrawInstances = null;
|
|
34157
|
-
this._visibilityChanged = true;
|
|
34158
34351
|
|
|
34159
34352
|
// Local matrix per geometry by using data texture
|
|
34160
34353
|
this._matricesTexture = null;
|
|
@@ -34295,14 +34488,14 @@ class BatchedMesh extends Mesh {
|
|
|
34295
34488
|
}
|
|
34296
34489
|
|
|
34297
34490
|
const boundingBox = this.boundingBox;
|
|
34298
|
-
const
|
|
34491
|
+
const instanceInfo = this._instanceInfo;
|
|
34299
34492
|
|
|
34300
34493
|
boundingBox.makeEmpty();
|
|
34301
|
-
for ( let i = 0, l =
|
|
34494
|
+
for ( let i = 0, l = instanceInfo.length; i < l; i ++ ) {
|
|
34302
34495
|
|
|
34303
|
-
if (
|
|
34496
|
+
if ( instanceInfo[ i ].active === false ) continue;
|
|
34304
34497
|
|
|
34305
|
-
const geometryId =
|
|
34498
|
+
const geometryId = instanceInfo[ i ].geometryIndex;
|
|
34306
34499
|
this.getMatrixAt( i, _matrix$1 );
|
|
34307
34500
|
this.getBoundingBoxAt( geometryId, _box$1 ).applyMatrix4( _matrix$1 );
|
|
34308
34501
|
boundingBox.union( _box$1 );
|
|
@@ -34320,14 +34513,14 @@ class BatchedMesh extends Mesh {
|
|
|
34320
34513
|
}
|
|
34321
34514
|
|
|
34322
34515
|
const boundingSphere = this.boundingSphere;
|
|
34323
|
-
const
|
|
34516
|
+
const instanceInfo = this._instanceInfo;
|
|
34324
34517
|
|
|
34325
34518
|
boundingSphere.makeEmpty();
|
|
34326
|
-
for ( let i = 0, l =
|
|
34519
|
+
for ( let i = 0, l = instanceInfo.length; i < l; i ++ ) {
|
|
34327
34520
|
|
|
34328
|
-
if (
|
|
34521
|
+
if ( instanceInfo[ i ].active === false ) continue;
|
|
34329
34522
|
|
|
34330
|
-
const geometryId =
|
|
34523
|
+
const geometryId = instanceInfo[ i ].geometryIndex;
|
|
34331
34524
|
this.getMatrixAt( i, _matrix$1 );
|
|
34332
34525
|
this.getBoundingSphereAt( geometryId, _sphere$2 ).applyMatrix4( _matrix$1 );
|
|
34333
34526
|
boundingSphere.union( _sphere$2 );
|
|
@@ -34338,7 +34531,7 @@ class BatchedMesh extends Mesh {
|
|
|
34338
34531
|
|
|
34339
34532
|
addInstance( geometryId ) {
|
|
34340
34533
|
|
|
34341
|
-
const atCapacity = this.
|
|
34534
|
+
const atCapacity = this._instanceInfo.length >= this.maxInstanceCount;
|
|
34342
34535
|
|
|
34343
34536
|
// ensure we're not over geometry
|
|
34344
34537
|
if ( atCapacity && this._availableInstanceIds.length === 0 ) {
|
|
@@ -34347,7 +34540,7 @@ class BatchedMesh extends Mesh {
|
|
|
34347
34540
|
|
|
34348
34541
|
}
|
|
34349
34542
|
|
|
34350
|
-
const
|
|
34543
|
+
const instanceInfo = {
|
|
34351
34544
|
visible: true,
|
|
34352
34545
|
active: true,
|
|
34353
34546
|
geometryIndex: geometryId,
|
|
@@ -34358,19 +34551,20 @@ class BatchedMesh extends Mesh {
|
|
|
34358
34551
|
// Prioritize using previously freed instance ids
|
|
34359
34552
|
if ( this._availableInstanceIds.length > 0 ) {
|
|
34360
34553
|
|
|
34361
|
-
|
|
34362
|
-
|
|
34554
|
+
this._availableInstanceIds.sort( ascIdSort );
|
|
34555
|
+
|
|
34556
|
+
drawId = this._availableInstanceIds.shift();
|
|
34557
|
+
this._instanceInfo[ drawId ] = instanceInfo;
|
|
34363
34558
|
|
|
34364
34559
|
} else {
|
|
34365
34560
|
|
|
34366
|
-
drawId = this.
|
|
34367
|
-
this.
|
|
34561
|
+
drawId = this._instanceInfo.length;
|
|
34562
|
+
this._instanceInfo.push( instanceInfo );
|
|
34368
34563
|
|
|
34369
34564
|
}
|
|
34370
34565
|
|
|
34371
34566
|
const matricesTexture = this._matricesTexture;
|
|
34372
|
-
|
|
34373
|
-
_identityMatrix.toArray( matricesArray, drawId * 16 );
|
|
34567
|
+
_matrix$1.identity().toArray( matricesTexture.image.data, drawId * 16 );
|
|
34374
34568
|
matricesTexture.needsUpdate = true;
|
|
34375
34569
|
|
|
34376
34570
|
const colorsTexture = this._colorsTexture;
|
|
@@ -34381,91 +34575,54 @@ class BatchedMesh extends Mesh {
|
|
|
34381
34575
|
|
|
34382
34576
|
}
|
|
34383
34577
|
|
|
34578
|
+
this._visibilityChanged = true;
|
|
34384
34579
|
return drawId;
|
|
34385
34580
|
|
|
34386
34581
|
}
|
|
34387
34582
|
|
|
34388
|
-
addGeometry( geometry,
|
|
34583
|
+
addGeometry( geometry, reservedVertexCount = - 1, reservedIndexCount = - 1 ) {
|
|
34389
34584
|
|
|
34390
34585
|
this._initializeGeometry( geometry );
|
|
34391
34586
|
|
|
34392
34587
|
this._validateGeometry( geometry );
|
|
34393
34588
|
|
|
34394
|
-
|
|
34395
|
-
|
|
34396
|
-
|
|
34397
|
-
throw new Error( 'BatchedMesh: Maximum item count reached.' );
|
|
34398
|
-
|
|
34399
|
-
}
|
|
34400
|
-
|
|
34401
|
-
// get the necessary range fo the geometry
|
|
34402
|
-
const reservedRange = {
|
|
34589
|
+
const geometryInfo = {
|
|
34590
|
+
// geometry information
|
|
34403
34591
|
vertexStart: - 1,
|
|
34404
34592
|
vertexCount: - 1,
|
|
34593
|
+
reservedVertexCount: - 1,
|
|
34594
|
+
|
|
34405
34595
|
indexStart: - 1,
|
|
34406
34596
|
indexCount: - 1,
|
|
34407
|
-
|
|
34408
|
-
|
|
34409
|
-
let lastRange = null;
|
|
34410
|
-
const reservedRanges = this._reservedRanges;
|
|
34411
|
-
const drawRanges = this._drawRanges;
|
|
34412
|
-
const bounds = this._bounds;
|
|
34413
|
-
if ( this._geometryCount !== 0 ) {
|
|
34414
|
-
|
|
34415
|
-
lastRange = reservedRanges[ reservedRanges.length - 1 ];
|
|
34416
|
-
|
|
34417
|
-
}
|
|
34418
|
-
|
|
34419
|
-
if ( vertexCount === - 1 ) {
|
|
34420
|
-
|
|
34421
|
-
reservedRange.vertexCount = geometry.getAttribute( 'position' ).count;
|
|
34422
|
-
|
|
34423
|
-
} else {
|
|
34424
|
-
|
|
34425
|
-
reservedRange.vertexCount = vertexCount;
|
|
34426
|
-
|
|
34427
|
-
}
|
|
34428
|
-
|
|
34429
|
-
if ( lastRange === null ) {
|
|
34597
|
+
reservedIndexCount: - 1,
|
|
34430
34598
|
|
|
34431
|
-
|
|
34599
|
+
// draw range information
|
|
34600
|
+
start: - 1,
|
|
34601
|
+
count: - 1,
|
|
34432
34602
|
|
|
34433
|
-
|
|
34434
|
-
|
|
34435
|
-
|
|
34603
|
+
// state
|
|
34604
|
+
boundingBox: null,
|
|
34605
|
+
boundingSphere: null,
|
|
34606
|
+
active: true,
|
|
34607
|
+
};
|
|
34436
34608
|
|
|
34437
|
-
|
|
34609
|
+
const geometryInfoList = this._geometryInfo;
|
|
34610
|
+
geometryInfo.vertexStart = this._nextVertexStart;
|
|
34611
|
+
geometryInfo.reservedVertexCount = reservedVertexCount === - 1 ? geometry.getAttribute( 'position' ).count : reservedVertexCount;
|
|
34438
34612
|
|
|
34439
34613
|
const index = geometry.getIndex();
|
|
34440
34614
|
const hasIndex = index !== null;
|
|
34441
34615
|
if ( hasIndex ) {
|
|
34442
34616
|
|
|
34443
|
-
|
|
34444
|
-
|
|
34445
|
-
reservedRange.indexCount = index.count;
|
|
34446
|
-
|
|
34447
|
-
} else {
|
|
34448
|
-
|
|
34449
|
-
reservedRange.indexCount = indexCount;
|
|
34450
|
-
|
|
34451
|
-
}
|
|
34452
|
-
|
|
34453
|
-
if ( lastRange === null ) {
|
|
34454
|
-
|
|
34455
|
-
reservedRange.indexStart = 0;
|
|
34456
|
-
|
|
34457
|
-
} else {
|
|
34458
|
-
|
|
34459
|
-
reservedRange.indexStart = lastRange.indexStart + lastRange.indexCount;
|
|
34460
|
-
|
|
34461
|
-
}
|
|
34617
|
+
geometryInfo.indexStart = this._nextIndexStart;
|
|
34618
|
+
geometryInfo.reservedIndexCount = reservedIndexCount === - 1 ? index.count : reservedIndexCount;
|
|
34462
34619
|
|
|
34463
34620
|
}
|
|
34464
34621
|
|
|
34465
34622
|
if (
|
|
34466
|
-
|
|
34467
|
-
|
|
34468
|
-
|
|
34623
|
+
geometryInfo.indexStart !== - 1 &&
|
|
34624
|
+
geometryInfo.indexStart + geometryInfo.reservedIndexCount > this._maxIndexCount ||
|
|
34625
|
+
geometryInfo.vertexStart + geometryInfo.reservedVertexCount > this._maxVertexCount
|
|
34469
34626
|
) {
|
|
34470
34627
|
|
|
34471
34628
|
throw new Error( 'BatchedMesh: Reserved space request exceeds the maximum buffer size.' );
|
|
@@ -34473,26 +34630,30 @@ class BatchedMesh extends Mesh {
|
|
|
34473
34630
|
}
|
|
34474
34631
|
|
|
34475
34632
|
// update id
|
|
34476
|
-
|
|
34477
|
-
this.
|
|
34478
|
-
|
|
34479
|
-
// add the reserved range and draw range objects
|
|
34480
|
-
reservedRanges.push( reservedRange );
|
|
34481
|
-
drawRanges.push( {
|
|
34482
|
-
start: hasIndex ? reservedRange.indexStart : reservedRange.vertexStart,
|
|
34483
|
-
count: - 1
|
|
34484
|
-
} );
|
|
34485
|
-
bounds.push( {
|
|
34486
|
-
boxInitialized: false,
|
|
34487
|
-
box: new Box3(),
|
|
34633
|
+
let geometryId;
|
|
34634
|
+
if ( this._availableGeometryIds.length > 0 ) {
|
|
34488
34635
|
|
|
34489
|
-
|
|
34490
|
-
|
|
34491
|
-
|
|
34636
|
+
this._availableGeometryIds.sort( ascIdSort );
|
|
34637
|
+
|
|
34638
|
+
geometryId = this._availableGeometryIds.shift();
|
|
34639
|
+
geometryInfoList[ geometryId ] = geometryInfo;
|
|
34640
|
+
|
|
34641
|
+
|
|
34642
|
+
} else {
|
|
34643
|
+
|
|
34644
|
+
geometryId = this._geometryCount;
|
|
34645
|
+
this._geometryCount ++;
|
|
34646
|
+
geometryInfoList.push( geometryInfo );
|
|
34647
|
+
|
|
34648
|
+
}
|
|
34492
34649
|
|
|
34493
34650
|
// update the geometry
|
|
34494
34651
|
this.setGeometryAt( geometryId, geometry );
|
|
34495
34652
|
|
|
34653
|
+
// increment the next geometry position
|
|
34654
|
+
this._nextIndexStart = geometryInfo.indexStart + geometryInfo.reservedIndexCount;
|
|
34655
|
+
this._nextVertexStart = geometryInfo.vertexStart + geometryInfo.reservedVertexCount;
|
|
34656
|
+
|
|
34496
34657
|
return geometryId;
|
|
34497
34658
|
|
|
34498
34659
|
}
|
|
@@ -34511,20 +34672,22 @@ class BatchedMesh extends Mesh {
|
|
|
34511
34672
|
const hasIndex = batchGeometry.getIndex() !== null;
|
|
34512
34673
|
const dstIndex = batchGeometry.getIndex();
|
|
34513
34674
|
const srcIndex = geometry.getIndex();
|
|
34514
|
-
const
|
|
34675
|
+
const geometryInfo = this._geometryInfo[ geometryId ];
|
|
34515
34676
|
if (
|
|
34516
34677
|
hasIndex &&
|
|
34517
|
-
srcIndex.count >
|
|
34518
|
-
geometry.attributes.position.count >
|
|
34678
|
+
srcIndex.count > geometryInfo.reservedIndexCount ||
|
|
34679
|
+
geometry.attributes.position.count > geometryInfo.reservedVertexCount
|
|
34519
34680
|
) {
|
|
34520
34681
|
|
|
34521
34682
|
throw new Error( 'BatchedMesh: Reserved space not large enough for provided geometry.' );
|
|
34522
34683
|
|
|
34523
34684
|
}
|
|
34524
34685
|
|
|
34525
|
-
// copy geometry over
|
|
34526
|
-
const vertexStart =
|
|
34527
|
-
const
|
|
34686
|
+
// copy geometry buffer data over
|
|
34687
|
+
const vertexStart = geometryInfo.vertexStart;
|
|
34688
|
+
const reservedVertexCount = geometryInfo.reservedVertexCount;
|
|
34689
|
+
geometryInfo.vertexCount = geometry.getAttribute( 'position' ).count;
|
|
34690
|
+
|
|
34528
34691
|
for ( const attributeName in batchGeometry.attributes ) {
|
|
34529
34692
|
|
|
34530
34693
|
// copy attribute data
|
|
@@ -34534,7 +34697,7 @@ class BatchedMesh extends Mesh {
|
|
|
34534
34697
|
|
|
34535
34698
|
// fill the rest in with zeroes
|
|
34536
34699
|
const itemSize = srcAttribute.itemSize;
|
|
34537
|
-
for ( let i = srcAttribute.count, l =
|
|
34700
|
+
for ( let i = srcAttribute.count, l = reservedVertexCount; i < l; i ++ ) {
|
|
34538
34701
|
|
|
34539
34702
|
const index = vertexStart + i;
|
|
34540
34703
|
for ( let c = 0; c < itemSize; c ++ ) {
|
|
@@ -34546,14 +34709,16 @@ class BatchedMesh extends Mesh {
|
|
|
34546
34709
|
}
|
|
34547
34710
|
|
|
34548
34711
|
dstAttribute.needsUpdate = true;
|
|
34549
|
-
dstAttribute.addUpdateRange( vertexStart * itemSize,
|
|
34712
|
+
dstAttribute.addUpdateRange( vertexStart * itemSize, reservedVertexCount * itemSize );
|
|
34550
34713
|
|
|
34551
34714
|
}
|
|
34552
34715
|
|
|
34553
34716
|
// copy index
|
|
34554
34717
|
if ( hasIndex ) {
|
|
34555
34718
|
|
|
34556
|
-
const indexStart =
|
|
34719
|
+
const indexStart = geometryInfo.indexStart;
|
|
34720
|
+
const reservedIndexCount = geometryInfo.reservedIndexCount;
|
|
34721
|
+
geometryInfo.indexCount = geometry.getIndex().count;
|
|
34557
34722
|
|
|
34558
34723
|
// copy index data over
|
|
34559
34724
|
for ( let i = 0; i < srcIndex.count; i ++ ) {
|
|
@@ -34563,69 +34728,80 @@ class BatchedMesh extends Mesh {
|
|
|
34563
34728
|
}
|
|
34564
34729
|
|
|
34565
34730
|
// fill the rest in with zeroes
|
|
34566
|
-
for ( let i = srcIndex.count, l =
|
|
34731
|
+
for ( let i = srcIndex.count, l = reservedIndexCount; i < l; i ++ ) {
|
|
34567
34732
|
|
|
34568
34733
|
dstIndex.setX( indexStart + i, vertexStart );
|
|
34569
34734
|
|
|
34570
34735
|
}
|
|
34571
34736
|
|
|
34572
34737
|
dstIndex.needsUpdate = true;
|
|
34573
|
-
dstIndex.addUpdateRange( indexStart,
|
|
34738
|
+
dstIndex.addUpdateRange( indexStart, geometryInfo.reservedIndexCount );
|
|
34574
34739
|
|
|
34575
34740
|
}
|
|
34576
34741
|
|
|
34742
|
+
// update the draw range
|
|
34743
|
+
geometryInfo.start = hasIndex ? geometryInfo.indexStart : geometryInfo.vertexStart;
|
|
34744
|
+
geometryInfo.count = hasIndex ? geometryInfo.indexCount : geometryInfo.vertexCount;
|
|
34745
|
+
|
|
34577
34746
|
// store the bounding boxes
|
|
34578
|
-
|
|
34747
|
+
geometryInfo.boundingBox = null;
|
|
34579
34748
|
if ( geometry.boundingBox !== null ) {
|
|
34580
34749
|
|
|
34581
|
-
|
|
34582
|
-
bound.boxInitialized = true;
|
|
34583
|
-
|
|
34584
|
-
} else {
|
|
34585
|
-
|
|
34586
|
-
bound.boxInitialized = false;
|
|
34750
|
+
geometryInfo.boundingBox = geometry.boundingBox.clone();
|
|
34587
34751
|
|
|
34588
34752
|
}
|
|
34589
34753
|
|
|
34754
|
+
geometryInfo.boundingSphere = null;
|
|
34590
34755
|
if ( geometry.boundingSphere !== null ) {
|
|
34591
34756
|
|
|
34592
|
-
|
|
34593
|
-
bound.sphereInitialized = true;
|
|
34594
|
-
|
|
34595
|
-
} else {
|
|
34596
|
-
|
|
34597
|
-
bound.sphereInitialized = false;
|
|
34757
|
+
geometryInfo.boundingSphere = geometry.boundingSphere.clone();
|
|
34598
34758
|
|
|
34599
34759
|
}
|
|
34600
34760
|
|
|
34601
|
-
// set drawRange count
|
|
34602
|
-
const drawRange = this._drawRanges[ geometryId ];
|
|
34603
|
-
const posAttr = geometry.getAttribute( 'position' );
|
|
34604
|
-
drawRange.count = hasIndex ? srcIndex.count : posAttr.count;
|
|
34605
34761
|
this._visibilityChanged = true;
|
|
34606
|
-
|
|
34607
34762
|
return geometryId;
|
|
34608
34763
|
|
|
34609
34764
|
}
|
|
34610
34765
|
|
|
34611
|
-
/*
|
|
34612
34766
|
deleteGeometry( geometryId ) {
|
|
34613
34767
|
|
|
34614
|
-
|
|
34768
|
+
const geometryInfoList = this._geometryInfo;
|
|
34769
|
+
if ( geometryId >= geometryInfoList.length || geometryInfoList[ geometryId ].active === false ) {
|
|
34770
|
+
|
|
34771
|
+
return this;
|
|
34772
|
+
|
|
34773
|
+
}
|
|
34774
|
+
|
|
34775
|
+
// delete any instances associated with this geometry
|
|
34776
|
+
const instanceInfo = this._instanceInfo;
|
|
34777
|
+
for ( let i = 0, l = instanceInfo.length; i < l; i ++ ) {
|
|
34778
|
+
|
|
34779
|
+
if ( instanceInfo[ i ].geometryIndex === geometryId ) {
|
|
34780
|
+
|
|
34781
|
+
this.deleteInstance( i );
|
|
34782
|
+
|
|
34783
|
+
}
|
|
34784
|
+
|
|
34785
|
+
}
|
|
34786
|
+
|
|
34787
|
+
geometryInfoList[ geometryId ].active = false;
|
|
34788
|
+
this._availableGeometryIds.push( geometryId );
|
|
34789
|
+
this._visibilityChanged = true;
|
|
34790
|
+
|
|
34791
|
+
return this;
|
|
34615
34792
|
|
|
34616
34793
|
}
|
|
34617
|
-
*/
|
|
34618
34794
|
|
|
34619
34795
|
deleteInstance( instanceId ) {
|
|
34620
34796
|
|
|
34621
|
-
const
|
|
34622
|
-
if ( instanceId >=
|
|
34797
|
+
const instanceInfo = this._instanceInfo;
|
|
34798
|
+
if ( instanceId >= instanceInfo.length || instanceInfo[ instanceId ].active === false ) {
|
|
34623
34799
|
|
|
34624
34800
|
return this;
|
|
34625
34801
|
|
|
34626
34802
|
}
|
|
34627
34803
|
|
|
34628
|
-
|
|
34804
|
+
instanceInfo[ instanceId ].active = false;
|
|
34629
34805
|
this._availableInstanceIds.push( instanceId );
|
|
34630
34806
|
this._visibilityChanged = true;
|
|
34631
34807
|
|
|
@@ -34633,6 +34809,95 @@ class BatchedMesh extends Mesh {
|
|
|
34633
34809
|
|
|
34634
34810
|
}
|
|
34635
34811
|
|
|
34812
|
+
optimize() {
|
|
34813
|
+
|
|
34814
|
+
// track the next indices to copy data to
|
|
34815
|
+
let nextVertexStart = 0;
|
|
34816
|
+
let nextIndexStart = 0;
|
|
34817
|
+
|
|
34818
|
+
// Iterate over all geometry ranges in order sorted from earliest in the geometry buffer to latest
|
|
34819
|
+
// in the geometry buffer. Because draw range objects can be reused there is no guarantee of their order.
|
|
34820
|
+
const geometryInfoList = this._geometryInfo;
|
|
34821
|
+
const indices = geometryInfoList
|
|
34822
|
+
.map( ( e, i ) => i )
|
|
34823
|
+
.sort( ( a, b ) => {
|
|
34824
|
+
|
|
34825
|
+
return geometryInfoList[ a ].vertexStart - geometryInfoList[ b ].vertexStart;
|
|
34826
|
+
|
|
34827
|
+
} );
|
|
34828
|
+
|
|
34829
|
+
const geometry = this.geometry;
|
|
34830
|
+
for ( let i = 0, l = geometryInfoList.length; i < l; i ++ ) {
|
|
34831
|
+
|
|
34832
|
+
// if a geometry range is inactive then don't copy anything
|
|
34833
|
+
const index = indices[ i ];
|
|
34834
|
+
const geometryInfo = geometryInfoList[ index ];
|
|
34835
|
+
if ( geometryInfo.active === false ) {
|
|
34836
|
+
|
|
34837
|
+
continue;
|
|
34838
|
+
|
|
34839
|
+
}
|
|
34840
|
+
|
|
34841
|
+
// if a geometry contains an index buffer then shift it, as well
|
|
34842
|
+
if ( geometry.index !== null ) {
|
|
34843
|
+
|
|
34844
|
+
if ( geometryInfo.indexStart !== nextIndexStart ) {
|
|
34845
|
+
|
|
34846
|
+
const { indexStart, vertexStart, reservedIndexCount } = geometryInfo;
|
|
34847
|
+
const index = geometry.index;
|
|
34848
|
+
const array = index.array;
|
|
34849
|
+
|
|
34850
|
+
// shift the index pointers based on how the vertex data will shift
|
|
34851
|
+
// adjusting the index must happen first so the original vertex start value is available
|
|
34852
|
+
const elementDelta = nextVertexStart - vertexStart;
|
|
34853
|
+
for ( let j = indexStart; j < indexStart + reservedIndexCount; j ++ ) {
|
|
34854
|
+
|
|
34855
|
+
array[ j ] = array[ j ] + elementDelta;
|
|
34856
|
+
|
|
34857
|
+
}
|
|
34858
|
+
|
|
34859
|
+
index.array.copyWithin( nextIndexStart, indexStart, indexStart + reservedIndexCount );
|
|
34860
|
+
index.addUpdateRange( nextIndexStart, reservedIndexCount );
|
|
34861
|
+
|
|
34862
|
+
geometryInfo.indexStart = nextIndexStart;
|
|
34863
|
+
|
|
34864
|
+
}
|
|
34865
|
+
|
|
34866
|
+
nextIndexStart += geometryInfo.reservedIndexCount;
|
|
34867
|
+
|
|
34868
|
+
}
|
|
34869
|
+
|
|
34870
|
+
// if a geometry needs to be moved then copy attribute data to overwrite unused space
|
|
34871
|
+
if ( geometryInfo.vertexStart !== nextVertexStart ) {
|
|
34872
|
+
|
|
34873
|
+
const { vertexStart, reservedVertexCount } = geometryInfo;
|
|
34874
|
+
const attributes = geometry.attributes;
|
|
34875
|
+
for ( const key in attributes ) {
|
|
34876
|
+
|
|
34877
|
+
const attribute = attributes[ key ];
|
|
34878
|
+
const { array, itemSize } = attribute;
|
|
34879
|
+
array.copyWithin( nextVertexStart * itemSize, vertexStart * itemSize, ( vertexStart + reservedVertexCount ) * itemSize );
|
|
34880
|
+
attribute.addUpdateRange( nextVertexStart * itemSize, reservedVertexCount * itemSize );
|
|
34881
|
+
|
|
34882
|
+
}
|
|
34883
|
+
|
|
34884
|
+
geometryInfo.vertexStart = nextVertexStart;
|
|
34885
|
+
|
|
34886
|
+
}
|
|
34887
|
+
|
|
34888
|
+
nextVertexStart += geometryInfo.reservedVertexCount;
|
|
34889
|
+
geometryInfo.start = geometry.index ? geometryInfo.indexStart : geometryInfo.vertexStart;
|
|
34890
|
+
|
|
34891
|
+
// step the next geometry points to the shifted position
|
|
34892
|
+
this._nextIndexStart = geometry.index ? geometryInfo.indexStart + geometryInfo.reservedIndexCount : 0;
|
|
34893
|
+
this._nextVertexStart = geometryInfo.vertexStart + geometryInfo.reservedVertexCount;
|
|
34894
|
+
|
|
34895
|
+
}
|
|
34896
|
+
|
|
34897
|
+
return this;
|
|
34898
|
+
|
|
34899
|
+
}
|
|
34900
|
+
|
|
34636
34901
|
// get bounding box and compute it if it doesn't exist
|
|
34637
34902
|
getBoundingBoxAt( geometryId, target ) {
|
|
34638
34903
|
|
|
@@ -34643,17 +34908,14 @@ class BatchedMesh extends Mesh {
|
|
|
34643
34908
|
}
|
|
34644
34909
|
|
|
34645
34910
|
// compute bounding box
|
|
34646
|
-
const bound = this._bounds[ geometryId ];
|
|
34647
|
-
const box = bound.box;
|
|
34648
34911
|
const geometry = this.geometry;
|
|
34649
|
-
|
|
34650
|
-
|
|
34651
|
-
box.makeEmpty();
|
|
34912
|
+
const geometryInfo = this._geometryInfo[ geometryId ];
|
|
34913
|
+
if ( geometryInfo.boundingBox === null ) {
|
|
34652
34914
|
|
|
34915
|
+
const box = new Box3();
|
|
34653
34916
|
const index = geometry.index;
|
|
34654
34917
|
const position = geometry.attributes.position;
|
|
34655
|
-
|
|
34656
|
-
for ( let i = drawRange.start, l = drawRange.start + drawRange.count; i < l; i ++ ) {
|
|
34918
|
+
for ( let i = geometryInfo.start, l = geometryInfo.start + geometryInfo.count; i < l; i ++ ) {
|
|
34657
34919
|
|
|
34658
34920
|
let iv = i;
|
|
34659
34921
|
if ( index ) {
|
|
@@ -34666,11 +34928,11 @@ class BatchedMesh extends Mesh {
|
|
|
34666
34928
|
|
|
34667
34929
|
}
|
|
34668
34930
|
|
|
34669
|
-
|
|
34931
|
+
geometryInfo.boundingBox = box;
|
|
34670
34932
|
|
|
34671
34933
|
}
|
|
34672
34934
|
|
|
34673
|
-
target.copy(
|
|
34935
|
+
target.copy( geometryInfo.boundingBox );
|
|
34674
34936
|
return target;
|
|
34675
34937
|
|
|
34676
34938
|
}
|
|
@@ -34685,22 +34947,19 @@ class BatchedMesh extends Mesh {
|
|
|
34685
34947
|
}
|
|
34686
34948
|
|
|
34687
34949
|
// compute bounding sphere
|
|
34688
|
-
const bound = this._bounds[ geometryId ];
|
|
34689
|
-
const sphere = bound.sphere;
|
|
34690
34950
|
const geometry = this.geometry;
|
|
34691
|
-
|
|
34692
|
-
|
|
34693
|
-
sphere.makeEmpty();
|
|
34951
|
+
const geometryInfo = this._geometryInfo[ geometryId ];
|
|
34952
|
+
if ( geometryInfo.boundingSphere === null ) {
|
|
34694
34953
|
|
|
34954
|
+
const sphere = new Sphere();
|
|
34695
34955
|
this.getBoundingBoxAt( geometryId, _box$1 );
|
|
34696
34956
|
_box$1.getCenter( sphere.center );
|
|
34697
34957
|
|
|
34698
34958
|
const index = geometry.index;
|
|
34699
34959
|
const position = geometry.attributes.position;
|
|
34700
|
-
const drawRange = this._drawRanges[ geometryId ];
|
|
34701
34960
|
|
|
34702
34961
|
let maxRadiusSq = 0;
|
|
34703
|
-
for ( let i =
|
|
34962
|
+
for ( let i = geometryInfo.start, l = geometryInfo.start + geometryInfo.count; i < l; i ++ ) {
|
|
34704
34963
|
|
|
34705
34964
|
let iv = i;
|
|
34706
34965
|
if ( index ) {
|
|
@@ -34715,24 +34974,21 @@ class BatchedMesh extends Mesh {
|
|
|
34715
34974
|
}
|
|
34716
34975
|
|
|
34717
34976
|
sphere.radius = Math.sqrt( maxRadiusSq );
|
|
34718
|
-
|
|
34977
|
+
geometryInfo.boundingSphere = sphere;
|
|
34719
34978
|
|
|
34720
34979
|
}
|
|
34721
34980
|
|
|
34722
|
-
target.copy(
|
|
34981
|
+
target.copy( geometryInfo.boundingSphere );
|
|
34723
34982
|
return target;
|
|
34724
34983
|
|
|
34725
34984
|
}
|
|
34726
34985
|
|
|
34727
34986
|
setMatrixAt( instanceId, matrix ) {
|
|
34728
34987
|
|
|
34729
|
-
|
|
34730
|
-
// optimize() can make geometryId mismatch the index
|
|
34731
|
-
|
|
34732
|
-
const drawInfo = this._drawInfo;
|
|
34988
|
+
const instanceInfo = this._instanceInfo;
|
|
34733
34989
|
const matricesTexture = this._matricesTexture;
|
|
34734
34990
|
const matricesArray = this._matricesTexture.image.data;
|
|
34735
|
-
if ( instanceId >=
|
|
34991
|
+
if ( instanceId >= instanceInfo.length || instanceInfo[ instanceId ].active === false ) {
|
|
34736
34992
|
|
|
34737
34993
|
return this;
|
|
34738
34994
|
|
|
@@ -34747,9 +35003,9 @@ class BatchedMesh extends Mesh {
|
|
|
34747
35003
|
|
|
34748
35004
|
getMatrixAt( instanceId, matrix ) {
|
|
34749
35005
|
|
|
34750
|
-
const
|
|
35006
|
+
const instanceInfo = this._instanceInfo;
|
|
34751
35007
|
const matricesArray = this._matricesTexture.image.data;
|
|
34752
|
-
if ( instanceId >=
|
|
35008
|
+
if ( instanceId >= instanceInfo.length || instanceInfo[ instanceId ].active === false ) {
|
|
34753
35009
|
|
|
34754
35010
|
return null;
|
|
34755
35011
|
|
|
@@ -34767,13 +35023,10 @@ class BatchedMesh extends Mesh {
|
|
|
34767
35023
|
|
|
34768
35024
|
}
|
|
34769
35025
|
|
|
34770
|
-
// @TODO: Map id to index of the arrays because
|
|
34771
|
-
// optimize() can make id mismatch the index
|
|
34772
|
-
|
|
34773
35026
|
const colorsTexture = this._colorsTexture;
|
|
34774
35027
|
const colorsArray = this._colorsTexture.image.data;
|
|
34775
|
-
const
|
|
34776
|
-
if ( instanceId >=
|
|
35028
|
+
const instanceInfo = this._instanceInfo;
|
|
35029
|
+
if ( instanceId >= instanceInfo.length || instanceInfo[ instanceId ].active === false ) {
|
|
34777
35030
|
|
|
34778
35031
|
return this;
|
|
34779
35032
|
|
|
@@ -34789,8 +35042,8 @@ class BatchedMesh extends Mesh {
|
|
|
34789
35042
|
getColorAt( instanceId, color ) {
|
|
34790
35043
|
|
|
34791
35044
|
const colorsArray = this._colorsTexture.image.data;
|
|
34792
|
-
const
|
|
34793
|
-
if ( instanceId >=
|
|
35045
|
+
const instanceInfo = this._instanceInfo;
|
|
35046
|
+
if ( instanceId >= instanceInfo.length || instanceInfo[ instanceId ].active === false ) {
|
|
34794
35047
|
|
|
34795
35048
|
return null;
|
|
34796
35049
|
|
|
@@ -34804,18 +35057,18 @@ class BatchedMesh extends Mesh {
|
|
|
34804
35057
|
|
|
34805
35058
|
// if the geometry is out of range, not active, or visibility state
|
|
34806
35059
|
// does not change then return early
|
|
34807
|
-
const
|
|
35060
|
+
const instanceInfo = this._instanceInfo;
|
|
34808
35061
|
if (
|
|
34809
|
-
instanceId >=
|
|
34810
|
-
|
|
34811
|
-
|
|
35062
|
+
instanceId >= instanceInfo.length ||
|
|
35063
|
+
instanceInfo[ instanceId ].active === false ||
|
|
35064
|
+
instanceInfo[ instanceId ].visible === value
|
|
34812
35065
|
) {
|
|
34813
35066
|
|
|
34814
35067
|
return this;
|
|
34815
35068
|
|
|
34816
35069
|
}
|
|
34817
35070
|
|
|
34818
|
-
|
|
35071
|
+
instanceInfo[ instanceId ].visible = value;
|
|
34819
35072
|
this._visibilityChanged = true;
|
|
34820
35073
|
|
|
34821
35074
|
return this;
|
|
@@ -34825,35 +35078,36 @@ class BatchedMesh extends Mesh {
|
|
|
34825
35078
|
getVisibleAt( instanceId ) {
|
|
34826
35079
|
|
|
34827
35080
|
// return early if the geometry is out of range or not active
|
|
34828
|
-
const
|
|
34829
|
-
if ( instanceId >=
|
|
35081
|
+
const instanceInfo = this._instanceInfo;
|
|
35082
|
+
if ( instanceId >= instanceInfo.length || instanceInfo[ instanceId ].active === false ) {
|
|
34830
35083
|
|
|
34831
35084
|
return false;
|
|
34832
35085
|
|
|
34833
35086
|
}
|
|
34834
35087
|
|
|
34835
|
-
return
|
|
35088
|
+
return instanceInfo[ instanceId ].visible;
|
|
34836
35089
|
|
|
34837
35090
|
}
|
|
34838
35091
|
|
|
34839
35092
|
setGeometryIdAt( instanceId, geometryId ) {
|
|
34840
35093
|
|
|
34841
35094
|
// return early if the geometry is out of range or not active
|
|
34842
|
-
const
|
|
34843
|
-
|
|
35095
|
+
const instanceInfo = this._instanceInfo;
|
|
35096
|
+
const geometryInfoList = this._geometryInfo;
|
|
35097
|
+
if ( instanceId >= instanceInfo.length || instanceInfo[ instanceId ].active === false ) {
|
|
34844
35098
|
|
|
34845
35099
|
return null;
|
|
34846
35100
|
|
|
34847
35101
|
}
|
|
34848
35102
|
|
|
34849
35103
|
// check if the provided geometryId is within the valid range
|
|
34850
|
-
if ( geometryId
|
|
35104
|
+
if ( geometryId >= geometryInfoList.length || geometryInfoList[ geometryId ].active === false ) {
|
|
34851
35105
|
|
|
34852
35106
|
return null;
|
|
34853
35107
|
|
|
34854
35108
|
}
|
|
34855
35109
|
|
|
34856
|
-
|
|
35110
|
+
instanceInfo[ instanceId ].geometryIndex = geometryId;
|
|
34857
35111
|
|
|
34858
35112
|
return this;
|
|
34859
35113
|
|
|
@@ -34861,14 +35115,14 @@ class BatchedMesh extends Mesh {
|
|
|
34861
35115
|
|
|
34862
35116
|
getGeometryIdAt( instanceId ) {
|
|
34863
35117
|
|
|
34864
|
-
const
|
|
34865
|
-
if ( instanceId >=
|
|
35118
|
+
const instanceInfo = this._instanceInfo;
|
|
35119
|
+
if ( instanceId >= instanceInfo.length || instanceInfo[ instanceId ].active === false ) {
|
|
34866
35120
|
|
|
34867
35121
|
return - 1;
|
|
34868
35122
|
|
|
34869
35123
|
}
|
|
34870
35124
|
|
|
34871
|
-
return
|
|
35125
|
+
return instanceInfo[ instanceId ].geometryIndex;
|
|
34872
35126
|
|
|
34873
35127
|
}
|
|
34874
35128
|
|
|
@@ -34880,19 +35134,136 @@ class BatchedMesh extends Mesh {
|
|
|
34880
35134
|
|
|
34881
35135
|
}
|
|
34882
35136
|
|
|
34883
|
-
const
|
|
35137
|
+
const geometryInfo = this._geometryInfo[ geometryId ];
|
|
35138
|
+
target.vertexStart = geometryInfo.vertexStart;
|
|
35139
|
+
target.vertexCount = geometryInfo.vertexCount;
|
|
35140
|
+
target.reservedVertexCount = geometryInfo.reservedVertexCount;
|
|
35141
|
+
|
|
35142
|
+
target.indexStart = geometryInfo.indexStart;
|
|
35143
|
+
target.indexCount = geometryInfo.indexCount;
|
|
35144
|
+
target.reservedIndexCount = geometryInfo.reservedIndexCount;
|
|
34884
35145
|
|
|
34885
|
-
target.start =
|
|
34886
|
-
target.count =
|
|
35146
|
+
target.start = geometryInfo.start;
|
|
35147
|
+
target.count = geometryInfo.count;
|
|
34887
35148
|
|
|
34888
35149
|
return target;
|
|
34889
35150
|
|
|
34890
35151
|
}
|
|
34891
35152
|
|
|
35153
|
+
setInstanceCount( maxInstanceCount ) {
|
|
35154
|
+
|
|
35155
|
+
// shrink the available instances as much as possible
|
|
35156
|
+
const availableInstanceIds = this._availableInstanceIds;
|
|
35157
|
+
const instanceInfo = this._instanceInfo;
|
|
35158
|
+
availableInstanceIds.sort( ascIdSort );
|
|
35159
|
+
while ( availableInstanceIds[ availableInstanceIds.length - 1 ] === instanceInfo.length ) {
|
|
35160
|
+
|
|
35161
|
+
instanceInfo.pop();
|
|
35162
|
+
availableInstanceIds.pop();
|
|
35163
|
+
|
|
35164
|
+
}
|
|
35165
|
+
|
|
35166
|
+
// throw an error if it can't be shrunk to the desired size
|
|
35167
|
+
if ( maxInstanceCount < instanceInfo.length ) {
|
|
35168
|
+
|
|
35169
|
+
throw new Error( `BatchedMesh: Instance ids outside the range ${ maxInstanceCount } are being used. Cannot shrink instance count.` );
|
|
35170
|
+
|
|
35171
|
+
}
|
|
35172
|
+
|
|
35173
|
+
// copy the multi draw counts
|
|
35174
|
+
const multiDrawCounts = new Int32Array( maxInstanceCount );
|
|
35175
|
+
const multiDrawStarts = new Int32Array( maxInstanceCount );
|
|
35176
|
+
copyArrayContents( this._multiDrawCounts, multiDrawCounts );
|
|
35177
|
+
copyArrayContents( this._multiDrawStarts, multiDrawStarts );
|
|
35178
|
+
|
|
35179
|
+
this._multiDrawCounts = multiDrawCounts;
|
|
35180
|
+
this._multiDrawStarts = multiDrawStarts;
|
|
35181
|
+
this._maxInstanceCount = maxInstanceCount;
|
|
35182
|
+
|
|
35183
|
+
// update texture data for instance sampling
|
|
35184
|
+
const indirectTexture = this._indirectTexture;
|
|
35185
|
+
const matricesTexture = this._matricesTexture;
|
|
35186
|
+
const colorsTexture = this._colorsTexture;
|
|
35187
|
+
|
|
35188
|
+
indirectTexture.dispose();
|
|
35189
|
+
this._initIndirectTexture();
|
|
35190
|
+
copyArrayContents( indirectTexture.image.data, this._indirectTexture.image.data );
|
|
35191
|
+
|
|
35192
|
+
matricesTexture.dispose();
|
|
35193
|
+
this._initMatricesTexture();
|
|
35194
|
+
copyArrayContents( matricesTexture.image.data, this._matricesTexture.image.data );
|
|
35195
|
+
|
|
35196
|
+
if ( colorsTexture ) {
|
|
35197
|
+
|
|
35198
|
+
colorsTexture.dispose();
|
|
35199
|
+
this._initColorsTexture();
|
|
35200
|
+
copyArrayContents( colorsTexture.image.data, this._colorsTexture.image.data );
|
|
35201
|
+
|
|
35202
|
+
}
|
|
35203
|
+
|
|
35204
|
+
}
|
|
35205
|
+
|
|
35206
|
+
setGeometrySize( maxVertexCount, maxIndexCount ) {
|
|
35207
|
+
|
|
35208
|
+
// Check if we can shrink to the requested vertex attribute size
|
|
35209
|
+
const validRanges = [ ...this._geometryInfo ].filter( info => info.active );
|
|
35210
|
+
const requiredVertexLength = Math.max( ...validRanges.map( range => range.vertexStart + range.reservedVertexCount ) );
|
|
35211
|
+
if ( requiredVertexLength > maxVertexCount ) {
|
|
35212
|
+
|
|
35213
|
+
throw new Error( `BatchedMesh: Geometry vertex values are being used outside the range ${ maxIndexCount }. Cannot shrink further.` );
|
|
35214
|
+
|
|
35215
|
+
}
|
|
35216
|
+
|
|
35217
|
+
// Check if we can shrink to the requested index attribute size
|
|
35218
|
+
if ( this.geometry.index ) {
|
|
35219
|
+
|
|
35220
|
+
const requiredIndexLength = Math.max( ...validRanges.map( range => range.indexStart + range.reservedIndexCount ) );
|
|
35221
|
+
if ( requiredIndexLength > maxIndexCount ) {
|
|
35222
|
+
|
|
35223
|
+
throw new Error( `BatchedMesh: Geometry index values are being used outside the range ${ maxIndexCount }. Cannot shrink further.` );
|
|
35224
|
+
|
|
35225
|
+
}
|
|
35226
|
+
|
|
35227
|
+
}
|
|
35228
|
+
|
|
35229
|
+
//
|
|
35230
|
+
|
|
35231
|
+
// dispose of the previous geometry
|
|
35232
|
+
const oldGeometry = this.geometry;
|
|
35233
|
+
oldGeometry.dispose();
|
|
35234
|
+
|
|
35235
|
+
// recreate the geometry needed based on the previous variant
|
|
35236
|
+
this._maxVertexCount = maxVertexCount;
|
|
35237
|
+
this._maxIndexCount = maxIndexCount;
|
|
35238
|
+
|
|
35239
|
+
if ( this._geometryInitialized ) {
|
|
35240
|
+
|
|
35241
|
+
this._geometryInitialized = false;
|
|
35242
|
+
this.geometry = new BufferGeometry();
|
|
35243
|
+
this._initializeGeometry( oldGeometry );
|
|
35244
|
+
|
|
35245
|
+
}
|
|
35246
|
+
|
|
35247
|
+
// copy data from the previous geometry
|
|
35248
|
+
const geometry = this.geometry;
|
|
35249
|
+
if ( oldGeometry.index ) {
|
|
35250
|
+
|
|
35251
|
+
copyArrayContents( oldGeometry.index.array, geometry.index.array );
|
|
35252
|
+
|
|
35253
|
+
}
|
|
35254
|
+
|
|
35255
|
+
for ( const key in oldGeometry.attributes ) {
|
|
35256
|
+
|
|
35257
|
+
copyArrayContents( oldGeometry.attributes[ key ].array, geometry.attributes[ key ].array );
|
|
35258
|
+
|
|
35259
|
+
}
|
|
35260
|
+
|
|
35261
|
+
}
|
|
35262
|
+
|
|
34892
35263
|
raycast( raycaster, intersects ) {
|
|
34893
35264
|
|
|
34894
|
-
const
|
|
34895
|
-
const
|
|
35265
|
+
const instanceInfo = this._instanceInfo;
|
|
35266
|
+
const geometryInfoList = this._geometryInfo;
|
|
34896
35267
|
const matrixWorld = this.matrixWorld;
|
|
34897
35268
|
const batchGeometry = this.geometry;
|
|
34898
35269
|
|
|
@@ -34912,19 +35283,19 @@ class BatchedMesh extends Mesh {
|
|
|
34912
35283
|
|
|
34913
35284
|
}
|
|
34914
35285
|
|
|
34915
|
-
for ( let i = 0, l =
|
|
35286
|
+
for ( let i = 0, l = instanceInfo.length; i < l; i ++ ) {
|
|
34916
35287
|
|
|
34917
|
-
if ( !
|
|
35288
|
+
if ( ! instanceInfo[ i ].visible || ! instanceInfo[ i ].active ) {
|
|
34918
35289
|
|
|
34919
35290
|
continue;
|
|
34920
35291
|
|
|
34921
35292
|
}
|
|
34922
35293
|
|
|
34923
|
-
const geometryId =
|
|
34924
|
-
const
|
|
34925
|
-
_mesh.geometry.setDrawRange(
|
|
35294
|
+
const geometryId = instanceInfo[ i ].geometryIndex;
|
|
35295
|
+
const geometryInfo = geometryInfoList[ geometryId ];
|
|
35296
|
+
_mesh.geometry.setDrawRange( geometryInfo.start, geometryInfo.count );
|
|
34926
35297
|
|
|
34927
|
-
//
|
|
35298
|
+
// get the intersects
|
|
34928
35299
|
this.getMatrixAt( i, _mesh.matrixWorld ).premultiply( matrixWorld );
|
|
34929
35300
|
this.getBoundingBoxAt( geometryId, _mesh.geometry.boundingBox );
|
|
34930
35301
|
this.getBoundingSphereAt( geometryId, _mesh.geometry.boundingSphere );
|
|
@@ -34961,17 +35332,13 @@ class BatchedMesh extends Mesh {
|
|
|
34961
35332
|
this.boundingBox = source.boundingBox !== null ? source.boundingBox.clone() : null;
|
|
34962
35333
|
this.boundingSphere = source.boundingSphere !== null ? source.boundingSphere.clone() : null;
|
|
34963
35334
|
|
|
34964
|
-
this.
|
|
34965
|
-
|
|
34966
|
-
|
|
34967
|
-
this._drawInfo = source._drawInfo.map( inf => ( { ...inf } ) );
|
|
34968
|
-
this._bounds = source._bounds.map( bound => ( {
|
|
34969
|
-
boxInitialized: bound.boxInitialized,
|
|
34970
|
-
box: bound.box.clone(),
|
|
35335
|
+
this._geometryInfo = source._geometryInfo.map( info => ( {
|
|
35336
|
+
...info,
|
|
34971
35337
|
|
|
34972
|
-
|
|
34973
|
-
|
|
35338
|
+
boundingBox: info.boundingBox !== null ? info.boundingBox.clone() : null,
|
|
35339
|
+
boundingSphere: info.boundingSphere !== null ? info.boundingSphere.clone() : null,
|
|
34974
35340
|
} ) );
|
|
35341
|
+
this._instanceInfo = source._instanceInfo.map( info => ( { ...info } ) );
|
|
34975
35342
|
|
|
34976
35343
|
this._maxInstanceCount = source._maxInstanceCount;
|
|
34977
35344
|
this._maxVertexCount = source._maxVertexCount;
|
|
@@ -35033,10 +35400,10 @@ class BatchedMesh extends Mesh {
|
|
|
35033
35400
|
const index = geometry.getIndex();
|
|
35034
35401
|
const bytesPerElement = index === null ? 1 : index.array.BYTES_PER_ELEMENT;
|
|
35035
35402
|
|
|
35036
|
-
const
|
|
35403
|
+
const instanceInfo = this._instanceInfo;
|
|
35037
35404
|
const multiDrawStarts = this._multiDrawStarts;
|
|
35038
35405
|
const multiDrawCounts = this._multiDrawCounts;
|
|
35039
|
-
const
|
|
35406
|
+
const geometryInfoList = this._geometryInfo;
|
|
35040
35407
|
const perObjectFrustumCulled = this.perObjectFrustumCulled;
|
|
35041
35408
|
const indirectTexture = this._indirectTexture;
|
|
35042
35409
|
const indirectArray = indirectTexture.image.data;
|
|
@@ -35044,29 +35411,29 @@ class BatchedMesh extends Mesh {
|
|
|
35044
35411
|
// prepare the frustum in the local frame
|
|
35045
35412
|
if ( perObjectFrustumCulled ) {
|
|
35046
35413
|
|
|
35047
|
-
|
|
35414
|
+
_matrix$1
|
|
35048
35415
|
.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse )
|
|
35049
35416
|
.multiply( this.matrixWorld );
|
|
35050
35417
|
_frustum.setFromProjectionMatrix(
|
|
35051
|
-
|
|
35418
|
+
_matrix$1,
|
|
35052
35419
|
renderer.coordinateSystem
|
|
35053
35420
|
);
|
|
35054
35421
|
|
|
35055
35422
|
}
|
|
35056
35423
|
|
|
35057
|
-
let
|
|
35424
|
+
let multiDrawCount = 0;
|
|
35058
35425
|
if ( this.sortObjects ) {
|
|
35059
35426
|
|
|
35060
35427
|
// get the camera position in the local frame
|
|
35061
|
-
|
|
35062
|
-
_vector$5.setFromMatrixPosition( camera.matrixWorld ).applyMatrix4(
|
|
35063
|
-
_forward.set( 0, 0, - 1 ).transformDirection( camera.matrixWorld ).transformDirection(
|
|
35428
|
+
_matrix$1.copy( this.matrixWorld ).invert();
|
|
35429
|
+
_vector$5.setFromMatrixPosition( camera.matrixWorld ).applyMatrix4( _matrix$1 );
|
|
35430
|
+
_forward.set( 0, 0, - 1 ).transformDirection( camera.matrixWorld ).transformDirection( _matrix$1 );
|
|
35064
35431
|
|
|
35065
|
-
for ( let i = 0, l =
|
|
35432
|
+
for ( let i = 0, l = instanceInfo.length; i < l; i ++ ) {
|
|
35066
35433
|
|
|
35067
|
-
if (
|
|
35434
|
+
if ( instanceInfo[ i ].visible && instanceInfo[ i ].active ) {
|
|
35068
35435
|
|
|
35069
|
-
const geometryId =
|
|
35436
|
+
const geometryId = instanceInfo[ i ].geometryIndex;
|
|
35070
35437
|
|
|
35071
35438
|
// get the bounds in world space
|
|
35072
35439
|
this.getMatrixAt( i, _matrix$1 );
|
|
@@ -35083,8 +35450,9 @@ class BatchedMesh extends Mesh {
|
|
|
35083
35450
|
if ( ! culled ) {
|
|
35084
35451
|
|
|
35085
35452
|
// get the distance from camera used for sorting
|
|
35453
|
+
const geometryInfo = geometryInfoList[ geometryId ];
|
|
35086
35454
|
const z = _temp.subVectors( _sphere$2.center, _vector$5 ).dot( _forward );
|
|
35087
|
-
_renderList.push(
|
|
35455
|
+
_renderList.push( geometryInfo.start, geometryInfo.count, z, i );
|
|
35088
35456
|
|
|
35089
35457
|
}
|
|
35090
35458
|
|
|
@@ -35108,10 +35476,10 @@ class BatchedMesh extends Mesh {
|
|
|
35108
35476
|
for ( let i = 0, l = list.length; i < l; i ++ ) {
|
|
35109
35477
|
|
|
35110
35478
|
const item = list[ i ];
|
|
35111
|
-
multiDrawStarts[
|
|
35112
|
-
multiDrawCounts[
|
|
35113
|
-
indirectArray[
|
|
35114
|
-
|
|
35479
|
+
multiDrawStarts[ multiDrawCount ] = item.start * bytesPerElement;
|
|
35480
|
+
multiDrawCounts[ multiDrawCount ] = item.count;
|
|
35481
|
+
indirectArray[ multiDrawCount ] = item.index;
|
|
35482
|
+
multiDrawCount ++;
|
|
35115
35483
|
|
|
35116
35484
|
}
|
|
35117
35485
|
|
|
@@ -35119,11 +35487,11 @@ class BatchedMesh extends Mesh {
|
|
|
35119
35487
|
|
|
35120
35488
|
} else {
|
|
35121
35489
|
|
|
35122
|
-
for ( let i = 0, l =
|
|
35490
|
+
for ( let i = 0, l = instanceInfo.length; i < l; i ++ ) {
|
|
35123
35491
|
|
|
35124
|
-
if (
|
|
35492
|
+
if ( instanceInfo[ i ].visible && instanceInfo[ i ].active ) {
|
|
35125
35493
|
|
|
35126
|
-
const geometryId =
|
|
35494
|
+
const geometryId = instanceInfo[ i ].geometryIndex;
|
|
35127
35495
|
|
|
35128
35496
|
// determine whether the batched geometry is within the frustum
|
|
35129
35497
|
let culled = false;
|
|
@@ -35138,11 +35506,11 @@ class BatchedMesh extends Mesh {
|
|
|
35138
35506
|
|
|
35139
35507
|
if ( ! culled ) {
|
|
35140
35508
|
|
|
35141
|
-
const
|
|
35142
|
-
multiDrawStarts[
|
|
35143
|
-
multiDrawCounts[
|
|
35144
|
-
indirectArray[
|
|
35145
|
-
|
|
35509
|
+
const geometryInfo = geometryInfoList[ geometryId ];
|
|
35510
|
+
multiDrawStarts[ multiDrawCount ] = geometryInfo.start * bytesPerElement;
|
|
35511
|
+
multiDrawCounts[ multiDrawCount ] = geometryInfo.count;
|
|
35512
|
+
indirectArray[ multiDrawCount ] = i;
|
|
35513
|
+
multiDrawCount ++;
|
|
35146
35514
|
|
|
35147
35515
|
}
|
|
35148
35516
|
|
|
@@ -35153,7 +35521,7 @@ class BatchedMesh extends Mesh {
|
|
|
35153
35521
|
}
|
|
35154
35522
|
|
|
35155
35523
|
indirectTexture.needsUpdate = true;
|
|
35156
|
-
this._multiDrawCount =
|
|
35524
|
+
this._multiDrawCount = multiDrawCount;
|
|
35157
35525
|
this._visibilityChanged = false;
|
|
35158
35526
|
|
|
35159
35527
|
}
|
|
@@ -35168,14 +35536,18 @@ class BatchedMesh extends Mesh {
|
|
|
35168
35536
|
|
|
35169
35537
|
class LineBasicMaterial extends Material {
|
|
35170
35538
|
|
|
35539
|
+
static get type() {
|
|
35540
|
+
|
|
35541
|
+
return 'LineBasicMaterial';
|
|
35542
|
+
|
|
35543
|
+
}
|
|
35544
|
+
|
|
35171
35545
|
constructor( parameters ) {
|
|
35172
35546
|
|
|
35173
35547
|
super();
|
|
35174
35548
|
|
|
35175
35549
|
this.isLineBasicMaterial = true;
|
|
35176
35550
|
|
|
35177
|
-
this.type = 'LineBasicMaterial';
|
|
35178
|
-
|
|
35179
35551
|
this.color = new Color( 0xffffff );
|
|
35180
35552
|
|
|
35181
35553
|
this.map = null;
|
|
@@ -35513,14 +35885,18 @@ class LineLoop extends Line {
|
|
|
35513
35885
|
|
|
35514
35886
|
class PointsMaterial extends Material {
|
|
35515
35887
|
|
|
35888
|
+
static get type() {
|
|
35889
|
+
|
|
35890
|
+
return 'PointsMaterial';
|
|
35891
|
+
|
|
35892
|
+
}
|
|
35893
|
+
|
|
35516
35894
|
constructor( parameters ) {
|
|
35517
35895
|
|
|
35518
35896
|
super();
|
|
35519
35897
|
|
|
35520
35898
|
this.isPointsMaterial = true;
|
|
35521
35899
|
|
|
35522
|
-
this.type = 'PointsMaterial';
|
|
35523
|
-
|
|
35524
35900
|
this.color = new Color( 0xffffff );
|
|
35525
35901
|
|
|
35526
35902
|
this.map = null;
|
|
@@ -38210,14 +38586,14 @@ class CylinderGeometry extends BufferGeometry {
|
|
|
38210
38586
|
|
|
38211
38587
|
// faces
|
|
38212
38588
|
|
|
38213
|
-
if ( radiusTop > 0 ) {
|
|
38589
|
+
if ( radiusTop > 0 || y !== 0 ) {
|
|
38214
38590
|
|
|
38215
38591
|
indices.push( a, b, d );
|
|
38216
38592
|
groupCount += 3;
|
|
38217
38593
|
|
|
38218
38594
|
}
|
|
38219
38595
|
|
|
38220
|
-
if ( radiusBottom > 0 ) {
|
|
38596
|
+
if ( radiusBottom > 0 || y !== heightSegments - 1 ) {
|
|
38221
38597
|
|
|
38222
38598
|
indices.push( b, c, d );
|
|
38223
38599
|
groupCount += 3;
|
|
@@ -41877,14 +42253,18 @@ var Geometries = /*#__PURE__*/Object.freeze({
|
|
|
41877
42253
|
|
|
41878
42254
|
class ShadowMaterial extends Material {
|
|
41879
42255
|
|
|
42256
|
+
static get type() {
|
|
42257
|
+
|
|
42258
|
+
return 'ShadowMaterial';
|
|
42259
|
+
|
|
42260
|
+
}
|
|
42261
|
+
|
|
41880
42262
|
constructor( parameters ) {
|
|
41881
42263
|
|
|
41882
42264
|
super();
|
|
41883
42265
|
|
|
41884
42266
|
this.isShadowMaterial = true;
|
|
41885
42267
|
|
|
41886
|
-
this.type = 'ShadowMaterial';
|
|
41887
|
-
|
|
41888
42268
|
this.color = new Color( 0x000000 );
|
|
41889
42269
|
this.transparent = true;
|
|
41890
42270
|
|
|
@@ -41910,20 +42290,30 @@ class ShadowMaterial extends Material {
|
|
|
41910
42290
|
|
|
41911
42291
|
class RawShaderMaterial extends ShaderMaterial {
|
|
41912
42292
|
|
|
42293
|
+
static get type() {
|
|
42294
|
+
|
|
42295
|
+
return 'RawShaderMaterial';
|
|
42296
|
+
|
|
42297
|
+
}
|
|
42298
|
+
|
|
41913
42299
|
constructor( parameters ) {
|
|
41914
42300
|
|
|
41915
42301
|
super( parameters );
|
|
41916
42302
|
|
|
41917
42303
|
this.isRawShaderMaterial = true;
|
|
41918
42304
|
|
|
41919
|
-
this.type = 'RawShaderMaterial';
|
|
41920
|
-
|
|
41921
42305
|
}
|
|
41922
42306
|
|
|
41923
42307
|
}
|
|
41924
42308
|
|
|
41925
42309
|
class MeshStandardMaterial extends Material {
|
|
41926
42310
|
|
|
42311
|
+
static get type() {
|
|
42312
|
+
|
|
42313
|
+
return 'MeshStandardMaterial';
|
|
42314
|
+
|
|
42315
|
+
}
|
|
42316
|
+
|
|
41927
42317
|
constructor( parameters ) {
|
|
41928
42318
|
|
|
41929
42319
|
super();
|
|
@@ -41932,8 +42322,6 @@ class MeshStandardMaterial extends Material {
|
|
|
41932
42322
|
|
|
41933
42323
|
this.defines = { 'STANDARD': '' };
|
|
41934
42324
|
|
|
41935
|
-
this.type = 'MeshStandardMaterial';
|
|
41936
|
-
|
|
41937
42325
|
this.color = new Color( 0xffffff ); // diffuse
|
|
41938
42326
|
this.roughness = 1.0;
|
|
41939
42327
|
this.metalness = 0.0;
|
|
@@ -42044,6 +42432,12 @@ class MeshStandardMaterial extends Material {
|
|
|
42044
42432
|
|
|
42045
42433
|
class MeshPhysicalMaterial extends MeshStandardMaterial {
|
|
42046
42434
|
|
|
42435
|
+
static get type() {
|
|
42436
|
+
|
|
42437
|
+
return 'MeshPhysicalMaterial';
|
|
42438
|
+
|
|
42439
|
+
}
|
|
42440
|
+
|
|
42047
42441
|
constructor( parameters ) {
|
|
42048
42442
|
|
|
42049
42443
|
super();
|
|
@@ -42057,8 +42451,6 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
|
|
|
42057
42451
|
|
|
42058
42452
|
};
|
|
42059
42453
|
|
|
42060
|
-
this.type = 'MeshPhysicalMaterial';
|
|
42061
|
-
|
|
42062
42454
|
this.anisotropyRotation = 0;
|
|
42063
42455
|
this.anisotropyMap = null;
|
|
42064
42456
|
|
|
@@ -42282,14 +42674,18 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
|
|
|
42282
42674
|
|
|
42283
42675
|
class MeshPhongMaterial extends Material {
|
|
42284
42676
|
|
|
42677
|
+
static get type() {
|
|
42678
|
+
|
|
42679
|
+
return 'MeshPhongMaterial';
|
|
42680
|
+
|
|
42681
|
+
}
|
|
42682
|
+
|
|
42285
42683
|
constructor( parameters ) {
|
|
42286
42684
|
|
|
42287
42685
|
super();
|
|
42288
42686
|
|
|
42289
42687
|
this.isMeshPhongMaterial = true;
|
|
42290
42688
|
|
|
42291
|
-
this.type = 'MeshPhongMaterial';
|
|
42292
|
-
|
|
42293
42689
|
this.color = new Color( 0xffffff ); // diffuse
|
|
42294
42690
|
this.specular = new Color( 0x111111 );
|
|
42295
42691
|
this.shininess = 30;
|
|
@@ -42398,6 +42794,12 @@ class MeshPhongMaterial extends Material {
|
|
|
42398
42794
|
|
|
42399
42795
|
class MeshToonMaterial extends Material {
|
|
42400
42796
|
|
|
42797
|
+
static get type() {
|
|
42798
|
+
|
|
42799
|
+
return 'MeshToonMaterial';
|
|
42800
|
+
|
|
42801
|
+
}
|
|
42802
|
+
|
|
42401
42803
|
constructor( parameters ) {
|
|
42402
42804
|
|
|
42403
42805
|
super();
|
|
@@ -42406,8 +42808,6 @@ class MeshToonMaterial extends Material {
|
|
|
42406
42808
|
|
|
42407
42809
|
this.defines = { 'TOON': '' };
|
|
42408
42810
|
|
|
42409
|
-
this.type = 'MeshToonMaterial';
|
|
42410
|
-
|
|
42411
42811
|
this.color = new Color( 0xffffff );
|
|
42412
42812
|
|
|
42413
42813
|
this.map = null;
|
|
@@ -42494,14 +42894,18 @@ class MeshToonMaterial extends Material {
|
|
|
42494
42894
|
|
|
42495
42895
|
class MeshNormalMaterial extends Material {
|
|
42496
42896
|
|
|
42897
|
+
static get type() {
|
|
42898
|
+
|
|
42899
|
+
return 'MeshNormalMaterial';
|
|
42900
|
+
|
|
42901
|
+
}
|
|
42902
|
+
|
|
42497
42903
|
constructor( parameters ) {
|
|
42498
42904
|
|
|
42499
42905
|
super();
|
|
42500
42906
|
|
|
42501
42907
|
this.isMeshNormalMaterial = true;
|
|
42502
42908
|
|
|
42503
|
-
this.type = 'MeshNormalMaterial';
|
|
42504
|
-
|
|
42505
42909
|
this.bumpMap = null;
|
|
42506
42910
|
this.bumpScale = 1;
|
|
42507
42911
|
|
|
@@ -42550,14 +42954,18 @@ class MeshNormalMaterial extends Material {
|
|
|
42550
42954
|
|
|
42551
42955
|
class MeshLambertMaterial extends Material {
|
|
42552
42956
|
|
|
42957
|
+
static get type() {
|
|
42958
|
+
|
|
42959
|
+
return 'MeshLambertMaterial';
|
|
42960
|
+
|
|
42961
|
+
}
|
|
42962
|
+
|
|
42553
42963
|
constructor( parameters ) {
|
|
42554
42964
|
|
|
42555
42965
|
super();
|
|
42556
42966
|
|
|
42557
42967
|
this.isMeshLambertMaterial = true;
|
|
42558
42968
|
|
|
42559
|
-
this.type = 'MeshLambertMaterial';
|
|
42560
|
-
|
|
42561
42969
|
this.color = new Color( 0xffffff ); // diffuse
|
|
42562
42970
|
|
|
42563
42971
|
this.map = null;
|
|
@@ -42662,6 +43070,12 @@ class MeshLambertMaterial extends Material {
|
|
|
42662
43070
|
|
|
42663
43071
|
class MeshMatcapMaterial extends Material {
|
|
42664
43072
|
|
|
43073
|
+
static get type() {
|
|
43074
|
+
|
|
43075
|
+
return 'MeshMatcapMaterial';
|
|
43076
|
+
|
|
43077
|
+
}
|
|
43078
|
+
|
|
42665
43079
|
constructor( parameters ) {
|
|
42666
43080
|
|
|
42667
43081
|
super();
|
|
@@ -42670,8 +43084,6 @@ class MeshMatcapMaterial extends Material {
|
|
|
42670
43084
|
|
|
42671
43085
|
this.defines = { 'MATCAP': '' };
|
|
42672
43086
|
|
|
42673
|
-
this.type = 'MeshMatcapMaterial';
|
|
42674
|
-
|
|
42675
43087
|
this.color = new Color( 0xffffff ); // diffuse
|
|
42676
43088
|
|
|
42677
43089
|
this.matcap = null;
|
|
@@ -42737,14 +43149,18 @@ class MeshMatcapMaterial extends Material {
|
|
|
42737
43149
|
|
|
42738
43150
|
class LineDashedMaterial extends LineBasicMaterial {
|
|
42739
43151
|
|
|
43152
|
+
static get type() {
|
|
43153
|
+
|
|
43154
|
+
return 'LineDashedMaterial';
|
|
43155
|
+
|
|
43156
|
+
}
|
|
43157
|
+
|
|
42740
43158
|
constructor( parameters ) {
|
|
42741
43159
|
|
|
42742
43160
|
super();
|
|
42743
43161
|
|
|
42744
43162
|
this.isLineDashedMaterial = true;
|
|
42745
43163
|
|
|
42746
|
-
this.type = 'LineDashedMaterial';
|
|
42747
|
-
|
|
42748
43164
|
this.scale = 1;
|
|
42749
43165
|
this.dashSize = 3;
|
|
42750
43166
|
this.gapSize = 1;
|
|
@@ -54752,7 +55168,6 @@ exports.DetachedBindMode = DetachedBindMode;
|
|
|
54752
55168
|
exports.DirectionalLight = DirectionalLight;
|
|
54753
55169
|
exports.DirectionalLightHelper = DirectionalLightHelper;
|
|
54754
55170
|
exports.DiscreteInterpolant = DiscreteInterpolant;
|
|
54755
|
-
exports.DisplayP3ColorSpace = DisplayP3ColorSpace;
|
|
54756
55171
|
exports.DodecahedronGeometry = DodecahedronGeometry;
|
|
54757
55172
|
exports.DoubleSide = DoubleSide;
|
|
54758
55173
|
exports.DstAlphaFactor = DstAlphaFactor;
|
|
@@ -54835,7 +55250,6 @@ exports.LineCurve3 = LineCurve3;
|
|
|
54835
55250
|
exports.LineDashedMaterial = LineDashedMaterial;
|
|
54836
55251
|
exports.LineLoop = LineLoop;
|
|
54837
55252
|
exports.LineSegments = LineSegments;
|
|
54838
|
-
exports.LinearDisplayP3ColorSpace = LinearDisplayP3ColorSpace;
|
|
54839
55253
|
exports.LinearFilter = LinearFilter;
|
|
54840
55254
|
exports.LinearInterpolant = LinearInterpolant;
|
|
54841
55255
|
exports.LinearMipMapLinearFilter = LinearMipMapLinearFilter;
|
|
@@ -54907,7 +55321,6 @@ exports.OneMinusDstColorFactor = OneMinusDstColorFactor;
|
|
|
54907
55321
|
exports.OneMinusSrcAlphaFactor = OneMinusSrcAlphaFactor;
|
|
54908
55322
|
exports.OneMinusSrcColorFactor = OneMinusSrcColorFactor;
|
|
54909
55323
|
exports.OrthographicCamera = OrthographicCamera;
|
|
54910
|
-
exports.P3Primaries = P3Primaries;
|
|
54911
55324
|
exports.PCFShadowMap = PCFShadowMap;
|
|
54912
55325
|
exports.PCFSoftShadowMap = PCFSoftShadowMap;
|
|
54913
55326
|
exports.PMREMGenerator = PMREMGenerator;
|
|
@@ -54973,7 +55386,6 @@ exports.RGIntegerFormat = RGIntegerFormat;
|
|
|
54973
55386
|
exports.RawShaderMaterial = RawShaderMaterial;
|
|
54974
55387
|
exports.Ray = Ray;
|
|
54975
55388
|
exports.Raycaster = Raycaster;
|
|
54976
|
-
exports.Rec709Primaries = Rec709Primaries;
|
|
54977
55389
|
exports.RectAreaLight = RectAreaLight;
|
|
54978
55390
|
exports.RedFormat = RedFormat;
|
|
54979
55391
|
exports.RedIntegerFormat = RedIntegerFormat;
|