super-three 0.181.0 → 0.184.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/LICENSE +1 -1
- package/README.md +3 -4
- package/build/three.cjs +13152 -11354
- package/build/three.core.js +12319 -11539
- package/build/three.core.min.js +2 -2
- package/build/three.module.js +1808 -781
- package/build/three.module.min.js +2 -2
- package/build/three.tsl.js +27 -13
- package/build/three.tsl.min.js +2 -2
- package/build/three.webgpu.js +10523 -6263
- package/build/three.webgpu.min.js +2 -2
- package/build/three.webgpu.nodes.js +10484 -6262
- package/build/three.webgpu.nodes.min.js +2 -2
- package/examples/jsm/Addons.js +11 -3
- package/examples/jsm/animation/CCDIKSolver.js +7 -3
- package/examples/jsm/controls/ArcballControls.js +7 -4
- package/examples/jsm/controls/DragControls.js +2 -2
- package/examples/jsm/controls/FirstPersonControls.js +58 -54
- package/examples/jsm/controls/FlyControls.js +4 -0
- package/examples/jsm/controls/MapControls.js +55 -1
- package/examples/jsm/controls/OrbitControls.js +111 -8
- package/examples/jsm/controls/TrackballControls.js +8 -8
- package/examples/jsm/controls/TransformControls.js +34 -2
- package/examples/jsm/csm/CSM.js +2 -1
- package/examples/jsm/csm/CSMShadowNode.js +6 -2
- package/examples/jsm/effects/AnaglyphEffect.js +102 -7
- package/examples/jsm/environments/ColorEnvironment.js +59 -0
- package/examples/jsm/environments/RoomEnvironment.js +3 -0
- package/examples/jsm/exporters/EXRExporter.js +1 -1
- package/examples/jsm/exporters/GLTFExporter.js +152 -9
- package/examples/jsm/exporters/USDZExporter.js +22 -3
- package/examples/jsm/geometries/DecalGeometry.js +1 -1
- package/examples/jsm/geometries/TextGeometry.js +18 -0
- package/examples/jsm/helpers/AnimationPathHelper.js +302 -0
- package/examples/jsm/helpers/LightProbeGridHelper.js +221 -0
- package/examples/jsm/helpers/LightProbeHelperGPU.js +1 -1
- package/examples/jsm/helpers/TextureHelperGPU.js +1 -1
- package/examples/jsm/helpers/ViewHelper.js +67 -8
- package/examples/jsm/inspector/Extension.js +13 -0
- package/examples/jsm/inspector/Inspector.js +203 -88
- package/examples/jsm/inspector/RendererInspector.js +14 -4
- package/examples/jsm/inspector/extensions/extensions.json +6 -0
- package/examples/jsm/inspector/extensions/tsl-graph/TSLGraphEditor.js +916 -0
- package/examples/jsm/inspector/extensions/tsl-graph/TSLGraphLoader.js +281 -0
- package/examples/jsm/inspector/tabs/Console.js +41 -7
- package/examples/jsm/inspector/tabs/Memory.js +128 -0
- package/examples/jsm/inspector/tabs/Parameters.js +51 -3
- package/examples/jsm/inspector/tabs/Performance.js +4 -4
- package/examples/jsm/inspector/tabs/Settings.js +264 -0
- package/examples/jsm/inspector/tabs/Timeline.js +1611 -0
- package/examples/jsm/inspector/tabs/Viewer.js +107 -5
- package/examples/jsm/inspector/ui/Graph.js +2 -2
- package/examples/jsm/inspector/ui/List.js +1 -1
- package/examples/jsm/inspector/ui/Profiler.js +1936 -34
- package/examples/jsm/inspector/ui/Style.js +1044 -31
- package/examples/jsm/inspector/ui/Tab.js +222 -3
- package/examples/jsm/inspector/ui/Values.js +55 -2
- package/examples/jsm/inspector/ui/utils.js +13 -0
- package/examples/jsm/interaction/InteractionManager.js +226 -0
- package/examples/jsm/libs/meshopt_decoder.module.js +9 -8
- package/examples/jsm/lighting/DynamicLighting.js +82 -0
- package/examples/jsm/lighting/LightProbeGrid.js +651 -0
- package/examples/jsm/lines/LineMaterial.js +7 -1
- package/examples/jsm/loaders/3DMLoader.js +5 -4
- package/examples/jsm/loaders/3MFLoader.js +2 -2
- package/examples/jsm/loaders/AMFLoader.js +2 -2
- package/examples/jsm/loaders/ColladaLoader.js +24 -4026
- package/examples/jsm/loaders/DRACOLoader.js +5 -5
- package/examples/jsm/loaders/EXRLoader.js +687 -48
- package/examples/jsm/loaders/FBXLoader.js +235 -37
- package/examples/jsm/loaders/GCodeLoader.js +34 -8
- package/examples/jsm/loaders/GLTFLoader.js +146 -178
- package/examples/jsm/loaders/HDRLoader.js +1 -2
- package/examples/jsm/loaders/KMZLoader.js +5 -5
- package/examples/jsm/loaders/KTX2Loader.js +27 -5
- package/examples/jsm/loaders/LDrawLoader.js +41 -50
- package/examples/jsm/loaders/LWOLoader.js +7 -39
- package/examples/jsm/loaders/NRRDLoader.js +2 -2
- package/examples/jsm/loaders/PCDLoader.js +4 -2
- package/examples/jsm/loaders/SVGLoader.js +2 -2
- package/examples/jsm/loaders/TDSLoader.js +0 -2
- package/examples/jsm/loaders/TGALoader.js +0 -2
- package/examples/jsm/loaders/USDLoader.js +100 -40
- package/examples/jsm/loaders/UltraHDRLoader.js +285 -160
- package/examples/jsm/loaders/VOXLoader.js +660 -117
- package/examples/jsm/loaders/VRMLLoader.js +79 -2
- package/examples/jsm/loaders/VTKLoader.js +42 -25
- package/examples/jsm/loaders/collada/ColladaComposer.js +3044 -0
- package/examples/jsm/loaders/collada/ColladaParser.js +1977 -0
- package/examples/jsm/loaders/usd/USDAParser.js +450 -363
- package/examples/jsm/loaders/usd/USDCParser.js +1867 -6
- package/examples/jsm/loaders/usd/USDComposer.js +4594 -0
- package/examples/jsm/materials/LDrawConditionalLineNodeMaterial.js +2 -2
- package/examples/jsm/materials/WoodNodeMaterial.js +11 -11
- package/examples/jsm/math/Octree.js +131 -1
- package/examples/jsm/misc/GPUComputationRenderer.js +2 -0
- package/examples/jsm/misc/RollerCoaster.js +42 -4
- package/examples/jsm/misc/Volume.js +0 -1
- package/examples/jsm/misc/VolumeSlice.js +0 -1
- package/examples/jsm/modifiers/TessellateModifier.js +1 -1
- package/examples/jsm/objects/LensflareMesh.js +1 -1
- package/examples/jsm/objects/Reflector.js +73 -25
- package/examples/jsm/objects/Sky.js +90 -6
- package/examples/jsm/objects/SkyMesh.js +150 -16
- package/examples/jsm/objects/Water.js +4 -3
- package/examples/jsm/objects/Water2.js +5 -3
- package/examples/jsm/objects/WaterMesh.js +5 -7
- package/examples/jsm/physics/AmmoPhysics.js +12 -7
- package/examples/jsm/physics/JoltPhysics.js +10 -6
- package/examples/jsm/physics/RapierPhysics.js +9 -5
- package/examples/jsm/postprocessing/EffectComposer.js +7 -5
- package/examples/jsm/postprocessing/OutputPass.js +9 -0
- package/examples/jsm/postprocessing/RenderPass.js +10 -0
- package/examples/jsm/postprocessing/RenderTransitionPass.js +1 -1
- package/examples/jsm/postprocessing/UnrealBloomPass.js +48 -18
- package/examples/jsm/renderers/CSS3DRenderer.js +1 -1
- package/examples/jsm/renderers/Projector.js +246 -28
- package/examples/jsm/renderers/SVGRenderer.js +174 -60
- package/examples/jsm/shaders/GTAOShader.js +19 -6
- package/examples/jsm/shaders/HalftoneShader.js +12 -1
- package/examples/jsm/shaders/PoissonDenoiseShader.js +6 -2
- package/examples/jsm/shaders/SAOShader.js +17 -4
- package/examples/jsm/shaders/SSAOShader.js +11 -1
- package/examples/jsm/shaders/SSRShader.js +6 -5
- package/examples/jsm/shaders/UnpackDepthRGBAShader.js +2 -4
- package/examples/jsm/shaders/VignetteShader.js +1 -1
- package/examples/jsm/transpiler/AST.js +44 -0
- package/examples/jsm/transpiler/GLSLDecoder.js +63 -6
- package/examples/jsm/transpiler/ShaderToyDecoder.js +2 -0
- package/examples/jsm/transpiler/TSLEncoder.js +46 -3
- package/examples/jsm/transpiler/TranspilerUtils.js +3 -3
- package/examples/jsm/transpiler/WGSLEncoder.js +27 -0
- package/examples/jsm/tsl/WebGLNodesHandler.js +605 -0
- package/examples/jsm/tsl/display/AfterImageNode.js +11 -1
- package/examples/jsm/tsl/display/AnaglyphPassNode.js +458 -16
- package/examples/jsm/tsl/display/AnamorphicNode.js +12 -1
- package/examples/jsm/tsl/display/BilateralBlurNode.js +374 -0
- package/examples/jsm/tsl/display/BloomNode.js +16 -6
- package/examples/jsm/tsl/display/CRT.js +150 -0
- package/examples/jsm/tsl/display/ChromaticAberrationNode.js +3 -36
- package/examples/jsm/tsl/display/DenoiseNode.js +1 -1
- package/examples/jsm/tsl/display/DepthOfFieldNode.js +1 -1
- package/examples/jsm/tsl/display/DotScreenNode.js +1 -1
- package/examples/jsm/tsl/display/FSR1Node.js +477 -0
- package/examples/jsm/tsl/display/FXAANode.js +2 -2
- package/examples/jsm/tsl/display/GTAONode.js +6 -4
- package/examples/jsm/tsl/display/GaussianBlurNode.js +21 -2
- package/examples/jsm/tsl/display/GodraysNode.js +615 -0
- package/examples/jsm/tsl/display/LensflareNode.js +1 -1
- package/examples/jsm/tsl/display/Lut3DNode.js +1 -1
- package/examples/jsm/tsl/display/OutlineNode.js +69 -19
- package/examples/jsm/tsl/display/ParallaxBarrierPassNode.js +2 -2
- package/examples/jsm/tsl/display/PixelationPassNode.js +7 -6
- package/examples/jsm/tsl/display/RGBShiftNode.js +2 -2
- package/examples/jsm/tsl/display/RetroPassNode.js +263 -0
- package/examples/jsm/tsl/display/SMAANode.js +2 -2
- package/examples/jsm/tsl/display/SSAAPassNode.js +2 -2
- package/examples/jsm/tsl/display/SSGINode.js +8 -24
- package/examples/jsm/tsl/display/SSRNode.js +8 -8
- package/examples/jsm/tsl/display/SSSNode.js +6 -4
- package/examples/jsm/tsl/display/Shape.js +29 -0
- package/examples/jsm/tsl/display/SharpenNode.js +283 -0
- package/examples/jsm/tsl/display/SobelOperatorNode.js +2 -2
- package/examples/jsm/tsl/display/StereoCompositePassNode.js +8 -1
- package/examples/jsm/tsl/display/StereoPassNode.js +1 -2
- package/examples/jsm/tsl/display/TAAUNode.js +835 -0
- package/examples/jsm/tsl/display/TRAANode.js +315 -126
- package/examples/jsm/tsl/display/TransitionNode.js +1 -1
- package/examples/jsm/tsl/display/depthAwareBlend.js +80 -0
- package/examples/jsm/tsl/display/radialBlur.js +68 -0
- package/examples/jsm/tsl/lighting/DynamicLightsNode.js +300 -0
- package/examples/jsm/tsl/lighting/data/AmbientLightDataNode.js +61 -0
- package/examples/jsm/tsl/lighting/data/DirectionalLightDataNode.js +111 -0
- package/examples/jsm/tsl/lighting/data/HemisphereLightDataNode.js +99 -0
- package/examples/jsm/tsl/lighting/data/PointLightDataNode.js +134 -0
- package/examples/jsm/tsl/lighting/data/SpotLightDataNode.js +161 -0
- package/examples/jsm/tsl/math/Bayer.js +53 -3
- package/examples/jsm/utils/BufferGeometryUtils.js +2 -3
- package/examples/jsm/utils/ColorUtils.js +76 -0
- package/examples/jsm/utils/LDrawUtils.js +1 -1
- package/examples/jsm/utils/ShadowMapViewer.js +24 -10
- package/examples/jsm/utils/ShadowMapViewerGPU.js +1 -1
- package/examples/jsm/utils/SkeletonUtils.js +14 -8
- package/examples/jsm/utils/WebGPUTextureUtils.js +1 -1
- package/examples/jsm/webxr/XRHandMeshModel.js +36 -10
- package/examples/jsm/webxr/XRHandModelFactory.js +2 -1
- package/package.json +24 -30
- package/src/Three.Core.js +3 -1
- package/src/Three.TSL.js +25 -11
- package/src/Three.WebGPU.Nodes.js +5 -0
- package/src/Three.WebGPU.js +9 -0
- package/src/Three.js +1 -0
- package/src/animation/AnimationAction.js +12 -2
- package/src/animation/AnimationClip.js +1 -1
- package/src/animation/AnimationMixer.js +6 -0
- package/src/animation/AnimationUtils.js +1 -12
- package/src/animation/KeyframeTrack.js +47 -8
- package/src/animation/PropertyMixer.js +4 -4
- package/src/animation/tracks/BooleanKeyframeTrack.js +1 -1
- package/src/animation/tracks/ColorKeyframeTrack.js +1 -1
- package/src/animation/tracks/NumberKeyframeTrack.js +1 -1
- package/src/animation/tracks/QuaternionKeyframeTrack.js +1 -1
- package/src/animation/tracks/StringKeyframeTrack.js +1 -1
- package/src/animation/tracks/VectorKeyframeTrack.js +1 -1
- package/src/audio/Audio.js +1 -1
- package/src/audio/AudioContext.js +2 -2
- package/src/audio/AudioListener.js +5 -3
- package/src/cameras/Camera.js +32 -2
- package/src/cameras/CubeCamera.js +20 -0
- package/src/constants.js +90 -5
- package/src/core/BufferAttribute.js +13 -1
- package/src/core/BufferGeometry.js +14 -2
- package/src/core/Clock.js +7 -0
- package/src/core/Object3D.js +52 -4
- package/src/core/Raycaster.js +2 -2
- package/src/core/RenderTarget.js +4 -4
- package/src/extras/PMREMGenerator.js +7 -18
- package/src/extras/TextureUtils.js +5 -1
- package/src/extras/curves/CatmullRomCurve3.js +3 -2
- package/src/geometries/ExtrudeGeometry.js +2 -2
- package/src/geometries/PolyhedronGeometry.js +1 -1
- package/src/geometries/TorusGeometry.js +8 -3
- package/src/helpers/CameraHelper.js +3 -0
- package/src/helpers/DirectionalLightHelper.js +4 -1
- package/src/helpers/HemisphereLightHelper.js +3 -0
- package/src/helpers/PointLightHelper.js +1 -25
- package/src/helpers/SpotLightHelper.js +3 -0
- package/src/lights/DirectionalLight.js +13 -0
- package/src/lights/HemisphereLight.js +10 -0
- package/src/lights/Light.js +1 -11
- package/src/lights/LightProbe.js +0 -15
- package/src/lights/LightShadow.js +15 -6
- package/src/lights/PointLight.js +15 -0
- package/src/lights/PointLightShadow.js +0 -86
- package/src/lights/SpotLight.js +22 -1
- package/src/lights/webgpu/IESSpotLight.js +2 -1
- package/src/loaders/AudioLoader.js +11 -1
- package/src/loaders/Cache.js +28 -0
- package/src/loaders/DataTextureLoader.js +6 -4
- package/src/loaders/FileLoader.js +2 -3
- package/src/loaders/ImageBitmapLoader.js +12 -9
- package/src/loaders/Loader.js +6 -0
- package/src/loaders/MaterialLoader.js +3 -2
- package/src/loaders/ObjectLoader.js +46 -6
- package/src/loaders/nodes/NodeLoader.js +2 -2
- package/src/loaders/nodes/NodeObjectLoader.js +18 -0
- package/src/materials/Material.js +2 -0
- package/src/materials/MeshLambertMaterial.js +9 -0
- package/src/materials/MeshPhongMaterial.js +9 -0
- package/src/materials/MeshToonMaterial.js +1 -1
- package/src/materials/ShaderMaterial.js +20 -1
- package/src/materials/nodes/Line2NodeMaterial.js +34 -7
- package/src/materials/nodes/MeshPhysicalNodeMaterial.js +5 -2
- package/src/materials/nodes/MeshStandardNodeMaterial.js +5 -4
- package/src/materials/nodes/NodeMaterial.js +45 -25
- package/src/materials/nodes/manager/NodeMaterialObserver.js +191 -86
- package/src/math/Line3.js +6 -5
- package/src/math/MathUtils.js +10 -10
- package/src/math/Matrix2.js +13 -9
- package/src/math/Matrix3.js +13 -9
- package/src/math/Matrix4.js +87 -74
- package/src/math/Plane.js +4 -3
- package/src/math/Quaternion.js +3 -29
- package/src/math/Sphere.js +1 -1
- package/src/math/Triangle.js +1 -1
- package/src/math/Vector2.js +11 -7
- package/src/math/Vector3.js +15 -13
- package/src/math/Vector4.js +13 -9
- package/src/math/interpolants/BezierInterpolant.js +108 -0
- package/src/nodes/Nodes.js +86 -68
- package/src/nodes/TSL.js +7 -7
- package/src/nodes/accessors/Arrays.js +1 -1
- package/src/nodes/accessors/BatchNode.js +10 -10
- package/src/nodes/accessors/Bitangent.js +5 -5
- package/src/nodes/accessors/BufferAttributeNode.js +107 -15
- package/src/nodes/accessors/BufferNode.js +29 -2
- package/src/nodes/accessors/Camera.js +149 -28
- package/src/nodes/accessors/ClippingNode.js +4 -4
- package/src/nodes/accessors/CubeTextureNode.js +27 -2
- package/src/nodes/accessors/InstanceNode.js +148 -43
- package/src/nodes/accessors/MaterialNode.js +9 -1
- package/src/nodes/accessors/MaterialProperties.js +2 -5
- package/src/nodes/accessors/MaterialReferenceNode.js +1 -2
- package/src/nodes/accessors/ModelNode.js +1 -1
- package/src/nodes/accessors/Normal.js +11 -11
- package/src/nodes/accessors/Object3DNode.js +1 -1
- package/src/nodes/accessors/Position.js +34 -2
- package/src/nodes/accessors/ReferenceBaseNode.js +6 -6
- package/src/nodes/accessors/ReferenceNode.js +8 -8
- package/src/nodes/accessors/RendererReferenceNode.js +1 -2
- package/src/nodes/accessors/SceneProperties.js +47 -0
- package/src/nodes/accessors/SkinningNode.js +27 -26
- package/src/nodes/accessors/StorageBufferNode.js +14 -25
- package/src/nodes/accessors/StorageTextureNode.js +40 -9
- package/src/nodes/accessors/Tangent.js +4 -14
- package/src/nodes/accessors/Texture3DNode.js +32 -35
- package/src/nodes/accessors/TextureNode.js +67 -23
- package/src/nodes/accessors/UniformArrayNode.js +6 -4
- package/src/nodes/accessors/UserDataNode.js +1 -2
- package/src/nodes/accessors/VertexColorNode.js +1 -2
- package/src/nodes/code/FunctionCallNode.js +1 -1
- package/src/nodes/code/FunctionNode.js +2 -3
- package/src/nodes/core/ArrayNode.js +21 -2
- package/src/nodes/core/AssignNode.js +3 -3
- package/src/nodes/core/AttributeNode.js +3 -3
- package/src/nodes/core/BypassNode.js +1 -1
- package/src/nodes/core/ContextNode.js +104 -5
- package/src/nodes/core/IndexNode.js +2 -1
- package/src/nodes/core/InputNode.js +1 -1
- package/src/nodes/core/InspectorNode.js +1 -1
- package/src/nodes/core/IsolateNode.js +1 -1
- package/src/nodes/core/MRTNode.js +48 -2
- package/src/nodes/core/Node.js +112 -15
- package/src/nodes/core/NodeBuilder.js +284 -66
- package/src/nodes/core/NodeError.js +28 -0
- package/src/nodes/core/NodeFrame.js +12 -4
- package/src/nodes/core/NodeUtils.js +11 -9
- package/src/nodes/core/OutputStructNode.js +12 -10
- package/src/nodes/core/ParameterNode.js +4 -4
- package/src/nodes/core/PropertyNode.js +19 -3
- package/src/nodes/core/StackNode.js +66 -17
- package/src/nodes/core/StackTrace.js +139 -0
- package/src/nodes/core/StructNode.js +17 -3
- package/src/nodes/core/StructTypeNode.js +12 -18
- package/src/nodes/core/SubBuildNode.js +2 -2
- package/src/nodes/core/UniformGroupNode.js +36 -6
- package/src/nodes/core/UniformNode.js +21 -5
- package/src/nodes/core/VarNode.js +48 -23
- package/src/nodes/core/VaryingNode.js +2 -19
- package/src/nodes/display/BlendModes.js +0 -64
- package/src/nodes/display/ColorAdjustment.js +17 -0
- package/src/nodes/display/ColorSpaceNode.js +3 -3
- package/src/nodes/display/NormalMapNode.js +39 -4
- package/src/nodes/display/PassNode.js +125 -16
- package/src/nodes/display/RenderOutputNode.js +7 -7
- package/src/nodes/display/ScreenNode.js +4 -2
- package/src/nodes/display/ToneMappingNode.js +1 -1
- package/src/nodes/display/ToonOutlinePassNode.js +2 -2
- package/src/nodes/display/ViewportDepthNode.js +52 -4
- package/src/nodes/display/ViewportDepthTextureNode.js +11 -15
- package/src/nodes/display/ViewportTextureNode.js +39 -11
- package/src/nodes/fog/Fog.js +18 -35
- package/src/nodes/functions/BSDF/BRDF_GGX_Multiscatter.js +3 -3
- package/src/nodes/functions/BSDF/DFGLUT.js +56 -0
- package/src/nodes/functions/BSDF/EnvironmentBRDF.js +2 -2
- package/src/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.js +2 -2
- package/src/nodes/functions/PhysicalLightingModel.js +126 -45
- package/src/nodes/geometry/RangeNode.js +5 -3
- package/src/nodes/gpgpu/AtomicFunctionNode.js +1 -1
- package/src/nodes/gpgpu/BarrierNode.js +9 -0
- package/src/nodes/gpgpu/ComputeBuiltinNode.js +2 -3
- package/src/nodes/gpgpu/ComputeNode.js +74 -48
- package/src/nodes/gpgpu/SubgroupFunctionNode.js +2 -2
- package/src/nodes/gpgpu/WorkgroupInfoNode.js +4 -4
- package/src/nodes/lighting/AnalyticLightNode.js +53 -0
- package/src/nodes/lighting/EnvironmentNode.js +28 -3
- package/src/nodes/lighting/LightsNode.js +7 -28
- package/src/nodes/lighting/PointShadowNode.js +162 -149
- package/src/nodes/lighting/ShadowFilterNode.js +53 -65
- package/src/nodes/lighting/ShadowNode.js +120 -42
- package/src/nodes/math/BitcastNode.js +1 -1
- package/src/nodes/math/BitcountNode.js +433 -0
- package/src/nodes/math/ConditionalNode.js +3 -3
- package/src/nodes/math/MathNode.js +76 -41
- package/src/nodes/math/OperatorNode.js +3 -2
- package/src/nodes/math/PackFloatNode.js +98 -0
- package/src/nodes/math/UnpackFloatNode.js +96 -0
- package/src/nodes/pmrem/PMREMNode.js +1 -1
- package/src/nodes/pmrem/PMREMUtils.js +9 -15
- package/src/nodes/tsl/TSLBase.js +1 -1
- package/src/nodes/tsl/TSLCore.js +38 -17
- package/src/nodes/utils/ArrayElementNode.js +14 -1
- package/src/nodes/utils/ConvertNode.js +1 -1
- package/src/nodes/utils/DebugNode.js +12 -12
- package/src/nodes/utils/EventNode.js +31 -2
- package/src/nodes/utils/FlipNode.js +1 -1
- package/src/nodes/utils/FunctionOverloadingNode.js +1 -1
- package/src/nodes/utils/JoinNode.js +3 -3
- package/src/nodes/utils/LoopNode.js +1 -1
- package/src/nodes/utils/MemberNode.js +2 -2
- package/src/nodes/utils/Packing.js +13 -1
- package/src/nodes/utils/PostProcessingUtils.js +33 -1
- package/src/nodes/utils/RTTNode.js +1 -1
- package/src/nodes/utils/ReflectorNode.js +3 -4
- package/src/nodes/utils/Remap.js +48 -0
- package/src/nodes/utils/RotateNode.js +1 -1
- package/src/nodes/utils/SampleNode.js +1 -1
- package/src/nodes/utils/SetNode.js +1 -1
- package/src/nodes/utils/SplitNode.js +1 -1
- package/src/nodes/utils/SpriteSheetUV.js +35 -0
- package/src/nodes/utils/UVUtils.js +28 -0
- package/src/objects/BatchedMesh.js +44 -16
- package/src/objects/InstancedMesh.js +30 -3
- package/src/objects/Line.js +1 -1
- package/src/objects/Mesh.js +1 -1
- package/src/objects/Points.js +1 -1
- package/src/objects/Skeleton.js +9 -0
- package/src/objects/SkinnedMesh.js +26 -9
- package/src/renderers/WebGLRenderer.js +329 -145
- package/src/renderers/common/Animation.js +3 -3
- package/src/renderers/common/Attributes.js +15 -1
- package/src/renderers/common/Backend.js +29 -8
- package/src/renderers/common/Background.js +26 -13
- package/src/renderers/common/BindGroup.js +1 -16
- package/src/renderers/common/Binding.js +11 -0
- package/src/renderers/common/Bindings.js +29 -14
- package/src/renderers/common/BlendMode.js +143 -0
- package/src/renderers/common/Buffer.js +40 -0
- package/src/renderers/common/BundleGroup.js +1 -1
- package/src/renderers/common/ChainMap.js +30 -6
- package/src/renderers/common/ComputePipeline.js +1 -1
- package/src/renderers/common/CubeRenderTarget.js +51 -7
- package/src/renderers/common/Geometries.js +29 -3
- package/src/renderers/common/Info.js +333 -4
- package/src/renderers/common/InspectorBase.js +6 -1
- package/src/renderers/common/Lighting.js +5 -21
- package/src/renderers/common/Pipelines.js +40 -7
- package/src/renderers/common/PostProcessing.js +8 -206
- package/src/renderers/common/ReadbackBuffer.js +78 -0
- package/src/renderers/common/RenderBundle.js +3 -1
- package/src/renderers/common/RenderBundles.js +7 -3
- package/src/renderers/common/RenderContext.js +16 -0
- package/src/renderers/common/RenderContexts.js +33 -49
- package/src/renderers/common/RenderLists.js +2 -1
- package/src/renderers/common/RenderObject.js +17 -5
- package/src/renderers/common/RenderObjectPipeline.js +40 -0
- package/src/renderers/common/RenderObjects.js +21 -5
- package/src/renderers/common/RenderPipeline.js +232 -17
- package/src/renderers/common/Renderer.js +481 -117
- package/src/renderers/common/Sampler.js +4 -4
- package/src/renderers/common/StorageBuffer.js +13 -1
- package/src/renderers/common/Textures.js +89 -4
- package/src/renderers/common/TimestampQueryPool.js +5 -3
- package/src/renderers/common/Uniform.js +8 -0
- package/src/renderers/common/UniformsGroup.js +62 -1
- package/src/renderers/common/XRManager.js +37 -29
- package/src/renderers/common/extras/PMREMGenerator.js +25 -23
- package/src/renderers/common/nodes/NodeBuilderState.js +1 -1
- package/src/renderers/common/nodes/{Nodes.js → NodeManager.js} +242 -99
- package/src/renderers/common/nodes/NodeStorageBuffer.js +13 -2
- package/src/renderers/common/nodes/NodeUniformBuffer.js +52 -0
- package/src/renderers/shaders/DFGLUTData.js +19 -34
- package/src/renderers/shaders/ShaderChunk/batching_pars_vertex.glsl.js +2 -2
- package/src/renderers/shaders/ShaderChunk/color_fragment.glsl.js +1 -5
- package/src/renderers/shaders/ShaderChunk/color_pars_fragment.glsl.js +1 -5
- package/src/renderers/shaders/ShaderChunk/color_pars_vertex.glsl.js +1 -5
- package/src/renderers/shaders/ShaderChunk/color_vertex.glsl.js +8 -10
- package/src/renderers/shaders/ShaderChunk/envmap_common_pars_fragment.glsl.js +0 -1
- package/src/renderers/shaders/ShaderChunk/envmap_fragment.glsl.js +8 -12
- package/src/renderers/shaders/ShaderChunk/lightprobes_pars_fragment.glsl.js +80 -0
- package/src/renderers/shaders/ShaderChunk/lights_fragment_begin.glsl.js +13 -2
- package/src/renderers/shaders/ShaderChunk/lights_fragment_end.glsl.js +6 -0
- package/src/renderers/shaders/ShaderChunk/lights_fragment_maps.glsl.js +6 -2
- package/src/renderers/shaders/ShaderChunk/lights_pars_begin.glsl.js +2 -0
- package/src/renderers/shaders/ShaderChunk/lights_physical_fragment.glsl.js +8 -4
- package/src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js +112 -53
- package/src/renderers/shaders/ShaderChunk/normal_fragment_maps.glsl.js +7 -0
- package/src/renderers/shaders/ShaderChunk/packing.glsl.js +20 -4
- package/src/renderers/shaders/ShaderChunk/premultiplied_alpha_fragment.glsl.js +0 -1
- package/src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js +225 -186
- package/src/renderers/shaders/ShaderChunk/shadowmap_vertex.glsl.js +12 -2
- package/src/renderers/shaders/ShaderChunk/shadowmask_pars_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/transmission_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk.js +5 -3
- package/src/renderers/shaders/ShaderLib/backgroundCube.glsl.js +1 -2
- package/src/renderers/shaders/ShaderLib/depth.glsl.js +3 -0
- package/src/renderers/shaders/ShaderLib/{distanceRGBA.glsl.js → distance.glsl.js} +1 -2
- package/src/renderers/shaders/ShaderLib/meshlambert.glsl.js +2 -1
- package/src/renderers/shaders/ShaderLib/meshnormal.glsl.js +1 -2
- package/src/renderers/shaders/ShaderLib/meshphong.glsl.js +2 -1
- package/src/renderers/shaders/ShaderLib/meshphysical.glsl.js +4 -9
- package/src/renderers/shaders/ShaderLib/meshtoon.glsl.js +0 -1
- package/src/renderers/shaders/ShaderLib/shadow.glsl.js +1 -1
- package/src/renderers/shaders/ShaderLib/vsm.glsl.js +4 -6
- package/src/renderers/shaders/ShaderLib.js +7 -6
- package/src/renderers/shaders/UniformsLib.js +7 -5
- package/src/renderers/shaders/UniformsUtils.js +27 -5
- package/src/renderers/webgl/WebGLAnimation.js +2 -1
- package/src/renderers/webgl/WebGLBackground.js +15 -15
- package/src/renderers/webgl/WebGLBindingStates.js +99 -27
- package/src/renderers/webgl/WebGLBufferRenderer.js +0 -32
- package/src/renderers/webgl/WebGLCapabilities.js +9 -4
- package/src/renderers/webgl/WebGLEnvironments.js +228 -0
- package/src/renderers/webgl/WebGLGeometries.js +10 -7
- package/src/renderers/webgl/WebGLIndexedBufferRenderer.js +0 -32
- package/src/renderers/webgl/WebGLLights.js +18 -1
- package/src/renderers/webgl/WebGLMaterials.js +24 -13
- package/src/renderers/webgl/WebGLObjects.js +3 -1
- package/src/renderers/webgl/WebGLOutput.js +270 -0
- package/src/renderers/webgl/WebGLProgram.js +49 -109
- package/src/renderers/webgl/WebGLPrograms.js +63 -51
- package/src/renderers/webgl/WebGLRenderLists.js +15 -0
- package/src/renderers/webgl/WebGLRenderStates.js +13 -2
- package/src/renderers/webgl/WebGLShadowMap.js +188 -24
- package/src/renderers/webgl/WebGLState.js +75 -37
- package/src/renderers/webgl/WebGLTextures.js +215 -54
- package/src/renderers/webgl/WebGLUniforms.js +40 -3
- package/src/renderers/webgl/WebGLUniformsGroups.js +19 -0
- package/src/renderers/webgl/WebGLUtils.js +6 -2
- package/src/renderers/webgl-fallback/WebGLBackend.js +253 -82
- package/src/renderers/webgl-fallback/WebGLBufferRenderer.js +0 -41
- package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +173 -74
- package/src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js +53 -19
- package/src/renderers/webgl-fallback/utils/WebGLCapabilities.js +25 -0
- package/src/renderers/webgl-fallback/utils/WebGLState.js +223 -6
- package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +68 -53
- package/src/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.js +10 -10
- package/src/renderers/webgl-fallback/utils/WebGLUtils.js +6 -2
- package/src/renderers/webgpu/WebGPUBackend.js +260 -140
- package/src/renderers/webgpu/WebGPURenderer.js +2 -1
- package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +366 -90
- package/src/renderers/webgpu/utils/WebGPUAttributeUtils.js +107 -34
- package/src/renderers/webgpu/utils/WebGPUBindingUtils.js +357 -200
- package/src/renderers/webgpu/utils/WebGPUCapabilities.js +48 -0
- package/src/renderers/webgpu/utils/WebGPUConstants.js +10 -0
- package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +61 -23
- package/src/renderers/webgpu/utils/WebGPUTexturePassUtils.js +152 -200
- package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +156 -59
- package/src/renderers/webgpu/utils/WebGPUTimestampQueryPool.js +7 -7
- package/src/renderers/webgpu/utils/WebGPUUtils.js +33 -11
- package/src/renderers/webxr/WebXRController.js +12 -0
- package/src/renderers/webxr/WebXRManager.js +4 -2
- package/src/textures/CubeDepthTexture.js +76 -0
- package/src/textures/HTMLTexture.js +74 -0
- package/src/textures/Source.js +2 -2
- package/src/textures/Texture.js +16 -5
- package/src/utils.js +280 -3
- package/examples/jsm/materials/MeshGouraudMaterial.js +0 -434
- package/examples/jsm/materials/MeshPostProcessingMaterial.js +0 -167
- package/examples/jsm/shaders/GodRaysShader.js +0 -333
- package/src/nodes/accessors/SceneNode.js +0 -145
- package/src/nodes/code/ScriptableNode.js +0 -726
- package/src/nodes/code/ScriptableValueNode.js +0 -253
- package/src/nodes/display/PosterizeNode.js +0 -65
- package/src/nodes/functions/BSDF/DFGApprox.js +0 -71
- package/src/nodes/utils/RemapNode.js +0 -125
- package/src/nodes/utils/SpriteSheetUVNode.js +0 -90
- package/src/renderers/webgl/WebGLCubeMaps.js +0 -99
- package/src/renderers/webgl/WebGLCubeUVMaps.js +0 -134
|
@@ -66,11 +66,12 @@ import {
|
|
|
66
66
|
InstancedBufferAttribute
|
|
67
67
|
} from 'three';
|
|
68
68
|
import { toTrianglesDrawMode } from '../utils/BufferGeometryUtils.js';
|
|
69
|
+
import { clone } from '../utils/SkeletonUtils.js';
|
|
69
70
|
|
|
70
71
|
/**
|
|
71
72
|
* A loader for the glTF 2.0 format.
|
|
72
73
|
*
|
|
73
|
-
* [glTF](https://www.khronos.org/gltf/
|
|
74
|
+
* [glTF](https://www.khronos.org/gltf/) (GL Transmission Format) is an [open format specification]{@link https://github.com/KhronosGroup/glTF/tree/main/specification/2.0)
|
|
74
75
|
* for efficient delivery and loading of 3D content. Assets may be provided either in JSON (.gltf) or binary (.glb)
|
|
75
76
|
* format. External files store textures (.jpg, .png) and additional binary data (.bin). A glTF asset may deliver
|
|
76
77
|
* one or more scenes, including meshes, materials, textures, skins, skeletons, morph targets, animations, lights,
|
|
@@ -82,8 +83,11 @@ import { toTrianglesDrawMode } from '../utils/BufferGeometryUtils.js';
|
|
|
82
83
|
*
|
|
83
84
|
* `GLTFLoader` supports the following glTF 2.0 extensions:
|
|
84
85
|
* - KHR_draco_mesh_compression
|
|
86
|
+
* - KHR_lights_punctual
|
|
87
|
+
* - KHR_materials_anisotropy
|
|
85
88
|
* - KHR_materials_clearcoat
|
|
86
89
|
* - KHR_materials_dispersion
|
|
90
|
+
* - KHR_materials_emissive_strength
|
|
87
91
|
* - KHR_materials_ior
|
|
88
92
|
* - KHR_materials_specular
|
|
89
93
|
* - KHR_materials_transmission
|
|
@@ -91,12 +95,14 @@ import { toTrianglesDrawMode } from '../utils/BufferGeometryUtils.js';
|
|
|
91
95
|
* - KHR_materials_unlit
|
|
92
96
|
* - KHR_materials_volume
|
|
93
97
|
* - KHR_mesh_quantization
|
|
94
|
-
* -
|
|
98
|
+
* - KHR_meshopt_compression
|
|
95
99
|
* - KHR_texture_basisu
|
|
96
100
|
* - KHR_texture_transform
|
|
97
|
-
* -
|
|
101
|
+
* - EXT_materials_bump
|
|
98
102
|
* - EXT_meshopt_compression
|
|
99
103
|
* - EXT_mesh_gpu_instancing
|
|
104
|
+
* - EXT_texture_avif
|
|
105
|
+
* - EXT_texture_webp
|
|
100
106
|
*
|
|
101
107
|
* The following glTF 2.0 extension is supported by an external user plugin:
|
|
102
108
|
* - [KHR_materials_variants](https://github.com/takahirox/three-gltf-extensions)
|
|
@@ -228,7 +234,13 @@ class GLTFLoader extends Loader {
|
|
|
228
234
|
|
|
229
235
|
this.register( function ( parser ) {
|
|
230
236
|
|
|
231
|
-
return new GLTFMeshoptCompression( parser );
|
|
237
|
+
return new GLTFMeshoptCompression( parser, EXTENSIONS.EXT_MESHOPT_COMPRESSION );
|
|
238
|
+
|
|
239
|
+
} );
|
|
240
|
+
|
|
241
|
+
this.register( function ( parser ) {
|
|
242
|
+
|
|
243
|
+
return new GLTFMeshoptCompression( parser, EXTENSIONS.KHR_MESHOPT_COMPRESSION );
|
|
232
244
|
|
|
233
245
|
} );
|
|
234
246
|
|
|
@@ -407,7 +419,7 @@ class GLTFLoader extends Loader {
|
|
|
407
419
|
}
|
|
408
420
|
|
|
409
421
|
/**
|
|
410
|
-
* Parses the given
|
|
422
|
+
* Parses the given glTF data and returns the resulting group.
|
|
411
423
|
*
|
|
412
424
|
* @param {string|ArrayBuffer} data - The raw glTF data.
|
|
413
425
|
* @param {string} path - The URL base path.
|
|
@@ -599,6 +611,20 @@ function GLTFRegistry() {
|
|
|
599
611
|
/********** EXTENSIONS ***********/
|
|
600
612
|
/*********************************/
|
|
601
613
|
|
|
614
|
+
function getMaterialExtension( parser, materialIndex, extensionName ) {
|
|
615
|
+
|
|
616
|
+
const materialDef = parser.json.materials[ materialIndex ];
|
|
617
|
+
|
|
618
|
+
if ( materialDef.extensions && materialDef.extensions[ extensionName ] ) {
|
|
619
|
+
|
|
620
|
+
return materialDef.extensions[ extensionName ];
|
|
621
|
+
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
return null;
|
|
625
|
+
|
|
626
|
+
}
|
|
627
|
+
|
|
602
628
|
const EXTENSIONS = {
|
|
603
629
|
KHR_BINARY_GLTF: 'KHR_binary_glTF',
|
|
604
630
|
KHR_DRACO_MESH_COMPRESSION: 'KHR_draco_mesh_compression',
|
|
@@ -621,6 +647,7 @@ const EXTENSIONS = {
|
|
|
621
647
|
EXT_TEXTURE_WEBP: 'EXT_texture_webp',
|
|
622
648
|
EXT_TEXTURE_AVIF: 'EXT_texture_avif',
|
|
623
649
|
EXT_MESHOPT_COMPRESSION: 'EXT_meshopt_compression',
|
|
650
|
+
KHR_MESHOPT_COMPRESSION: 'KHR_meshopt_compression',
|
|
624
651
|
EXT_MESH_GPU_INSTANCING: 'EXT_mesh_gpu_instancing'
|
|
625
652
|
};
|
|
626
653
|
|
|
@@ -835,20 +862,13 @@ class GLTFMaterialsEmissiveStrengthExtension {
|
|
|
835
862
|
|
|
836
863
|
extendMaterialParams( materialIndex, materialParams ) {
|
|
837
864
|
|
|
838
|
-
const
|
|
839
|
-
const materialDef = parser.json.materials[ materialIndex ];
|
|
840
|
-
|
|
841
|
-
if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) {
|
|
865
|
+
const extension = getMaterialExtension( this.parser, materialIndex, this.name );
|
|
842
866
|
|
|
843
|
-
|
|
867
|
+
if ( extension === null ) return Promise.resolve();
|
|
844
868
|
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
const emissiveStrength = materialDef.extensions[ this.name ].emissiveStrength;
|
|
869
|
+
if ( extension.emissiveStrength !== undefined ) {
|
|
848
870
|
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
materialParams.emissiveIntensity = emissiveStrength;
|
|
871
|
+
materialParams.emissiveIntensity = extension.emissiveStrength;
|
|
852
872
|
|
|
853
873
|
}
|
|
854
874
|
|
|
@@ -876,30 +896,20 @@ class GLTFMaterialsClearcoatExtension {
|
|
|
876
896
|
|
|
877
897
|
getMaterialType( materialIndex ) {
|
|
878
898
|
|
|
879
|
-
const
|
|
880
|
-
const materialDef = parser.json.materials[ materialIndex ];
|
|
899
|
+
const extension = getMaterialExtension( this.parser, materialIndex, this.name );
|
|
881
900
|
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
return MeshPhysicalMaterial;
|
|
901
|
+
return extension !== null ? MeshPhysicalMaterial : null;
|
|
885
902
|
|
|
886
903
|
}
|
|
887
904
|
|
|
888
905
|
extendMaterialParams( materialIndex, materialParams ) {
|
|
889
906
|
|
|
890
|
-
const
|
|
891
|
-
const materialDef = parser.json.materials[ materialIndex ];
|
|
892
|
-
|
|
893
|
-
if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) {
|
|
907
|
+
const extension = getMaterialExtension( this.parser, materialIndex, this.name );
|
|
894
908
|
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
}
|
|
909
|
+
if ( extension === null ) return Promise.resolve();
|
|
898
910
|
|
|
899
911
|
const pending = [];
|
|
900
912
|
|
|
901
|
-
const extension = materialDef.extensions[ this.name ];
|
|
902
|
-
|
|
903
913
|
if ( extension.clearcoatFactor !== undefined ) {
|
|
904
914
|
|
|
905
915
|
materialParams.clearcoat = extension.clearcoatFactor;
|
|
@@ -908,7 +918,7 @@ class GLTFMaterialsClearcoatExtension {
|
|
|
908
918
|
|
|
909
919
|
if ( extension.clearcoatTexture !== undefined ) {
|
|
910
920
|
|
|
911
|
-
pending.push( parser.assignTexture( materialParams, 'clearcoatMap', extension.clearcoatTexture ) );
|
|
921
|
+
pending.push( this.parser.assignTexture( materialParams, 'clearcoatMap', extension.clearcoatTexture ) );
|
|
912
922
|
|
|
913
923
|
}
|
|
914
924
|
|
|
@@ -920,13 +930,13 @@ class GLTFMaterialsClearcoatExtension {
|
|
|
920
930
|
|
|
921
931
|
if ( extension.clearcoatRoughnessTexture !== undefined ) {
|
|
922
932
|
|
|
923
|
-
pending.push( parser.assignTexture( materialParams, 'clearcoatRoughnessMap', extension.clearcoatRoughnessTexture ) );
|
|
933
|
+
pending.push( this.parser.assignTexture( materialParams, 'clearcoatRoughnessMap', extension.clearcoatRoughnessTexture ) );
|
|
924
934
|
|
|
925
935
|
}
|
|
926
936
|
|
|
927
937
|
if ( extension.clearcoatNormalTexture !== undefined ) {
|
|
928
938
|
|
|
929
|
-
pending.push( parser.assignTexture( materialParams, 'clearcoatNormalMap', extension.clearcoatNormalTexture ) );
|
|
939
|
+
pending.push( this.parser.assignTexture( materialParams, 'clearcoatNormalMap', extension.clearcoatNormalTexture ) );
|
|
930
940
|
|
|
931
941
|
if ( extension.clearcoatNormalTexture.scale !== undefined ) {
|
|
932
942
|
|
|
@@ -962,27 +972,17 @@ class GLTFMaterialsDispersionExtension {
|
|
|
962
972
|
|
|
963
973
|
getMaterialType( materialIndex ) {
|
|
964
974
|
|
|
965
|
-
const
|
|
966
|
-
const materialDef = parser.json.materials[ materialIndex ];
|
|
975
|
+
const extension = getMaterialExtension( this.parser, materialIndex, this.name );
|
|
967
976
|
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
return MeshPhysicalMaterial;
|
|
977
|
+
return extension !== null ? MeshPhysicalMaterial : null;
|
|
971
978
|
|
|
972
979
|
}
|
|
973
980
|
|
|
974
981
|
extendMaterialParams( materialIndex, materialParams ) {
|
|
975
982
|
|
|
976
|
-
const
|
|
977
|
-
const materialDef = parser.json.materials[ materialIndex ];
|
|
978
|
-
|
|
979
|
-
if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) {
|
|
980
|
-
|
|
981
|
-
return Promise.resolve();
|
|
983
|
+
const extension = getMaterialExtension( this.parser, materialIndex, this.name );
|
|
982
984
|
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
const extension = materialDef.extensions[ this.name ];
|
|
985
|
+
if ( extension === null ) return Promise.resolve();
|
|
986
986
|
|
|
987
987
|
materialParams.dispersion = extension.dispersion !== undefined ? extension.dispersion : 0;
|
|
988
988
|
|
|
@@ -1010,30 +1010,20 @@ class GLTFMaterialsIridescenceExtension {
|
|
|
1010
1010
|
|
|
1011
1011
|
getMaterialType( materialIndex ) {
|
|
1012
1012
|
|
|
1013
|
-
const
|
|
1014
|
-
const materialDef = parser.json.materials[ materialIndex ];
|
|
1015
|
-
|
|
1016
|
-
if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null;
|
|
1013
|
+
const extension = getMaterialExtension( this.parser, materialIndex, this.name );
|
|
1017
1014
|
|
|
1018
|
-
return MeshPhysicalMaterial;
|
|
1015
|
+
return extension !== null ? MeshPhysicalMaterial : null;
|
|
1019
1016
|
|
|
1020
1017
|
}
|
|
1021
1018
|
|
|
1022
1019
|
extendMaterialParams( materialIndex, materialParams ) {
|
|
1023
1020
|
|
|
1024
|
-
const
|
|
1025
|
-
const materialDef = parser.json.materials[ materialIndex ];
|
|
1026
|
-
|
|
1027
|
-
if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) {
|
|
1021
|
+
const extension = getMaterialExtension( this.parser, materialIndex, this.name );
|
|
1028
1022
|
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
}
|
|
1023
|
+
if ( extension === null ) return Promise.resolve();
|
|
1032
1024
|
|
|
1033
1025
|
const pending = [];
|
|
1034
1026
|
|
|
1035
|
-
const extension = materialDef.extensions[ this.name ];
|
|
1036
|
-
|
|
1037
1027
|
if ( extension.iridescenceFactor !== undefined ) {
|
|
1038
1028
|
|
|
1039
1029
|
materialParams.iridescence = extension.iridescenceFactor;
|
|
@@ -1042,7 +1032,7 @@ class GLTFMaterialsIridescenceExtension {
|
|
|
1042
1032
|
|
|
1043
1033
|
if ( extension.iridescenceTexture !== undefined ) {
|
|
1044
1034
|
|
|
1045
|
-
pending.push( parser.assignTexture( materialParams, 'iridescenceMap', extension.iridescenceTexture ) );
|
|
1035
|
+
pending.push( this.parser.assignTexture( materialParams, 'iridescenceMap', extension.iridescenceTexture ) );
|
|
1046
1036
|
|
|
1047
1037
|
}
|
|
1048
1038
|
|
|
@@ -1072,7 +1062,7 @@ class GLTFMaterialsIridescenceExtension {
|
|
|
1072
1062
|
|
|
1073
1063
|
if ( extension.iridescenceThicknessTexture !== undefined ) {
|
|
1074
1064
|
|
|
1075
|
-
pending.push( parser.assignTexture( materialParams, 'iridescenceThicknessMap', extension.iridescenceThicknessTexture ) );
|
|
1065
|
+
pending.push( this.parser.assignTexture( materialParams, 'iridescenceThicknessMap', extension.iridescenceThicknessTexture ) );
|
|
1076
1066
|
|
|
1077
1067
|
}
|
|
1078
1068
|
|
|
@@ -1100,25 +1090,17 @@ class GLTFMaterialsSheenExtension {
|
|
|
1100
1090
|
|
|
1101
1091
|
getMaterialType( materialIndex ) {
|
|
1102
1092
|
|
|
1103
|
-
const
|
|
1104
|
-
const materialDef = parser.json.materials[ materialIndex ];
|
|
1105
|
-
|
|
1106
|
-
if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null;
|
|
1093
|
+
const extension = getMaterialExtension( this.parser, materialIndex, this.name );
|
|
1107
1094
|
|
|
1108
|
-
return MeshPhysicalMaterial;
|
|
1095
|
+
return extension !== null ? MeshPhysicalMaterial : null;
|
|
1109
1096
|
|
|
1110
1097
|
}
|
|
1111
1098
|
|
|
1112
1099
|
extendMaterialParams( materialIndex, materialParams ) {
|
|
1113
1100
|
|
|
1114
|
-
const
|
|
1115
|
-
const materialDef = parser.json.materials[ materialIndex ];
|
|
1116
|
-
|
|
1117
|
-
if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) {
|
|
1101
|
+
const extension = getMaterialExtension( this.parser, materialIndex, this.name );
|
|
1118
1102
|
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
}
|
|
1103
|
+
if ( extension === null ) return Promise.resolve();
|
|
1122
1104
|
|
|
1123
1105
|
const pending = [];
|
|
1124
1106
|
|
|
@@ -1126,8 +1108,6 @@ class GLTFMaterialsSheenExtension {
|
|
|
1126
1108
|
materialParams.sheenRoughness = 0;
|
|
1127
1109
|
materialParams.sheen = 1;
|
|
1128
1110
|
|
|
1129
|
-
const extension = materialDef.extensions[ this.name ];
|
|
1130
|
-
|
|
1131
1111
|
if ( extension.sheenColorFactor !== undefined ) {
|
|
1132
1112
|
|
|
1133
1113
|
const colorFactor = extension.sheenColorFactor;
|
|
@@ -1143,13 +1123,13 @@ class GLTFMaterialsSheenExtension {
|
|
|
1143
1123
|
|
|
1144
1124
|
if ( extension.sheenColorTexture !== undefined ) {
|
|
1145
1125
|
|
|
1146
|
-
pending.push( parser.assignTexture( materialParams, 'sheenColorMap', extension.sheenColorTexture, SRGBColorSpace ) );
|
|
1126
|
+
pending.push( this.parser.assignTexture( materialParams, 'sheenColorMap', extension.sheenColorTexture, SRGBColorSpace ) );
|
|
1147
1127
|
|
|
1148
1128
|
}
|
|
1149
1129
|
|
|
1150
1130
|
if ( extension.sheenRoughnessTexture !== undefined ) {
|
|
1151
1131
|
|
|
1152
|
-
pending.push( parser.assignTexture( materialParams, 'sheenRoughnessMap', extension.sheenRoughnessTexture ) );
|
|
1132
|
+
pending.push( this.parser.assignTexture( materialParams, 'sheenRoughnessMap', extension.sheenRoughnessTexture ) );
|
|
1153
1133
|
|
|
1154
1134
|
}
|
|
1155
1135
|
|
|
@@ -1178,30 +1158,20 @@ class GLTFMaterialsTransmissionExtension {
|
|
|
1178
1158
|
|
|
1179
1159
|
getMaterialType( materialIndex ) {
|
|
1180
1160
|
|
|
1181
|
-
const
|
|
1182
|
-
const materialDef = parser.json.materials[ materialIndex ];
|
|
1183
|
-
|
|
1184
|
-
if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null;
|
|
1161
|
+
const extension = getMaterialExtension( this.parser, materialIndex, this.name );
|
|
1185
1162
|
|
|
1186
|
-
return MeshPhysicalMaterial;
|
|
1163
|
+
return extension !== null ? MeshPhysicalMaterial : null;
|
|
1187
1164
|
|
|
1188
1165
|
}
|
|
1189
1166
|
|
|
1190
1167
|
extendMaterialParams( materialIndex, materialParams ) {
|
|
1191
1168
|
|
|
1192
|
-
const
|
|
1193
|
-
const materialDef = parser.json.materials[ materialIndex ];
|
|
1169
|
+
const extension = getMaterialExtension( this.parser, materialIndex, this.name );
|
|
1194
1170
|
|
|
1195
|
-
if (
|
|
1196
|
-
|
|
1197
|
-
return Promise.resolve();
|
|
1198
|
-
|
|
1199
|
-
}
|
|
1171
|
+
if ( extension === null ) return Promise.resolve();
|
|
1200
1172
|
|
|
1201
1173
|
const pending = [];
|
|
1202
1174
|
|
|
1203
|
-
const extension = materialDef.extensions[ this.name ];
|
|
1204
|
-
|
|
1205
1175
|
if ( extension.transmissionFactor !== undefined ) {
|
|
1206
1176
|
|
|
1207
1177
|
materialParams.transmission = extension.transmissionFactor;
|
|
@@ -1210,7 +1180,7 @@ class GLTFMaterialsTransmissionExtension {
|
|
|
1210
1180
|
|
|
1211
1181
|
if ( extension.transmissionTexture !== undefined ) {
|
|
1212
1182
|
|
|
1213
|
-
pending.push( parser.assignTexture( materialParams, 'transmissionMap', extension.transmissionTexture ) );
|
|
1183
|
+
pending.push( this.parser.assignTexture( materialParams, 'transmissionMap', extension.transmissionTexture ) );
|
|
1214
1184
|
|
|
1215
1185
|
}
|
|
1216
1186
|
|
|
@@ -1238,35 +1208,25 @@ class GLTFMaterialsVolumeExtension {
|
|
|
1238
1208
|
|
|
1239
1209
|
getMaterialType( materialIndex ) {
|
|
1240
1210
|
|
|
1241
|
-
const
|
|
1242
|
-
const materialDef = parser.json.materials[ materialIndex ];
|
|
1243
|
-
|
|
1244
|
-
if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null;
|
|
1211
|
+
const extension = getMaterialExtension( this.parser, materialIndex, this.name );
|
|
1245
1212
|
|
|
1246
|
-
return MeshPhysicalMaterial;
|
|
1213
|
+
return extension !== null ? MeshPhysicalMaterial : null;
|
|
1247
1214
|
|
|
1248
1215
|
}
|
|
1249
1216
|
|
|
1250
1217
|
extendMaterialParams( materialIndex, materialParams ) {
|
|
1251
1218
|
|
|
1252
|
-
const
|
|
1253
|
-
const materialDef = parser.json.materials[ materialIndex ];
|
|
1254
|
-
|
|
1255
|
-
if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) {
|
|
1256
|
-
|
|
1257
|
-
return Promise.resolve();
|
|
1219
|
+
const extension = getMaterialExtension( this.parser, materialIndex, this.name );
|
|
1258
1220
|
|
|
1259
|
-
|
|
1221
|
+
if ( extension === null ) return Promise.resolve();
|
|
1260
1222
|
|
|
1261
1223
|
const pending = [];
|
|
1262
1224
|
|
|
1263
|
-
const extension = materialDef.extensions[ this.name ];
|
|
1264
|
-
|
|
1265
1225
|
materialParams.thickness = extension.thicknessFactor !== undefined ? extension.thicknessFactor : 0;
|
|
1266
1226
|
|
|
1267
1227
|
if ( extension.thicknessTexture !== undefined ) {
|
|
1268
1228
|
|
|
1269
|
-
pending.push( parser.assignTexture( materialParams, 'thicknessMap', extension.thicknessTexture ) );
|
|
1229
|
+
pending.push( this.parser.assignTexture( materialParams, 'thicknessMap', extension.thicknessTexture ) );
|
|
1270
1230
|
|
|
1271
1231
|
}
|
|
1272
1232
|
|
|
@@ -1299,30 +1259,22 @@ class GLTFMaterialsIorExtension {
|
|
|
1299
1259
|
|
|
1300
1260
|
getMaterialType( materialIndex ) {
|
|
1301
1261
|
|
|
1302
|
-
const
|
|
1303
|
-
const materialDef = parser.json.materials[ materialIndex ];
|
|
1304
|
-
|
|
1305
|
-
if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null;
|
|
1262
|
+
const extension = getMaterialExtension( this.parser, materialIndex, this.name );
|
|
1306
1263
|
|
|
1307
|
-
return MeshPhysicalMaterial;
|
|
1264
|
+
return extension !== null ? MeshPhysicalMaterial : null;
|
|
1308
1265
|
|
|
1309
1266
|
}
|
|
1310
1267
|
|
|
1311
1268
|
extendMaterialParams( materialIndex, materialParams ) {
|
|
1312
1269
|
|
|
1313
|
-
const
|
|
1314
|
-
const materialDef = parser.json.materials[ materialIndex ];
|
|
1315
|
-
|
|
1316
|
-
if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) {
|
|
1270
|
+
const extension = getMaterialExtension( this.parser, materialIndex, this.name );
|
|
1317
1271
|
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
}
|
|
1321
|
-
|
|
1322
|
-
const extension = materialDef.extensions[ this.name ];
|
|
1272
|
+
if ( extension === null ) return Promise.resolve();
|
|
1323
1273
|
|
|
1324
1274
|
materialParams.ior = extension.ior !== undefined ? extension.ior : 1.5;
|
|
1325
1275
|
|
|
1276
|
+
if ( materialParams.ior === 0 ) materialParams.ior = 1000; // see #26167
|
|
1277
|
+
|
|
1326
1278
|
return Promise.resolve();
|
|
1327
1279
|
|
|
1328
1280
|
}
|
|
@@ -1347,35 +1299,25 @@ class GLTFMaterialsSpecularExtension {
|
|
|
1347
1299
|
|
|
1348
1300
|
getMaterialType( materialIndex ) {
|
|
1349
1301
|
|
|
1350
|
-
const
|
|
1351
|
-
const materialDef = parser.json.materials[ materialIndex ];
|
|
1352
|
-
|
|
1353
|
-
if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null;
|
|
1302
|
+
const extension = getMaterialExtension( this.parser, materialIndex, this.name );
|
|
1354
1303
|
|
|
1355
|
-
return MeshPhysicalMaterial;
|
|
1304
|
+
return extension !== null ? MeshPhysicalMaterial : null;
|
|
1356
1305
|
|
|
1357
1306
|
}
|
|
1358
1307
|
|
|
1359
1308
|
extendMaterialParams( materialIndex, materialParams ) {
|
|
1360
1309
|
|
|
1361
|
-
const
|
|
1362
|
-
const materialDef = parser.json.materials[ materialIndex ];
|
|
1363
|
-
|
|
1364
|
-
if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) {
|
|
1310
|
+
const extension = getMaterialExtension( this.parser, materialIndex, this.name );
|
|
1365
1311
|
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
}
|
|
1312
|
+
if ( extension === null ) return Promise.resolve();
|
|
1369
1313
|
|
|
1370
1314
|
const pending = [];
|
|
1371
1315
|
|
|
1372
|
-
const extension = materialDef.extensions[ this.name ];
|
|
1373
|
-
|
|
1374
1316
|
materialParams.specularIntensity = extension.specularFactor !== undefined ? extension.specularFactor : 1.0;
|
|
1375
1317
|
|
|
1376
1318
|
if ( extension.specularTexture !== undefined ) {
|
|
1377
1319
|
|
|
1378
|
-
pending.push( parser.assignTexture( materialParams, 'specularIntensityMap', extension.specularTexture ) );
|
|
1320
|
+
pending.push( this.parser.assignTexture( materialParams, 'specularIntensityMap', extension.specularTexture ) );
|
|
1379
1321
|
|
|
1380
1322
|
}
|
|
1381
1323
|
|
|
@@ -1384,7 +1326,7 @@ class GLTFMaterialsSpecularExtension {
|
|
|
1384
1326
|
|
|
1385
1327
|
if ( extension.specularColorTexture !== undefined ) {
|
|
1386
1328
|
|
|
1387
|
-
pending.push( parser.assignTexture( materialParams, 'specularColorMap', extension.specularColorTexture, SRGBColorSpace ) );
|
|
1329
|
+
pending.push( this.parser.assignTexture( materialParams, 'specularColorMap', extension.specularColorTexture, SRGBColorSpace ) );
|
|
1388
1330
|
|
|
1389
1331
|
}
|
|
1390
1332
|
|
|
@@ -1413,35 +1355,25 @@ class GLTFMaterialsBumpExtension {
|
|
|
1413
1355
|
|
|
1414
1356
|
getMaterialType( materialIndex ) {
|
|
1415
1357
|
|
|
1416
|
-
const
|
|
1417
|
-
const materialDef = parser.json.materials[ materialIndex ];
|
|
1418
|
-
|
|
1419
|
-
if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null;
|
|
1358
|
+
const extension = getMaterialExtension( this.parser, materialIndex, this.name );
|
|
1420
1359
|
|
|
1421
|
-
return MeshPhysicalMaterial;
|
|
1360
|
+
return extension !== null ? MeshPhysicalMaterial : null;
|
|
1422
1361
|
|
|
1423
1362
|
}
|
|
1424
1363
|
|
|
1425
1364
|
extendMaterialParams( materialIndex, materialParams ) {
|
|
1426
1365
|
|
|
1427
|
-
const
|
|
1428
|
-
const materialDef = parser.json.materials[ materialIndex ];
|
|
1429
|
-
|
|
1430
|
-
if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) {
|
|
1366
|
+
const extension = getMaterialExtension( this.parser, materialIndex, this.name );
|
|
1431
1367
|
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
}
|
|
1368
|
+
if ( extension === null ) return Promise.resolve();
|
|
1435
1369
|
|
|
1436
1370
|
const pending = [];
|
|
1437
1371
|
|
|
1438
|
-
const extension = materialDef.extensions[ this.name ];
|
|
1439
|
-
|
|
1440
1372
|
materialParams.bumpScale = extension.bumpFactor !== undefined ? extension.bumpFactor : 1.0;
|
|
1441
1373
|
|
|
1442
1374
|
if ( extension.bumpTexture !== undefined ) {
|
|
1443
1375
|
|
|
1444
|
-
pending.push( parser.assignTexture( materialParams, 'bumpMap', extension.bumpTexture ) );
|
|
1376
|
+
pending.push( this.parser.assignTexture( materialParams, 'bumpMap', extension.bumpTexture ) );
|
|
1445
1377
|
|
|
1446
1378
|
}
|
|
1447
1379
|
|
|
@@ -1469,30 +1401,20 @@ class GLTFMaterialsAnisotropyExtension {
|
|
|
1469
1401
|
|
|
1470
1402
|
getMaterialType( materialIndex ) {
|
|
1471
1403
|
|
|
1472
|
-
const
|
|
1473
|
-
const materialDef = parser.json.materials[ materialIndex ];
|
|
1474
|
-
|
|
1475
|
-
if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null;
|
|
1404
|
+
const extension = getMaterialExtension( this.parser, materialIndex, this.name );
|
|
1476
1405
|
|
|
1477
|
-
return MeshPhysicalMaterial;
|
|
1406
|
+
return extension !== null ? MeshPhysicalMaterial : null;
|
|
1478
1407
|
|
|
1479
1408
|
}
|
|
1480
1409
|
|
|
1481
1410
|
extendMaterialParams( materialIndex, materialParams ) {
|
|
1482
1411
|
|
|
1483
|
-
const
|
|
1484
|
-
const materialDef = parser.json.materials[ materialIndex ];
|
|
1485
|
-
|
|
1486
|
-
if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) {
|
|
1412
|
+
const extension = getMaterialExtension( this.parser, materialIndex, this.name );
|
|
1487
1413
|
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
}
|
|
1414
|
+
if ( extension === null ) return Promise.resolve();
|
|
1491
1415
|
|
|
1492
1416
|
const pending = [];
|
|
1493
1417
|
|
|
1494
|
-
const extension = materialDef.extensions[ this.name ];
|
|
1495
|
-
|
|
1496
1418
|
if ( extension.anisotropyStrength !== undefined ) {
|
|
1497
1419
|
|
|
1498
1420
|
materialParams.anisotropy = extension.anisotropyStrength;
|
|
@@ -1507,7 +1429,7 @@ class GLTFMaterialsAnisotropyExtension {
|
|
|
1507
1429
|
|
|
1508
1430
|
if ( extension.anisotropyTexture !== undefined ) {
|
|
1509
1431
|
|
|
1510
|
-
pending.push( parser.assignTexture( materialParams, 'anisotropyMap', extension.anisotropyTexture ) );
|
|
1432
|
+
pending.push( this.parser.assignTexture( materialParams, 'anisotropyMap', extension.anisotropyTexture ) );
|
|
1511
1433
|
|
|
1512
1434
|
}
|
|
1513
1435
|
|
|
@@ -1673,9 +1595,9 @@ class GLTFTextureAVIFExtension {
|
|
|
1673
1595
|
*/
|
|
1674
1596
|
class GLTFMeshoptCompression {
|
|
1675
1597
|
|
|
1676
|
-
constructor( parser ) {
|
|
1598
|
+
constructor( parser, name ) {
|
|
1677
1599
|
|
|
1678
|
-
this.name =
|
|
1600
|
+
this.name = name;
|
|
1679
1601
|
this.parser = parser;
|
|
1680
1602
|
|
|
1681
1603
|
}
|
|
@@ -2662,7 +2584,7 @@ class GLTFParser {
|
|
|
2662
2584
|
let isFirefox = false;
|
|
2663
2585
|
let firefoxVersion = - 1;
|
|
2664
2586
|
|
|
2665
|
-
if ( typeof navigator !== 'undefined' ) {
|
|
2587
|
+
if ( typeof navigator !== 'undefined' && typeof navigator.userAgent !== 'undefined' ) {
|
|
2666
2588
|
|
|
2667
2589
|
const userAgent = navigator.userAgent;
|
|
2668
2590
|
|
|
@@ -4319,6 +4241,28 @@ class GLTFParser {
|
|
|
4319
4241
|
|
|
4320
4242
|
}
|
|
4321
4243
|
|
|
4244
|
+
// Reconstruct pivot from container pattern created by GLTFExporter
|
|
4245
|
+
// The container has position+pivot, rotation, scale; child has -pivot offset and mesh
|
|
4246
|
+
if ( node.userData.pivot !== undefined && children.length > 0 ) {
|
|
4247
|
+
|
|
4248
|
+
const pivot = node.userData.pivot;
|
|
4249
|
+
const pivotChild = children[ 0 ];
|
|
4250
|
+
|
|
4251
|
+
// Set pivot on container and adjust transforms
|
|
4252
|
+
node.pivot = new Vector3().fromArray( pivot );
|
|
4253
|
+
|
|
4254
|
+
// Adjust container position: stored as position + pivot, so subtract pivot
|
|
4255
|
+
node.position.x -= pivot[ 0 ];
|
|
4256
|
+
node.position.y -= pivot[ 1 ];
|
|
4257
|
+
node.position.z -= pivot[ 2 ];
|
|
4258
|
+
|
|
4259
|
+
// Remove the child's -pivot offset since pivot now handles it
|
|
4260
|
+
pivotChild.position.set( 0, 0, 0 );
|
|
4261
|
+
|
|
4262
|
+
delete node.userData.pivot;
|
|
4263
|
+
|
|
4264
|
+
}
|
|
4265
|
+
|
|
4322
4266
|
return node;
|
|
4323
4267
|
|
|
4324
4268
|
} );
|
|
@@ -4510,7 +4454,20 @@ class GLTFParser {
|
|
|
4510
4454
|
|
|
4511
4455
|
for ( let i = 0, il = nodes.length; i < il; i ++ ) {
|
|
4512
4456
|
|
|
4513
|
-
|
|
4457
|
+
const node = nodes[ i ];
|
|
4458
|
+
|
|
4459
|
+
// If the node already has a parent, it means it's being reused across multiple scenes.
|
|
4460
|
+
// Clone it to avoid the second scene's add() removing it from the first scene.
|
|
4461
|
+
// See: https://github.com/mrdoob/three.js/issues/27993
|
|
4462
|
+
if ( node.parent !== null ) {
|
|
4463
|
+
|
|
4464
|
+
scene.add( clone( node ) );
|
|
4465
|
+
|
|
4466
|
+
} else {
|
|
4467
|
+
|
|
4468
|
+
scene.add( node );
|
|
4469
|
+
|
|
4470
|
+
}
|
|
4514
4471
|
|
|
4515
4472
|
}
|
|
4516
4473
|
|
|
@@ -4561,17 +4518,28 @@ class GLTFParser {
|
|
|
4561
4518
|
const targetName = node.name ? node.name : node.uuid;
|
|
4562
4519
|
const targetNames = [];
|
|
4563
4520
|
|
|
4521
|
+
function collectMorphTargets( object ) {
|
|
4522
|
+
|
|
4523
|
+
if ( object.morphTargetInfluences ) {
|
|
4524
|
+
|
|
4525
|
+
targetNames.push( object.name ? object.name : object.uuid );
|
|
4526
|
+
|
|
4527
|
+
}
|
|
4528
|
+
|
|
4529
|
+
}
|
|
4530
|
+
|
|
4531
|
+
|
|
4564
4532
|
if ( PATH_PROPERTIES[ target.path ] === PATH_PROPERTIES.weights ) {
|
|
4565
4533
|
|
|
4566
|
-
|
|
4534
|
+
collectMorphTargets( node );
|
|
4567
4535
|
|
|
4568
|
-
|
|
4536
|
+
// for multi-primitive meshes, the node is a Group containing the sub-meshes
|
|
4569
4537
|
|
|
4570
|
-
|
|
4538
|
+
if ( node.isGroup ) {
|
|
4571
4539
|
|
|
4572
|
-
|
|
4540
|
+
node.children.forEach( collectMorphTargets );
|
|
4573
4541
|
|
|
4574
|
-
}
|
|
4542
|
+
}
|
|
4575
4543
|
|
|
4576
4544
|
} else {
|
|
4577
4545
|
|
|
@@ -100,7 +100,7 @@ class HDRLoader extends DataTextureLoader {
|
|
|
100
100
|
|
|
101
101
|
s += chunk; len += chunk.length;
|
|
102
102
|
p += chunkSize;
|
|
103
|
-
chunk
|
|
103
|
+
chunk = String.fromCharCode.apply( null, new Uint16Array( buffer.subarray( p, p + chunkSize ) ) );
|
|
104
104
|
|
|
105
105
|
}
|
|
106
106
|
|
|
@@ -424,7 +424,6 @@ class HDRLoader extends DataTextureLoader {
|
|
|
424
424
|
default:
|
|
425
425
|
|
|
426
426
|
throw new Error( 'THREE.HDRLoader: Unsupported type: ' + this.type );
|
|
427
|
-
break;
|
|
428
427
|
|
|
429
428
|
}
|
|
430
429
|
|