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
|
@@ -8,7 +8,6 @@ import { StringKeyframeTrack } from './tracks/StringKeyframeTrack.js';
|
|
|
8
8
|
import { VectorKeyframeTrack } from './tracks/VectorKeyframeTrack.js';
|
|
9
9
|
import { generateUUID } from '../math/MathUtils.js';
|
|
10
10
|
import { NormalAnimationBlendMode } from '../constants.js';
|
|
11
|
-
import { warn, error } from '../utils.js';
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
13
|
* A reusable set of keyframe tracks which represent an animation.
|
|
@@ -295,144 +294,6 @@ class AnimationClip {
|
|
|
295
294
|
|
|
296
295
|
}
|
|
297
296
|
|
|
298
|
-
/**
|
|
299
|
-
* Parses the `animation.hierarchy` format and returns a new animation clip.
|
|
300
|
-
*
|
|
301
|
-
* @static
|
|
302
|
-
* @deprecated since r175.
|
|
303
|
-
* @param {Object} animation - A serialized animation clip as JSON.
|
|
304
|
-
* @param {Array<Bone>} bones - An array of bones.
|
|
305
|
-
* @return {?AnimationClip} The new animation clip.
|
|
306
|
-
*/
|
|
307
|
-
static parseAnimation( animation, bones ) {
|
|
308
|
-
|
|
309
|
-
warn( 'AnimationClip: parseAnimation() is deprecated and will be removed with r185' );
|
|
310
|
-
|
|
311
|
-
if ( ! animation ) {
|
|
312
|
-
|
|
313
|
-
error( 'AnimationClip: No animation in JSONLoader data.' );
|
|
314
|
-
return null;
|
|
315
|
-
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
const addNonemptyTrack = function ( trackType, trackName, animationKeys, propertyName, destTracks ) {
|
|
319
|
-
|
|
320
|
-
// only return track if there are actually keys.
|
|
321
|
-
if ( animationKeys.length !== 0 ) {
|
|
322
|
-
|
|
323
|
-
const times = [];
|
|
324
|
-
const values = [];
|
|
325
|
-
|
|
326
|
-
AnimationUtils.flattenJSON( animationKeys, times, values, propertyName );
|
|
327
|
-
|
|
328
|
-
// empty keys are filtered out, so check again
|
|
329
|
-
if ( times.length !== 0 ) {
|
|
330
|
-
|
|
331
|
-
destTracks.push( new trackType( trackName, times, values ) );
|
|
332
|
-
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
};
|
|
338
|
-
|
|
339
|
-
const tracks = [];
|
|
340
|
-
|
|
341
|
-
const clipName = animation.name || 'default';
|
|
342
|
-
const fps = animation.fps || 30;
|
|
343
|
-
const blendMode = animation.blendMode;
|
|
344
|
-
|
|
345
|
-
// automatic length determination in AnimationClip.
|
|
346
|
-
let duration = animation.length || - 1;
|
|
347
|
-
|
|
348
|
-
const hierarchyTracks = animation.hierarchy || [];
|
|
349
|
-
|
|
350
|
-
for ( let h = 0; h < hierarchyTracks.length; h ++ ) {
|
|
351
|
-
|
|
352
|
-
const animationKeys = hierarchyTracks[ h ].keys;
|
|
353
|
-
|
|
354
|
-
// skip empty tracks
|
|
355
|
-
if ( ! animationKeys || animationKeys.length === 0 ) continue;
|
|
356
|
-
|
|
357
|
-
// process morph targets
|
|
358
|
-
if ( animationKeys[ 0 ].morphTargets ) {
|
|
359
|
-
|
|
360
|
-
// figure out all morph targets used in this track
|
|
361
|
-
const morphTargetNames = {};
|
|
362
|
-
|
|
363
|
-
let k;
|
|
364
|
-
|
|
365
|
-
for ( k = 0; k < animationKeys.length; k ++ ) {
|
|
366
|
-
|
|
367
|
-
if ( animationKeys[ k ].morphTargets ) {
|
|
368
|
-
|
|
369
|
-
for ( let m = 0; m < animationKeys[ k ].morphTargets.length; m ++ ) {
|
|
370
|
-
|
|
371
|
-
morphTargetNames[ animationKeys[ k ].morphTargets[ m ] ] = - 1;
|
|
372
|
-
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
// create a track for each morph target with all zero
|
|
380
|
-
// morphTargetInfluences except for the keys in which
|
|
381
|
-
// the morphTarget is named.
|
|
382
|
-
for ( const morphTargetName in morphTargetNames ) {
|
|
383
|
-
|
|
384
|
-
const times = [];
|
|
385
|
-
const values = [];
|
|
386
|
-
|
|
387
|
-
for ( let m = 0; m !== animationKeys[ k ].morphTargets.length; ++ m ) {
|
|
388
|
-
|
|
389
|
-
const animationKey = animationKeys[ k ];
|
|
390
|
-
|
|
391
|
-
times.push( animationKey.time );
|
|
392
|
-
values.push( ( animationKey.morphTarget === morphTargetName ) ? 1 : 0 );
|
|
393
|
-
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
tracks.push( new NumberKeyframeTrack( '.morphTargetInfluence[' + morphTargetName + ']', times, values ) );
|
|
397
|
-
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
duration = morphTargetNames.length * fps;
|
|
401
|
-
|
|
402
|
-
} else {
|
|
403
|
-
|
|
404
|
-
// ...assume skeletal animation
|
|
405
|
-
|
|
406
|
-
const boneName = '.bones[' + bones[ h ].name + ']';
|
|
407
|
-
|
|
408
|
-
addNonemptyTrack(
|
|
409
|
-
VectorKeyframeTrack, boneName + '.position',
|
|
410
|
-
animationKeys, 'pos', tracks );
|
|
411
|
-
|
|
412
|
-
addNonemptyTrack(
|
|
413
|
-
QuaternionKeyframeTrack, boneName + '.quaternion',
|
|
414
|
-
animationKeys, 'rot', tracks );
|
|
415
|
-
|
|
416
|
-
addNonemptyTrack(
|
|
417
|
-
VectorKeyframeTrack, boneName + '.scale',
|
|
418
|
-
animationKeys, 'scl', tracks );
|
|
419
|
-
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
if ( tracks.length === 0 ) {
|
|
425
|
-
|
|
426
|
-
return null;
|
|
427
|
-
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
const clip = new this( clipName, duration, tracks, blendMode );
|
|
431
|
-
|
|
432
|
-
return clip;
|
|
433
|
-
|
|
434
|
-
}
|
|
435
|
-
|
|
436
297
|
/**
|
|
437
298
|
* Sets the duration of this clip to the duration of its longest keyframe track.
|
|
438
299
|
*
|
|
@@ -158,10 +158,10 @@ class KeyframeTrack {
|
|
|
158
158
|
|
|
159
159
|
const interpolant = new BezierInterpolant( this.times, this.values, this.getValueSize(), result );
|
|
160
160
|
|
|
161
|
-
// Pass tangent data from track settings to interpolant
|
|
162
161
|
if ( this.settings ) {
|
|
163
162
|
|
|
164
|
-
interpolant.
|
|
163
|
+
interpolant.inTangents = this.settings.inTangents;
|
|
164
|
+
interpolant.outTangents = this.settings.outTangents;
|
|
165
165
|
|
|
166
166
|
}
|
|
167
167
|
|
|
@@ -212,7 +212,7 @@ class PropertyBinding {
|
|
|
212
212
|
|
|
213
213
|
if ( matches === null ) {
|
|
214
214
|
|
|
215
|
-
throw new Error( 'PropertyBinding: Cannot parse trackName: ' + trackName );
|
|
215
|
+
throw new Error( 'THREE.PropertyBinding: Cannot parse trackName: ' + trackName );
|
|
216
216
|
|
|
217
217
|
}
|
|
218
218
|
|
|
@@ -246,7 +246,7 @@ class PropertyBinding {
|
|
|
246
246
|
|
|
247
247
|
if ( results.propertyName === null || results.propertyName.length === 0 ) {
|
|
248
248
|
|
|
249
|
-
throw new Error( 'PropertyBinding: can not parse propertyName from trackName: ' + trackName );
|
|
249
|
+
throw new Error( 'THREE.PropertyBinding: can not parse propertyName from trackName: ' + trackName );
|
|
250
250
|
|
|
251
251
|
}
|
|
252
252
|
|
package/src/cameras/Camera.js
CHANGED
|
@@ -129,9 +129,9 @@ class Camera extends Object3D {
|
|
|
129
129
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
updateWorldMatrix( updateParents, updateChildren ) {
|
|
132
|
+
updateWorldMatrix( updateParents, updateChildren, force = false ) {
|
|
133
133
|
|
|
134
|
-
super.updateWorldMatrix( updateParents, updateChildren );
|
|
134
|
+
super.updateWorldMatrix( updateParents, updateChildren, force );
|
|
135
135
|
|
|
136
136
|
// exclude scale from view matrix to be glTF conform
|
|
137
137
|
|
|
@@ -136,8 +136,11 @@ class StereoCamera {
|
|
|
136
136
|
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
this.cameraL.
|
|
140
|
-
this.
|
|
139
|
+
this.cameraL.matrix.copy( camera.matrixWorld ).multiply( _eyeLeft );
|
|
140
|
+
this.cameraL.matrixWorldNeedsUpdate = true;
|
|
141
|
+
|
|
142
|
+
this.cameraR.matrix.copy( camera.matrixWorld ).multiply( _eyeRight );
|
|
143
|
+
this.cameraR.matrixWorldNeedsUpdate = true;
|
|
141
144
|
|
|
142
145
|
}
|
|
143
146
|
|
package/src/constants.js
CHANGED
|
@@ -195,6 +195,19 @@ class BufferGeometry extends EventDispatcher {
|
|
|
195
195
|
*/
|
|
196
196
|
this.userData = {};
|
|
197
197
|
|
|
198
|
+
/**
|
|
199
|
+
* `true` when the geometry has been transformed since construction
|
|
200
|
+
* (e.g. via {@link BufferGeometry#applyMatrix4}). Only relevant for
|
|
201
|
+
* geometry generators (subclasses that populate `parameters`): when set,
|
|
202
|
+
* {@link BufferGeometry#toJSON} omits `parameters` since they no longer
|
|
203
|
+
* describe the geometry.
|
|
204
|
+
*
|
|
205
|
+
* @private
|
|
206
|
+
* @type {boolean}
|
|
207
|
+
* @default false
|
|
208
|
+
*/
|
|
209
|
+
this._transformed = false;
|
|
210
|
+
|
|
198
211
|
}
|
|
199
212
|
|
|
200
213
|
/**
|
|
@@ -406,6 +419,8 @@ class BufferGeometry extends EventDispatcher {
|
|
|
406
419
|
|
|
407
420
|
}
|
|
408
421
|
|
|
422
|
+
this._transformed = true;
|
|
423
|
+
|
|
409
424
|
return this;
|
|
410
425
|
|
|
411
426
|
}
|
|
@@ -841,13 +856,14 @@ class BufferGeometry extends EventDispatcher {
|
|
|
841
856
|
const normalAttribute = attributes.normal;
|
|
842
857
|
const uvAttribute = attributes.uv;
|
|
843
858
|
|
|
844
|
-
|
|
859
|
+
let tangentAttribute = this.getAttribute( 'tangent' );
|
|
845
860
|
|
|
846
|
-
|
|
861
|
+
if ( tangentAttribute === undefined || tangentAttribute.count !== positionAttribute.count ) {
|
|
847
862
|
|
|
848
|
-
|
|
863
|
+
tangentAttribute = new BufferAttribute( new Float32Array( 4 * positionAttribute.count ), 4 );
|
|
864
|
+
this.setAttribute( 'tangent', tangentAttribute );
|
|
849
865
|
|
|
850
|
-
|
|
866
|
+
}
|
|
851
867
|
|
|
852
868
|
const tan1 = [], tan2 = [];
|
|
853
869
|
|
|
@@ -976,6 +992,8 @@ class BufferGeometry extends EventDispatcher {
|
|
|
976
992
|
|
|
977
993
|
}
|
|
978
994
|
|
|
995
|
+
this._transformed = true;
|
|
996
|
+
|
|
979
997
|
}
|
|
980
998
|
|
|
981
999
|
/**
|
|
@@ -993,7 +1011,7 @@ class BufferGeometry extends EventDispatcher {
|
|
|
993
1011
|
|
|
994
1012
|
let normalAttribute = this.getAttribute( 'normal' );
|
|
995
1013
|
|
|
996
|
-
if ( normalAttribute === undefined ) {
|
|
1014
|
+
if ( normalAttribute === undefined || normalAttribute.count !== positionAttribute.count ) {
|
|
997
1015
|
|
|
998
1016
|
normalAttribute = new BufferAttribute( new Float32Array( positionAttribute.count * 3 ), 3 );
|
|
999
1017
|
this.setAttribute( 'normal', normalAttribute );
|
|
@@ -1222,11 +1240,11 @@ class BufferGeometry extends EventDispatcher {
|
|
|
1222
1240
|
// standard BufferGeometry serialization
|
|
1223
1241
|
|
|
1224
1242
|
data.uuid = this.uuid;
|
|
1225
|
-
data.type = this.type;
|
|
1243
|
+
data.type = ( this.parameters !== undefined && this._transformed === true ) ? 'BufferGeometry' : this.type;
|
|
1226
1244
|
if ( this.name !== '' ) data.name = this.name;
|
|
1227
1245
|
if ( Object.keys( this.userData ).length > 0 ) data.userData = this.userData;
|
|
1228
1246
|
|
|
1229
|
-
if ( this.parameters !== undefined ) {
|
|
1247
|
+
if ( this.parameters !== undefined && this._transformed !== true ) {
|
|
1230
1248
|
|
|
1231
1249
|
const parameters = this.parameters;
|
|
1232
1250
|
|
|
@@ -1437,6 +1455,10 @@ class BufferGeometry extends EventDispatcher {
|
|
|
1437
1455
|
|
|
1438
1456
|
this.userData = source.userData;
|
|
1439
1457
|
|
|
1458
|
+
// transformed flag
|
|
1459
|
+
|
|
1460
|
+
this._transformed = source._transformed;
|
|
1461
|
+
|
|
1440
1462
|
return this;
|
|
1441
1463
|
|
|
1442
1464
|
}
|
package/src/core/Object3D.js
CHANGED
|
@@ -1208,8 +1208,10 @@ class Object3D extends EventDispatcher {
|
|
|
1208
1208
|
*
|
|
1209
1209
|
* @param {boolean} [updateParents=false] Whether ancestor nodes should be updated or not.
|
|
1210
1210
|
* @param {boolean} [updateChildren=false] Whether descendant nodes should be updated or not.
|
|
1211
|
+
* @param {boolean} [force=false] - When set to `true`, a recomputation of world matrices is forced even
|
|
1212
|
+
* when {@link Object3D#matrixWorldNeedsUpdate} is `false`.
|
|
1211
1213
|
*/
|
|
1212
|
-
updateWorldMatrix( updateParents, updateChildren ) {
|
|
1214
|
+
updateWorldMatrix( updateParents, updateChildren, force = false ) {
|
|
1213
1215
|
|
|
1214
1216
|
const parent = this.parent;
|
|
1215
1217
|
|
|
@@ -1221,18 +1223,26 @@ class Object3D extends EventDispatcher {
|
|
|
1221
1223
|
|
|
1222
1224
|
if ( this.matrixAutoUpdate ) this.updateMatrix();
|
|
1223
1225
|
|
|
1224
|
-
if ( this.
|
|
1226
|
+
if ( this.matrixWorldNeedsUpdate || force ) {
|
|
1227
|
+
|
|
1228
|
+
if ( this.matrixWorldAutoUpdate === true ) {
|
|
1225
1229
|
|
|
1226
|
-
|
|
1230
|
+
if ( this.parent === null ) {
|
|
1227
1231
|
|
|
1228
|
-
|
|
1232
|
+
this.matrixWorld.copy( this.matrix );
|
|
1229
1233
|
|
|
1230
|
-
|
|
1234
|
+
} else {
|
|
1235
|
+
|
|
1236
|
+
this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );
|
|
1231
1237
|
|
|
1232
|
-
|
|
1238
|
+
}
|
|
1233
1239
|
|
|
1234
1240
|
}
|
|
1235
1241
|
|
|
1242
|
+
this.matrixWorldNeedsUpdate = false;
|
|
1243
|
+
|
|
1244
|
+
force = true;
|
|
1245
|
+
|
|
1236
1246
|
}
|
|
1237
1247
|
|
|
1238
1248
|
// make sure descendants are updated
|
|
@@ -1245,7 +1255,7 @@ class Object3D extends EventDispatcher {
|
|
|
1245
1255
|
|
|
1246
1256
|
const child = children[ i ];
|
|
1247
1257
|
|
|
1248
|
-
child.updateWorldMatrix( false, true );
|
|
1258
|
+
child.updateWorldMatrix( false, true, force );
|
|
1249
1259
|
|
|
1250
1260
|
}
|
|
1251
1261
|
|
package/src/core/Raycaster.js
CHANGED
|
@@ -126,7 +126,7 @@ class Raycaster {
|
|
|
126
126
|
|
|
127
127
|
} else if ( camera.isOrthographicCamera ) {
|
|
128
128
|
|
|
129
|
-
this.ray.origin.set( coords.x, coords.y,
|
|
129
|
+
this.ray.origin.set( coords.x, coords.y, camera.projectionMatrix.elements[ 14 ] ).unproject( camera ); // set origin in plane of camera
|
|
130
130
|
this.ray.direction.set( 0, 0, - 1 ).transformDirection( camera.matrixWorld );
|
|
131
131
|
this.camera = camera;
|
|
132
132
|
|
package/src/core/RenderTarget.js
CHANGED
|
@@ -36,7 +36,8 @@ class RenderTarget extends EventDispatcher {
|
|
|
36
36
|
* @property {number} [samples=0] - The MSAA samples count.
|
|
37
37
|
* @property {number} [count=1] - Defines the number of color attachments . Must be at least `1`.
|
|
38
38
|
* @property {number} [depth=1] - The texture depth.
|
|
39
|
-
* @property {boolean} [multiview=false] - Whether this target is used for multiview rendering.
|
|
39
|
+
* @property {boolean} [multiview=false] - Whether this target is used for multiview rendering (WebGL OVR_multiview2 extension).
|
|
40
|
+
* @property {boolean} [useArrayDepthTexture=false] - Whether to create the depth texture as an array texture for per-layer depth testing. This is separate from multiview so layered render targets can use array depth without the multiview extension.
|
|
40
41
|
*/
|
|
41
42
|
|
|
42
43
|
/**
|
|
@@ -62,7 +63,8 @@ class RenderTarget extends EventDispatcher {
|
|
|
62
63
|
samples: 0,
|
|
63
64
|
count: 1,
|
|
64
65
|
depth: 1,
|
|
65
|
-
multiview: false
|
|
66
|
+
multiview: false,
|
|
67
|
+
useArrayDepthTexture: false
|
|
66
68
|
}, options );
|
|
67
69
|
|
|
68
70
|
/**
|
|
@@ -199,6 +201,16 @@ class RenderTarget extends EventDispatcher {
|
|
|
199
201
|
*/
|
|
200
202
|
this.multiview = options.multiview;
|
|
201
203
|
|
|
204
|
+
/**
|
|
205
|
+
* Whether to create the depth texture as an array texture for per-layer depth testing.
|
|
206
|
+
* This is separate from multiview so layered render targets can use array depth without
|
|
207
|
+
* the multiview extension.
|
|
208
|
+
*
|
|
209
|
+
* @type {boolean}
|
|
210
|
+
* @default false
|
|
211
|
+
*/
|
|
212
|
+
this.useArrayDepthTexture = options.useArrayDepthTexture;
|
|
213
|
+
|
|
202
214
|
}
|
|
203
215
|
|
|
204
216
|
_setTextureOptions( options = {} ) {
|
|
@@ -370,6 +382,7 @@ class RenderTarget extends EventDispatcher {
|
|
|
370
382
|
|
|
371
383
|
this.samples = source.samples;
|
|
372
384
|
this.multiview = source.multiview;
|
|
385
|
+
this.useArrayDepthTexture = source.useArrayDepthTexture;
|
|
373
386
|
|
|
374
387
|
return this;
|
|
375
388
|
|
|
@@ -142,8 +142,9 @@ class PMREMGenerator {
|
|
|
142
142
|
|
|
143
143
|
/**
|
|
144
144
|
* Generates a PMREM from an equirectangular texture, which can be either LDR
|
|
145
|
-
* or HDR. The ideal input image size is 1k (1024 x 512),
|
|
146
|
-
*
|
|
145
|
+
* or HDR. The ideal input image size is 1k (1024 x 512), as this matches best
|
|
146
|
+
* with the 256 x 256 cubemap output. The minimum supported input image size
|
|
147
|
+
* is 64 x 32.
|
|
147
148
|
*
|
|
148
149
|
* @param {Texture} equirectangular - The equirectangular texture to be converted.
|
|
149
150
|
* @param {?WebGLRenderTarget} [renderTarget=null] - The render target to use.
|
|
@@ -157,8 +158,9 @@ class PMREMGenerator {
|
|
|
157
158
|
|
|
158
159
|
/**
|
|
159
160
|
* Generates a PMREM from an cubemap texture, which can be either LDR
|
|
160
|
-
* or HDR. The ideal input cube size is 256 x 256,
|
|
161
|
-
*
|
|
161
|
+
* or HDR. The ideal input cube size is 256 x 256, as this matches best
|
|
162
|
+
* with the 256 x 256 cubemap output. The minimum supported input cube
|
|
163
|
+
* size is 16 x 16 per face.
|
|
162
164
|
*
|
|
163
165
|
* @param {Texture} cubemap - The cubemap texture to be converted.
|
|
164
166
|
* @param {?WebGLRenderTarget} [renderTarget=null] - The render target to use.
|