super-three 0.184.0 → 0.185.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 +1260 -927
- package/build/three.core.js +1104 -829
- package/build/three.core.min.js +1 -1
- package/build/three.module.js +156 -98
- package/build/three.module.min.js +1 -1
- package/build/three.tsl.js +11 -4
- package/build/three.tsl.min.js +1 -1
- package/build/three.webgpu.js +7538 -3367
- package/build/three.webgpu.min.js +1 -1
- package/build/three.webgpu.nodes.js +7538 -3366
- package/build/three.webgpu.nodes.min.js +1 -1
- package/examples/jsm/Addons.js +3 -0
- package/examples/jsm/controls/ArcballControls.js +6 -2
- package/examples/jsm/controls/FirstPersonControls.js +79 -42
- package/examples/jsm/controls/TransformControls.js +68 -15
- package/examples/jsm/csm/CSMFrustum.js +31 -6
- package/examples/jsm/csm/CSMShadowNode.js +4 -1
- package/examples/jsm/effects/AsciiEffect.js +14 -1
- package/examples/jsm/exporters/DRACOExporter.js +27 -6
- package/examples/jsm/exporters/GLTFExporter.js +114 -12
- package/examples/jsm/exporters/PLYExporter.js +286 -73
- package/examples/jsm/exporters/USDZExporter.js +347 -112
- package/examples/jsm/generators/CityGenerator.js +346 -0
- package/examples/jsm/generators/ForestGenerator.js +347 -0
- package/examples/jsm/generators/TerrainGenerator.js +504 -0
- package/examples/jsm/generators/TreeGenerator.js +377 -0
- package/examples/jsm/generators/city/SidewalkGenerator.js +253 -0
- package/examples/jsm/generators/city/SkyscraperGenerator.js +1357 -0
- package/examples/jsm/geometries/LoftGeometry.js +355 -0
- package/examples/jsm/helpers/LightProbeGridHelper.js +1 -1
- package/examples/jsm/helpers/LightProbeHelper.js +5 -4
- package/examples/jsm/helpers/ViewHelper.js +16 -6
- package/examples/jsm/inspector/Inspector.js +53 -15
- package/examples/jsm/inspector/RendererInspector.js +152 -36
- package/examples/jsm/inspector/extensions/tsl-graph/TSLGraphEditor.js +1 -1
- package/examples/jsm/inspector/extensions/tsl-graph/TSLGraphLoader.js +1 -1
- package/examples/jsm/inspector/tabs/Console.js +200 -18
- package/examples/jsm/inspector/tabs/Memory.js +8 -0
- package/examples/jsm/inspector/tabs/Parameters.js +64 -4
- package/examples/jsm/inspector/tabs/Performance.js +21 -6
- package/examples/jsm/inspector/tabs/Settings.js +51 -9
- package/examples/jsm/inspector/tabs/Timeline.js +178 -93
- package/examples/jsm/inspector/tabs/Viewer.js +628 -16
- package/examples/jsm/inspector/ui/Graph.js +162 -25
- package/examples/jsm/inspector/ui/Item.js +92 -13
- package/examples/jsm/inspector/ui/List.js +1 -1
- package/examples/jsm/inspector/ui/Profiler.js +90 -45
- package/examples/jsm/inspector/ui/Style.js +1788 -1401
- package/examples/jsm/inspector/ui/Tab.js +5 -3
- package/examples/jsm/inspector/ui/Values.js +71 -6
- package/examples/jsm/inspector/ui/utils.js +130 -10
- package/examples/jsm/libs/basis/README.md +0 -1
- package/examples/jsm/libs/demuxer_mp4.js +3 -3
- package/examples/jsm/libs/draco/README.md +0 -1
- package/examples/jsm/libs/meshopt_clusterizer.module.js +421 -0
- package/examples/jsm/libs/meshopt_simplifier.module.js +627 -0
- package/examples/jsm/libs/mikktspace.module.js +34 -9
- package/examples/jsm/lighting/ClusteredLighting.js +55 -0
- package/examples/jsm/lighting/LightProbeGrid.js +106 -76
- package/examples/jsm/lines/LineMaterial.js +38 -15
- package/examples/jsm/lines/LineSegments2.js +8 -0
- package/examples/jsm/lines/webgpu/LineSegments2.js +8 -0
- package/examples/jsm/loaders/3DMLoader.js +1 -1
- package/examples/jsm/loaders/DRACOLoader.js +46 -13
- package/examples/jsm/loaders/EXRLoader.js +27 -55
- package/examples/jsm/loaders/HDRLoader.js +6 -28
- package/examples/jsm/loaders/KTX2Loader.js +31 -12
- package/examples/jsm/loaders/LDrawLoader.js +8 -8
- package/examples/jsm/loaders/LUT3dlLoader.js +2 -2
- package/examples/jsm/loaders/LUTCubeLoader.js +2 -2
- package/examples/jsm/loaders/LWOLoader.js +4 -0
- package/examples/jsm/loaders/LottieLoader.js +1 -1
- package/examples/jsm/loaders/MaterialXLoader.js +31 -9
- package/examples/jsm/loaders/NRRDLoader.js +3 -3
- package/examples/jsm/loaders/PCDLoader.js +7 -7
- package/examples/jsm/loaders/PLYLoader.js +218 -55
- package/examples/jsm/loaders/SVGLoader.js +547 -495
- package/examples/jsm/loaders/TTFLoader.js +1 -1
- package/examples/jsm/loaders/USDLoader.js +33 -9
- package/examples/jsm/loaders/VRMLLoader.js +1 -1
- package/examples/jsm/loaders/usd/USDAParser.js +93 -20
- package/examples/jsm/loaders/usd/USDCParser.js +1 -1
- package/examples/jsm/loaders/usd/USDComposer.js +52 -19
- package/examples/jsm/misc/TileCreasedNormalsPlugin.js +270 -0
- package/examples/jsm/misc/Volume.js +2 -2
- package/examples/jsm/objects/GroundedSkybox.js +1 -1
- package/examples/jsm/objects/Reflector.js +2 -3
- package/examples/jsm/objects/Water2Mesh.js +1 -1
- package/examples/jsm/physics/AmmoPhysics.js +15 -8
- package/examples/jsm/physics/RapierPhysics.js +27 -2
- package/examples/jsm/shaders/VolumeShader.js +31 -44
- package/examples/jsm/transpiler/GLSLDecoder.js +6 -6
- package/examples/jsm/transpiler/Linker.js +1 -1
- package/examples/jsm/tsl/display/BloomNode.js +59 -19
- package/examples/jsm/tsl/display/DepthOfFieldNode.js +2 -2
- package/examples/jsm/tsl/display/FXAANode.js +11 -12
- package/examples/jsm/tsl/display/GTAONode.js +34 -13
- package/examples/jsm/tsl/display/GodraysNode.js +1 -1
- package/examples/jsm/tsl/display/ImportanceSampledEnvironment.js +560 -0
- package/examples/jsm/tsl/display/PixelationPassNode.js +2 -2
- package/examples/jsm/tsl/display/RecurrentDenoiseNode.js +912 -0
- package/examples/jsm/tsl/display/SSAAPassNode.js +13 -25
- package/examples/jsm/tsl/display/SSGINode.js +89 -39
- package/examples/jsm/tsl/display/SSRNode.js +829 -132
- package/examples/jsm/tsl/display/SSSNode.js +2 -2
- package/examples/jsm/tsl/display/TemporalReprojectNode.js +1023 -0
- package/examples/jsm/tsl/lighting/ClusteredLightsNode.js +622 -0
- package/examples/jsm/tsl/lighting/DynamicLightsNode.js +1 -1
- package/examples/jsm/tsl/math/curlNoise.js +107 -0
- package/examples/jsm/tsl/shadows/TileShadowNode.js +1 -1
- package/examples/jsm/tsl/shadows/TileShadowNodeHelper.js +3 -3
- package/examples/jsm/tsl/utils/GroundedSkybox.js +62 -0
- package/examples/jsm/tsl/utils/RNoise.js +51 -0
- package/examples/jsm/tsl/utils/SpecularHelpers.js +325 -0
- package/examples/jsm/utils/BufferGeometryUtils.js +126 -59
- package/examples/jsm/utils/GeometryCompressionUtils.js +1 -1
- package/examples/jsm/utils/SceneOptimizer.js +1 -1
- package/examples/jsm/webxr/ARButton.js +1 -1
- package/examples/jsm/webxr/WebGLXRFallback.js +89 -0
- package/examples/jsm/webxr/XRControllerModelFactory.js +2 -2
- package/package.json +7 -7
- package/src/Three.TSL.js +10 -3
- package/src/Three.WebGPU.js +4 -0
- package/src/animation/AnimationAction.js +15 -11
- package/src/animation/AnimationClip.js +0 -139
- package/src/animation/KeyframeTrack.js +2 -2
- package/src/animation/PropertyBinding.js +2 -2
- package/src/cameras/Camera.js +2 -2
- package/src/cameras/StereoCamera.js +5 -2
- package/src/constants.js +1 -1
- package/src/core/BufferGeometry.js +29 -7
- package/src/core/Object3D.js +17 -7
- package/src/core/Raycaster.js +1 -1
- package/src/core/RenderTarget.js +15 -2
- package/src/extras/PMREMGenerator.js +6 -4
- package/src/extras/TextureUtils.js +1 -1
- package/src/extras/core/ShapePath.js +149 -160
- package/src/geometries/SphereGeometry.js +8 -3
- package/src/helpers/DirectionalLightHelper.js +2 -0
- package/src/helpers/HemisphereLightHelper.js +2 -0
- package/src/helpers/PointLightHelper.js +2 -0
- package/src/helpers/SpotLightHelper.js +1 -1
- package/src/loaders/DataTextureLoader.js +69 -38
- package/src/loaders/LoadingManager.js +5 -0
- package/src/loaders/MaterialLoader.js +36 -266
- package/src/loaders/ObjectLoader.js +3 -1
- package/src/materials/LineBasicMaterial.js +4 -0
- package/src/materials/Material.js +196 -1
- package/src/materials/MeshBasicMaterial.js +24 -0
- package/src/materials/MeshDepthMaterial.js +10 -0
- package/src/materials/MeshDistanceMaterial.js +10 -0
- package/src/materials/MeshLambertMaterial.js +40 -1
- package/src/materials/MeshMatcapMaterial.js +25 -1
- package/src/materials/MeshNormalMaterial.js +9 -1
- package/src/materials/MeshPhongMaterial.js +40 -1
- package/src/materials/MeshPhysicalMaterial.js +38 -0
- package/src/materials/MeshStandardMaterial.js +42 -1
- package/src/materials/MeshToonMaterial.js +34 -1
- package/src/materials/PointsMaterial.js +7 -0
- package/src/materials/ShaderMaterial.js +86 -0
- package/src/materials/SpriteMaterial.js +7 -0
- package/src/materials/nodes/Line2NodeMaterial.js +378 -322
- package/src/materials/nodes/MeshBasicNodeMaterial.js +2 -2
- package/src/materials/nodes/MeshNormalNodeMaterial.js +2 -2
- package/src/materials/nodes/MeshPhongNodeMaterial.js +0 -9
- package/src/materials/nodes/MeshPhysicalNodeMaterial.js +0 -30
- package/src/materials/nodes/MeshSSSNodeMaterial.js +0 -13
- package/src/materials/nodes/MeshStandardNodeMaterial.js +0 -11
- package/src/materials/nodes/NodeMaterial.js +115 -71
- package/src/materials/nodes/SpriteNodeMaterial.js +0 -10
- package/src/materials/nodes/manager/NodeMaterialObserver.js +49 -20
- package/src/math/Box3.js +5 -0
- package/src/math/FrustumArray.js +103 -133
- package/src/math/Interpolant.js +1 -1
- package/src/math/MathUtils.js +2 -2
- package/src/math/Matrix3.js +11 -0
- package/src/math/Matrix4.js +28 -3
- package/src/math/Vector2.js +2 -2
- package/src/math/Vector3.js +2 -2
- package/src/math/Vector4.js +2 -2
- package/src/math/interpolants/BezierInterpolant.js +4 -6
- package/src/nodes/Nodes.js +2 -5
- package/src/nodes/TSL.js +8 -6
- package/src/nodes/accessors/Arrays.js +4 -4
- package/src/nodes/accessors/Batch.js +108 -0
- package/src/nodes/accessors/Bitangent.js +2 -2
- package/src/nodes/accessors/BufferAttributeNode.js +13 -2
- package/src/nodes/accessors/Camera.js +7 -7
- package/src/nodes/accessors/ClippingNode.js +1 -1
- package/src/nodes/accessors/Instance.js +264 -0
- package/src/nodes/accessors/MaterialNode.js +18 -2
- package/src/nodes/accessors/MaterialProperties.js +4 -3
- package/src/nodes/accessors/{MorphNode.js → Morph.js} +99 -112
- package/src/nodes/accessors/Normal.js +13 -13
- package/src/nodes/accessors/Position.js +5 -1
- package/src/nodes/accessors/ReferenceNode.js +1 -0
- package/src/nodes/accessors/ReflectVector.js +3 -3
- package/src/nodes/accessors/SceneProperties.js +1 -1
- package/src/nodes/accessors/Skinning.js +263 -0
- package/src/nodes/accessors/StorageBufferNode.js +2 -2
- package/src/nodes/accessors/StorageTexture3DNode.js +100 -0
- package/src/nodes/accessors/StorageTextureNode.js +39 -7
- package/src/nodes/accessors/Tangent.js +4 -4
- package/src/nodes/accessors/TextureNode.js +60 -5
- package/src/nodes/code/FunctionNode.js +2 -16
- package/src/nodes/core/MRTNode.js +7 -2
- package/src/nodes/core/Node.js +39 -2
- package/src/nodes/core/NodeBuilder.js +201 -41
- package/src/nodes/core/NodeUtils.js +13 -13
- package/src/nodes/core/OutputStructNode.js +1 -1
- package/src/nodes/core/OverrideContextNode.js +153 -0
- package/src/nodes/core/PropertyNode.js +51 -5
- package/src/nodes/core/StackNode.js +56 -34
- package/src/nodes/core/StructNode.js +4 -6
- package/src/nodes/core/StructTypeNode.js +6 -6
- package/src/nodes/core/VarNode.js +8 -0
- package/src/nodes/core/VaryingNode.js +12 -2
- package/src/nodes/display/BlendModes.js +1 -41
- package/src/nodes/display/BumpMapNode.js +6 -1
- package/src/nodes/display/ColorAdjustment.js +10 -9
- package/src/nodes/display/FrontFacingNode.js +38 -9
- package/src/nodes/display/NormalMapNode.js +2 -2
- package/src/nodes/display/PassNode.js +35 -43
- package/src/nodes/display/PremultiplyAlphaFunctions.js +39 -0
- package/src/nodes/display/RenderOutputNode.js +12 -3
- package/src/nodes/functions/VolumetricLightingModel.js +40 -7
- package/src/nodes/gpgpu/WorkgroupInfoNode.js +1 -1
- package/src/nodes/lighting/EnvironmentNode.js +2 -2
- package/src/nodes/lighting/IESSpotLightNode.js +40 -2
- package/src/nodes/lighting/LightingContextNode.js +10 -2
- package/src/nodes/lighting/LightsNode.js +90 -37
- package/src/nodes/lighting/PointShadowNode.js +6 -1
- package/src/nodes/lighting/ShadowFilterNode.js +21 -52
- package/src/nodes/lighting/ShadowNode.js +34 -14
- package/src/nodes/materialx/lib/mx_noise.js +2 -2
- package/src/nodes/math/ConditionalNode.js +3 -3
- package/src/nodes/math/MathNode.js +39 -11
- package/src/nodes/math/OperatorNode.js +23 -23
- package/src/nodes/parsers/GLSLNodeFunction.js +1 -1
- package/src/nodes/pmrem/PMREMNode.js +33 -2
- package/src/nodes/tsl/TSLCore.js +63 -18
- package/src/nodes/utils/EquirectUV.js +30 -5
- package/src/nodes/utils/FunctionOverloadingNode.js +1 -1
- package/src/nodes/utils/Packing.js +35 -4
- package/src/nodes/utils/RTTNode.js +40 -24
- package/src/nodes/utils/ReflectorNode.js +1 -0
- package/src/nodes/utils/StorageArrayElementNode.js +1 -1
- package/src/objects/BatchedMesh.js +22 -14
- package/src/objects/InstancedMesh.js +0 -11
- package/src/objects/Skeleton.js +0 -9
- package/src/renderers/WebGLRenderer.js +19 -15
- package/src/renderers/common/Backend.js +49 -5
- package/src/renderers/common/Bindings.js +114 -45
- package/src/renderers/common/Buffer.js +9 -0
- package/src/renderers/common/ClippingContext.js +10 -2
- package/src/renderers/common/Info.js +63 -22
- package/src/renderers/common/Lighting.js +53 -5
- package/src/renderers/common/RenderList.js +41 -4
- package/src/renderers/common/RenderObject.js +73 -13
- package/src/renderers/common/Renderer.js +281 -108
- package/src/renderers/common/Sampler.js +16 -48
- package/src/renderers/common/Textures.js +32 -5
- package/src/renderers/common/TimestampQueryPool.js +1 -1
- package/src/renderers/common/UniformsGroup.js +31 -9
- package/src/renderers/common/XRManager.js +340 -22
- package/src/renderers/common/extras/PMREMGenerator.js +15 -38
- package/src/renderers/common/nodes/NodeBuilderState.js +9 -1
- package/src/renderers/common/nodes/NodeLibrary.js +4 -4
- package/src/renderers/common/nodes/NodeManager.js +63 -14
- package/src/renderers/common/nodes/NodeUniformBuffer.js +13 -0
- package/src/renderers/shaders/ShaderChunk/common.glsl.js +13 -4
- package/src/renderers/shaders/ShaderChunk/defaultnormal_vertex.glsl.js +0 -6
- package/src/renderers/shaders/ShaderChunk/envmap_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/envmap_physical_pars_fragment.glsl.js +2 -2
- package/src/renderers/shaders/ShaderChunk/envmap_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/lights_fragment_begin.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/lights_pars_begin.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/normal_fragment_begin.glsl.js +2 -2
- package/src/renderers/shaders/ShaderChunk/normal_vertex.glsl.js +6 -0
- package/src/renderers/shaders/ShaderChunk/shadowmap_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/transmission_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderLib/distance.glsl.js +1 -1
- package/src/renderers/webgl/WebGLOutput.js +2 -1
- package/src/renderers/webgl/WebGLProgram.js +5 -4
- package/src/renderers/webgl/WebGLPrograms.js +12 -5
- package/src/renderers/webgl/WebGLRenderLists.js +9 -1
- package/src/renderers/webgl/WebGLShaderCache.js +5 -11
- package/src/renderers/webgl/WebGLTextures.js +20 -7
- package/src/renderers/webgl/WebGLUniformsGroups.js +66 -38
- package/src/renderers/webgl-fallback/WebGLBackend.js +84 -25
- package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +138 -8
- package/src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js +1 -1
- package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +52 -22
- package/src/renderers/webgl-fallback/utils/WebGLUtils.js +4 -2
- package/src/renderers/webgpu/WebGPUBackend.js +480 -169
- package/src/renderers/webgpu/descriptors/GPUBindGroupDescriptor.js +48 -0
- package/src/renderers/webgpu/descriptors/GPUBufferDescriptor.js +57 -0
- package/src/renderers/webgpu/descriptors/GPUCommandEncoderDescriptor.js +30 -0
- package/src/renderers/webgpu/descriptors/GPUComputePassDescriptor.js +38 -0
- package/src/renderers/webgpu/descriptors/GPUComputePipelineDescriptor.js +48 -0
- package/src/renderers/webgpu/descriptors/GPUCopyExternalImageDestInfo.js +47 -0
- package/src/renderers/webgpu/descriptors/GPUCopyExternalImageSourceInfo.js +50 -0
- package/src/renderers/webgpu/descriptors/GPUExtent3D.js +51 -0
- package/src/renderers/webgpu/descriptors/GPUPipelineLayoutDescriptor.js +39 -0
- package/src/renderers/webgpu/descriptors/GPUQuerySetDescriptor.js +47 -0
- package/src/renderers/webgpu/descriptors/GPURenderBundleEncoderDescriptor.js +74 -0
- package/src/renderers/webgpu/descriptors/GPURenderPassColorAttachment.js +72 -0
- package/src/renderers/webgpu/descriptors/GPURenderPassDepthStencilAttachment.js +99 -0
- package/src/renderers/webgpu/descriptors/GPURenderPassDescriptor.js +72 -0
- package/src/renderers/webgpu/descriptors/GPURenderPassTimestampWrites.js +49 -0
- package/src/renderers/webgpu/descriptors/GPURenderPipelineDescriptor.js +130 -0
- package/src/renderers/webgpu/descriptors/GPUSamplerDescriptor.js +119 -0
- package/src/renderers/webgpu/descriptors/GPUShaderModuleDescriptor.js +46 -0
- package/src/renderers/webgpu/descriptors/GPUTexelCopyBufferInfo.js +57 -0
- package/src/renderers/webgpu/descriptors/GPUTexelCopyBufferLayout.js +48 -0
- package/src/renderers/webgpu/descriptors/GPUTexelCopyTextureInfo.js +61 -0
- package/src/renderers/webgpu/descriptors/GPUTextureDescriptor.js +99 -0
- package/src/renderers/webgpu/descriptors/GPUTextureViewDescriptor.js +108 -0
- package/src/renderers/webgpu/nodes/StandardNodeLibrary.js +0 -1
- package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +164 -7
- package/src/renderers/webgpu/nodes/WGSLNodeFunction.js +1 -1
- package/src/renderers/webgpu/utils/WebGPUAttributeUtils.js +98 -38
- package/src/renderers/webgpu/utils/WebGPUBindingUtils.js +72 -68
- package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +164 -69
- package/src/renderers/webgpu/utils/WebGPUTexturePassUtils.js +158 -95
- package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +297 -141
- package/src/renderers/webgpu/utils/WebGPUTimestampQueryPool.js +33 -18
- package/src/renderers/webgpu/utils/WebGPUUtils.js +38 -3
- package/src/textures/DepthTexture.js +1 -1
- package/src/textures/ExternalTexture.js +0 -3
- package/examples/fonts/LICENSE +0 -13
- package/examples/fonts/MPLUSRounded1c/MPLUSRounded1c-Regular.typeface.json.zip +0 -0
- package/examples/fonts/MPLUSRounded1c/OFL.txt +0 -91
- package/examples/fonts/README.md +0 -11
- package/examples/fonts/droid/NOTICE +0 -190
- package/examples/fonts/droid/README.txt +0 -18
- package/examples/fonts/droid/droid_sans_bold.typeface.json +0 -1
- package/examples/fonts/droid/droid_sans_mono_regular.typeface.json +0 -1
- package/examples/fonts/droid/droid_sans_regular.typeface.json +0 -1
- package/examples/fonts/droid/droid_serif_bold.typeface.json +0 -1
- package/examples/fonts/droid/droid_serif_regular.typeface.json +0 -1
- package/examples/fonts/gentilis_bold.typeface.json +0 -1
- package/examples/fonts/gentilis_regular.typeface.json +0 -1
- package/examples/fonts/helvetiker_bold.typeface.json +0 -1
- package/examples/fonts/helvetiker_regular.typeface.json +0 -1
- package/examples/fonts/optimer_bold.typeface.json +0 -1
- package/examples/fonts/optimer_regular.typeface.json +0 -1
- package/examples/fonts/ttf/README.md +0 -9
- package/examples/fonts/ttf/kenpixel.ttf +0 -0
- package/examples/jsm/inspector/extensions/extensions.json +0 -6
- package/examples/jsm/libs/ammo.wasm.js +0 -822
- package/examples/jsm/libs/ammo.wasm.wasm +0 -0
- package/examples/jsm/libs/draco/draco_encoder.js +0 -33
- package/examples/jsm/libs/draco/gltf/draco_encoder.js +0 -33
- package/examples/jsm/libs/lottie_canvas.module.js +0 -14849
- package/examples/jsm/libs/opentype.module.js +0 -14506
- package/examples/jsm/libs/rhino3dm/rhino3dm.js +0 -21
- package/examples/jsm/libs/rhino3dm/rhino3dm.module.js +0 -16
- package/examples/jsm/libs/rhino3dm/rhino3dm.wasm +0 -0
- package/examples/jsm/lighting/TiledLighting.js +0 -42
- package/examples/jsm/tsl/display/AnamorphicNode.js +0 -293
- package/examples/jsm/tsl/lighting/TiledLightsNode.js +0 -442
- package/src/nodes/accessors/BatchNode.js +0 -163
- package/src/nodes/accessors/InstanceNode.js +0 -349
- package/src/nodes/accessors/InstancedMeshNode.js +0 -50
- package/src/nodes/accessors/SkinningNode.js +0 -328
|
@@ -5,6 +5,7 @@ import { uniform } from '../core/UniformNode.js';
|
|
|
5
5
|
import { NodeUpdateType } from '../core/constants.js';
|
|
6
6
|
import { nodeProxy, vec3 } from '../tsl/TSLBase.js';
|
|
7
7
|
|
|
8
|
+
import { CubeUVReflectionMapping } from '../../constants.js';
|
|
8
9
|
import { Texture } from '../../textures/Texture.js';
|
|
9
10
|
import PMREMGenerator from '../../renderers/common/extras/PMREMGenerator.js';
|
|
10
11
|
import { materialEnvRotation } from '../accessors/MaterialProperties.js';
|
|
@@ -80,6 +81,31 @@ function _getPMREMFromTexture( texture, renderer, generator ) {
|
|
|
80
81
|
|
|
81
82
|
cacheTexture.pmremVersion = texture.pmremVersion;
|
|
82
83
|
|
|
84
|
+
// add dispose event listener for new PMREMs
|
|
85
|
+
|
|
86
|
+
if ( cache.has( texture ) === false ) {
|
|
87
|
+
|
|
88
|
+
const onDispose = () => {
|
|
89
|
+
|
|
90
|
+
texture.removeEventListener( 'dispose', onDispose );
|
|
91
|
+
|
|
92
|
+
const pmrem = cache.get( texture );
|
|
93
|
+
|
|
94
|
+
if ( pmrem !== undefined ) {
|
|
95
|
+
|
|
96
|
+
pmrem.dispose();
|
|
97
|
+
cache.delete( texture );
|
|
98
|
+
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
texture.addEventListener( 'dispose', onDispose );
|
|
104
|
+
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
//
|
|
108
|
+
|
|
83
109
|
cache.set( texture, cacheTexture );
|
|
84
110
|
|
|
85
111
|
}
|
|
@@ -270,7 +296,7 @@ class PMREMNode extends TempNode {
|
|
|
270
296
|
|
|
271
297
|
if ( pmremVersion !== texture.pmremVersion ) {
|
|
272
298
|
|
|
273
|
-
if ( texture.isPMREMTexture === true ) {
|
|
299
|
+
if ( texture.isPMREMTexture === true || texture.mapping === CubeUVReflectionMapping ) {
|
|
274
300
|
|
|
275
301
|
pmrem = texture;
|
|
276
302
|
|
|
@@ -314,7 +340,12 @@ class PMREMNode extends TempNode {
|
|
|
314
340
|
|
|
315
341
|
//
|
|
316
342
|
|
|
317
|
-
|
|
343
|
+
// PMREMGenerator renders into a render target with inverted Y, so its output needs the Y
|
|
344
|
+
// flip on sampling. Externally authored PMREMs follow the standard convention and don't.
|
|
345
|
+
|
|
346
|
+
uvNode = this._pmrem.isRenderTargetTexture
|
|
347
|
+
? materialEnvRotation.mul( vec3( uvNode.x, uvNode.y.negate(), uvNode.z ) )
|
|
348
|
+
: materialEnvRotation.mul( uvNode );
|
|
318
349
|
|
|
319
350
|
//
|
|
320
351
|
|
package/src/nodes/tsl/TSLCore.js
CHANGED
|
@@ -291,8 +291,6 @@ Object.defineProperties( Node.prototype, proto );
|
|
|
291
291
|
|
|
292
292
|
// --- FINISH ---
|
|
293
293
|
|
|
294
|
-
const nodeBuilderFunctionsCacheMap = new WeakMap();
|
|
295
|
-
|
|
296
294
|
const ShaderNodeObject = function ( obj, altType = null ) {
|
|
297
295
|
|
|
298
296
|
const type = getValueType( obj );
|
|
@@ -506,33 +504,59 @@ class ShaderCallNodeInternal extends Node {
|
|
|
506
504
|
|
|
507
505
|
if ( shaderNode.layout ) {
|
|
508
506
|
|
|
509
|
-
|
|
507
|
+
// build inputs first
|
|
510
508
|
|
|
511
|
-
if (
|
|
509
|
+
if ( rawInputs ) {
|
|
512
510
|
|
|
513
|
-
|
|
511
|
+
// use layout inputs to ensure that no extra parameters are built
|
|
514
512
|
|
|
515
|
-
|
|
513
|
+
const inputs = shaderNode.layout.inputs;
|
|
516
514
|
|
|
517
|
-
|
|
515
|
+
if ( isArrayAsParameter( rawInputs ) ) {
|
|
516
|
+
|
|
517
|
+
const rawArrayParameters = rawInputs;
|
|
518
|
+
|
|
519
|
+
for ( let i = 0; i < inputs.length; i ++ ) {
|
|
520
|
+
|
|
521
|
+
const rawParameter = rawArrayParameters[ i ];
|
|
522
|
+
|
|
523
|
+
if ( rawParameter && rawParameter.isNode ) {
|
|
518
524
|
|
|
519
|
-
|
|
525
|
+
rawParameter.build( builder );
|
|
520
526
|
|
|
521
|
-
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
} else {
|
|
522
532
|
|
|
523
|
-
|
|
533
|
+
const rawObjectParameters = rawInputs[ 0 ];
|
|
524
534
|
|
|
525
|
-
|
|
535
|
+
for ( const param of inputs ) {
|
|
536
|
+
|
|
537
|
+
const rawParameter = rawObjectParameters[ param.name ];
|
|
538
|
+
|
|
539
|
+
if ( rawParameter && rawParameter.isNode ) {
|
|
540
|
+
|
|
541
|
+
rawParameter.build( builder );
|
|
542
|
+
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
}
|
|
526
548
|
|
|
527
549
|
}
|
|
528
550
|
|
|
551
|
+
const functionNode = builder.buildFunctionNode( shaderNode );
|
|
552
|
+
|
|
529
553
|
builder.addInclude( functionNode );
|
|
530
554
|
|
|
531
555
|
//
|
|
532
556
|
|
|
533
557
|
const inputs = rawInputs ? getLayoutParameters( rawInputs ) : null;
|
|
534
558
|
|
|
535
|
-
result =
|
|
559
|
+
result = functionNode.call( inputs );
|
|
536
560
|
|
|
537
561
|
} else {
|
|
538
562
|
|
|
@@ -679,15 +703,19 @@ class ShaderCallNodeInternal extends Node {
|
|
|
679
703
|
|
|
680
704
|
}
|
|
681
705
|
|
|
706
|
+
function isArrayAsParameter( params ) {
|
|
707
|
+
|
|
708
|
+
return params[ 0 ] && ( params[ 0 ].isNode || Object.getPrototypeOf( params[ 0 ] ) !== Object.prototype );
|
|
709
|
+
|
|
710
|
+
}
|
|
711
|
+
|
|
682
712
|
function getLayoutParameters( params ) {
|
|
683
713
|
|
|
684
714
|
let output;
|
|
685
715
|
|
|
686
716
|
nodeObjects( params );
|
|
687
717
|
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
if ( isArrayAsParameter ) {
|
|
718
|
+
if ( isArrayAsParameter( params ) ) {
|
|
691
719
|
|
|
692
720
|
output = [ ...params ];
|
|
693
721
|
|
|
@@ -957,6 +985,26 @@ export const nodeProxy = ( NodeClass, scope = null, factor = null, settings = nu
|
|
|
957
985
|
export const nodeImmutable = ( NodeClass, ...params ) => new ShaderNodeImmutable( NodeClass, ...params );
|
|
958
986
|
export const nodeProxyIntent = ( NodeClass, scope = null, factor = null, settings = {} ) => new ShaderNodeProxy( NodeClass, scope, factor, { ...settings, intent: true } );
|
|
959
987
|
|
|
988
|
+
export const nodeProxyConstructor = ( constructorFunction, nodeInstance ) => {
|
|
989
|
+
|
|
990
|
+
return new Proxy( constructorFunction, {
|
|
991
|
+
|
|
992
|
+
get( target, prop, receiver ) {
|
|
993
|
+
|
|
994
|
+
return Reflect.get( nodeInstance, prop, receiver );
|
|
995
|
+
|
|
996
|
+
},
|
|
997
|
+
|
|
998
|
+
set( target, prop, value ) {
|
|
999
|
+
|
|
1000
|
+
return Reflect.set( nodeInstance, prop, value );
|
|
1001
|
+
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
} );
|
|
1005
|
+
|
|
1006
|
+
};
|
|
1007
|
+
|
|
960
1008
|
let fnId = 0;
|
|
961
1009
|
|
|
962
1010
|
class FnNode extends Node {
|
|
@@ -1192,9 +1240,6 @@ export const mat2 = new ConvertType( 'mat2' );
|
|
|
1192
1240
|
export const mat3 = new ConvertType( 'mat3' );
|
|
1193
1241
|
export const mat4 = new ConvertType( 'mat4' );
|
|
1194
1242
|
|
|
1195
|
-
export const string = ( value = '' ) => new ConstNode( value, 'string' );
|
|
1196
|
-
export const arrayBuffer = ( value ) => new ConstNode( value, 'ArrayBuffer' );
|
|
1197
|
-
|
|
1198
1243
|
addMethodChaining( 'toColor', color );
|
|
1199
1244
|
addMethodChaining( 'toFloat', float );
|
|
1200
1245
|
addMethodChaining( 'toInt', int );
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { positionWorldDirection } from '../accessors/Position.js';
|
|
2
|
-
import {
|
|
2
|
+
import { uv as UV } from '../accessors/UV.js';
|
|
3
|
+
import { Fn, vec2, vec3 } from '../tsl/TSLCore.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* TSL function for creating an equirect uv node.
|
|
@@ -14,14 +15,38 @@ import { Fn, vec2 } from '../tsl/TSLBase.js';
|
|
|
14
15
|
*
|
|
15
16
|
* @tsl
|
|
16
17
|
* @function
|
|
17
|
-
* @param {?Node<vec3>} [
|
|
18
|
+
* @param {?Node<vec3>} [direction=positionWorldDirection] - A direction vector for sampling which is by default `positionWorldDirection`.
|
|
18
19
|
* @returns {Node<vec2>}
|
|
19
20
|
*/
|
|
20
|
-
export const equirectUV = /*@__PURE__*/ Fn( ( [
|
|
21
|
+
export const equirectUV = /*@__PURE__*/ Fn( ( [ direction = positionWorldDirection ] ) => {
|
|
21
22
|
|
|
22
|
-
const u =
|
|
23
|
-
const v =
|
|
23
|
+
const u = direction.z.atan( direction.x ).mul( 1 / ( Math.PI * 2 ) ).add( 0.5 );
|
|
24
|
+
const v = direction.y.clamp( - 1.0, 1.0 ).asin().mul( 1 / Math.PI ).add( 0.5 );
|
|
24
25
|
|
|
25
26
|
return vec2( u, v );
|
|
26
27
|
|
|
27
28
|
} );
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* TSL function for creating an equirect direction node.
|
|
32
|
+
*
|
|
33
|
+
* Can be used to compute a direction vector from the given equirectangular
|
|
34
|
+
* UV coordinates.
|
|
35
|
+
*
|
|
36
|
+
* @tsl
|
|
37
|
+
* @function
|
|
38
|
+
* @param {?Node<vec2>} [uv=UV()] - The equirectangular UV coordinates.
|
|
39
|
+
* @returns {Node<vec3>} The computed direction vector.
|
|
40
|
+
*/
|
|
41
|
+
export const equirectDirection = /*@__PURE__*/ Fn( ( [ uv = UV() ] ) => {
|
|
42
|
+
|
|
43
|
+
const theta = uv.x.sub( 0.5 ).mul( Math.PI * 2 );
|
|
44
|
+
const phi = uv.y.sub( 0.5 ).mul( Math.PI );
|
|
45
|
+
const cosPhi = phi.cos();
|
|
46
|
+
const x = cosPhi.mul( theta.cos() );
|
|
47
|
+
const y = phi.sin();
|
|
48
|
+
const z = cosPhi.mul( theta.sin() );
|
|
49
|
+
|
|
50
|
+
return vec3( x, y, z );
|
|
51
|
+
|
|
52
|
+
} );
|
|
@@ -97,7 +97,7 @@ class FunctionOverloadingNode extends Node {
|
|
|
97
97
|
|
|
98
98
|
if ( layout === null ) {
|
|
99
99
|
|
|
100
|
-
throw new Error( 'FunctionOverloadingNode: FunctionNode must be a layout.' );
|
|
100
|
+
throw new Error( 'THREE.FunctionOverloadingNode: FunctionNode must be a layout.' );
|
|
101
101
|
|
|
102
102
|
}
|
|
103
103
|
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import { nodeObject, vec3, float } from '../tsl/TSLBase.js';
|
|
2
2
|
import { dot, sqrt, saturate } from '../math/MathNode.js';
|
|
3
|
+
import { warnOnce } from '../../utils.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
|
-
* Packs a
|
|
6
|
+
* Packs a normal vector into a color value.
|
|
6
7
|
*
|
|
7
8
|
* @tsl
|
|
8
9
|
* @function
|
|
9
10
|
* @param {Node<vec3>} node - The direction to pack.
|
|
10
11
|
* @return {Node<vec3>} The color.
|
|
11
12
|
*/
|
|
12
|
-
export const
|
|
13
|
+
export const packNormalToRGB = ( node ) => nodeObject( node ).mul( 0.5 ).add( 0.5 );
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
|
-
* Unpacks a color value into a
|
|
16
|
+
* Unpacks a color value into a normal vector.
|
|
16
17
|
*
|
|
17
18
|
* @tsl
|
|
18
19
|
* @function
|
|
19
20
|
* @param {Node<vec3>} node - The color to unpack.
|
|
20
21
|
* @return {Node<vec3>} The direction.
|
|
21
22
|
*/
|
|
22
|
-
export const
|
|
23
|
+
export const unpackRGBToNormal = ( node ) => nodeObject( node ).mul( 2.0 ).sub( 1 );
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
26
|
* Unpacks a tangent space normal, reconstructing the Z component by projecting the X,Y coordinates onto the hemisphere.
|
|
@@ -31,3 +32,33 @@ export const colorToDirection = ( node ) => nodeObject( node ).mul( 2.0 ).sub( 1
|
|
|
31
32
|
* @return {Node<vec3>} The resulting normal.
|
|
32
33
|
*/
|
|
33
34
|
export const unpackNormal = ( xy ) => vec3( xy, sqrt( saturate( float( 1.0 ).sub( dot( xy, xy ) ) ) ) );
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @tsl
|
|
38
|
+
* @function
|
|
39
|
+
* @deprecated since r185. Use {@link packNormalToRGB} instead.
|
|
40
|
+
* @param {Node<vec3>} node - The direction to pack.
|
|
41
|
+
* @returns {Node<vec3>}
|
|
42
|
+
*/
|
|
43
|
+
export const directionToColor = ( node ) => {
|
|
44
|
+
|
|
45
|
+
warnOnce( 'TSL: "directionToColor()" has been renamed to "packNormalToRGB()".' ); // @deprecated r185
|
|
46
|
+
|
|
47
|
+
return packNormalToRGB( node );
|
|
48
|
+
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @tsl
|
|
53
|
+
* @function
|
|
54
|
+
* @deprecated since r185. Use {@link unpackRGBToNormal} instead.
|
|
55
|
+
* @param {Node<vec3>} node - The color to unpack.
|
|
56
|
+
* @returns {Node<vec3>}
|
|
57
|
+
*/
|
|
58
|
+
export const colorToDirection = ( node ) => {
|
|
59
|
+
|
|
60
|
+
warnOnce( 'TSL: "colorToDirection()" has been renamed to "unpackRGBToNormal()".' ); // @deprecated r185
|
|
61
|
+
|
|
62
|
+
return unpackRGBToNormal( node );
|
|
63
|
+
|
|
64
|
+
};
|
|
@@ -74,14 +74,6 @@ class RTTNode extends TextureNode {
|
|
|
74
74
|
*/
|
|
75
75
|
this.height = height;
|
|
76
76
|
|
|
77
|
-
/**
|
|
78
|
-
* The pixel ratio
|
|
79
|
-
*
|
|
80
|
-
* @type {number}
|
|
81
|
-
* @default 1
|
|
82
|
-
*/
|
|
83
|
-
this.pixelRatio = 1;
|
|
84
|
-
|
|
85
77
|
/**
|
|
86
78
|
* The render target
|
|
87
79
|
*
|
|
@@ -105,6 +97,15 @@ class RTTNode extends TextureNode {
|
|
|
105
97
|
*/
|
|
106
98
|
this.autoUpdate = true;
|
|
107
99
|
|
|
100
|
+
/**
|
|
101
|
+
* The resolution scale
|
|
102
|
+
*
|
|
103
|
+
* @private
|
|
104
|
+
* @type {number}
|
|
105
|
+
* @default 1
|
|
106
|
+
*/
|
|
107
|
+
this._resolutionScale = 1;
|
|
108
|
+
|
|
108
109
|
/**
|
|
109
110
|
* The node which is used with the quad mesh for RTT.
|
|
110
111
|
*
|
|
@@ -164,11 +165,8 @@ class RTTNode extends TextureNode {
|
|
|
164
165
|
*/
|
|
165
166
|
setSize( width, height ) {
|
|
166
167
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
const effectiveWidth = width * this.pixelRatio;
|
|
171
|
-
const effectiveHeight = height * this.pixelRatio;
|
|
168
|
+
const effectiveWidth = Math.floor( width * this._resolutionScale );
|
|
169
|
+
const effectiveHeight = Math.floor( height * this._resolutionScale );
|
|
172
170
|
|
|
173
171
|
this.renderTarget.setSize( effectiveWidth, effectiveHeight );
|
|
174
172
|
|
|
@@ -177,15 +175,34 @@ class RTTNode extends TextureNode {
|
|
|
177
175
|
}
|
|
178
176
|
|
|
179
177
|
/**
|
|
180
|
-
* Sets the
|
|
178
|
+
* Sets the resolution scale.
|
|
179
|
+
* The resolution scale is a factor that is multiplied with the renderer's width and height.
|
|
181
180
|
*
|
|
182
|
-
* @param {number}
|
|
181
|
+
* @param {number} resolutionScale - The resolution scale to set. A value of `1` means full resolution.
|
|
182
|
+
* @returns {RTTNode} A reference to this node.
|
|
183
183
|
*/
|
|
184
|
-
|
|
184
|
+
setResolutionScale( resolutionScale ) {
|
|
185
185
|
|
|
186
|
-
this.
|
|
186
|
+
this._resolutionScale = resolutionScale;
|
|
187
187
|
|
|
188
|
-
|
|
188
|
+
if ( this.autoResize === false ) {
|
|
189
|
+
|
|
190
|
+
this.setSize( this.width, this.height );
|
|
191
|
+
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
return this;
|
|
195
|
+
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Gets the resolution scale.
|
|
200
|
+
*
|
|
201
|
+
* @returns {number} The resolution scale.
|
|
202
|
+
*/
|
|
203
|
+
getResolutionScale() {
|
|
204
|
+
|
|
205
|
+
return this._resolutionScale;
|
|
189
206
|
|
|
190
207
|
}
|
|
191
208
|
|
|
@@ -197,13 +214,14 @@ class RTTNode extends TextureNode {
|
|
|
197
214
|
|
|
198
215
|
//
|
|
199
216
|
|
|
217
|
+
const currentRenderTarget = renderer.getRenderTarget();
|
|
218
|
+
|
|
200
219
|
if ( this.autoResize === true ) {
|
|
201
220
|
|
|
202
|
-
const
|
|
203
|
-
const size = renderer.getSize( _size );
|
|
221
|
+
const size = renderer.getDrawingBufferSize( _size );
|
|
204
222
|
|
|
205
|
-
const effectiveWidth = Math.floor( size.width *
|
|
206
|
-
const effectiveHeight = Math.floor( size.height *
|
|
223
|
+
const effectiveWidth = Math.floor( size.width * this._resolutionScale );
|
|
224
|
+
const effectiveHeight = Math.floor( size.height * this._resolutionScale );
|
|
207
225
|
|
|
208
226
|
if ( effectiveWidth !== this.renderTarget.width || effectiveHeight !== this.renderTarget.height ) {
|
|
209
227
|
|
|
@@ -231,8 +249,6 @@ class RTTNode extends TextureNode {
|
|
|
231
249
|
|
|
232
250
|
//
|
|
233
251
|
|
|
234
|
-
const currentRenderTarget = renderer.getRenderTarget();
|
|
235
|
-
|
|
236
252
|
renderer.setRenderTarget( this.renderTarget );
|
|
237
253
|
|
|
238
254
|
this._quadMesh.render( renderer );
|
|
@@ -163,6 +163,7 @@ class ReflectorNode extends TextureNode {
|
|
|
163
163
|
newNode.depthNode = this.depthNode;
|
|
164
164
|
newNode.compareNode = this.compareNode;
|
|
165
165
|
newNode.gradNode = this.gradNode;
|
|
166
|
+
newNode.gatherNode = this.gatherNode;
|
|
166
167
|
newNode.offsetNode = this.offsetNode;
|
|
167
168
|
newNode._reflectorBaseNode = this._reflectorBaseNode;
|
|
168
169
|
|
|
@@ -1277,7 +1277,7 @@ class BatchedMesh extends Mesh {
|
|
|
1277
1277
|
// throw an error if it can't be shrunk to the desired size
|
|
1278
1278
|
if ( maxInstanceCount < instanceInfo.length ) {
|
|
1279
1279
|
|
|
1280
|
-
throw new Error( `BatchedMesh: Instance ids outside the range ${ maxInstanceCount } are being used. Cannot shrink instance count.` );
|
|
1280
|
+
throw new Error( `THREE.BatchedMesh: Instance ids outside the range ${ maxInstanceCount } are being used. Cannot shrink instance count.` );
|
|
1281
1281
|
|
|
1282
1282
|
}
|
|
1283
1283
|
|
|
@@ -1329,7 +1329,7 @@ class BatchedMesh extends Mesh {
|
|
|
1329
1329
|
const requiredVertexLength = Math.max( ...validRanges.map( range => range.vertexStart + range.reservedVertexCount ) );
|
|
1330
1330
|
if ( requiredVertexLength > maxVertexCount ) {
|
|
1331
1331
|
|
|
1332
|
-
throw new Error( `BatchedMesh: Geometry vertex values are being used outside the range ${ maxIndexCount }. Cannot shrink further.` );
|
|
1332
|
+
throw new Error( `THREE.BatchedMesh: Geometry vertex values are being used outside the range ${ maxIndexCount }. Cannot shrink further.` );
|
|
1333
1333
|
|
|
1334
1334
|
}
|
|
1335
1335
|
|
|
@@ -1339,7 +1339,7 @@ class BatchedMesh extends Mesh {
|
|
|
1339
1339
|
const requiredIndexLength = Math.max( ...validRanges.map( range => range.indexStart + range.reservedIndexCount ) );
|
|
1340
1340
|
if ( requiredIndexLength > maxIndexCount ) {
|
|
1341
1341
|
|
|
1342
|
-
throw new Error( `BatchedMesh: Geometry index values are being used outside the range ${ maxIndexCount }. Cannot shrink further.` );
|
|
1342
|
+
throw new Error( `THREE.BatchedMesh: Geometry index values are being used outside the range ${ maxIndexCount }. Cannot shrink further.` );
|
|
1343
1343
|
|
|
1344
1344
|
}
|
|
1345
1345
|
|
|
@@ -1552,17 +1552,25 @@ class BatchedMesh extends Mesh {
|
|
|
1552
1552
|
|
|
1553
1553
|
const frustum = camera.isArrayCamera ? _frustumArray : _frustum;
|
|
1554
1554
|
// prepare the frustum in the local frame
|
|
1555
|
-
if ( perObjectFrustumCulled
|
|
1555
|
+
if ( perObjectFrustumCulled ) {
|
|
1556
1556
|
|
|
1557
|
-
|
|
1558
|
-
.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse )
|
|
1559
|
-
.multiply( this.matrixWorld );
|
|
1557
|
+
if ( camera.isArrayCamera ) {
|
|
1560
1558
|
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1559
|
+
frustum.setFromArrayCamera( camera );
|
|
1560
|
+
|
|
1561
|
+
} else {
|
|
1562
|
+
|
|
1563
|
+
_matrix
|
|
1564
|
+
.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse )
|
|
1565
|
+
.multiply( this.matrixWorld );
|
|
1566
|
+
|
|
1567
|
+
frustum.setFromProjectionMatrix(
|
|
1568
|
+
_matrix,
|
|
1569
|
+
camera.coordinateSystem,
|
|
1570
|
+
camera.reversedDepth
|
|
1571
|
+
);
|
|
1572
|
+
|
|
1573
|
+
}
|
|
1566
1574
|
|
|
1567
1575
|
}
|
|
1568
1576
|
|
|
@@ -1588,7 +1596,7 @@ class BatchedMesh extends Mesh {
|
|
|
1588
1596
|
let culled = false;
|
|
1589
1597
|
if ( perObjectFrustumCulled ) {
|
|
1590
1598
|
|
|
1591
|
-
culled = ! frustum.intersectsSphere( _sphere
|
|
1599
|
+
culled = ! frustum.intersectsSphere( _sphere );
|
|
1592
1600
|
|
|
1593
1601
|
}
|
|
1594
1602
|
|
|
@@ -1645,7 +1653,7 @@ class BatchedMesh extends Mesh {
|
|
|
1645
1653
|
// get the bounds in world space
|
|
1646
1654
|
this.getMatrixAt( i, _matrix );
|
|
1647
1655
|
this.getBoundingSphereAt( geometryId, _sphere ).applyMatrix4( _matrix );
|
|
1648
|
-
culled = ! frustum.intersectsSphere( _sphere
|
|
1656
|
+
culled = ! frustum.intersectsSphere( _sphere );
|
|
1649
1657
|
|
|
1650
1658
|
}
|
|
1651
1659
|
|
|
@@ -56,15 +56,6 @@ class InstancedMesh extends Mesh {
|
|
|
56
56
|
*/
|
|
57
57
|
this.instanceMatrix = new InstancedBufferAttribute( new Float32Array( count * 16 ), 16 );
|
|
58
58
|
|
|
59
|
-
/**
|
|
60
|
-
* Represents the local transformation of all instances of the previous frame.
|
|
61
|
-
* Required for computing velocity. Maintained in {@link InstanceNode}.
|
|
62
|
-
*
|
|
63
|
-
* @type {?InstancedBufferAttribute}
|
|
64
|
-
* @default null
|
|
65
|
-
*/
|
|
66
|
-
this.previousInstanceMatrix = null;
|
|
67
|
-
|
|
68
59
|
/**
|
|
69
60
|
* Represents the color of all instances. You have to set its
|
|
70
61
|
* {@link BufferAttribute#needsUpdate} flag to true if you modify instanced data
|
|
@@ -194,8 +185,6 @@ class InstancedMesh extends Mesh {
|
|
|
194
185
|
|
|
195
186
|
this.instanceMatrix.copy( source.instanceMatrix );
|
|
196
187
|
|
|
197
|
-
if ( source.previousInstanceMatrix !== null ) this.previousInstanceMatrix = source.previousInstanceMatrix.clone();
|
|
198
|
-
|
|
199
188
|
if ( source.morphTexture !== null ) this.morphTexture = source.morphTexture.clone();
|
|
200
189
|
if ( source.instanceColor !== null ) this.instanceColor = source.instanceColor.clone();
|
|
201
190
|
|
package/src/objects/Skeleton.js
CHANGED
|
@@ -70,15 +70,6 @@ class Skeleton {
|
|
|
70
70
|
*/
|
|
71
71
|
this.boneMatrices = null;
|
|
72
72
|
|
|
73
|
-
/**
|
|
74
|
-
* An array buffer holding the bone data of the previous frame.
|
|
75
|
-
* Required for computing velocity. Maintained in {@link SkinningNode}.
|
|
76
|
-
*
|
|
77
|
-
* @type {?Float32Array}
|
|
78
|
-
* @default null
|
|
79
|
-
*/
|
|
80
|
-
this.previousBoneMatrices = null;
|
|
81
|
-
|
|
82
73
|
/**
|
|
83
74
|
* A texture holding the bone data for use
|
|
84
75
|
* in the vertex shader.
|