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
|
@@ -14,6 +14,29 @@ const _weakMap = /*@__PURE__*/ new WeakMap();
|
|
|
14
14
|
*/
|
|
15
15
|
class Lighting {
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Constructs a new lighting manager.
|
|
19
|
+
*/
|
|
20
|
+
constructor() {
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Whether this lighting manager is enabled or not.
|
|
24
|
+
*
|
|
25
|
+
* @type {boolean}
|
|
26
|
+
* @default true
|
|
27
|
+
*/
|
|
28
|
+
this.enabled = true;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* A stack of light arrays saved per render via {@link Lighting#beginRender}.
|
|
32
|
+
*
|
|
33
|
+
* @private
|
|
34
|
+
* @type {Array<Array<Light>>}
|
|
35
|
+
*/
|
|
36
|
+
this._cache = [];
|
|
37
|
+
|
|
38
|
+
}
|
|
39
|
+
|
|
17
40
|
/**
|
|
18
41
|
* Creates a new lights node for the given array of lights.
|
|
19
42
|
*
|
|
@@ -27,17 +50,15 @@ class Lighting {
|
|
|
27
50
|
}
|
|
28
51
|
|
|
29
52
|
/**
|
|
30
|
-
* Returns a lights node for the given scene
|
|
53
|
+
* Returns a lights node for the given scene.
|
|
31
54
|
*
|
|
32
55
|
* @param {Scene} scene - The scene.
|
|
33
|
-
* @param {Camera} camera - The camera.
|
|
34
56
|
* @return {LightsNode} The lights node.
|
|
35
57
|
*/
|
|
36
58
|
getNode( scene ) {
|
|
37
59
|
|
|
38
|
-
//
|
|
39
|
-
|
|
40
|
-
if ( scene.isQuadMesh ) return _defaultLights;
|
|
60
|
+
// Ignore renderable objects, e.g: Mesh, Sprite, etc.
|
|
61
|
+
if ( scene.isScene !== true && scene.isGroup !== true ) return _defaultLights;
|
|
41
62
|
|
|
42
63
|
let node = _weakMap.get( scene );
|
|
43
64
|
|
|
@@ -52,6 +73,33 @@ class Lighting {
|
|
|
52
73
|
|
|
53
74
|
}
|
|
54
75
|
|
|
76
|
+
/**
|
|
77
|
+
* Saves the current lights of the scene's lights node so they can be restored
|
|
78
|
+
* in {@link Lighting#finishRender}. Must be paired with a `finishRender()` call
|
|
79
|
+
* to avoid memory leaks.
|
|
80
|
+
*
|
|
81
|
+
* Nested render calls might mutate the lights array so a save/restore is required
|
|
82
|
+
* for each render call.
|
|
83
|
+
*
|
|
84
|
+
* @param {Scene} scene - The scene.
|
|
85
|
+
*/
|
|
86
|
+
beginRender( scene ) {
|
|
87
|
+
|
|
88
|
+
this._cache.push( this.getNode( scene ).getLights() );
|
|
89
|
+
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Restores the lights saved by the matching {@link Lighting#beginRender} call.
|
|
94
|
+
*
|
|
95
|
+
* @param {Scene} scene - The scene.
|
|
96
|
+
*/
|
|
97
|
+
finishRender( scene ) {
|
|
98
|
+
|
|
99
|
+
this.getNode( scene ).setLights( this._cache.pop() );
|
|
100
|
+
|
|
101
|
+
}
|
|
102
|
+
|
|
55
103
|
}
|
|
56
104
|
|
|
57
105
|
export default Lighting;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { DoubleSide } from '../../constants.js';
|
|
2
2
|
|
|
3
|
+
const _emptyArray = /*@__PURE__*/ Object.freeze( [] );
|
|
4
|
+
|
|
3
5
|
/**
|
|
4
6
|
* Default sorting function for opaque render items.
|
|
5
7
|
*
|
|
@@ -144,6 +146,13 @@ class RenderList {
|
|
|
144
146
|
*/
|
|
145
147
|
this.bundles = [];
|
|
146
148
|
|
|
149
|
+
/**
|
|
150
|
+
* The lighting management component.
|
|
151
|
+
*
|
|
152
|
+
* @type {Lighting}
|
|
153
|
+
*/
|
|
154
|
+
this.lighting = lighting;
|
|
155
|
+
|
|
147
156
|
/**
|
|
148
157
|
* The render list's lights node. This node is later
|
|
149
158
|
* relevant for the actual analytical light nodes which
|
|
@@ -151,7 +160,7 @@ class RenderList {
|
|
|
151
160
|
*
|
|
152
161
|
* @type {LightsNode}
|
|
153
162
|
*/
|
|
154
|
-
this.lightsNode = lighting.getNode( scene
|
|
163
|
+
this.lightsNode = lighting.getNode( scene );
|
|
155
164
|
|
|
156
165
|
/**
|
|
157
166
|
* The scene's lights stored in an array. This array
|
|
@@ -183,6 +192,18 @@ class RenderList {
|
|
|
183
192
|
*/
|
|
184
193
|
this.occlusionQueryCount = 0;
|
|
185
194
|
|
|
195
|
+
/**
|
|
196
|
+
* The last object that was counted for occlusion query testing. Used to
|
|
197
|
+
* avoid counting an object more than once when it produces multiple render
|
|
198
|
+
* items (e.g. a mesh with multiple material groups), since such an object
|
|
199
|
+
* is covered by a single occlusion query.
|
|
200
|
+
*
|
|
201
|
+
* @private
|
|
202
|
+
* @type {?Object3D}
|
|
203
|
+
* @default null
|
|
204
|
+
*/
|
|
205
|
+
this._lastOcclusionObject = null;
|
|
206
|
+
|
|
186
207
|
}
|
|
187
208
|
|
|
188
209
|
/**
|
|
@@ -281,7 +302,12 @@ class RenderList {
|
|
|
281
302
|
|
|
282
303
|
const renderItem = this.getNextRenderItem( object, geometry, material, groupOrder, z, group, clippingContext );
|
|
283
304
|
|
|
284
|
-
if ( object.occlusionTest === true
|
|
305
|
+
if ( object.occlusionTest === true && this._lastOcclusionObject !== object ) {
|
|
306
|
+
|
|
307
|
+
this.occlusionQueryCount ++;
|
|
308
|
+
this._lastOcclusionObject = object;
|
|
309
|
+
|
|
310
|
+
}
|
|
285
311
|
|
|
286
312
|
if ( material.transparent === true || material.transmission > 0 ||
|
|
287
313
|
( material.transmissionNode && material.transmissionNode.isNode ) ||
|
|
@@ -358,13 +384,22 @@ class RenderList {
|
|
|
358
384
|
*
|
|
359
385
|
* @param {?function(any, any): number} customOpaqueSort - A custom sort function for opaque objects.
|
|
360
386
|
* @param {?function(any, any): number} customTransparentSort - A custom sort function for transparent objects.
|
|
387
|
+
* @param {boolean} reversedDepth - Whether a reversed depth buffer is used or not.
|
|
361
388
|
*/
|
|
362
|
-
sort( customOpaqueSort, customTransparentSort ) {
|
|
389
|
+
sort( customOpaqueSort, customTransparentSort, reversedDepth ) {
|
|
363
390
|
|
|
364
391
|
if ( this.opaque.length > 1 ) this.opaque.sort( customOpaqueSort || painterSortStable );
|
|
365
392
|
if ( this.transparentDoublePass.length > 1 ) this.transparentDoublePass.sort( customTransparentSort || reversePainterSortStable );
|
|
366
393
|
if ( this.transparent.length > 1 ) this.transparent.sort( customTransparentSort || reversePainterSortStable );
|
|
367
394
|
|
|
395
|
+
if ( reversedDepth ) {
|
|
396
|
+
|
|
397
|
+
this.opaque.reverse();
|
|
398
|
+
this.transparentDoublePass.reverse();
|
|
399
|
+
this.transparent.reverse();
|
|
400
|
+
|
|
401
|
+
}
|
|
402
|
+
|
|
368
403
|
}
|
|
369
404
|
|
|
370
405
|
/**
|
|
@@ -375,7 +410,7 @@ class RenderList {
|
|
|
375
410
|
|
|
376
411
|
// update lights
|
|
377
412
|
|
|
378
|
-
this.lightsNode.setLights( this.lightsArray );
|
|
413
|
+
this.lightsNode.setLights( this.lighting.enabled ? this.lightsArray : _emptyArray );
|
|
379
414
|
|
|
380
415
|
// Clear references from inactive renderItems in the list
|
|
381
416
|
|
|
@@ -397,6 +432,8 @@ class RenderList {
|
|
|
397
432
|
|
|
398
433
|
}
|
|
399
434
|
|
|
435
|
+
this._lastOcclusionObject = null;
|
|
436
|
+
|
|
400
437
|
}
|
|
401
438
|
|
|
402
439
|
}
|
|
@@ -1,37 +1,45 @@
|
|
|
1
1
|
import { hash, hashString } from '../../nodes/core/NodeUtils.js';
|
|
2
2
|
|
|
3
3
|
let _id = 0;
|
|
4
|
+
const _protoKeysCache = new WeakMap();
|
|
4
5
|
|
|
5
6
|
function getKeys( obj ) {
|
|
6
7
|
|
|
7
8
|
const keys = Object.keys( obj );
|
|
8
9
|
|
|
9
|
-
let
|
|
10
|
+
let protoKeys = _protoKeysCache.get( obj.constructor );
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
if ( protoKeys === undefined ) {
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
protoKeys = [];
|
|
15
|
+
let proto = Object.getPrototypeOf( obj );
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
while ( proto ) {
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
const descriptors = Object.getOwnPropertyDescriptors( proto );
|
|
20
|
+
|
|
21
|
+
for ( const key in descriptors ) {
|
|
18
22
|
|
|
19
23
|
const descriptor = descriptors[ key ];
|
|
20
24
|
|
|
21
25
|
if ( descriptor && typeof descriptor.get === 'function' ) {
|
|
22
26
|
|
|
23
|
-
|
|
27
|
+
protoKeys.push( key );
|
|
24
28
|
|
|
25
29
|
}
|
|
26
30
|
|
|
27
31
|
}
|
|
28
32
|
|
|
33
|
+
proto = Object.getPrototypeOf( proto );
|
|
34
|
+
|
|
29
35
|
}
|
|
30
36
|
|
|
31
|
-
|
|
37
|
+
_protoKeysCache.set( obj.constructor, protoKeys );
|
|
32
38
|
|
|
33
39
|
}
|
|
34
40
|
|
|
41
|
+
for ( let i = 0; i < protoKeys.length; i ++ ) keys.push( protoKeys[ i ] );
|
|
42
|
+
|
|
35
43
|
return keys;
|
|
36
44
|
|
|
37
45
|
}
|
|
@@ -281,6 +289,16 @@ class RenderObject {
|
|
|
281
289
|
*/
|
|
282
290
|
this._monitor = null;
|
|
283
291
|
|
|
292
|
+
/**
|
|
293
|
+
* The object's original material when this render object is drawn with an
|
|
294
|
+
* override material.
|
|
295
|
+
*
|
|
296
|
+
* @type {?Material}
|
|
297
|
+
* @private
|
|
298
|
+
* @default null
|
|
299
|
+
*/
|
|
300
|
+
this._sourceMaterial = renderer._currentSourceMaterial;
|
|
301
|
+
|
|
284
302
|
/**
|
|
285
303
|
* An event listener which is defined by `RenderObjects`. It performs
|
|
286
304
|
* clean up tasks when `dispose()` on this render object.
|
|
@@ -328,6 +346,12 @@ class RenderObject {
|
|
|
328
346
|
this.material.addEventListener( 'dispose', this.onMaterialDispose );
|
|
329
347
|
this.geometry.addEventListener( 'dispose', this.onGeometryDispose );
|
|
330
348
|
|
|
349
|
+
if ( this._sourceMaterial !== null ) {
|
|
350
|
+
|
|
351
|
+
this._sourceMaterial.addEventListener( 'dispose', this.onMaterialDispose );
|
|
352
|
+
|
|
353
|
+
}
|
|
354
|
+
|
|
331
355
|
}
|
|
332
356
|
|
|
333
357
|
/**
|
|
@@ -365,7 +389,7 @@ class RenderObject {
|
|
|
365
389
|
*/
|
|
366
390
|
get hardwareClippingPlanes() {
|
|
367
391
|
|
|
368
|
-
return this.
|
|
392
|
+
return this.getNodeBuilderState().hardwareClipping === true ? this.clippingContext.unionClippingCount : 0;
|
|
369
393
|
|
|
370
394
|
}
|
|
371
395
|
|
|
@@ -511,7 +535,20 @@ class RenderObject {
|
|
|
511
535
|
|
|
512
536
|
// geometry attribute
|
|
513
537
|
attribute = geometry.getAttribute( nodeAttribute.name );
|
|
514
|
-
|
|
538
|
+
|
|
539
|
+
if ( attribute !== undefined ) {
|
|
540
|
+
|
|
541
|
+
if ( attribute.isInterleavedBufferAttribute ) {
|
|
542
|
+
|
|
543
|
+
attributesId[ nodeAttribute.name ] = attribute.data.uuid;
|
|
544
|
+
|
|
545
|
+
} else {
|
|
546
|
+
|
|
547
|
+
attributesId[ nodeAttribute.name ] = attribute.id;
|
|
548
|
+
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
}
|
|
515
552
|
|
|
516
553
|
}
|
|
517
554
|
|
|
@@ -655,7 +692,7 @@ class RenderObject {
|
|
|
655
692
|
|
|
656
693
|
// structural equality isn't sufficient for morph targets since the
|
|
657
694
|
// data are maintained in textures. only if the targets are all equal
|
|
658
|
-
// the texture and thus the
|
|
695
|
+
// the texture and thus the `morphReference` can be shared.
|
|
659
696
|
|
|
660
697
|
for ( const name of Object.keys( geometry.morphAttributes ).sort() ) {
|
|
661
698
|
|
|
@@ -712,7 +749,20 @@ class RenderObject {
|
|
|
712
749
|
|
|
713
750
|
if ( type === 'number' ) {
|
|
714
751
|
|
|
715
|
-
|
|
752
|
+
if ( property === 'side' ) {
|
|
753
|
+
|
|
754
|
+
// `side` is an enum (FrontSide/BackSide/DoubleSide) that changes code
|
|
755
|
+
// generation, so its exact value must be preserved.
|
|
756
|
+
|
|
757
|
+
valueKey = String( value );
|
|
758
|
+
|
|
759
|
+
} else {
|
|
760
|
+
|
|
761
|
+
// Other numbers are reduced to on/off
|
|
762
|
+
|
|
763
|
+
valueKey = value !== 0 ? '1' : '0';
|
|
764
|
+
|
|
765
|
+
}
|
|
716
766
|
|
|
717
767
|
} else if ( type === 'object' ) {
|
|
718
768
|
|
|
@@ -780,7 +830,7 @@ class RenderObject {
|
|
|
780
830
|
|
|
781
831
|
}
|
|
782
832
|
|
|
783
|
-
if ( object.isInstancedMesh || object.count > 1
|
|
833
|
+
if ( object.isInstancedMesh || object.count > 1 ) {
|
|
784
834
|
|
|
785
835
|
// TODO: https://github.com/mrdoob/three.js/pull/29066#issuecomment-2269400850
|
|
786
836
|
|
|
@@ -814,7 +864,11 @@ class RenderObject {
|
|
|
814
864
|
|
|
815
865
|
const attribute = this.geometry.getAttribute( name );
|
|
816
866
|
|
|
817
|
-
if ( attribute === undefined
|
|
867
|
+
if ( attribute === undefined ) return true;
|
|
868
|
+
|
|
869
|
+
const id = attribute.isInterleavedBufferAttribute ? attribute.data.uuid : attribute.id;
|
|
870
|
+
|
|
871
|
+
if ( attributesId[ name ] !== id ) {
|
|
818
872
|
|
|
819
873
|
return true;
|
|
820
874
|
|
|
@@ -906,6 +960,12 @@ class RenderObject {
|
|
|
906
960
|
this.material.removeEventListener( 'dispose', this.onMaterialDispose );
|
|
907
961
|
this.geometry.removeEventListener( 'dispose', this.onGeometryDispose );
|
|
908
962
|
|
|
963
|
+
if ( this._sourceMaterial !== null ) {
|
|
964
|
+
|
|
965
|
+
this._sourceMaterial.removeEventListener( 'dispose', this.onMaterialDispose );
|
|
966
|
+
|
|
967
|
+
}
|
|
968
|
+
|
|
909
969
|
this.onDispose();
|
|
910
970
|
|
|
911
971
|
}
|