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
package/src/math/FrustumArray.js
CHANGED
|
@@ -3,7 +3,6 @@ import { Frustum } from './Frustum.js';
|
|
|
3
3
|
import { Matrix4 } from './Matrix4.js';
|
|
4
4
|
|
|
5
5
|
const _projScreenMatrix = /*@__PURE__*/ new Matrix4();
|
|
6
|
-
const _frustum = /*@__PURE__*/ new Frustum();
|
|
7
6
|
|
|
8
7
|
/**
|
|
9
8
|
* FrustumArray is used to determine if an object is visible in at least one camera
|
|
@@ -25,220 +24,191 @@ class FrustumArray {
|
|
|
25
24
|
*/
|
|
26
25
|
this.coordinateSystem = WebGLCoordinateSystem;
|
|
27
26
|
|
|
27
|
+
/**
|
|
28
|
+
* A pool of frustum instances. It may hold more entries than are
|
|
29
|
+
* currently in use; surplus instances are kept for reuse to avoid
|
|
30
|
+
* reallocating when array cameras of different lengths are rendered.
|
|
31
|
+
*
|
|
32
|
+
* @private
|
|
33
|
+
* @type {Array<Frustum>}
|
|
34
|
+
*/
|
|
35
|
+
this._frustums = [];
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The number of frustums in {@link FrustumArray#_frustums} that are currently
|
|
39
|
+
* in use.
|
|
40
|
+
*
|
|
41
|
+
* @private
|
|
42
|
+
* @type {number}
|
|
43
|
+
* @default 0
|
|
44
|
+
*/
|
|
45
|
+
this._count = 0;
|
|
46
|
+
|
|
28
47
|
}
|
|
29
48
|
|
|
30
49
|
/**
|
|
31
|
-
*
|
|
32
|
-
* from the camera array.
|
|
50
|
+
* Computes and caches a frustum for each camera of the given array camera.
|
|
33
51
|
*
|
|
34
|
-
* @param {
|
|
35
|
-
* @
|
|
36
|
-
* @return {boolean} Whether the 3D object is visible in any camera.
|
|
52
|
+
* @param {ArrayCamera} cameraArray - The array camera whose sub-cameras define the frustums.
|
|
53
|
+
* @return {FrustumArray} A reference to this frustum array.
|
|
37
54
|
*/
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
if ( ! cameraArray.isArrayCamera || cameraArray.cameras.length === 0 ) {
|
|
41
|
-
|
|
42
|
-
return false;
|
|
43
|
-
|
|
44
|
-
}
|
|
55
|
+
setFromArrayCamera( cameraArray ) {
|
|
45
56
|
|
|
46
|
-
|
|
57
|
+
const cameras = cameraArray.cameras;
|
|
58
|
+
const frustums = this._frustums;
|
|
47
59
|
|
|
48
|
-
|
|
60
|
+
for ( let i = 0; i < cameras.length; i ++ ) {
|
|
49
61
|
|
|
50
|
-
|
|
51
|
-
camera.projectionMatrix,
|
|
52
|
-
camera.matrixWorldInverse
|
|
53
|
-
);
|
|
62
|
+
const camera = cameras[ i ];
|
|
54
63
|
|
|
55
|
-
|
|
56
|
-
_projScreenMatrix,
|
|
57
|
-
camera.coordinateSystem,
|
|
58
|
-
camera.reversedDepth
|
|
59
|
-
);
|
|
64
|
+
_projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );
|
|
60
65
|
|
|
61
|
-
if (
|
|
66
|
+
if ( frustums[ i ] === undefined ) frustums[ i ] = new Frustum();
|
|
62
67
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
68
|
+
frustums[ i ].setFromProjectionMatrix( _projScreenMatrix, camera.coordinateSystem, camera.reversedDepth );
|
|
66
69
|
|
|
67
70
|
}
|
|
68
71
|
|
|
69
|
-
|
|
72
|
+
this._count = cameras.length;
|
|
73
|
+
|
|
74
|
+
return this;
|
|
70
75
|
|
|
71
76
|
}
|
|
72
77
|
|
|
73
78
|
/**
|
|
74
|
-
* Returns `true` if the
|
|
75
|
-
* from the camera array.
|
|
79
|
+
* Returns `true` if the 3D object's bounding sphere is intersecting any cached frustum.
|
|
76
80
|
*
|
|
77
|
-
* @
|
|
78
|
-
*
|
|
79
|
-
* @
|
|
81
|
+
* {@link FrustumArray#setFromArrayCamera} must be called once per render before this method.
|
|
82
|
+
*
|
|
83
|
+
* @param {Object3D} object - The 3D object to test.
|
|
84
|
+
* @return {boolean} Whether the 3D object is visible in any camera.
|
|
80
85
|
*/
|
|
81
|
-
|
|
86
|
+
intersectsObject( object ) {
|
|
82
87
|
|
|
83
|
-
|
|
88
|
+
const frustums = this._frustums;
|
|
84
89
|
|
|
85
|
-
|
|
90
|
+
for ( let i = 0; i < this._count; i ++ ) {
|
|
86
91
|
|
|
87
|
-
|
|
92
|
+
if ( frustums[ i ].intersectsObject( object ) ) return true;
|
|
88
93
|
|
|
89
|
-
|
|
94
|
+
}
|
|
90
95
|
|
|
91
|
-
|
|
96
|
+
return false;
|
|
92
97
|
|
|
93
|
-
|
|
94
|
-
camera.projectionMatrix,
|
|
95
|
-
camera.matrixWorldInverse
|
|
96
|
-
);
|
|
98
|
+
}
|
|
97
99
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
/**
|
|
101
|
+
* Returns `true` if the given sprite is intersecting any cached frustum.
|
|
102
|
+
*
|
|
103
|
+
* {@link FrustumArray#setFromArrayCamera} must be called once per render before this method.
|
|
104
|
+
*
|
|
105
|
+
* @param {Sprite} sprite - The sprite to test.
|
|
106
|
+
* @return {boolean} Whether the sprite is visible in any camera.
|
|
107
|
+
*/
|
|
108
|
+
intersectsSprite( sprite ) {
|
|
103
109
|
|
|
104
|
-
|
|
110
|
+
const frustums = this._frustums;
|
|
105
111
|
|
|
106
|
-
|
|
112
|
+
for ( let i = 0; i < this._count; i ++ ) {
|
|
107
113
|
|
|
108
|
-
|
|
114
|
+
if ( frustums[ i ].intersectsSprite( sprite ) ) return true;
|
|
109
115
|
|
|
110
116
|
}
|
|
111
117
|
|
|
112
|
-
return false;
|
|
118
|
+
return false;
|
|
113
119
|
|
|
114
120
|
}
|
|
115
121
|
|
|
116
122
|
/**
|
|
117
|
-
* Returns `true` if the given bounding sphere is intersecting any frustum
|
|
118
|
-
*
|
|
123
|
+
* Returns `true` if the given bounding sphere is intersecting any cached frustum.
|
|
124
|
+
*
|
|
125
|
+
* {@link FrustumArray#setFromArrayCamera} must be called once per render before this method.
|
|
119
126
|
*
|
|
120
127
|
* @param {Sphere} sphere - The bounding sphere to test.
|
|
121
|
-
* @param {Object} cameraArray - An object with a cameras property containing an array of cameras.
|
|
122
128
|
* @return {boolean} Whether the sphere is visible in any camera.
|
|
123
129
|
*/
|
|
124
|
-
intersectsSphere( sphere
|
|
125
|
-
|
|
126
|
-
if ( ! cameraArray || ! cameraArray.cameras || cameraArray.cameras.length === 0 ) {
|
|
127
|
-
|
|
128
|
-
return false;
|
|
129
|
-
|
|
130
|
-
}
|
|
130
|
+
intersectsSphere( sphere ) {
|
|
131
131
|
|
|
132
|
-
|
|
132
|
+
const frustums = this._frustums;
|
|
133
133
|
|
|
134
|
-
|
|
134
|
+
for ( let i = 0; i < this._count; i ++ ) {
|
|
135
135
|
|
|
136
|
-
|
|
137
|
-
camera.projectionMatrix,
|
|
138
|
-
camera.matrixWorldInverse
|
|
139
|
-
);
|
|
140
|
-
|
|
141
|
-
_frustum.setFromProjectionMatrix(
|
|
142
|
-
_projScreenMatrix,
|
|
143
|
-
camera.coordinateSystem,
|
|
144
|
-
camera.reversedDepth
|
|
145
|
-
);
|
|
146
|
-
|
|
147
|
-
if ( _frustum.intersectsSphere( sphere ) ) {
|
|
148
|
-
|
|
149
|
-
return true; // Sphere is visible in at least one camera
|
|
150
|
-
|
|
151
|
-
}
|
|
136
|
+
if ( frustums[ i ].intersectsSphere( sphere ) ) return true;
|
|
152
137
|
|
|
153
138
|
}
|
|
154
139
|
|
|
155
|
-
return false;
|
|
140
|
+
return false;
|
|
156
141
|
|
|
157
142
|
}
|
|
158
143
|
|
|
159
144
|
/**
|
|
160
|
-
* Returns `true` if the given bounding box is intersecting any frustum
|
|
161
|
-
*
|
|
145
|
+
* Returns `true` if the given bounding box is intersecting any cached frustum.
|
|
146
|
+
*
|
|
147
|
+
* {@link FrustumArray#setFromArrayCamera} must be called once per render before this method.
|
|
162
148
|
*
|
|
163
149
|
* @param {Box3} box - The bounding box to test.
|
|
164
|
-
* @param {Object} cameraArray - An object with a cameras property containing an array of cameras.
|
|
165
150
|
* @return {boolean} Whether the box is visible in any camera.
|
|
166
151
|
*/
|
|
167
|
-
intersectsBox( box
|
|
168
|
-
|
|
169
|
-
if ( ! cameraArray || ! cameraArray.cameras || cameraArray.cameras.length === 0 ) {
|
|
170
|
-
|
|
171
|
-
return false;
|
|
152
|
+
intersectsBox( box ) {
|
|
172
153
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
for ( let i = 0; i < cameraArray.cameras.length; i ++ ) {
|
|
176
|
-
|
|
177
|
-
const camera = cameraArray.cameras[ i ];
|
|
178
|
-
|
|
179
|
-
_projScreenMatrix.multiplyMatrices(
|
|
180
|
-
camera.projectionMatrix,
|
|
181
|
-
camera.matrixWorldInverse
|
|
182
|
-
);
|
|
154
|
+
const frustums = this._frustums;
|
|
183
155
|
|
|
184
|
-
|
|
185
|
-
_projScreenMatrix,
|
|
186
|
-
camera.coordinateSystem,
|
|
187
|
-
camera.reversedDepth
|
|
188
|
-
);
|
|
156
|
+
for ( let i = 0; i < this._count; i ++ ) {
|
|
189
157
|
|
|
190
|
-
if (
|
|
191
|
-
|
|
192
|
-
return true; // Box is visible in at least one camera
|
|
193
|
-
|
|
194
|
-
}
|
|
158
|
+
if ( frustums[ i ].intersectsBox( box ) ) return true;
|
|
195
159
|
|
|
196
160
|
}
|
|
197
161
|
|
|
198
|
-
return false;
|
|
162
|
+
return false;
|
|
199
163
|
|
|
200
164
|
}
|
|
201
165
|
|
|
202
166
|
/**
|
|
203
|
-
* Returns `true` if the given point lies within any frustum
|
|
204
|
-
*
|
|
167
|
+
* Returns `true` if the given point lies within any cached frustum.
|
|
168
|
+
*
|
|
169
|
+
* {@link FrustumArray#setFromArrayCamera} must be called once per render before this method.
|
|
205
170
|
*
|
|
206
171
|
* @param {Vector3} point - The point to test.
|
|
207
|
-
* @param {Object} cameraArray - An object with a cameras property containing an array of cameras.
|
|
208
172
|
* @return {boolean} Whether the point is visible in any camera.
|
|
209
173
|
*/
|
|
210
|
-
containsPoint( point
|
|
174
|
+
containsPoint( point ) {
|
|
211
175
|
|
|
212
|
-
|
|
176
|
+
const frustums = this._frustums;
|
|
213
177
|
|
|
214
|
-
|
|
178
|
+
for ( let i = 0; i < this._count; i ++ ) {
|
|
179
|
+
|
|
180
|
+
if ( frustums[ i ].containsPoint( point ) ) return true;
|
|
215
181
|
|
|
216
182
|
}
|
|
217
183
|
|
|
218
|
-
|
|
184
|
+
return false;
|
|
219
185
|
|
|
220
|
-
|
|
186
|
+
}
|
|
221
187
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
188
|
+
/**
|
|
189
|
+
* Copies the values of the given frustum array to this instance.
|
|
190
|
+
*
|
|
191
|
+
* @param {FrustumArray} frustumArray - The frustum array to copy.
|
|
192
|
+
* @return {FrustumArray} A reference to this frustum array.
|
|
193
|
+
*/
|
|
194
|
+
copy( source ) {
|
|
195
|
+
|
|
196
|
+
this.coordinateSystem = source.coordinateSystem;
|
|
226
197
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
camera.coordinateSystem,
|
|
230
|
-
camera.reversedDepth
|
|
231
|
-
);
|
|
198
|
+
const frustums = this._frustums;
|
|
199
|
+
const sourceFrustums = source._frustums;
|
|
232
200
|
|
|
233
|
-
|
|
201
|
+
for ( let i = 0; i < source._count; i ++ ) {
|
|
234
202
|
|
|
235
|
-
|
|
203
|
+
if ( frustums[ i ] === undefined ) frustums[ i ] = new Frustum();
|
|
236
204
|
|
|
237
|
-
|
|
205
|
+
frustums[ i ].copy( sourceFrustums[ i ] );
|
|
238
206
|
|
|
239
207
|
}
|
|
240
208
|
|
|
241
|
-
|
|
209
|
+
this._count = source._count;
|
|
210
|
+
|
|
211
|
+
return this;
|
|
242
212
|
|
|
243
213
|
}
|
|
244
214
|
|
|
@@ -249,7 +219,7 @@ class FrustumArray {
|
|
|
249
219
|
*/
|
|
250
220
|
clone() {
|
|
251
221
|
|
|
252
|
-
return new FrustumArray();
|
|
222
|
+
return new FrustumArray().copy( this );
|
|
253
223
|
|
|
254
224
|
}
|
|
255
225
|
|
package/src/math/Interpolant.js
CHANGED
|
@@ -297,7 +297,7 @@ class Interpolant {
|
|
|
297
297
|
*/
|
|
298
298
|
interpolate_( /* i1, t0, t, t1 */ ) {
|
|
299
299
|
|
|
300
|
-
throw new Error( '
|
|
300
|
+
throw new Error( 'THREE.Interpolant: Call to abstract method.' );
|
|
301
301
|
// implementations shall return this.resultBuffer
|
|
302
302
|
|
|
303
303
|
}
|
package/src/math/MathUtils.js
CHANGED
|
@@ -419,7 +419,7 @@ function denormalize( value, array ) {
|
|
|
419
419
|
|
|
420
420
|
default:
|
|
421
421
|
|
|
422
|
-
throw new Error( 'Invalid component type.' );
|
|
422
|
+
throw new Error( 'THREE.MathUtils: Invalid component type.' );
|
|
423
423
|
|
|
424
424
|
}
|
|
425
425
|
|
|
@@ -466,7 +466,7 @@ function normalize( value, array ) {
|
|
|
466
466
|
|
|
467
467
|
default:
|
|
468
468
|
|
|
469
|
-
throw new Error( 'Invalid component type.' );
|
|
469
|
+
throw new Error( 'THREE.MathUtils: Invalid component type.' );
|
|
470
470
|
|
|
471
471
|
}
|
|
472
472
|
|
package/src/math/Matrix3.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { warnOnce } from '../utils.js';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Represents a 3x3 matrix.
|
|
3
5
|
*
|
|
@@ -407,12 +409,15 @@ class Matrix3 {
|
|
|
407
409
|
/**
|
|
408
410
|
* Scales this matrix with the given scalar values.
|
|
409
411
|
*
|
|
412
|
+
* @deprecated
|
|
410
413
|
* @param {number} sx - The amount to scale in the X axis.
|
|
411
414
|
* @param {number} sy - The amount to scale in the Y axis.
|
|
412
415
|
* @return {Matrix3} A reference to this matrix.
|
|
413
416
|
*/
|
|
414
417
|
scale( sx, sy ) {
|
|
415
418
|
|
|
419
|
+
warnOnce( 'Matrix3: .scale() is deprecated. Use .makeScale() instead.' ); // @deprecated r185
|
|
420
|
+
|
|
416
421
|
this.premultiply( _m3.makeScale( sx, sy ) );
|
|
417
422
|
|
|
418
423
|
return this;
|
|
@@ -422,11 +427,14 @@ class Matrix3 {
|
|
|
422
427
|
/**
|
|
423
428
|
* Rotates this matrix by the given angle.
|
|
424
429
|
*
|
|
430
|
+
* @deprecated
|
|
425
431
|
* @param {number} theta - The rotation in radians.
|
|
426
432
|
* @return {Matrix3} A reference to this matrix.
|
|
427
433
|
*/
|
|
428
434
|
rotate( theta ) {
|
|
429
435
|
|
|
436
|
+
warnOnce( 'Matrix3: .rotate() is deprecated. Use .makeRotation() instead.' ); // @deprecated r185
|
|
437
|
+
|
|
430
438
|
this.premultiply( _m3.makeRotation( - theta ) );
|
|
431
439
|
|
|
432
440
|
return this;
|
|
@@ -436,12 +444,15 @@ class Matrix3 {
|
|
|
436
444
|
/**
|
|
437
445
|
* Translates this matrix by the given scalar values.
|
|
438
446
|
*
|
|
447
|
+
* @deprecated
|
|
439
448
|
* @param {number} tx - The amount to translate in the X axis.
|
|
440
449
|
* @param {number} ty - The amount to translate in the Y axis.
|
|
441
450
|
* @return {Matrix3} A reference to this matrix.
|
|
442
451
|
*/
|
|
443
452
|
translate( tx, ty ) {
|
|
444
453
|
|
|
454
|
+
warnOnce( 'Matrix3: .translate() is deprecated. Use .makeTranslation() instead.' ); // @deprecated r185
|
|
455
|
+
|
|
445
456
|
this.premultiply( _m3.makeTranslation( tx, ty ) );
|
|
446
457
|
|
|
447
458
|
return this;
|
package/src/math/Matrix4.js
CHANGED
|
@@ -238,7 +238,7 @@ class Matrix4 {
|
|
|
238
238
|
*/
|
|
239
239
|
extractBasis( xAxis, yAxis, zAxis ) {
|
|
240
240
|
|
|
241
|
-
if ( this.
|
|
241
|
+
if ( this.determinantAffine() === 0 ) {
|
|
242
242
|
|
|
243
243
|
xAxis.set( 1, 0, 0 );
|
|
244
244
|
yAxis.set( 0, 1, 0 );
|
|
@@ -288,7 +288,7 @@ class Matrix4 {
|
|
|
288
288
|
*/
|
|
289
289
|
extractRotation( m ) {
|
|
290
290
|
|
|
291
|
-
if ( m.
|
|
291
|
+
if ( m.determinantAffine() === 0 ) {
|
|
292
292
|
|
|
293
293
|
return this.identity();
|
|
294
294
|
|
|
@@ -649,6 +649,31 @@ class Matrix4 {
|
|
|
649
649
|
|
|
650
650
|
}
|
|
651
651
|
|
|
652
|
+
/**
|
|
653
|
+
* Computes and returns the determinant of the 4x4 matrix, but assumes the
|
|
654
|
+
* matrix is affine, saving some computations.
|
|
655
|
+
*
|
|
656
|
+
* For affine matrices (like an object's world matrix), this value equals the
|
|
657
|
+
* full 4x4 {@link Matrix4#determinant} but is cheaper to compute.
|
|
658
|
+
*
|
|
659
|
+
* Assumes the bottom row is [0, 0, 0, 1].
|
|
660
|
+
*
|
|
661
|
+
* @return {number} The determinant of the matrix.
|
|
662
|
+
*/
|
|
663
|
+
determinantAffine() {
|
|
664
|
+
|
|
665
|
+
const te = this.elements;
|
|
666
|
+
|
|
667
|
+
const n11 = te[ 0 ], n12 = te[ 4 ], n13 = te[ 8 ];
|
|
668
|
+
const n21 = te[ 1 ], n22 = te[ 5 ], n23 = te[ 9 ];
|
|
669
|
+
const n31 = te[ 2 ], n32 = te[ 6 ], n33 = te[ 10 ];
|
|
670
|
+
|
|
671
|
+
return n11 * ( n22 * n33 - n23 * n32 ) -
|
|
672
|
+
n12 * ( n21 * n33 - n23 * n31 ) +
|
|
673
|
+
n13 * ( n21 * n32 - n22 * n31 );
|
|
674
|
+
|
|
675
|
+
}
|
|
676
|
+
|
|
652
677
|
/**
|
|
653
678
|
* Transposes this matrix in place.
|
|
654
679
|
*
|
|
@@ -1058,7 +1083,7 @@ class Matrix4 {
|
|
|
1058
1083
|
position.y = te[ 13 ];
|
|
1059
1084
|
position.z = te[ 14 ];
|
|
1060
1085
|
|
|
1061
|
-
const det = this.
|
|
1086
|
+
const det = this.determinantAffine();
|
|
1062
1087
|
|
|
1063
1088
|
if ( det === 0 ) {
|
|
1064
1089
|
|
package/src/math/Vector2.js
CHANGED
|
@@ -170,7 +170,7 @@ class Vector2 {
|
|
|
170
170
|
|
|
171
171
|
case 0: this.x = value; break;
|
|
172
172
|
case 1: this.y = value; break;
|
|
173
|
-
default: throw new Error( 'index is out of range: ' + index );
|
|
173
|
+
default: throw new Error( 'THREE.Vector2: index is out of range: ' + index );
|
|
174
174
|
|
|
175
175
|
}
|
|
176
176
|
|
|
@@ -190,7 +190,7 @@ class Vector2 {
|
|
|
190
190
|
|
|
191
191
|
case 0: return this.x;
|
|
192
192
|
case 1: return this.y;
|
|
193
|
-
default: throw new Error( 'index is out of range: ' + index );
|
|
193
|
+
default: throw new Error( 'THREE.Vector2: index is out of range: ' + index );
|
|
194
194
|
|
|
195
195
|
}
|
|
196
196
|
|
package/src/math/Vector3.js
CHANGED
|
@@ -165,7 +165,7 @@ class Vector3 {
|
|
|
165
165
|
case 0: this.x = value; break;
|
|
166
166
|
case 1: this.y = value; break;
|
|
167
167
|
case 2: this.z = value; break;
|
|
168
|
-
default: throw new Error( 'index is out of range: ' + index );
|
|
168
|
+
default: throw new Error( 'THREE.Vector3: index is out of range: ' + index );
|
|
169
169
|
|
|
170
170
|
}
|
|
171
171
|
|
|
@@ -186,7 +186,7 @@ class Vector3 {
|
|
|
186
186
|
case 0: return this.x;
|
|
187
187
|
case 1: return this.y;
|
|
188
188
|
case 2: return this.z;
|
|
189
|
-
default: throw new Error( 'index is out of range: ' + index );
|
|
189
|
+
default: throw new Error( 'THREE.Vector3: index is out of range: ' + index );
|
|
190
190
|
|
|
191
191
|
}
|
|
192
192
|
|
package/src/math/Vector4.js
CHANGED
|
@@ -222,7 +222,7 @@ class Vector4 {
|
|
|
222
222
|
case 1: this.y = value; break;
|
|
223
223
|
case 2: this.z = value; break;
|
|
224
224
|
case 3: this.w = value; break;
|
|
225
|
-
default: throw new Error( 'index is out of range: ' + index );
|
|
225
|
+
default: throw new Error( 'THREE.Vector4: index is out of range: ' + index );
|
|
226
226
|
|
|
227
227
|
}
|
|
228
228
|
|
|
@@ -245,7 +245,7 @@ class Vector4 {
|
|
|
245
245
|
case 1: return this.y;
|
|
246
246
|
case 2: return this.z;
|
|
247
247
|
case 3: return this.w;
|
|
248
|
-
default: throw new Error( 'index is out of range: ' + index );
|
|
248
|
+
default: throw new Error( 'THREE.Vector4: index is out of range: ' + index );
|
|
249
249
|
|
|
250
250
|
}
|
|
251
251
|
|
|
@@ -7,9 +7,8 @@ import { Interpolant } from '../Interpolant.js';
|
|
|
7
7
|
* each keyframe has explicit in/out tangent control points specified as
|
|
8
8
|
* 2D coordinates (time, value).
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* - `settings.outTangents`: Float32Array with [time, value] pairs per keyframe per component
|
|
10
|
+
* Tangent data is read from `inTangents` and `outTangents` on the interpolant
|
|
11
|
+
* (populated by `KeyframeTrack.InterpolantFactoryMethodBezier`).
|
|
13
12
|
*
|
|
14
13
|
* For a track with N keyframes and stride S:
|
|
15
14
|
* - Each tangent array has N * S * 2 values
|
|
@@ -29,9 +28,8 @@ class BezierInterpolant extends Interpolant {
|
|
|
29
28
|
const offset1 = i1 * stride;
|
|
30
29
|
const offset0 = offset1 - stride;
|
|
31
30
|
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const outTangents = settings.outTangents;
|
|
31
|
+
const inTangents = this.inTangents;
|
|
32
|
+
const outTangents = this.outTangents;
|
|
35
33
|
|
|
36
34
|
// If no tangent data, fall back to linear interpolation
|
|
37
35
|
if ( ! inTangents || ! outTangents ) {
|
package/src/nodes/Nodes.js
CHANGED
|
@@ -26,6 +26,7 @@ export { default as NodeUniform } from './core/NodeUniform.js';
|
|
|
26
26
|
export { default as NodeVar } from './core/NodeVar.js';
|
|
27
27
|
export { default as NodeVarying } from './core/NodeVarying.js';
|
|
28
28
|
export { default as OutputStructNode } from './core/OutputStructNode.js';
|
|
29
|
+
export { default as OverrideContextNode } from './core/OverrideContextNode.js';
|
|
29
30
|
export { default as ParameterNode } from './core/ParameterNode.js';
|
|
30
31
|
export { default as PropertyNode } from './core/PropertyNode.js';
|
|
31
32
|
export { default as StackNode } from './core/StackNode.js';
|
|
@@ -43,25 +44,21 @@ import * as NodeUtils from './core/NodeUtils.js';
|
|
|
43
44
|
export { NodeUtils };
|
|
44
45
|
|
|
45
46
|
// accessors
|
|
46
|
-
export { default as BatchNode } from './accessors/BatchNode.js';
|
|
47
47
|
export { default as BufferAttributeNode } from './accessors/BufferAttributeNode.js';
|
|
48
48
|
export { default as BufferNode } from './accessors/BufferNode.js';
|
|
49
49
|
export { default as BuiltinNode } from './accessors/BuiltinNode.js';
|
|
50
50
|
export { default as ClippingNode } from './accessors/ClippingNode.js';
|
|
51
51
|
export { default as CubeTextureNode } from './accessors/CubeTextureNode.js';
|
|
52
|
-
export { default as InstanceNode } from './accessors/InstanceNode.js';
|
|
53
|
-
export { default as InstancedMeshNode } from './accessors/InstancedMeshNode.js';
|
|
54
52
|
export { default as MaterialNode } from './accessors/MaterialNode.js';
|
|
55
53
|
export { default as MaterialReferenceNode } from './accessors/MaterialReferenceNode.js';
|
|
56
54
|
export { default as ModelNode } from './accessors/ModelNode.js';
|
|
57
|
-
export { default as MorphNode } from './accessors/MorphNode.js';
|
|
58
55
|
export { default as Object3DNode } from './accessors/Object3DNode.js';
|
|
59
56
|
export { default as PointUVNode } from './accessors/PointUVNode.js';
|
|
60
57
|
export { default as ReferenceBaseNode } from './accessors/ReferenceBaseNode.js';
|
|
61
58
|
export { default as ReferenceNode } from './accessors/ReferenceNode.js';
|
|
62
59
|
export { default as RendererReferenceNode } from './accessors/RendererReferenceNode.js';
|
|
63
|
-
export { default as SkinningNode } from './accessors/SkinningNode.js';
|
|
64
60
|
export { default as StorageBufferNode } from './accessors/StorageBufferNode.js';
|
|
61
|
+
export { default as StorageTexture3DNode } from './accessors/StorageTexture3DNode.js';
|
|
65
62
|
export { default as StorageTextureNode } from './accessors/StorageTextureNode.js';
|
|
66
63
|
export { default as Texture3DNode } from './accessors/Texture3DNode.js';
|
|
67
64
|
export { default as TextureNode } from './accessors/TextureNode.js';
|
package/src/nodes/TSL.js
CHANGED
|
@@ -7,6 +7,7 @@ export * from './core/AttributeNode.js';
|
|
|
7
7
|
export * from './core/BypassNode.js';
|
|
8
8
|
export * from './core/IsolateNode.js';
|
|
9
9
|
export * from './core/ContextNode.js';
|
|
10
|
+
export * from './core/OverrideContextNode.js';
|
|
10
11
|
export * from './core/IndexNode.js';
|
|
11
12
|
export * from './core/ParameterNode.js';
|
|
12
13
|
export * from './core/PropertyNode.js';
|
|
@@ -63,14 +64,13 @@ export * from './accessors/BuiltinNode.js';
|
|
|
63
64
|
export * from './accessors/Camera.js';
|
|
64
65
|
export * from './accessors/VertexColorNode.js';
|
|
65
66
|
export * from './accessors/CubeTextureNode.js';
|
|
66
|
-
export * from './accessors/
|
|
67
|
-
export * from './accessors/
|
|
68
|
-
export * from './accessors/BatchNode.js';
|
|
67
|
+
export * from './accessors/Instance.js';
|
|
68
|
+
export * from './accessors/Batch.js';
|
|
69
69
|
export * from './accessors/MaterialNode.js';
|
|
70
70
|
export * from './accessors/MaterialProperties.js';
|
|
71
71
|
export * from './accessors/MaterialReferenceNode.js';
|
|
72
72
|
export * from './accessors/RendererReferenceNode.js';
|
|
73
|
-
export * from './accessors/
|
|
73
|
+
export * from './accessors/Morph.js';
|
|
74
74
|
export * from './accessors/TextureBicubic.js';
|
|
75
75
|
export * from './accessors/ModelNode.js';
|
|
76
76
|
export * from './accessors/ModelViewProjectionNode.js';
|
|
@@ -80,13 +80,14 @@ export * from './accessors/PointUVNode.js';
|
|
|
80
80
|
export * from './accessors/Position.js';
|
|
81
81
|
export * from './accessors/ReferenceNode.js';
|
|
82
82
|
export * from './accessors/ReflectVector.js';
|
|
83
|
-
export * from './accessors/
|
|
83
|
+
export * from './accessors/Skinning.js';
|
|
84
84
|
export * from './accessors/SceneProperties.js';
|
|
85
85
|
export * from './accessors/StorageBufferNode.js';
|
|
86
|
+
export * from './accessors/StorageTexture3DNode.js';
|
|
87
|
+
export * from './accessors/StorageTextureNode.js';
|
|
86
88
|
export * from './accessors/Tangent.js';
|
|
87
89
|
export * from './accessors/TextureNode.js';
|
|
88
90
|
export * from './accessors/TextureSizeNode.js';
|
|
89
|
-
export * from './accessors/StorageTextureNode.js';
|
|
90
91
|
export * from './accessors/Texture3DNode.js';
|
|
91
92
|
export * from './accessors/UV.js';
|
|
92
93
|
export * from './accessors/UserDataNode.js';
|
|
@@ -99,6 +100,7 @@ export * from './display/ColorAdjustment.js';
|
|
|
99
100
|
export * from './display/ColorSpaceNode.js';
|
|
100
101
|
export * from './display/FrontFacingNode.js';
|
|
101
102
|
export * from './display/NormalMapNode.js';
|
|
103
|
+
export * from './display/PremultiplyAlphaFunctions.js';
|
|
102
104
|
export * from './display/ToneMappingNode.js';
|
|
103
105
|
export * from './display/ScreenNode.js';
|
|
104
106
|
export * from './display/ViewportTextureNode.js';
|
|
@@ -16,9 +16,9 @@ export const attributeArray = ( count, type = 'float' ) => {
|
|
|
16
16
|
|
|
17
17
|
let itemSize, typedArray;
|
|
18
18
|
|
|
19
|
-
if ( type.
|
|
19
|
+
if ( type.isStructTypeNode === true ) {
|
|
20
20
|
|
|
21
|
-
itemSize = type.
|
|
21
|
+
itemSize = type.getLength();
|
|
22
22
|
typedArray = getTypedArrayFromType( 'float' );
|
|
23
23
|
|
|
24
24
|
} else {
|
|
@@ -48,9 +48,9 @@ export const instancedArray = ( count, type = 'float' ) => {
|
|
|
48
48
|
|
|
49
49
|
let itemSize, typedArray;
|
|
50
50
|
|
|
51
|
-
if ( type.
|
|
51
|
+
if ( type.isStructTypeNode === true ) {
|
|
52
52
|
|
|
53
|
-
itemSize = type.
|
|
53
|
+
itemSize = type.getLength();
|
|
54
54
|
typedArray = getTypedArrayFromType( 'float' );
|
|
55
55
|
|
|
56
56
|
} else {
|