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
|
@@ -276,7 +276,7 @@ class EXRLoader extends DataTextureLoader {
|
|
|
276
276
|
|
|
277
277
|
if ( p.value - inOffset.value > ni ) {
|
|
278
278
|
|
|
279
|
-
throw new Error( 'Something wrong with hufUnpackEncTable' );
|
|
279
|
+
throw new Error( 'THREE.EXRLoader: Something wrong with hufUnpackEncTable' );
|
|
280
280
|
|
|
281
281
|
}
|
|
282
282
|
|
|
@@ -288,7 +288,7 @@ class EXRLoader extends DataTextureLoader {
|
|
|
288
288
|
|
|
289
289
|
if ( im + zerun > iM + 1 ) {
|
|
290
290
|
|
|
291
|
-
throw new Error( 'Something wrong with hufUnpackEncTable' );
|
|
291
|
+
throw new Error( 'THREE.EXRLoader: Something wrong with hufUnpackEncTable' );
|
|
292
292
|
|
|
293
293
|
}
|
|
294
294
|
|
|
@@ -302,7 +302,7 @@ class EXRLoader extends DataTextureLoader {
|
|
|
302
302
|
|
|
303
303
|
if ( im + zerun > iM + 1 ) {
|
|
304
304
|
|
|
305
|
-
throw new Error( 'Something wrong with hufUnpackEncTable' );
|
|
305
|
+
throw new Error( 'THREE.EXRLoader: Something wrong with hufUnpackEncTable' );
|
|
306
306
|
|
|
307
307
|
}
|
|
308
308
|
|
|
@@ -339,7 +339,7 @@ class EXRLoader extends DataTextureLoader {
|
|
|
339
339
|
|
|
340
340
|
if ( c >> l ) {
|
|
341
341
|
|
|
342
|
-
throw new Error( 'Invalid table entry' );
|
|
342
|
+
throw new Error( 'THREE.EXRLoader: Invalid table entry' );
|
|
343
343
|
|
|
344
344
|
}
|
|
345
345
|
|
|
@@ -349,7 +349,7 @@ class EXRLoader extends DataTextureLoader {
|
|
|
349
349
|
|
|
350
350
|
if ( pl.len ) {
|
|
351
351
|
|
|
352
|
-
throw new Error( 'Invalid table entry' );
|
|
352
|
+
throw new Error( 'THREE.EXRLoader: Invalid table entry' );
|
|
353
353
|
|
|
354
354
|
}
|
|
355
355
|
|
|
@@ -384,7 +384,7 @@ class EXRLoader extends DataTextureLoader {
|
|
|
384
384
|
|
|
385
385
|
if ( pl.len || pl.p ) {
|
|
386
386
|
|
|
387
|
-
throw new Error( 'Invalid table entry' );
|
|
387
|
+
throw new Error( 'THREE.EXRLoader: Invalid table entry' );
|
|
388
388
|
|
|
389
389
|
}
|
|
390
390
|
|
|
@@ -673,7 +673,7 @@ class EXRLoader extends DataTextureLoader {
|
|
|
673
673
|
|
|
674
674
|
if ( ! pl.p ) {
|
|
675
675
|
|
|
676
|
-
throw new Error( 'hufDecode issues' );
|
|
676
|
+
throw new Error( 'THREE.EXRLoader: hufDecode issues' );
|
|
677
677
|
|
|
678
678
|
}
|
|
679
679
|
|
|
@@ -713,7 +713,7 @@ class EXRLoader extends DataTextureLoader {
|
|
|
713
713
|
|
|
714
714
|
if ( j == pl.lit ) {
|
|
715
715
|
|
|
716
|
-
throw new Error( 'hufDecode issues' );
|
|
716
|
+
throw new Error( 'THREE.EXRLoader: hufDecode issues' );
|
|
717
717
|
|
|
718
718
|
}
|
|
719
719
|
|
|
@@ -743,7 +743,7 @@ class EXRLoader extends DataTextureLoader {
|
|
|
743
743
|
|
|
744
744
|
} else {
|
|
745
745
|
|
|
746
|
-
throw new Error( 'hufDecode issues' );
|
|
746
|
+
throw new Error( 'THREE.EXRLoader: hufDecode issues' );
|
|
747
747
|
|
|
748
748
|
}
|
|
749
749
|
|
|
@@ -769,7 +769,7 @@ class EXRLoader extends DataTextureLoader {
|
|
|
769
769
|
|
|
770
770
|
if ( im < 0 || im >= HUF_ENCSIZE || iM < 0 || iM >= HUF_ENCSIZE ) {
|
|
771
771
|
|
|
772
|
-
throw new Error( 'Something wrong with HUF_ENCSIZE' );
|
|
772
|
+
throw new Error( 'THREE.EXRLoader: Something wrong with HUF_ENCSIZE' );
|
|
773
773
|
|
|
774
774
|
}
|
|
775
775
|
|
|
@@ -784,7 +784,7 @@ class EXRLoader extends DataTextureLoader {
|
|
|
784
784
|
|
|
785
785
|
if ( nBits > 8 * ( nCompressed - ( inOffset.value - initialInOffset ) ) ) {
|
|
786
786
|
|
|
787
|
-
throw new Error( 'Something wrong with hufUncompress' );
|
|
787
|
+
throw new Error( 'THREE.EXRLoader: Something wrong with hufUncompress' );
|
|
788
788
|
|
|
789
789
|
}
|
|
790
790
|
|
|
@@ -1415,7 +1415,7 @@ class EXRLoader extends DataTextureLoader {
|
|
|
1415
1415
|
|
|
1416
1416
|
if ( maxNonZero >= BITMAP_SIZE ) {
|
|
1417
1417
|
|
|
1418
|
-
throw new Error( 'Something is wrong with PIZ_COMPRESSION BITMAP_SIZE' );
|
|
1418
|
+
throw new Error( 'THREE.EXRLoader: Something is wrong with PIZ_COMPRESSION BITMAP_SIZE' );
|
|
1419
1419
|
|
|
1420
1420
|
}
|
|
1421
1421
|
|
|
@@ -1781,7 +1781,7 @@ class EXRLoader extends DataTextureLoader {
|
|
|
1781
1781
|
};
|
|
1782
1782
|
|
|
1783
1783
|
if ( dwaHeader.version < 2 )
|
|
1784
|
-
throw new Error( 'EXRLoader
|
|
1784
|
+
throw new Error( 'THREE.EXRLoader: ' + EXRHeader.compression + ' version ' + dwaHeader.version + ' is unsupported' );
|
|
1785
1785
|
|
|
1786
1786
|
// Read channel ruleset information
|
|
1787
1787
|
const channelRules = new Array();
|
|
@@ -1979,7 +1979,7 @@ class EXRLoader extends DataTextureLoader {
|
|
|
1979
1979
|
break;
|
|
1980
1980
|
|
|
1981
1981
|
default:
|
|
1982
|
-
throw new Error( 'EXRLoader
|
|
1982
|
+
throw new Error( 'THREE.EXRLoader: unsupported channel compression' );
|
|
1983
1983
|
|
|
1984
1984
|
}
|
|
1985
1985
|
|
|
@@ -2485,11 +2485,9 @@ class EXRLoader extends DataTextureLoader {
|
|
|
2485
2485
|
|
|
2486
2486
|
offset.value += EXRDecoder.size;
|
|
2487
2487
|
|
|
2488
|
-
for ( let line_y = 0; line_y < EXRDecoder.
|
|
2488
|
+
for ( let line_y = 0; line_y < EXRDecoder.lines; line_y ++ ) {
|
|
2489
2489
|
|
|
2490
|
-
const
|
|
2491
|
-
const true_y = line_y + EXRDecoder.scanOrder( scan_y );
|
|
2492
|
-
if ( true_y >= EXRDecoder.height ) continue;
|
|
2490
|
+
const true_y = line + line_y;
|
|
2493
2491
|
|
|
2494
2492
|
const lineOffset = line_y * bytesPerLine;
|
|
2495
2493
|
const outLineOffset = ( EXRDecoder.height - 1 - true_y ) * EXRDecoder.outLineWidth;
|
|
@@ -2543,10 +2541,9 @@ class EXRLoader extends DataTextureLoader {
|
|
|
2543
2541
|
const viewer = isCompressed ? EXRDecoder.uncompress( EXRDecoder ) : uncompressRAW( EXRDecoder );
|
|
2544
2542
|
EXRDecoder.offset = savedOffset;
|
|
2545
2543
|
|
|
2546
|
-
for ( let line_y = 0; line_y < EXRDecoder.
|
|
2544
|
+
for ( let line_y = 0; line_y < EXRDecoder.lines; line_y ++ ) {
|
|
2547
2545
|
|
|
2548
|
-
const true_y =
|
|
2549
|
-
if ( true_y >= EXRDecoder.height ) continue;
|
|
2546
|
+
const true_y = line + line_y;
|
|
2550
2547
|
|
|
2551
2548
|
const lineOffset = line_y * bytesPerLine;
|
|
2552
2549
|
const outLineOffset = ( EXRDecoder.height - 1 - true_y ) * EXRDecoder.outLineWidth;
|
|
@@ -2608,7 +2605,7 @@ class EXRLoader extends DataTextureLoader {
|
|
|
2608
2605
|
}
|
|
2609
2606
|
|
|
2610
2607
|
default:
|
|
2611
|
-
throw new Error( 'EXRLoader
|
|
2608
|
+
throw new Error( 'THREE.EXRLoader: ' + compression + ' is unsupported for deep data' );
|
|
2612
2609
|
|
|
2613
2610
|
}
|
|
2614
2611
|
|
|
@@ -2888,7 +2885,6 @@ class EXRLoader extends DataTextureLoader {
|
|
|
2888
2885
|
channelByteOffsets: {},
|
|
2889
2886
|
shouldExpand: false,
|
|
2890
2887
|
yCbCr: false,
|
|
2891
|
-
scanOrder: null,
|
|
2892
2888
|
totalBytes: null,
|
|
2893
2889
|
columns: null,
|
|
2894
2890
|
lines: null,
|
|
@@ -2948,7 +2944,7 @@ class EXRLoader extends DataTextureLoader {
|
|
|
2948
2944
|
break;
|
|
2949
2945
|
|
|
2950
2946
|
default:
|
|
2951
|
-
throw new Error( 'EXRLoader
|
|
2947
|
+
throw new Error( 'THREE.EXRLoader: ' + EXRHeader.compression + ' is unsupported' );
|
|
2952
2948
|
|
|
2953
2949
|
}
|
|
2954
2950
|
|
|
@@ -2991,7 +2987,7 @@ class EXRLoader extends DataTextureLoader {
|
|
|
2991
2987
|
|
|
2992
2988
|
} else {
|
|
2993
2989
|
|
|
2994
|
-
throw new Error( 'EXRLoader
|
|
2990
|
+
throw new Error( 'THREE.EXRLoader: file contains unsupported data channels.' );
|
|
2995
2991
|
|
|
2996
2992
|
}
|
|
2997
2993
|
|
|
@@ -3070,7 +3066,7 @@ class EXRLoader extends DataTextureLoader {
|
|
|
3070
3066
|
|
|
3071
3067
|
}
|
|
3072
3068
|
|
|
3073
|
-
if ( invalidOutput ) throw new Error( 'EXRLoader
|
|
3069
|
+
if ( invalidOutput ) throw new Error( 'THREE.EXRLoader: invalid output format for specified file.' );
|
|
3074
3070
|
|
|
3075
3071
|
// Luminance/chroma images always decode to RGBA; override whatever the output-format switch selected.
|
|
3076
3072
|
if ( EXRDecoder.yCbCr ) {
|
|
@@ -3113,7 +3109,7 @@ class EXRLoader extends DataTextureLoader {
|
|
|
3113
3109
|
|
|
3114
3110
|
} else {
|
|
3115
3111
|
|
|
3116
|
-
throw new Error( 'EXRLoader
|
|
3112
|
+
throw new Error( 'THREE.EXRLoader: unsupported pixelType ' + EXRDecoder.type + ' for ' + EXRHeader.compression + '.' );
|
|
3117
3113
|
|
|
3118
3114
|
}
|
|
3119
3115
|
|
|
@@ -3161,16 +3157,6 @@ class EXRLoader extends DataTextureLoader {
|
|
|
3161
3157
|
EXRDecoder.totalBytes = byteOffset;
|
|
3162
3158
|
EXRDecoder.outLineWidth = EXRDecoder.width * EXRDecoder.outputChannels;
|
|
3163
3159
|
|
|
3164
|
-
if ( EXRHeader.lineOrder === 'INCREASING_Y' ) {
|
|
3165
|
-
|
|
3166
|
-
EXRDecoder.scanOrder = ( y ) => y;
|
|
3167
|
-
|
|
3168
|
-
} else {
|
|
3169
|
-
|
|
3170
|
-
EXRDecoder.scanOrder = ( y ) => EXRDecoder.height - 1 - y;
|
|
3171
|
-
|
|
3172
|
-
}
|
|
3173
|
-
|
|
3174
3160
|
if ( EXRHeader.spec.deepFormat ) {
|
|
3175
3161
|
|
|
3176
3162
|
// Deep format: offset tables are already parsed in the main flow.
|
|
@@ -3357,6 +3343,10 @@ class EXRLoader extends DataTextureLoader {
|
|
|
3357
3343
|
format: EXRDecoder.format,
|
|
3358
3344
|
colorSpace: EXRDecoder.colorSpace,
|
|
3359
3345
|
type: this.type,
|
|
3346
|
+
minFilter: LinearFilter,
|
|
3347
|
+
magFilter: LinearFilter,
|
|
3348
|
+
generateMipmaps: false,
|
|
3349
|
+
flipY: false,
|
|
3360
3350
|
};
|
|
3361
3351
|
|
|
3362
3352
|
}
|
|
@@ -3400,24 +3390,6 @@ class EXRLoader extends DataTextureLoader {
|
|
|
3400
3390
|
|
|
3401
3391
|
}
|
|
3402
3392
|
|
|
3403
|
-
load( url, onLoad, onProgress, onError ) {
|
|
3404
|
-
|
|
3405
|
-
function onLoadCallback( texture, texData ) {
|
|
3406
|
-
|
|
3407
|
-
texture.colorSpace = texData.colorSpace;
|
|
3408
|
-
texture.minFilter = LinearFilter;
|
|
3409
|
-
texture.magFilter = LinearFilter;
|
|
3410
|
-
texture.generateMipmaps = false;
|
|
3411
|
-
texture.flipY = false;
|
|
3412
|
-
|
|
3413
|
-
if ( onLoad ) onLoad( texture, texData );
|
|
3414
|
-
|
|
3415
|
-
}
|
|
3416
|
-
|
|
3417
|
-
return super.load( url, onLoadCallback, onProgress, onError );
|
|
3418
|
-
|
|
3419
|
-
}
|
|
3420
|
-
|
|
3421
3393
|
}
|
|
3422
3394
|
|
|
3423
3395
|
export { EXRLoader };
|
|
@@ -433,7 +433,12 @@ class HDRLoader extends DataTextureLoader {
|
|
|
433
433
|
header: rgbe_header_info.string,
|
|
434
434
|
gamma: rgbe_header_info.gamma,
|
|
435
435
|
exposure: rgbe_header_info.exposure,
|
|
436
|
-
type: type
|
|
436
|
+
type: type,
|
|
437
|
+
colorSpace: LinearSRGBColorSpace,
|
|
438
|
+
minFilter: LinearFilter,
|
|
439
|
+
magFilter: LinearFilter,
|
|
440
|
+
generateMipmaps: false,
|
|
441
|
+
flipY: true
|
|
437
442
|
};
|
|
438
443
|
|
|
439
444
|
}
|
|
@@ -451,33 +456,6 @@ class HDRLoader extends DataTextureLoader {
|
|
|
451
456
|
|
|
452
457
|
}
|
|
453
458
|
|
|
454
|
-
load( url, onLoad, onProgress, onError ) {
|
|
455
|
-
|
|
456
|
-
function onLoadCallback( texture, texData ) {
|
|
457
|
-
|
|
458
|
-
switch ( texture.type ) {
|
|
459
|
-
|
|
460
|
-
case FloatType:
|
|
461
|
-
case HalfFloatType:
|
|
462
|
-
|
|
463
|
-
texture.colorSpace = LinearSRGBColorSpace;
|
|
464
|
-
texture.minFilter = LinearFilter;
|
|
465
|
-
texture.magFilter = LinearFilter;
|
|
466
|
-
texture.generateMipmaps = false;
|
|
467
|
-
texture.flipY = true;
|
|
468
|
-
|
|
469
|
-
break;
|
|
470
|
-
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
if ( onLoad ) onLoad( texture, texData );
|
|
474
|
-
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
return super.load( url, onLoadCallback, onProgress, onError );
|
|
478
|
-
|
|
479
|
-
}
|
|
480
|
-
|
|
481
459
|
}
|
|
482
460
|
|
|
483
461
|
export { HDRLoader };
|
|
@@ -103,6 +103,9 @@ import {
|
|
|
103
103
|
import { ZSTDDecoder } from '../libs/zstddec.module.js';
|
|
104
104
|
import { DisplayP3ColorSpace, LinearDisplayP3ColorSpace } from '../math/ColorSpaces.js';
|
|
105
105
|
|
|
106
|
+
const WASM_BIN_URL = new URL( '../libs/basis/basis_transcoder.wasm', import.meta.url ).toString();
|
|
107
|
+
const WASM_JS_URL = new URL( '../libs/basis/basis_transcoder.js', import.meta.url ).toString();
|
|
108
|
+
|
|
106
109
|
const _taskCache = new WeakMap();
|
|
107
110
|
|
|
108
111
|
let _activeLoaders = 0;
|
|
@@ -169,9 +172,9 @@ class KTX2Loader extends Loader {
|
|
|
169
172
|
}
|
|
170
173
|
|
|
171
174
|
/**
|
|
172
|
-
* Sets the transcoder path.
|
|
175
|
+
* Sets the transcoder path to optionally set the decoder load path from a CDN.
|
|
173
176
|
*
|
|
174
|
-
* The WASM transcoder and JS wrapper are
|
|
177
|
+
* By default The WASM transcoder and JS wrapper are loaded from the `examples/jsm/libs/basis` directory.
|
|
175
178
|
*
|
|
176
179
|
* @param {string} path - The transcoder path to set.
|
|
177
180
|
* @return {KTX2Loader} A reference to this loader.
|
|
@@ -254,16 +257,17 @@ class KTX2Loader extends Loader {
|
|
|
254
257
|
|
|
255
258
|
if ( typeof navigator !== 'undefined' &&
|
|
256
259
|
typeof navigator.platform !== 'undefined' && typeof navigator.userAgent !== 'undefined' &&
|
|
257
|
-
navigator.platform.indexOf( 'Linux' ) >= 0 && navigator.userAgent.indexOf( '
|
|
260
|
+
navigator.platform.indexOf( 'Linux' ) >= 0 && navigator.userAgent.indexOf( 'Android' ) < 0 &&
|
|
258
261
|
this.workerConfig.astcSupported && this.workerConfig.etc2Supported &&
|
|
259
262
|
this.workerConfig.bptcSupported && this.workerConfig.dxtSupported ) {
|
|
260
263
|
|
|
261
|
-
// On Linux, Mesa drivers for AMD and Intel GPUs expose ETC2 and ASTC even though the hardware doesn't support these.
|
|
264
|
+
// On Linux, Mesa drivers for AMD and Intel GPUs expose ETC1,ETC2 and ASTC even though the hardware doesn't support these.
|
|
262
265
|
// Using these extensions will result in expensive software decompression on the main thread inside the driver, causing performance issues.
|
|
263
|
-
//
|
|
266
|
+
// In general, browsers should not expose extensions for emulated formats, but Chrome and Firefox currently do so on Linux.
|
|
264
267
|
// Since a granular filter is a little too fragile and we can transcode into other GPU formats, disable formats that are likely to be emulated.
|
|
265
268
|
|
|
266
269
|
this.workerConfig.astcSupported = false;
|
|
270
|
+
this.workerConfig.etc1Supported = false;
|
|
267
271
|
this.workerConfig.etc2Supported = false;
|
|
268
272
|
|
|
269
273
|
}
|
|
@@ -280,18 +284,30 @@ class KTX2Loader extends Loader {
|
|
|
280
284
|
|
|
281
285
|
if ( ! this.transcoderPending ) {
|
|
282
286
|
|
|
283
|
-
// Load transcoder wrapper.
|
|
284
287
|
const jsLoader = new FileLoader( this.manager );
|
|
285
|
-
jsLoader.setPath( this.transcoderPath );
|
|
286
288
|
jsLoader.setWithCredentials( this.withCredentials );
|
|
287
|
-
const jsContent = jsLoader.loadAsync( 'basis_transcoder.js' );
|
|
288
289
|
|
|
289
|
-
// Load transcoder WASM binary.
|
|
290
290
|
const binaryLoader = new FileLoader( this.manager );
|
|
291
|
-
binaryLoader.setPath( this.transcoderPath );
|
|
292
|
-
binaryLoader.setResponseType( 'arraybuffer' );
|
|
293
291
|
binaryLoader.setWithCredentials( this.withCredentials );
|
|
294
|
-
|
|
292
|
+
binaryLoader.setResponseType( 'arraybuffer' );
|
|
293
|
+
|
|
294
|
+
let jsContent, binaryContent;
|
|
295
|
+
if ( this.transcoderPath === '' ) {
|
|
296
|
+
|
|
297
|
+
jsContent = jsLoader.loadAsync( WASM_JS_URL );
|
|
298
|
+
binaryContent = binaryLoader.loadAsync( WASM_BIN_URL );
|
|
299
|
+
|
|
300
|
+
} else {
|
|
301
|
+
|
|
302
|
+
// Load transcoder wrapper.
|
|
303
|
+
jsLoader.setPath( this.transcoderPath );
|
|
304
|
+
jsContent = jsLoader.loadAsync( 'basis_transcoder.js' );
|
|
305
|
+
|
|
306
|
+
// Load transcoder WASM binary.
|
|
307
|
+
binaryLoader.setPath( this.transcoderPath );
|
|
308
|
+
binaryContent = binaryLoader.loadAsync( 'basis_transcoder.wasm' );
|
|
309
|
+
|
|
310
|
+
}
|
|
295
311
|
|
|
296
312
|
this.transcoderPending = Promise.all( [ jsContent, binaryContent ] )
|
|
297
313
|
.then( ( [ jsContent, binaryContent ] ) => {
|
|
@@ -956,6 +972,8 @@ KTX2Loader.BasisWorker = function () {
|
|
|
956
972
|
|
|
957
973
|
const UNCOMPRESSED_FORMATS = new Set( [ RGBAFormat, RGBFormat, RGFormat, RedFormat ] );
|
|
958
974
|
|
|
975
|
+
const NORMALIZED_VK_FORMATS = new Set( [ VK_FORMAT_R16G16B16A16_UNORM ] );
|
|
976
|
+
|
|
959
977
|
const FORMAT_MAP = {
|
|
960
978
|
|
|
961
979
|
[ VK_FORMAT_R32G32B32A32_SFLOAT ]: RGBAFormat,
|
|
@@ -1205,6 +1223,7 @@ async function createRawTexture( container ) {
|
|
|
1205
1223
|
texture.minFilter = useMipmaps ? NearestMipmapNearestFilter : NearestFilter;
|
|
1206
1224
|
texture.magFilter = NearestFilter;
|
|
1207
1225
|
texture.generateMipmaps = container.levelCount === 0;
|
|
1226
|
+
texture.normalized = NORMALIZED_VK_FORMATS.has( vkFormat );
|
|
1208
1227
|
|
|
1209
1228
|
} else {
|
|
1210
1229
|
|
|
@@ -644,7 +644,7 @@ class LDrawParsedCache {
|
|
|
644
644
|
|
|
645
645
|
}
|
|
646
646
|
|
|
647
|
-
throw new Error( 'LDrawLoader: Subobject "' + fileName + '" could not be loaded.' );
|
|
647
|
+
throw new Error( 'THREE.LDrawLoader: Subobject "' + fileName + '" could not be loaded.' );
|
|
648
648
|
|
|
649
649
|
}
|
|
650
650
|
|
|
@@ -1060,7 +1060,7 @@ class LDrawParsedCache {
|
|
|
1060
1060
|
break;
|
|
1061
1061
|
|
|
1062
1062
|
default:
|
|
1063
|
-
throw new Error( 'LDrawLoader: Unknown line type "' + lineType + '"' + lp.getLineNumberString() + '.' );
|
|
1063
|
+
throw new Error( 'THREE.LDrawLoader: Unknown line type "' + lineType + '"' + lp.getLineNumberString() + '.' );
|
|
1064
1064
|
|
|
1065
1065
|
}
|
|
1066
1066
|
|
|
@@ -2217,7 +2217,7 @@ class LDrawLoader extends Loader {
|
|
|
2217
2217
|
const name = lineParser.getToken();
|
|
2218
2218
|
if ( ! name ) {
|
|
2219
2219
|
|
|
2220
|
-
throw new Error( 'LDrawLoader: Material name was expected after "!COLOUR tag' + lineParser.getLineNumberString() + '.' );
|
|
2220
|
+
throw new Error( 'THREE.LDrawLoader: Material name was expected after "!COLOUR tag' + lineParser.getLineNumberString() + '.' );
|
|
2221
2221
|
|
|
2222
2222
|
}
|
|
2223
2223
|
|
|
@@ -2251,7 +2251,7 @@ class LDrawLoader extends Loader {
|
|
|
2251
2251
|
|
|
2252
2252
|
} else if ( ! fillColor.startsWith( '#' ) ) {
|
|
2253
2253
|
|
|
2254
|
-
throw new Error( 'LDrawLoader: Invalid color while parsing material' + lineParser.getLineNumberString() + '.' );
|
|
2254
|
+
throw new Error( 'THREE.LDrawLoader: Invalid color while parsing material' + lineParser.getLineNumberString() + '.' );
|
|
2255
2255
|
|
|
2256
2256
|
}
|
|
2257
2257
|
|
|
@@ -2270,7 +2270,7 @@ class LDrawLoader extends Loader {
|
|
|
2270
2270
|
edgeMaterial = this.getMaterial( edgeColor );
|
|
2271
2271
|
if ( ! edgeMaterial ) {
|
|
2272
2272
|
|
|
2273
|
-
throw new Error( 'LDrawLoader: Invalid edge color while parsing material' + lineParser.getLineNumberString() + '.' );
|
|
2273
|
+
throw new Error( 'THREE.LDrawLoader: Invalid edge color while parsing material' + lineParser.getLineNumberString() + '.' );
|
|
2274
2274
|
|
|
2275
2275
|
}
|
|
2276
2276
|
|
|
@@ -2287,7 +2287,7 @@ class LDrawLoader extends Loader {
|
|
|
2287
2287
|
|
|
2288
2288
|
if ( isNaN( alpha ) ) {
|
|
2289
2289
|
|
|
2290
|
-
throw new Error( 'LDrawLoader: Invalid alpha value in material definition' + lineParser.getLineNumberString() + '.' );
|
|
2290
|
+
throw new Error( 'THREE.LDrawLoader: Invalid alpha value in material definition' + lineParser.getLineNumberString() + '.' );
|
|
2291
2291
|
|
|
2292
2292
|
}
|
|
2293
2293
|
|
|
@@ -2305,7 +2305,7 @@ class LDrawLoader extends Loader {
|
|
|
2305
2305
|
|
|
2306
2306
|
if ( ! parseLuminance( lineParser.getToken() ) ) {
|
|
2307
2307
|
|
|
2308
|
-
throw new Error( 'LDrawLoader: Invalid luminance value in material definition' + lineParser.getLineNumberString() + '.' );
|
|
2308
|
+
throw new Error( 'THREE.LDrawLoader: Invalid luminance value in material definition' + lineParser.getLineNumberString() + '.' );
|
|
2309
2309
|
|
|
2310
2310
|
}
|
|
2311
2311
|
|
|
@@ -2337,7 +2337,7 @@ class LDrawLoader extends Loader {
|
|
|
2337
2337
|
break;
|
|
2338
2338
|
|
|
2339
2339
|
default:
|
|
2340
|
-
throw new Error( 'LDrawLoader: Unknown token "' + token + '" while parsing material' + lineParser.getLineNumberString() + '.' );
|
|
2340
|
+
throw new Error( 'THREE.LDrawLoader: Unknown token "' + token + '" while parsing material' + lineParser.getLineNumberString() + '.' );
|
|
2341
2341
|
|
|
2342
2342
|
}
|
|
2343
2343
|
|
|
@@ -114,7 +114,7 @@ export class LUT3dlLoader extends Loader {
|
|
|
114
114
|
|
|
115
115
|
if ( result === null ) {
|
|
116
116
|
|
|
117
|
-
throw new Error( 'LUT3dlLoader: Missing grid information' );
|
|
117
|
+
throw new Error( 'THREE.LUT3dlLoader: Missing grid information' );
|
|
118
118
|
|
|
119
119
|
}
|
|
120
120
|
|
|
@@ -127,7 +127,7 @@ export class LUT3dlLoader extends Loader {
|
|
|
127
127
|
|
|
128
128
|
if ( gridStep !== ( gridLines[ i ] - gridLines[ i - 1 ] ) ) {
|
|
129
129
|
|
|
130
|
-
throw new Error( 'LUT3dlLoader: Inconsistent grid size' );
|
|
130
|
+
throw new Error( 'THREE.LUT3dlLoader: Inconsistent grid size' );
|
|
131
131
|
|
|
132
132
|
}
|
|
133
133
|
|
|
@@ -118,7 +118,7 @@ export class LUTCubeLoader extends Loader {
|
|
|
118
118
|
|
|
119
119
|
if ( result === null ) {
|
|
120
120
|
|
|
121
|
-
throw new Error( 'LUTCubeLoader: Missing LUT_3D_SIZE information' );
|
|
121
|
+
throw new Error( 'THREE.LUTCubeLoader: Missing LUT_3D_SIZE information' );
|
|
122
122
|
|
|
123
123
|
}
|
|
124
124
|
|
|
@@ -147,7 +147,7 @@ export class LUTCubeLoader extends Loader {
|
|
|
147
147
|
|
|
148
148
|
if ( domainMin.x > domainMax.x || domainMin.y > domainMax.y || domainMin.z > domainMax.z ) {
|
|
149
149
|
|
|
150
|
-
throw new Error( 'LUTCubeLoader: Invalid input domain' );
|
|
150
|
+
throw new Error( 'THREE.LUTCubeLoader: Invalid input domain' );
|
|
151
151
|
|
|
152
152
|
}
|
|
153
153
|
|
|
@@ -50,6 +50,7 @@ let _lwoTree;
|
|
|
50
50
|
*
|
|
51
51
|
* @augments Loader
|
|
52
52
|
* @three_import import { LWOLoader } from 'three/addons/loaders/LWOLoader.js';
|
|
53
|
+
* @deprecated since r185.
|
|
53
54
|
*/
|
|
54
55
|
class LWOLoader extends Loader {
|
|
55
56
|
|
|
@@ -57,11 +58,14 @@ class LWOLoader extends Loader {
|
|
|
57
58
|
* Constructs a new LWO loader.
|
|
58
59
|
*
|
|
59
60
|
* @param {LoadingManager} [manager] - The loading manager.
|
|
61
|
+
* @deprecated since r185.
|
|
60
62
|
*/
|
|
61
63
|
constructor( manager ) {
|
|
62
64
|
|
|
63
65
|
super( manager );
|
|
64
66
|
|
|
67
|
+
console.warn( 'THREE.LWOLoader: The loader has been deprecated and will be removed with r195. Export your LWO files to glTF before using them on the web.' ); // @deprecated, r185
|
|
68
|
+
|
|
65
69
|
}
|
|
66
70
|
|
|
67
71
|
/**
|
|
@@ -886,17 +886,39 @@ class MaterialXNode {
|
|
|
886
886
|
material.specularIntensityNode = specularIntensityNode || float( 0.5 );
|
|
887
887
|
material.specularColorNode = specularColorNode || color( 1.0, 1.0, 1.0 );
|
|
888
888
|
material.iorNode = iorNode || float( 1.5 );
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
889
|
+
|
|
890
|
+
if ( anisotropyNode !== null ) {
|
|
891
|
+
|
|
892
|
+
material.anisotropyNode = anisotropyNode;
|
|
893
|
+
material.anisotropyRotationNode = anisotropyRotationNode || float( 0 );
|
|
894
|
+
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
if ( transmissionNode !== null ) {
|
|
898
|
+
|
|
899
|
+
material.transmissionNode = transmissionNode;
|
|
900
|
+
material.transmissionColorNode = transmissionColorNode || color( 1.0, 1.0, 1.0 );
|
|
901
|
+
|
|
902
|
+
}
|
|
903
|
+
|
|
893
904
|
material.thinFilmThicknessNode = thinFilmThicknessNode || float( 0 );
|
|
894
905
|
material.thinFilmIorNode = thinFilmIorNode || float( 1.5 );
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
906
|
+
|
|
907
|
+
if ( sheenNode !== null ) {
|
|
908
|
+
|
|
909
|
+
material.sheenNode = sheenNode;
|
|
910
|
+
material.sheenColorNode = sheenColorNode || color( 1.0, 1.0, 1.0 );
|
|
911
|
+
material.sheenRoughnessNode = sheenRoughnessNode || float( 0.5 );
|
|
912
|
+
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
if ( clearcoatNode !== null ) {
|
|
916
|
+
|
|
917
|
+
material.clearcoatNode = clearcoatNode;
|
|
918
|
+
material.clearcoatRoughnessNode = clearcoatRoughnessNode || float( 0 );
|
|
919
|
+
|
|
920
|
+
}
|
|
921
|
+
|
|
900
922
|
if ( normalNode ) material.normalNode = normalNode;
|
|
901
923
|
if ( emissiveNode ) material.emissiveNode = emissiveNode;
|
|
902
924
|
|
|
@@ -223,13 +223,13 @@ class NRRDLoader extends Loader {
|
|
|
223
223
|
|
|
224
224
|
if ( ! headerObject.isNrrd ) {
|
|
225
225
|
|
|
226
|
-
throw new Error( 'Not an NRRD file' );
|
|
226
|
+
throw new Error( 'THREE.NRRDLoader: Not an NRRD file' );
|
|
227
227
|
|
|
228
228
|
}
|
|
229
229
|
|
|
230
230
|
if ( headerObject.encoding === 'bz2' || headerObject.encoding === 'bzip2' ) {
|
|
231
231
|
|
|
232
|
-
throw new Error( 'Bzip is not supported' );
|
|
232
|
+
throw new Error( 'THREE.NRRDLoader: Bzip is not supported' );
|
|
233
233
|
|
|
234
234
|
}
|
|
235
235
|
|
|
@@ -598,7 +598,7 @@ const _fieldFunctions = {
|
|
|
598
598
|
this.__array = Float64Array;
|
|
599
599
|
break;
|
|
600
600
|
default:
|
|
601
|
-
throw new Error( 'Unsupported NRRD data type: ' + data );
|
|
601
|
+
throw new Error( 'THREE.NRRDLoader: Unsupported NRRD data type: ' + data );
|
|
602
602
|
|
|
603
603
|
}
|
|
604
604
|
|
|
@@ -188,8 +188,8 @@ class PCDLoader extends Loader {
|
|
|
188
188
|
if ( ctrl < ( 1 << 5 ) ) {
|
|
189
189
|
|
|
190
190
|
ctrl ++;
|
|
191
|
-
if ( outPtr + ctrl > outLength ) throw new Error( 'Output buffer is not large enough' );
|
|
192
|
-
if ( inPtr + ctrl > inLength ) throw new Error( 'Invalid compressed data' );
|
|
191
|
+
if ( outPtr + ctrl > outLength ) throw new Error( 'THREE.PCDLoader: Output buffer is not large enough' );
|
|
192
|
+
if ( inPtr + ctrl > inLength ) throw new Error( 'THREE.PCDLoader: Invalid compressed data' );
|
|
193
193
|
do {
|
|
194
194
|
|
|
195
195
|
outData[ outPtr ++ ] = inData[ inPtr ++ ];
|
|
@@ -200,18 +200,18 @@ class PCDLoader extends Loader {
|
|
|
200
200
|
|
|
201
201
|
len = ctrl >> 5;
|
|
202
202
|
ref = outPtr - ( ( ctrl & 0x1f ) << 8 ) - 1;
|
|
203
|
-
if ( inPtr >= inLength ) throw new Error( 'Invalid compressed data' );
|
|
203
|
+
if ( inPtr >= inLength ) throw new Error( 'THREE.PCDLoader: Invalid compressed data' );
|
|
204
204
|
if ( len === 7 ) {
|
|
205
205
|
|
|
206
206
|
len += inData[ inPtr ++ ];
|
|
207
|
-
if ( inPtr >= inLength ) throw new Error( 'Invalid compressed data' );
|
|
207
|
+
if ( inPtr >= inLength ) throw new Error( 'THREE.PCDLoader: Invalid compressed data' );
|
|
208
208
|
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
ref -= inData[ inPtr ++ ];
|
|
212
|
-
if ( outPtr + len + 2 > outLength ) throw new Error( 'Output buffer is not large enough' );
|
|
213
|
-
if ( ref < 0 ) throw new Error( 'Invalid compressed data' );
|
|
214
|
-
if ( ref >= outPtr ) throw new Error( 'Invalid compressed data' );
|
|
212
|
+
if ( outPtr + len + 2 > outLength ) throw new Error( 'THREE.PCDLoader: Output buffer is not large enough' );
|
|
213
|
+
if ( ref < 0 ) throw new Error( 'THREE.PCDLoader: Invalid compressed data' );
|
|
214
|
+
if ( ref >= outPtr ) throw new Error( 'THREE.PCDLoader: Invalid compressed data' );
|
|
215
215
|
do {
|
|
216
216
|
|
|
217
217
|
outData[ outPtr ++ ] = outData[ ref ++ ];
|