super-three 0.141.0 → 0.147.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/README.md +9 -9
- package/build/three.cjs +2441 -1569
- package/build/three.js +2441 -1569
- package/build/three.min.js +1 -1
- package/build/three.module.js +2847 -1576
- package/examples/js/animation/AnimationClipCreator.js +0 -8
- package/examples/js/animation/CCDIKSolver.js +50 -67
- package/examples/js/animation/MMDAnimationHelper.js +66 -137
- package/examples/js/animation/MMDPhysics.js +71 -150
- package/examples/js/cameras/CinematicCamera.js +33 -22
- package/examples/js/controls/ArcballControls.js +149 -403
- package/examples/js/controls/DragControls.js +8 -33
- package/examples/js/controls/FirstPersonControls.js +32 -61
- package/examples/js/controls/FlyControls.js +29 -63
- package/examples/js/controls/OrbitControls.js +125 -103
- package/examples/js/controls/PointerLockControls.js +5 -22
- package/examples/js/controls/TrackballControls.js +33 -88
- package/examples/js/controls/TransformControls.js +101 -182
- package/examples/js/csm/CSM.js +4 -39
- package/examples/js/csm/CSMFrustum.js +3 -9
- package/examples/js/csm/CSMHelper.js +24 -4
- package/examples/js/csm/CSMShader.js +2 -6
- package/examples/js/curves/CurveExtras.js +27 -27
- package/examples/js/curves/NURBSCurve.js +4 -16
- package/examples/js/curves/NURBSSurface.js +3 -9
- package/examples/js/curves/NURBSUtils.js +8 -45
- package/examples/js/effects/AnaglyphEffect.js +6 -20
- package/examples/js/effects/AsciiEffect.js +32 -31
- package/examples/js/effects/OutlineEffect.js +30 -54
- package/examples/js/effects/ParallaxBarrierEffect.js +2 -15
- package/examples/js/effects/PeppersGhostEffect.js +14 -41
- package/examples/js/effects/StereoEffect.js +2 -6
- package/examples/js/environments/RoomEnvironment.js +32 -8
- package/examples/js/exporters/ColladaExporter.js +52 -78
- package/examples/js/exporters/DRACOExporter.js +22 -34
- package/examples/js/exporters/EXRExporter.js +15 -18
- package/examples/js/exporters/GLTFExporter.js +168 -345
- package/examples/js/exporters/MMDExporter.js +5 -12
- package/examples/js/exporters/OBJExporter.js +40 -52
- package/examples/js/exporters/PLYExporter.js +50 -57
- package/examples/js/exporters/STLExporter.js +5 -14
- package/examples/js/exporters/USDZExporter.js +119 -27
- package/examples/js/geometries/BoxLineGeometry.js +0 -1
- package/examples/js/geometries/ConvexGeometry.js +12 -7
- package/examples/js/geometries/DecalGeometry.js +53 -20
- package/examples/js/geometries/LightningStrike.js +54 -67
- package/examples/js/geometries/ParametricGeometries.js +8 -7
- package/examples/js/geometries/ParametricGeometry.js +23 -17
- package/examples/js/geometries/RoundedBoxGeometry.js +21 -19
- package/examples/js/geometries/TeapotGeometry.js +54 -50
- package/examples/js/geometries/TextGeometry.js +6 -4
- package/examples/js/helpers/LightProbeHelper.js +1 -2
- package/examples/js/helpers/OctreeHelper.js +22 -20
- package/examples/js/helpers/PositionalAudioHelper.js +8 -6
- package/examples/js/helpers/RectAreaLightHelper.js +6 -7
- package/examples/js/helpers/VertexNormalsHelper.js +15 -13
- package/examples/js/helpers/VertexTangentsHelper.js +15 -9
- package/examples/js/helpers/ViewHelper.js +31 -16
- package/examples/js/interactive/HTMLMesh.js +25 -39
- package/examples/js/interactive/InteractiveGroup.js +9 -14
- package/examples/js/interactive/SelectionBox.js +3 -70
- package/examples/js/interactive/SelectionHelper.js +2 -8
- package/examples/js/libs/ktx-parse.umd.js +1 -0
- package/examples/js/libs/meshopt_decoder.js +98 -32
- package/examples/js/lights/LightProbeGenerator.js +32 -39
- package/examples/js/lights/RectAreaLightUniformsLib.js +5 -1
- package/examples/js/lines/LineGeometry.js +3 -5
- package/examples/js/lines/LineMaterial.js +4 -11
- package/examples/js/lines/LineSegments2.js +40 -89
- package/examples/js/lines/LineSegmentsGeometry.js +7 -28
- package/examples/js/lines/Wireframe.js +2 -7
- package/examples/js/lines/WireframeGeometry2.js +3 -1
- package/examples/js/loaders/3DMLoader.js +58 -155
- package/examples/js/loaders/3MFLoader.js +72 -106
- package/examples/js/loaders/AMFLoader.js +0 -25
- package/examples/js/loaders/BVHLoader.js +44 -43
- package/examples/js/loaders/BasisTextureLoader.js +16 -46
- package/examples/js/loaders/ColladaLoader.js +229 -359
- package/examples/js/loaders/DDSLoader.js +24 -25
- package/examples/js/loaders/DRACOLoader.js +30 -90
- package/examples/js/loaders/EXRLoader.js +69 -177
- package/examples/js/loaders/FBXLoader.js +294 -441
- package/examples/js/loaders/FontLoader.js +9 -31
- package/examples/js/loaders/GCodeLoader.js +15 -16
- package/examples/js/loaders/GLTFLoader.js +458 -739
- package/examples/js/loaders/HDRCubeTextureLoader.js +0 -17
- package/examples/js/loaders/KMZLoader.js +3 -7
- package/examples/js/loaders/KTXLoader.js +12 -30
- package/examples/js/loaders/LDrawLoader.js +309 -355
- package/examples/js/loaders/LUT3dlLoader.js +7 -11
- package/examples/js/loaders/LUTCubeLoader.js +0 -8
- package/examples/js/loaders/LWOLoader.js +59 -124
- package/examples/js/loaders/LogLuvLoader.js +27 -77
- package/examples/js/loaders/LottieLoader.js +4 -4
- package/examples/js/loaders/MD2Loader.js +26 -27
- package/examples/js/loaders/MDDLoader.js +6 -10
- package/examples/js/loaders/MMDLoader.js +180 -189
- package/examples/js/loaders/MTLLoader.js +18 -47
- package/examples/js/loaders/NRRDLoader.js +44 -84
- package/examples/js/loaders/OBJLoader.js +56 -77
- package/examples/js/loaders/PCDLoader.js +92 -42
- package/examples/js/loaders/PDBLoader.js +17 -13
- package/examples/js/loaders/PLYLoader.js +65 -51
- package/examples/js/loaders/PRWMLoader.js +11 -22
- package/examples/js/loaders/PVRLoader.js +7 -16
- package/examples/js/loaders/RGBELoader.js +36 -61
- package/examples/js/loaders/RGBMLoader.js +26 -87
- package/examples/js/loaders/STLLoader.js +20 -27
- package/examples/js/loaders/SVGLoader.js +365 -236
- package/examples/js/loaders/TDSLoader.js +81 -118
- package/examples/js/loaders/TGALoader.js +39 -41
- package/examples/js/loaders/TIFFLoader.js +30 -0
- package/examples/js/loaders/TTFLoader.js +0 -8
- package/examples/js/loaders/TiltLoader.js +14 -15
- package/examples/js/loaders/VOXLoader.js +8 -16
- package/examples/js/loaders/VRMLLoader.js +266 -354
- package/examples/js/loaders/VTKLoader.js +102 -119
- package/examples/js/loaders/XYZLoader.js +2 -4
- package/examples/js/loaders/lwo/IFFParser.js +55 -136
- package/examples/js/loaders/lwo/LWO2Parser.js +39 -89
- package/examples/js/loaders/lwo/LWO3Parser.js +38 -79
- package/examples/js/materials/MeshGouraudMaterial.js +387 -0
- package/examples/js/math/Capsule.js +0 -17
- package/examples/js/math/ColorConverter.js +3 -53
- package/examples/js/math/ConvexHull.js +185 -141
- package/examples/js/math/ImprovedNoise.js +1 -1
- package/examples/js/math/Lut.js +8 -15
- package/examples/js/math/MeshSurfaceSampler.js +6 -28
- package/examples/js/math/OBB.js +90 -49
- package/examples/js/math/Octree.js +2 -57
- package/examples/js/math/SimplexNoise.js +74 -88
- package/examples/js/misc/ConvexObjectBreaker.js +37 -48
- package/examples/js/misc/GPUComputationRenderer.js +47 -14
- package/examples/js/misc/Gyroscope.js +5 -9
- package/examples/js/misc/MD2Character.js +14 -23
- package/examples/js/misc/MD2CharacterComplex.js +73 -54
- package/examples/js/misc/MorphAnimMesh.js +0 -6
- package/examples/js/misc/MorphBlendMesh.js +3 -30
- package/examples/js/misc/ProgressiveLightMap.js +47 -43
- package/examples/js/misc/RollerCoaster.js +17 -24
- package/examples/js/misc/TubePainter.js +18 -12
- package/examples/js/misc/Volume.js +173 -194
- package/examples/js/misc/VolumeSlice.js +91 -99
- package/examples/js/modifiers/CurveModifier.js +19 -21
- package/examples/js/modifiers/EdgeSplitModifier.js +0 -30
- package/examples/js/modifiers/SimplifyModifier.js +57 -60
- package/examples/js/modifiers/TessellateModifier.js +2 -9
- package/examples/js/objects/GroundProjectedEnv.js +181 -0
- package/examples/js/objects/Lensflare.js +47 -38
- package/examples/js/objects/LightningStorm.js +10 -13
- package/examples/js/objects/MarchingCubes.js +80 -59
- package/examples/js/objects/Reflector.js +31 -22
- package/examples/js/objects/ReflectorForSSRPass.js +20 -25
- package/examples/js/objects/Refractor.js +61 -33
- package/examples/js/objects/ShadowMesh.js +6 -3
- package/examples/js/objects/Sky.js +2 -7
- package/examples/js/objects/Water.js +23 -18
- package/examples/js/objects/Water2.js +20 -19
- package/examples/js/physics/AmmoPhysics.js +23 -20
- package/examples/js/physics/OimoPhysics.js +19 -17
- package/examples/js/postprocessing/AdaptiveToneMappingPass.js +13 -20
- package/examples/js/postprocessing/AfterimagePass.js +19 -12
- package/examples/js/postprocessing/BloomPass.js +38 -17
- package/examples/js/postprocessing/BokehPass.js +29 -12
- package/examples/js/postprocessing/ClearPass.js +1 -6
- package/examples/js/postprocessing/CubeTexturePass.js +12 -9
- package/examples/js/postprocessing/DotScreenPass.js +7 -5
- package/examples/js/postprocessing/EffectComposer.js +25 -32
- package/examples/js/postprocessing/FilmPass.js +7 -5
- package/examples/js/postprocessing/GlitchPass.js +10 -11
- package/examples/js/postprocessing/HalftonePass.js +9 -9
- package/examples/js/postprocessing/LUTPass.js +2 -15
- package/examples/js/postprocessing/MaskPass.js +20 -17
- package/examples/js/postprocessing/OutlinePass.js +49 -38
- package/examples/js/postprocessing/Pass.js +11 -14
- package/examples/js/postprocessing/RenderPass.js +3 -7
- package/examples/js/postprocessing/RenderPixelatedPass.js +215 -0
- package/examples/js/postprocessing/SAOPass.js +40 -32
- package/examples/js/postprocessing/SMAAPass.js +34 -17
- package/examples/js/postprocessing/SSAARenderPass.js +14 -14
- package/examples/js/postprocessing/SSAOPass.js +56 -42
- package/examples/js/postprocessing/SSRPass.js +78 -61
- package/examples/js/postprocessing/SavePass.js +14 -6
- package/examples/js/postprocessing/ShaderPass.js +9 -8
- package/examples/js/postprocessing/TAARenderPass.js +11 -9
- package/examples/js/postprocessing/TexturePass.js +7 -4
- package/examples/js/postprocessing/UnrealBloomPass.js +43 -25
- package/examples/js/renderers/CSS2DRenderer.js +4 -23
- package/examples/js/renderers/CSS3DRenderer.js +5 -26
- package/examples/js/renderers/Projector.js +31 -108
- package/examples/js/renderers/SVGRenderer.js +4 -50
- package/examples/js/shaders/ACESFilmicToneMappingShader.js +3 -6
- package/examples/js/shaders/AfterimageShader.js +3 -6
- package/examples/js/shaders/BasicShader.js +3 -6
- package/examples/js/shaders/BleachBypassShader.js +3 -6
- package/examples/js/shaders/BlendShader.js +3 -6
- package/examples/js/shaders/BokehShader.js +3 -6
- package/examples/js/shaders/BokehShader2.js +4 -13
- package/examples/js/shaders/BrightnessContrastShader.js +3 -6
- package/examples/js/shaders/ColorCorrectionShader.js +2 -6
- package/examples/js/shaders/ColorifyShader.js +2 -6
- package/examples/js/shaders/ConvolutionShader.js +5 -10
- package/examples/js/shaders/CopyShader.js +3 -6
- package/examples/js/shaders/DOFMipMapShader.js +3 -6
- package/examples/js/shaders/DepthLimitedBlurShader.js +2 -9
- package/examples/js/shaders/DigitalGlitch.js +3 -6
- package/examples/js/shaders/DotScreenShader.js +2 -6
- package/examples/js/shaders/FXAAShader.js +1 -3
- package/examples/js/shaders/FilmShader.js +3 -6
- package/examples/js/shaders/FocusShader.js +3 -6
- package/examples/js/shaders/FreiChenShader.js +2 -6
- package/examples/js/shaders/GammaCorrectionShader.js +3 -6
- package/examples/js/shaders/GodRaysShader.js +11 -24
- package/examples/js/shaders/HalftoneShader.js +3 -6
- package/examples/js/shaders/HorizontalBlurShader.js +3 -6
- package/examples/js/shaders/HorizontalTiltShiftShader.js +3 -6
- package/examples/js/shaders/HueSaturationShader.js +3 -6
- package/examples/js/shaders/KaleidoShader.js +3 -6
- package/examples/js/shaders/LuminosityHighPassShader.js +2 -6
- package/examples/js/shaders/LuminosityShader.js +4 -7
- package/examples/js/shaders/MMDToonShader.js +2 -4
- package/examples/js/shaders/MirrorShader.js +3 -6
- package/examples/js/shaders/NormalMapShader.js +2 -6
- package/examples/js/shaders/RGBShiftShader.js +3 -6
- package/examples/js/shaders/SAOShader.js +2 -6
- package/examples/js/shaders/SMAAShader.js +6 -18
- package/examples/js/shaders/SSAOShader.js +2 -6
- package/examples/js/shaders/SSRShader.js +6 -18
- package/examples/js/shaders/SepiaShader.js +3 -6
- package/examples/js/shaders/SobelOperatorShader.js +2 -6
- package/examples/js/shaders/TechnicolorShader.js +3 -6
- package/examples/js/shaders/ToneMapShader.js +4 -7
- package/examples/js/shaders/ToonShader.js +8 -24
- package/examples/js/shaders/TriangleBlurShader.js +2 -6
- package/examples/js/shaders/UnpackDepthRGBAShader.js +3 -6
- package/examples/js/shaders/VelocityShader.js +126 -0
- package/examples/js/shaders/VerticalBlurShader.js +3 -6
- package/examples/js/shaders/VerticalTiltShiftShader.js +3 -6
- package/examples/js/shaders/VignetteShader.js +3 -6
- package/examples/js/shaders/VolumeShader.js +2 -6
- package/examples/js/shaders/WaterRefractionShader.js +2 -6
- package/examples/js/textures/FlakesTexture.js +0 -1
- package/examples/js/utils/BufferGeometryUtils.js +237 -171
- package/examples/js/utils/CameraUtils.js +5 -20
- package/examples/js/utils/GPUStatsPanel.js +3 -12
- package/examples/js/utils/GeometryCompressionUtils.js +19 -44
- package/examples/js/utils/GeometryUtils.js +15 -36
- package/examples/js/utils/LDrawUtils.js +8 -11
- package/examples/js/utils/PackedPhongMaterial.js +6 -4
- package/examples/js/utils/SceneUtils.js +109 -14
- package/examples/js/utils/ShadowMapViewer.js +17 -14
- package/examples/js/utils/SkeletonUtils.js +13 -27
- package/examples/js/utils/UVsDebug.js +20 -12
- package/examples/js/utils/WorkerPool.js +1 -11
- package/examples/jsm/animation/CCDIKSolver.js +27 -3
- package/examples/jsm/animation/MMDPhysics.js +28 -22
- package/examples/jsm/capabilities/WebGPU.js +3 -1
- package/examples/jsm/controls/ArcballControls.js +17 -2
- package/examples/jsm/controls/FirstPersonControls.js +20 -27
- package/examples/jsm/controls/FlyControls.js +16 -24
- package/examples/jsm/controls/OrbitControls.js +44 -9
- package/examples/jsm/controls/PointerLockControls.js +0 -7
- package/examples/jsm/controls/TrackballControls.js +14 -5
- package/examples/jsm/controls/TransformControls.js +18 -16
- package/examples/jsm/csm/CSM.js +1 -0
- package/examples/jsm/csm/CSMHelper.js +30 -0
- package/examples/jsm/effects/AnaglyphEffect.js +2 -2
- package/examples/jsm/effects/OutlineEffect.js +4 -25
- package/examples/jsm/effects/ParallaxBarrierEffect.js +2 -2
- package/examples/jsm/effects/PeppersGhostEffect.js +2 -2
- package/examples/jsm/effects/StereoEffect.js +2 -2
- package/examples/jsm/environments/RoomEnvironment.js +23 -0
- package/examples/jsm/exporters/ColladaExporter.js +4 -13
- package/examples/jsm/exporters/DRACOExporter.js +0 -13
- package/examples/jsm/exporters/GLTFExporter.js +29 -110
- package/examples/jsm/exporters/KTX2Exporter.js +29 -29
- package/examples/jsm/exporters/OBJExporter.js +0 -18
- package/examples/jsm/exporters/PLYExporter.js +14 -22
- package/examples/jsm/exporters/STLExporter.js +1 -9
- package/examples/jsm/exporters/USDZExporter.js +107 -4
- package/examples/jsm/geometries/ConvexGeometry.js +1 -1
- package/examples/jsm/geometries/ParametricGeometry.js +0 -6
- package/examples/jsm/helpers/OctreeHelper.js +22 -8
- package/examples/jsm/helpers/VertexNormalsHelper.js +7 -1
- package/examples/jsm/helpers/VertexTangentsHelper.js +7 -0
- package/examples/jsm/helpers/ViewHelper.js +24 -0
- package/examples/jsm/interactive/HTMLMesh.js +14 -15
- package/examples/jsm/interactive/InteractiveGroup.js +4 -2
- package/examples/jsm/interactive/SelectionHelper.js +5 -3
- package/examples/jsm/libs/flow.module.js +610 -160
- package/examples/jsm/libs/lottie_canvas.module.js +14844 -0
- package/examples/jsm/libs/meshopt_decoder.module.js +97 -32
- package/examples/jsm/libs/utif.module.js +1579 -0
- package/examples/jsm/libs/zstddec.module.js +1 -0
- package/examples/jsm/lines/LineSegments2.js +4 -0
- package/examples/jsm/loaders/3DMLoader.js +1 -2
- package/examples/jsm/loaders/ColladaLoader.js +29 -0
- package/examples/jsm/loaders/DRACOLoader.js +2 -28
- package/examples/jsm/loaders/EXRLoader.js +3 -13
- package/examples/jsm/loaders/FBXLoader.js +26 -3
- package/examples/jsm/loaders/FontLoader.js +3 -16
- package/examples/jsm/loaders/GLTFLoader.js +321 -464
- package/examples/jsm/loaders/HDRCubeTextureLoader.js +0 -13
- package/examples/jsm/loaders/KTX2Loader.js +254 -53
- package/examples/jsm/loaders/LDrawLoader.js +149 -87
- package/examples/jsm/loaders/LottieLoader.js +4 -2
- package/examples/jsm/loaders/MaterialXLoader.js +728 -0
- package/examples/jsm/loaders/OBJLoader.js +6 -14
- package/examples/jsm/loaders/PCDLoader.js +60 -14
- package/examples/jsm/loaders/PLYLoader.js +71 -19
- package/examples/jsm/loaders/RGBELoader.js +1 -1
- package/examples/jsm/loaders/SVGLoader.js +231 -17
- package/examples/jsm/loaders/TIFFLoader.js +36 -0
- package/examples/jsm/loaders/USDZLoader.js +633 -0
- package/examples/jsm/loaders/VRMLLoader.js +36 -26
- package/examples/jsm/loaders/VTKLoader.js +1 -1
- package/examples/jsm/loaders/lwo/LWO2Parser.js +6 -8
- package/examples/jsm/loaders/lwo/LWO3Parser.js +6 -8
- package/examples/jsm/materials/MeshGouraudMaterial.js +423 -0
- package/examples/jsm/math/ColorConverter.js +1 -49
- package/examples/jsm/math/ConvexHull.js +4 -4
- package/examples/jsm/math/Octree.js +1 -1
- package/examples/jsm/misc/GPUComputationRenderer.js +43 -0
- package/examples/jsm/misc/Volume.js +169 -171
- package/examples/jsm/misc/VolumeSlice.js +78 -80
- package/examples/jsm/modifiers/SimplifyModifier.js +1 -1
- package/examples/jsm/node-editor/NodeEditor.js +91 -12
- package/examples/jsm/node-editor/accessors/MatcapUVEditor.js +1 -1
- package/examples/jsm/node-editor/accessors/NormalEditor.js +1 -1
- package/examples/jsm/node-editor/accessors/PositionEditor.js +1 -1
- package/examples/jsm/node-editor/accessors/UVEditor.js +1 -1
- package/examples/jsm/node-editor/core/BaseNode.js +10 -3
- package/examples/jsm/node-editor/display/BlendEditor.js +1 -1
- package/examples/jsm/node-editor/display/NormalMapEditor.js +1 -1
- package/examples/jsm/node-editor/inputs/ColorEditor.js +1 -1
- package/examples/jsm/node-editor/inputs/FloatEditor.js +1 -1
- package/examples/jsm/node-editor/inputs/SliderEditor.js +1 -1
- package/examples/jsm/node-editor/inputs/TextureEditor.js +1 -1
- package/examples/jsm/node-editor/inputs/Vector2Editor.js +1 -1
- package/examples/jsm/node-editor/inputs/Vector3Editor.js +1 -1
- package/examples/jsm/node-editor/inputs/Vector4Editor.js +1 -1
- package/examples/jsm/node-editor/materials/BasicMaterialEditor.js +7 -10
- package/examples/jsm/node-editor/materials/PointsMaterialEditor.js +1 -1
- package/examples/jsm/node-editor/materials/StandardMaterialEditor.js +7 -10
- package/examples/jsm/node-editor/math/AngleEditor.js +4 -4
- package/examples/jsm/node-editor/math/DotEditor.js +1 -1
- package/examples/jsm/node-editor/math/InvertEditor.js +3 -3
- package/examples/jsm/node-editor/math/LimiterEditor.js +1 -1
- package/examples/jsm/node-editor/math/NormalizeEditor.js +1 -1
- package/examples/jsm/node-editor/math/OperatorEditor.js +1 -1
- package/examples/jsm/node-editor/math/PowerEditor.js +1 -1
- package/examples/jsm/node-editor/math/TrigonometryEditor.js +1 -1
- package/examples/jsm/node-editor/procedural/CheckerEditor.js +1 -1
- package/examples/jsm/node-editor/scene/MeshEditor.js +11 -8
- package/examples/jsm/node-editor/utils/JoinEditor.js +1 -1
- package/examples/jsm/node-editor/utils/OscillatorEditor.js +1 -1
- package/examples/jsm/node-editor/utils/PreviewEditor.js +7 -3
- package/examples/jsm/node-editor/utils/SplitEditor.js +1 -1
- package/examples/jsm/node-editor/utils/TimerEditor.js +1 -1
- package/examples/jsm/nodes/Nodes.js +70 -13
- package/examples/jsm/nodes/accessors/BitangentNode.js +62 -0
- package/examples/jsm/nodes/accessors/CubeTextureNode.js +9 -5
- package/examples/jsm/nodes/accessors/NormalNode.js +8 -8
- package/examples/jsm/nodes/accessors/Object3DNode.js +1 -1
- package/examples/jsm/nodes/accessors/PositionNode.js +11 -5
- package/examples/jsm/nodes/accessors/ReferenceNode.js +1 -1
- package/examples/jsm/nodes/accessors/ReflectVectorNode.js +31 -0
- package/examples/jsm/nodes/accessors/SkinningNode.js +8 -1
- package/examples/jsm/nodes/accessors/TangentNode.js +95 -0
- package/examples/jsm/nodes/core/AttributeNode.js +32 -9
- package/examples/jsm/nodes/core/CodeNode.js +3 -3
- package/examples/jsm/nodes/core/FunctionCallNode.js +20 -5
- package/examples/jsm/nodes/core/FunctionNode.js +2 -2
- package/examples/jsm/nodes/core/Node.js +15 -13
- package/examples/jsm/nodes/core/NodeBuilder.js +67 -18
- package/examples/jsm/nodes/core/NodeFrame.js +2 -2
- package/examples/jsm/nodes/core/NodeUtils.js +23 -1
- package/examples/jsm/nodes/core/NodeVarying.js +17 -0
- package/examples/jsm/nodes/core/VaryingNode.js +56 -0
- package/examples/jsm/nodes/core/constants.js +13 -13
- package/examples/jsm/nodes/display/BlendModeNode.js +85 -0
- package/examples/jsm/nodes/display/ColorAdjustmentNode.js +84 -0
- package/examples/jsm/nodes/display/NormalMapNode.js +19 -12
- package/examples/jsm/nodes/display/PosterizeNode.js +25 -0
- package/examples/jsm/nodes/display/ViewportNode.js +106 -0
- package/examples/jsm/nodes/functions/BSDF/BRDF_GGX.js +5 -5
- package/examples/jsm/nodes/functions/PhysicalLightingModel.js +3 -3
- package/examples/jsm/nodes/functions/light/getDistanceAttenuation.js +2 -2
- package/examples/jsm/nodes/geometry/RangeNode.js +109 -0
- package/examples/jsm/nodes/gpgpu/ComputeNode.js +3 -1
- package/examples/jsm/nodes/lighting/AnalyticLightNode.js +1 -1
- package/examples/jsm/nodes/lighting/EnvironmentNode.js +8 -7
- package/examples/jsm/nodes/lighting/LightingContextNode.js +4 -4
- package/examples/jsm/nodes/loaders/NodeLoader.js +2 -2
- package/examples/jsm/nodes/loaders/NodeMaterialLoader.js +33 -0
- package/examples/jsm/nodes/materials/Materials.js +21 -31
- package/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.js +70 -0
- package/examples/jsm/nodes/materials/MeshStandardNodeMaterial.js +4 -7
- package/examples/jsm/nodes/materials/NodeMaterial.js +11 -3
- package/examples/jsm/nodes/materials/SpriteNodeMaterial.js +28 -17
- package/examples/jsm/nodes/materialx/DISCLAIMER.md +199 -0
- package/examples/jsm/nodes/materialx/MaterialXNodes.js +59 -0
- package/examples/jsm/nodes/materialx/lib/mx_hsv.js +56 -0
- package/examples/jsm/nodes/materialx/lib/mx_noise.js +617 -0
- package/examples/jsm/nodes/materialx/lib/mx_transform_color.js +18 -0
- package/examples/jsm/nodes/math/MathNode.js +7 -17
- package/examples/jsm/nodes/math/OperatorNode.js +16 -3
- package/examples/jsm/nodes/parsers/GLSLNodeFunction.js +21 -6
- package/examples/jsm/nodes/procedural/CheckerNode.js +2 -2
- package/examples/jsm/nodes/shadernode/ShaderNode.js +40 -25
- package/examples/jsm/nodes/shadernode/ShaderNodeBaseElements.js +95 -68
- package/examples/jsm/nodes/shadernode/ShaderNodeElements.js +49 -6
- package/examples/jsm/nodes/utils/ConvertNode.js +18 -12
- package/examples/jsm/nodes/utils/EquirectUVNode.js +27 -0
- package/examples/jsm/nodes/utils/JoinNode.js +15 -9
- package/examples/jsm/nodes/utils/MatcapUVNode.js +2 -4
- package/examples/jsm/nodes/utils/MaxMipLevelNode.js +3 -2
- package/examples/jsm/nodes/utils/OscNode.js +2 -2
- package/examples/jsm/nodes/utils/RemapNode.js +34 -0
- package/examples/jsm/nodes/utils/RotateUVNode.js +32 -0
- package/examples/jsm/nodes/utils/SplitNode.js +21 -5
- package/examples/jsm/nodes/utils/SpriteSheetUVNode.js +8 -10
- package/examples/jsm/nodes/utils/TimerNode.js +23 -3
- package/examples/jsm/nodes/utils/TriplanarTexturesNode.js +51 -0
- package/examples/jsm/objects/GroundProjectedEnv.js +186 -0
- package/examples/jsm/objects/Reflector.js +12 -5
- package/examples/jsm/objects/ReflectorForSSRPass.js +3 -5
- package/examples/jsm/objects/Refractor.js +12 -6
- package/examples/jsm/objects/ShadowMesh.js +8 -2
- package/examples/jsm/postprocessing/AfterimagePass.js +17 -4
- package/examples/jsm/postprocessing/BloomPass.js +22 -3
- package/examples/jsm/postprocessing/BokehPass.js +18 -4
- package/examples/jsm/postprocessing/CubeTexturePass.js +12 -5
- package/examples/jsm/postprocessing/DotScreenPass.js +8 -0
- package/examples/jsm/postprocessing/EffectComposer.js +9 -0
- package/examples/jsm/postprocessing/FilmPass.js +8 -0
- package/examples/jsm/postprocessing/GlitchPass.js +13 -1
- package/examples/jsm/postprocessing/HalftonePass.js +8 -0
- package/examples/jsm/postprocessing/OutlinePass.js +25 -3
- package/examples/jsm/postprocessing/Pass.js +2 -0
- package/examples/jsm/postprocessing/RenderPixelatedPass.js +234 -0
- package/examples/jsm/postprocessing/SAOPass.js +20 -0
- package/examples/jsm/postprocessing/SMAAPass.js +16 -0
- package/examples/jsm/postprocessing/SSAARenderPass.js +4 -0
- package/examples/jsm/postprocessing/SavePass.js +17 -1
- package/examples/jsm/postprocessing/ShaderPass.js +8 -0
- package/examples/jsm/postprocessing/TAARenderPass.js +9 -0
- package/examples/jsm/postprocessing/TexturePass.js +8 -0
- package/examples/jsm/postprocessing/UnrealBloomPass.js +16 -0
- package/examples/jsm/renderers/CSS2DRenderer.js +2 -2
- package/examples/jsm/renderers/CSS3DRenderer.js +2 -2
- package/examples/jsm/renderers/Projector.js +2 -24
- package/examples/jsm/renderers/webgl/nodes/SlotNode.js +9 -5
- package/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.js +363 -231
- package/examples/jsm/renderers/webgl/nodes/WebGLNodes.js +7 -3
- package/examples/jsm/renderers/webgpu/WebGPUAnimation.js +58 -0
- package/examples/jsm/renderers/webgpu/WebGPUAttributes.js +63 -5
- package/examples/jsm/renderers/webgpu/WebGPUBackground.js +68 -3
- package/examples/jsm/renderers/webgpu/WebGPUComputePipelines.js +6 -0
- package/examples/jsm/renderers/webgpu/WebGPUGeometries.js +6 -0
- package/examples/jsm/renderers/webgpu/WebGPUObjects.js +1 -1
- package/examples/jsm/renderers/webgpu/WebGPURenderPipeline.js +17 -19
- package/examples/jsm/renderers/webgpu/WebGPURenderPipelines.js +16 -14
- package/examples/jsm/renderers/webgpu/WebGPURenderStates.js +2 -2
- package/examples/jsm/renderers/webgpu/WebGPURenderer.js +113 -93
- package/examples/jsm/renderers/webgpu/WebGPUTextureUtils.js +5 -3
- package/examples/jsm/renderers/webgpu/WebGPUTextures.js +2 -2
- package/examples/jsm/renderers/webgpu/WebGPUUtils.js +81 -0
- package/examples/jsm/renderers/webgpu/nodes/WebGPUNodeBuilder.js +63 -36
- package/examples/jsm/renderers/webgpu/nodes/WebGPUNodes.js +1 -1
- package/examples/jsm/shaders/LuminosityShader.js +1 -1
- package/examples/jsm/shaders/MMDToonShader.js +2 -4
- package/examples/jsm/shaders/ToneMapShader.js +1 -1
- package/examples/jsm/shaders/VelocityShader.js +128 -0
- package/examples/jsm/utils/BufferGeometryUtils.js +176 -43
- package/examples/jsm/utils/GeometryUtils.js +17 -25
- package/examples/jsm/utils/PackedPhongMaterial.js +0 -1
- package/examples/jsm/utils/SceneUtils.js +117 -12
- package/examples/jsm/webxr/OculusHandModel.js +3 -2
- package/examples/jsm/webxr/OculusHandPointerModel.js +6 -1
- package/examples/jsm/webxr/VRButton.js +1 -7
- package/examples/jsm/webxr/XRHandMeshModel.js +8 -3
- package/package.json +22 -18
- package/src/Three.Legacy.js +262 -36
- package/src/Three.js +4 -2
- package/src/animation/AnimationAction.js +6 -5
- package/src/animation/AnimationClip.js +1 -1
- package/src/animation/AnimationMixer.js +1 -1
- package/src/animation/AnimationUtils.js +204 -199
- package/src/animation/KeyframeTrack.js +1 -1
- package/src/animation/PropertyBinding.js +31 -5
- package/src/audio/AudioContext.js +5 -5
- package/src/cameras/CubeCamera.js +14 -21
- package/src/constants.js +2 -4
- package/src/core/BufferAttribute.js +81 -111
- package/src/core/BufferGeometry.js +3 -41
- package/src/core/InstancedBufferAttribute.js +0 -10
- package/src/core/InstancedBufferGeometry.js +1 -7
- package/src/core/InterleavedBuffer.js +1 -1
- package/src/core/InterleavedBufferAttribute.js +57 -8
- package/src/core/Object3D.js +22 -5
- package/src/core/Uniform.js +0 -7
- package/src/core/UniformsGroup.js +92 -0
- package/src/extras/DataUtils.js +104 -88
- package/src/extras/Earcut.js +67 -67
- package/src/extras/core/Path.js +1 -0
- package/src/extras/core/ShapePath.js +1 -4
- package/src/extras/curves/CatmullRomCurve3.js +4 -2
- package/src/geometries/BoxGeometry.js +1 -1
- package/src/geometries/CapsuleGeometry.js +1 -1
- package/src/geometries/CircleGeometry.js +1 -1
- package/src/geometries/ConeGeometry.js +1 -1
- package/src/geometries/CylinderGeometry.js +2 -1
- package/src/geometries/DodecahedronGeometry.js +1 -1
- package/src/geometries/EdgesGeometry.js +5 -4
- package/src/geometries/ExtrudeGeometry.js +2 -11
- package/src/geometries/IcosahedronGeometry.js +1 -1
- package/src/geometries/LatheGeometry.js +2 -2
- package/src/geometries/OctahedronGeometry.js +1 -1
- package/src/geometries/PlaneGeometry.js +2 -1
- package/src/geometries/PolyhedronGeometry.js +2 -2
- package/src/geometries/RingGeometry.js +1 -1
- package/src/geometries/ShapeGeometry.js +3 -2
- package/src/geometries/SphereGeometry.js +2 -1
- package/src/geometries/TetrahedronGeometry.js +1 -1
- package/src/geometries/TorusGeometry.js +2 -1
- package/src/geometries/TorusKnotGeometry.js +2 -1
- package/src/geometries/TubeGeometry.js +2 -1
- package/src/geometries/WireframeGeometry.js +1 -0
- package/src/helpers/ArrowHelper.js +9 -0
- package/src/helpers/Box3Helper.js +7 -0
- package/src/helpers/BoxHelper.js +7 -1
- package/src/helpers/CameraHelper.js +97 -38
- package/src/helpers/DirectionalLightHelper.js +6 -1
- package/src/helpers/GridHelper.js +7 -0
- package/src/helpers/HemisphereLightHelper.js +5 -1
- package/src/helpers/PlaneHelper.js +15 -9
- package/src/helpers/PointLightHelper.js +2 -1
- package/src/helpers/PolarGridHelper.js +25 -14
- package/src/helpers/SkeletonHelper.js +7 -0
- package/src/helpers/SpotLightHelper.js +5 -2
- package/src/lights/LightShadow.js +1 -2
- package/src/lights/PointLight.js +2 -2
- package/src/lights/SpotLight.js +4 -2
- package/src/loaders/FileLoader.js +16 -2
- package/src/loaders/LoadingManager.js +1 -1
- package/src/loaders/MaterialLoader.js +49 -7
- package/src/loaders/ObjectLoader.js +9 -42
- package/src/materials/Material.js +2 -34
- package/src/materials/Materials.js +0 -27
- package/src/materials/MeshLambertMaterial.js +28 -1
- package/src/materials/MeshPhysicalMaterial.js +1 -1
- package/src/materials/ShaderMaterial.js +3 -7
- package/src/math/Color.js +8 -18
- package/src/math/MathUtils.js +1 -7
- package/src/math/Matrix3.js +54 -25
- package/src/math/Matrix4.js +3 -27
- package/src/math/Quaternion.js +1 -21
- package/src/math/Ray.js +2 -5
- package/src/math/Sphere.js +36 -21
- package/src/math/Vector2.js +4 -24
- package/src/math/Vector3.js +7 -46
- package/src/math/Vector4.js +4 -24
- package/src/objects/InstancedMesh.js +7 -0
- package/src/objects/LOD.js +25 -6
- package/src/renderers/WebGL3DRenderTarget.js +1 -1
- package/src/renderers/WebGLArrayRenderTarget.js +1 -1
- package/src/renderers/WebGLCubeRenderTarget.js +1 -1
- package/src/renderers/WebGLMultipleRenderTargets.js +1 -1
- package/src/renderers/WebGLRenderTarget.js +1 -1
- package/src/renderers/WebGLRenderer.js +119 -69
- package/src/renderers/shaders/ShaderChunk/bsdfs.glsl.js +12 -12
- package/src/renderers/shaders/ShaderChunk/bumpmap_pars_fragment.glsl.js +3 -5
- package/src/renderers/shaders/ShaderChunk/common.glsl.js +6 -5
- package/src/renderers/shaders/ShaderChunk/cube_uv_reflection_fragment.glsl.js +24 -24
- package/src/renderers/shaders/ShaderChunk/envmap_fragment.glsl.js +0 -4
- package/src/renderers/shaders/ShaderChunk/envmap_pars_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/envmap_pars_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/gradientmap_pars_fragment.glsl.js +2 -1
- package/src/renderers/shaders/ShaderChunk/iridescence_fragment.glsl.js +113 -99
- package/src/renderers/shaders/ShaderChunk/lights_fragment_begin.glsl.js +34 -13
- package/src/renderers/shaders/ShaderChunk/lights_lambert_fragment.glsl.js +5 -0
- package/src/renderers/shaders/ShaderChunk/lights_lambert_pars_fragment.glsl.js +28 -0
- package/src/renderers/shaders/ShaderChunk/lights_phong_pars_fragment.glsl.js +0 -2
- package/src/renderers/shaders/ShaderChunk/lights_physical_fragment.glsl.js +3 -1
- package/src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js +13 -1
- package/src/renderers/shaders/ShaderChunk/lights_toon_pars_fragment.glsl.js +0 -2
- package/src/renderers/shaders/ShaderChunk/normal_fragment_begin.glsl.js +2 -4
- package/src/renderers/shaders/ShaderChunk/normalmap_pars_fragment.glsl.js +2 -4
- package/src/renderers/shaders/ShaderChunk/output_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/packing.glsl.js +8 -0
- package/src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js +18 -7
- package/src/renderers/shaders/ShaderChunk/shadowmap_pars_vertex.glsl.js +8 -3
- package/src/renderers/shaders/ShaderChunk/shadowmap_vertex.glsl.js +9 -6
- package/src/renderers/shaders/ShaderChunk/shadowmask_pars_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/transmission_fragment.glsl.js +14 -10
- package/src/renderers/shaders/ShaderChunk/transmission_pars_fragment.glsl.js +2 -2
- package/src/renderers/shaders/ShaderChunk/worldpos_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk.js +7 -2
- package/src/renderers/shaders/ShaderLib/background.glsl.js +7 -2
- package/src/renderers/shaders/ShaderLib/backgroundCube.glsl.js +62 -0
- package/src/renderers/shaders/ShaderLib/cube.glsl.js +4 -6
- package/src/renderers/shaders/ShaderLib/meshbasic.glsl.js +0 -1
- package/src/renderers/shaders/ShaderLib/meshlambert.glsl.js +22 -50
- package/src/renderers/shaders/ShaderLib/meshphong.glsl.js +0 -1
- package/src/renderers/shaders/ShaderLib/vsm.glsl.js +0 -3
- package/src/renderers/shaders/ShaderLib.js +50 -36
- package/src/renderers/shaders/UniformsLib.js +13 -12
- package/src/renderers/shaders/UniformsUtils.js +29 -0
- package/src/renderers/webgl/WebGLAttributes.js +2 -0
- package/src/renderers/webgl/WebGLBackground.js +17 -9
- package/src/renderers/webgl/WebGLLights.js +37 -17
- package/src/renderers/webgl/WebGLMaterials.js +2 -1
- package/src/renderers/webgl/WebGLMorphtargets.js +0 -20
- package/src/renderers/webgl/WebGLProgram.js +6 -11
- package/src/renderers/webgl/WebGLPrograms.js +30 -26
- package/src/renderers/webgl/WebGLRenderLists.js +5 -4
- package/src/renderers/webgl/WebGLRenderStates.js +5 -4
- package/src/renderers/webgl/WebGLShaderCache.js +9 -6
- package/src/renderers/webgl/WebGLShadowMap.js +13 -16
- package/src/renderers/webgl/WebGLState.js +125 -41
- package/src/renderers/webgl/WebGLTextures.js +94 -39
- package/src/renderers/webgl/WebGLUniforms.js +156 -28
- package/src/renderers/webgl/WebGLUniformsGroups.js +372 -0
- package/src/renderers/webgl/WebGLUtils.js +3 -1
- package/src/renderers/webvr/WebVRManager.js +42 -9
- package/src/renderers/webvr/WebVRUtils.js +1 -1
- package/src/renderers/webxr/WebXRController.js +91 -50
- package/src/renderers/webxr/WebXRManager.js +127 -34
- package/src/scenes/Scene.js +24 -3
- package/src/textures/CompressedArrayTexture.js +18 -0
- package/src/textures/Source.js +1 -1
- package/src/textures/Texture.js +2 -1
- package/src/utils.js +1 -1
- package/examples/js/controls/experimental/CameraControls.js +0 -1048
- package/examples/js/libs/lottie_canvas.js +0 -12751
- package/examples/js/loaders/KTX2Loader.js +0 -558
- package/examples/js/shaders/PixelShader.js +0 -51
- package/examples/jsm/controls/experimental/CameraControls.js +0 -1248
- package/examples/jsm/nodes/accessors/ReflectNode.js +0 -70
- package/examples/jsm/nodes/core/NodeVary.js +0 -14
- package/examples/jsm/nodes/core/VaryNode.js +0 -54
- package/examples/jsm/package.json +0 -3
- package/examples/jsm/renderers/webgl/nodes/WebGLPhysicalContextNode.js +0 -45
- package/examples/jsm/shaders/PixelShader.js +0 -44
- package/src/renderers/shaders/ShaderChunk/lights_lambert_vertex.glsl.js +0 -122
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
FrontSide,
|
|
13
13
|
Group,
|
|
14
14
|
ImageBitmapLoader,
|
|
15
|
+
InstancedMesh,
|
|
15
16
|
InterleavedBuffer,
|
|
16
17
|
InterleavedBufferAttribute,
|
|
17
18
|
Interpolant,
|
|
@@ -52,7 +53,6 @@ import {
|
|
|
52
53
|
SkinnedMesh,
|
|
53
54
|
Sphere,
|
|
54
55
|
SpotLight,
|
|
55
|
-
TangentSpaceNormalMap,
|
|
56
56
|
Texture,
|
|
57
57
|
TextureLoader,
|
|
58
58
|
TriangleFanDrawMode,
|
|
@@ -147,6 +147,12 @@ class GLTFLoader extends Loader {
|
|
|
147
147
|
|
|
148
148
|
} );
|
|
149
149
|
|
|
150
|
+
this.register( function ( parser ) {
|
|
151
|
+
|
|
152
|
+
return new GLTFMeshGpuInstancing( parser );
|
|
153
|
+
|
|
154
|
+
} );
|
|
155
|
+
|
|
150
156
|
}
|
|
151
157
|
|
|
152
158
|
load( url, onLoad, onProgress, onError ) {
|
|
@@ -277,15 +283,15 @@ class GLTFLoader extends Loader {
|
|
|
277
283
|
|
|
278
284
|
parse( data, path, onLoad, onError ) {
|
|
279
285
|
|
|
280
|
-
let
|
|
286
|
+
let json;
|
|
281
287
|
const extensions = {};
|
|
282
288
|
const plugins = {};
|
|
283
289
|
|
|
284
290
|
if ( typeof data === 'string' ) {
|
|
285
291
|
|
|
286
|
-
|
|
292
|
+
json = JSON.parse( data );
|
|
287
293
|
|
|
288
|
-
} else {
|
|
294
|
+
} else if ( data instanceof ArrayBuffer ) {
|
|
289
295
|
|
|
290
296
|
const magic = LoaderUtils.decodeText( new Uint8Array( data, 0, 4 ) );
|
|
291
297
|
|
|
@@ -302,17 +308,19 @@ class GLTFLoader extends Loader {
|
|
|
302
308
|
|
|
303
309
|
}
|
|
304
310
|
|
|
305
|
-
|
|
311
|
+
json = JSON.parse( extensions[ EXTENSIONS.KHR_BINARY_GLTF ].content );
|
|
306
312
|
|
|
307
313
|
} else {
|
|
308
314
|
|
|
309
|
-
|
|
315
|
+
json = JSON.parse( LoaderUtils.decodeText( new Uint8Array( data ) ) );
|
|
310
316
|
|
|
311
317
|
}
|
|
312
318
|
|
|
313
|
-
}
|
|
319
|
+
} else {
|
|
314
320
|
|
|
315
|
-
|
|
321
|
+
json = data;
|
|
322
|
+
|
|
323
|
+
}
|
|
316
324
|
|
|
317
325
|
if ( json.asset === undefined || json.asset.version[ 0 ] < 2 ) {
|
|
318
326
|
|
|
@@ -360,10 +368,6 @@ class GLTFLoader extends Loader {
|
|
|
360
368
|
extensions[ extensionName ] = new GLTFMaterialsUnlitExtension();
|
|
361
369
|
break;
|
|
362
370
|
|
|
363
|
-
case EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:
|
|
364
|
-
extensions[ extensionName ] = new GLTFMaterialsPbrSpecularGlossinessExtension();
|
|
365
|
-
break;
|
|
366
|
-
|
|
367
371
|
case EXTENSIONS.KHR_DRACO_MESH_COMPRESSION:
|
|
368
372
|
extensions[ extensionName ] = new GLTFDracoMeshCompressionExtension( json, this.dracoLoader );
|
|
369
373
|
break;
|
|
@@ -456,7 +460,6 @@ const EXTENSIONS = {
|
|
|
456
460
|
KHR_LIGHTS_PUNCTUAL: 'KHR_lights_punctual',
|
|
457
461
|
KHR_MATERIALS_CLEARCOAT: 'KHR_materials_clearcoat',
|
|
458
462
|
KHR_MATERIALS_IOR: 'KHR_materials_ior',
|
|
459
|
-
KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS: 'KHR_materials_pbrSpecularGlossiness',
|
|
460
463
|
KHR_MATERIALS_SHEEN: 'KHR_materials_sheen',
|
|
461
464
|
KHR_MATERIALS_SPECULAR: 'KHR_materials_specular',
|
|
462
465
|
KHR_MATERIALS_TRANSMISSION: 'KHR_materials_transmission',
|
|
@@ -468,7 +471,8 @@ const EXTENSIONS = {
|
|
|
468
471
|
KHR_MESH_QUANTIZATION: 'KHR_mesh_quantization',
|
|
469
472
|
KHR_MATERIALS_EMISSIVE_STRENGTH: 'KHR_materials_emissive_strength',
|
|
470
473
|
EXT_TEXTURE_WEBP: 'EXT_texture_webp',
|
|
471
|
-
EXT_MESHOPT_COMPRESSION: 'EXT_meshopt_compression'
|
|
474
|
+
EXT_MESHOPT_COMPRESSION: 'EXT_meshopt_compression',
|
|
475
|
+
EXT_MESH_GPU_INSTANCING: 'EXT_mesh_gpu_instancing'
|
|
472
476
|
};
|
|
473
477
|
|
|
474
478
|
/**
|
|
@@ -566,6 +570,8 @@ class GLTFLightsExtension {
|
|
|
566
570
|
|
|
567
571
|
lightNode.decay = 2;
|
|
568
572
|
|
|
573
|
+
assignExtrasToUserData( lightNode, lightDef );
|
|
574
|
+
|
|
569
575
|
if ( lightDef.intensity !== undefined ) lightNode.intensity = lightDef.intensity;
|
|
570
576
|
|
|
571
577
|
lightNode.name = parser.createUniqueName( lightDef.name || ( 'light_' + lightIndex ) );
|
|
@@ -578,6 +584,14 @@ class GLTFLightsExtension {
|
|
|
578
584
|
|
|
579
585
|
}
|
|
580
586
|
|
|
587
|
+
getDependency( type, index ) {
|
|
588
|
+
|
|
589
|
+
if ( type !== 'light' ) return;
|
|
590
|
+
|
|
591
|
+
return this._loadLight( index );
|
|
592
|
+
|
|
593
|
+
}
|
|
594
|
+
|
|
581
595
|
createNodeAttachment( nodeIndex ) {
|
|
582
596
|
|
|
583
597
|
const self = this;
|
|
@@ -1044,7 +1058,7 @@ class GLTFMaterialsVolumeExtension {
|
|
|
1044
1058
|
|
|
1045
1059
|
}
|
|
1046
1060
|
|
|
1047
|
-
materialParams.attenuationDistance = extension.attenuationDistance ||
|
|
1061
|
+
materialParams.attenuationDistance = extension.attenuationDistance || Infinity;
|
|
1048
1062
|
|
|
1049
1063
|
const colorArray = extension.attenuationColor || [ 1, 1, 1 ];
|
|
1050
1064
|
materialParams.attenuationColor = new Color( colorArray[ 0 ], colorArray[ 1 ], colorArray[ 2 ] );
|
|
@@ -1341,7 +1355,7 @@ class GLTFMeshoptCompression {
|
|
|
1341
1355
|
|
|
1342
1356
|
}
|
|
1343
1357
|
|
|
1344
|
-
return
|
|
1358
|
+
return buffer.then( function ( res ) {
|
|
1345
1359
|
|
|
1346
1360
|
const byteOffset = extensionDef.byteOffset || 0;
|
|
1347
1361
|
const byteLength = extensionDef.byteLength || 0;
|
|
@@ -1349,11 +1363,28 @@ class GLTFMeshoptCompression {
|
|
|
1349
1363
|
const count = extensionDef.count;
|
|
1350
1364
|
const stride = extensionDef.byteStride;
|
|
1351
1365
|
|
|
1352
|
-
const
|
|
1353
|
-
|
|
1366
|
+
const source = new Uint8Array( res, byteOffset, byteLength );
|
|
1367
|
+
|
|
1368
|
+
if ( decoder.decodeGltfBufferAsync ) {
|
|
1369
|
+
|
|
1370
|
+
return decoder.decodeGltfBufferAsync( count, stride, source, extensionDef.mode, extensionDef.filter ).then( function ( res ) {
|
|
1354
1371
|
|
|
1355
|
-
|
|
1356
|
-
|
|
1372
|
+
return res.buffer;
|
|
1373
|
+
|
|
1374
|
+
} );
|
|
1375
|
+
|
|
1376
|
+
} else {
|
|
1377
|
+
|
|
1378
|
+
// Support for MeshoptDecoder 0.18 or earlier, without decodeGltfBufferAsync
|
|
1379
|
+
return decoder.ready.then( function () {
|
|
1380
|
+
|
|
1381
|
+
const result = new ArrayBuffer( count * stride );
|
|
1382
|
+
decoder.decodeGltfBuffer( new Uint8Array( result ), count, stride, source, extensionDef.mode, extensionDef.filter );
|
|
1383
|
+
return result;
|
|
1384
|
+
|
|
1385
|
+
} );
|
|
1386
|
+
|
|
1387
|
+
}
|
|
1357
1388
|
|
|
1358
1389
|
} );
|
|
1359
1390
|
|
|
@@ -1367,6 +1398,160 @@ class GLTFMeshoptCompression {
|
|
|
1367
1398
|
|
|
1368
1399
|
}
|
|
1369
1400
|
|
|
1401
|
+
/**
|
|
1402
|
+
* GPU Instancing Extension
|
|
1403
|
+
*
|
|
1404
|
+
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_mesh_gpu_instancing
|
|
1405
|
+
*
|
|
1406
|
+
*/
|
|
1407
|
+
class GLTFMeshGpuInstancing {
|
|
1408
|
+
|
|
1409
|
+
constructor( parser ) {
|
|
1410
|
+
|
|
1411
|
+
this.name = EXTENSIONS.EXT_MESH_GPU_INSTANCING;
|
|
1412
|
+
this.parser = parser;
|
|
1413
|
+
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
createNodeMesh( nodeIndex ) {
|
|
1417
|
+
|
|
1418
|
+
const json = this.parser.json;
|
|
1419
|
+
const nodeDef = json.nodes[ nodeIndex ];
|
|
1420
|
+
|
|
1421
|
+
if ( ! nodeDef.extensions || ! nodeDef.extensions[ this.name ] ||
|
|
1422
|
+
nodeDef.mesh === undefined ) {
|
|
1423
|
+
|
|
1424
|
+
return null;
|
|
1425
|
+
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
const meshDef = json.meshes[ nodeDef.mesh ];
|
|
1429
|
+
|
|
1430
|
+
// No Points or Lines + Instancing support yet
|
|
1431
|
+
|
|
1432
|
+
for ( const primitive of meshDef.primitives ) {
|
|
1433
|
+
|
|
1434
|
+
if ( primitive.mode !== WEBGL_CONSTANTS.TRIANGLES &&
|
|
1435
|
+
primitive.mode !== WEBGL_CONSTANTS.TRIANGLE_STRIP &&
|
|
1436
|
+
primitive.mode !== WEBGL_CONSTANTS.TRIANGLE_FAN &&
|
|
1437
|
+
primitive.mode !== undefined ) {
|
|
1438
|
+
|
|
1439
|
+
return null;
|
|
1440
|
+
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
const extensionDef = nodeDef.extensions[ this.name ];
|
|
1446
|
+
const attributesDef = extensionDef.attributes;
|
|
1447
|
+
|
|
1448
|
+
// @TODO: Can we support InstancedMesh + SkinnedMesh?
|
|
1449
|
+
|
|
1450
|
+
const pending = [];
|
|
1451
|
+
const attributes = {};
|
|
1452
|
+
|
|
1453
|
+
for ( const key in attributesDef ) {
|
|
1454
|
+
|
|
1455
|
+
pending.push( this.parser.getDependency( 'accessor', attributesDef[ key ] ).then( accessor => {
|
|
1456
|
+
|
|
1457
|
+
attributes[ key ] = accessor;
|
|
1458
|
+
return attributes[ key ];
|
|
1459
|
+
|
|
1460
|
+
} ) );
|
|
1461
|
+
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
if ( pending.length < 1 ) {
|
|
1465
|
+
|
|
1466
|
+
return null;
|
|
1467
|
+
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
pending.push( this.parser.createNodeMesh( nodeIndex ) );
|
|
1471
|
+
|
|
1472
|
+
return Promise.all( pending ).then( results => {
|
|
1473
|
+
|
|
1474
|
+
const nodeObject = results.pop();
|
|
1475
|
+
const meshes = nodeObject.isGroup ? nodeObject.children : [ nodeObject ];
|
|
1476
|
+
const count = results[ 0 ].count; // All attribute counts should be same
|
|
1477
|
+
const instancedMeshes = [];
|
|
1478
|
+
|
|
1479
|
+
for ( const mesh of meshes ) {
|
|
1480
|
+
|
|
1481
|
+
// Temporal variables
|
|
1482
|
+
const m = new Matrix4();
|
|
1483
|
+
const p = new Vector3();
|
|
1484
|
+
const q = new Quaternion();
|
|
1485
|
+
const s = new Vector3( 1, 1, 1 );
|
|
1486
|
+
|
|
1487
|
+
const instancedMesh = new InstancedMesh( mesh.geometry, mesh.material, count );
|
|
1488
|
+
|
|
1489
|
+
for ( let i = 0; i < count; i ++ ) {
|
|
1490
|
+
|
|
1491
|
+
if ( attributes.TRANSLATION ) {
|
|
1492
|
+
|
|
1493
|
+
p.fromBufferAttribute( attributes.TRANSLATION, i );
|
|
1494
|
+
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1497
|
+
if ( attributes.ROTATION ) {
|
|
1498
|
+
|
|
1499
|
+
q.fromBufferAttribute( attributes.ROTATION, i );
|
|
1500
|
+
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
if ( attributes.SCALE ) {
|
|
1504
|
+
|
|
1505
|
+
s.fromBufferAttribute( attributes.SCALE, i );
|
|
1506
|
+
|
|
1507
|
+
}
|
|
1508
|
+
|
|
1509
|
+
instancedMesh.setMatrixAt( i, m.compose( p, q, s ) );
|
|
1510
|
+
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1513
|
+
// Add instance attributes to the geometry, excluding TRS.
|
|
1514
|
+
for ( const attributeName in attributes ) {
|
|
1515
|
+
|
|
1516
|
+
if ( attributeName !== 'TRANSLATION' &&
|
|
1517
|
+
attributeName !== 'ROTATION' &&
|
|
1518
|
+
attributeName !== 'SCALE' ) {
|
|
1519
|
+
|
|
1520
|
+
mesh.geometry.setAttribute( attributeName, attributes[ attributeName ] );
|
|
1521
|
+
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
// Just in case
|
|
1527
|
+
Object3D.prototype.copy.call( instancedMesh, mesh );
|
|
1528
|
+
|
|
1529
|
+
// https://github.com/mrdoob/three.js/issues/18334
|
|
1530
|
+
instancedMesh.frustumCulled = false;
|
|
1531
|
+
this.parser.assignFinalMaterial( instancedMesh );
|
|
1532
|
+
|
|
1533
|
+
instancedMeshes.push( instancedMesh );
|
|
1534
|
+
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
if ( nodeObject.isGroup ) {
|
|
1538
|
+
|
|
1539
|
+
nodeObject.clear();
|
|
1540
|
+
|
|
1541
|
+
nodeObject.add( ... instancedMeshes );
|
|
1542
|
+
|
|
1543
|
+
return nodeObject;
|
|
1544
|
+
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
return instancedMeshes[ 0 ];
|
|
1548
|
+
|
|
1549
|
+
} );
|
|
1550
|
+
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1370
1555
|
/* BINARY EXTENSION */
|
|
1371
1556
|
const BINARY_EXTENSION_HEADER_MAGIC = 'glTF';
|
|
1372
1557
|
const BINARY_EXTENSION_HEADER_LENGTH = 12;
|
|
@@ -1487,7 +1672,7 @@ class GLTFDracoMeshCompressionExtension {
|
|
|
1487
1672
|
const accessorDef = json.accessors[ primitive.attributes[ attributeName ] ];
|
|
1488
1673
|
const componentType = WEBGL_COMPONENT_TYPES[ accessorDef.componentType ];
|
|
1489
1674
|
|
|
1490
|
-
attributeTypeMap[ threeAttributeName ] = componentType;
|
|
1675
|
+
attributeTypeMap[ threeAttributeName ] = componentType.name;
|
|
1491
1676
|
attributeNormalizedMap[ threeAttributeName ] = accessorDef.normalized === true;
|
|
1492
1677
|
|
|
1493
1678
|
}
|
|
@@ -1577,335 +1762,6 @@ class GLTFTextureTransformExtension {
|
|
|
1577
1762
|
|
|
1578
1763
|
}
|
|
1579
1764
|
|
|
1580
|
-
/**
|
|
1581
|
-
* Specular-Glossiness Extension
|
|
1582
|
-
*
|
|
1583
|
-
* Specification: https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Archived/KHR_materials_pbrSpecularGlossiness
|
|
1584
|
-
*/
|
|
1585
|
-
|
|
1586
|
-
/**
|
|
1587
|
-
* A sub class of StandardMaterial with some of the functionality
|
|
1588
|
-
* changed via the `onBeforeCompile` callback
|
|
1589
|
-
* @pailhead
|
|
1590
|
-
*/
|
|
1591
|
-
class GLTFMeshStandardSGMaterial extends MeshStandardMaterial {
|
|
1592
|
-
|
|
1593
|
-
constructor( params ) {
|
|
1594
|
-
|
|
1595
|
-
super();
|
|
1596
|
-
|
|
1597
|
-
this.isGLTFSpecularGlossinessMaterial = true;
|
|
1598
|
-
|
|
1599
|
-
//various chunks that need replacing
|
|
1600
|
-
const specularMapParsFragmentChunk = [
|
|
1601
|
-
'#ifdef USE_SPECULARMAP',
|
|
1602
|
-
' uniform sampler2D specularMap;',
|
|
1603
|
-
'#endif'
|
|
1604
|
-
].join( '\n' );
|
|
1605
|
-
|
|
1606
|
-
const glossinessMapParsFragmentChunk = [
|
|
1607
|
-
'#ifdef USE_GLOSSINESSMAP',
|
|
1608
|
-
' uniform sampler2D glossinessMap;',
|
|
1609
|
-
'#endif'
|
|
1610
|
-
].join( '\n' );
|
|
1611
|
-
|
|
1612
|
-
const specularMapFragmentChunk = [
|
|
1613
|
-
'vec3 specularFactor = specular;',
|
|
1614
|
-
'#ifdef USE_SPECULARMAP',
|
|
1615
|
-
' vec4 texelSpecular = texture2D( specularMap, vUv );',
|
|
1616
|
-
' // reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture',
|
|
1617
|
-
' specularFactor *= texelSpecular.rgb;',
|
|
1618
|
-
'#endif'
|
|
1619
|
-
].join( '\n' );
|
|
1620
|
-
|
|
1621
|
-
const glossinessMapFragmentChunk = [
|
|
1622
|
-
'float glossinessFactor = glossiness;',
|
|
1623
|
-
'#ifdef USE_GLOSSINESSMAP',
|
|
1624
|
-
' vec4 texelGlossiness = texture2D( glossinessMap, vUv );',
|
|
1625
|
-
' // reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture',
|
|
1626
|
-
' glossinessFactor *= texelGlossiness.a;',
|
|
1627
|
-
'#endif'
|
|
1628
|
-
].join( '\n' );
|
|
1629
|
-
|
|
1630
|
-
const lightPhysicalFragmentChunk = [
|
|
1631
|
-
'PhysicalMaterial material;',
|
|
1632
|
-
'material.diffuseColor = diffuseColor.rgb * ( 1. - max( specularFactor.r, max( specularFactor.g, specularFactor.b ) ) );',
|
|
1633
|
-
'vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );',
|
|
1634
|
-
'float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );',
|
|
1635
|
-
'material.roughness = max( 1.0 - glossinessFactor, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.',
|
|
1636
|
-
'material.roughness += geometryRoughness;',
|
|
1637
|
-
'material.roughness = min( material.roughness, 1.0 );',
|
|
1638
|
-
'material.specularColor = specularFactor;',
|
|
1639
|
-
].join( '\n' );
|
|
1640
|
-
|
|
1641
|
-
const uniforms = {
|
|
1642
|
-
specular: { value: new Color().setHex( 0xffffff ) },
|
|
1643
|
-
glossiness: { value: 1 },
|
|
1644
|
-
specularMap: { value: null },
|
|
1645
|
-
glossinessMap: { value: null }
|
|
1646
|
-
};
|
|
1647
|
-
|
|
1648
|
-
this._extraUniforms = uniforms;
|
|
1649
|
-
|
|
1650
|
-
this.onBeforeCompile = function ( shader ) {
|
|
1651
|
-
|
|
1652
|
-
for ( const uniformName in uniforms ) {
|
|
1653
|
-
|
|
1654
|
-
shader.uniforms[ uniformName ] = uniforms[ uniformName ];
|
|
1655
|
-
|
|
1656
|
-
}
|
|
1657
|
-
|
|
1658
|
-
shader.fragmentShader = shader.fragmentShader
|
|
1659
|
-
.replace( 'uniform float roughness;', 'uniform vec3 specular;' )
|
|
1660
|
-
.replace( 'uniform float metalness;', 'uniform float glossiness;' )
|
|
1661
|
-
.replace( '#include <roughnessmap_pars_fragment>', specularMapParsFragmentChunk )
|
|
1662
|
-
.replace( '#include <metalnessmap_pars_fragment>', glossinessMapParsFragmentChunk )
|
|
1663
|
-
.replace( '#include <roughnessmap_fragment>', specularMapFragmentChunk )
|
|
1664
|
-
.replace( '#include <metalnessmap_fragment>', glossinessMapFragmentChunk )
|
|
1665
|
-
.replace( '#include <lights_physical_fragment>', lightPhysicalFragmentChunk );
|
|
1666
|
-
|
|
1667
|
-
};
|
|
1668
|
-
|
|
1669
|
-
Object.defineProperties( this, {
|
|
1670
|
-
|
|
1671
|
-
specular: {
|
|
1672
|
-
get: function () {
|
|
1673
|
-
|
|
1674
|
-
return uniforms.specular.value;
|
|
1675
|
-
|
|
1676
|
-
},
|
|
1677
|
-
set: function ( v ) {
|
|
1678
|
-
|
|
1679
|
-
uniforms.specular.value = v;
|
|
1680
|
-
|
|
1681
|
-
}
|
|
1682
|
-
},
|
|
1683
|
-
|
|
1684
|
-
specularMap: {
|
|
1685
|
-
get: function () {
|
|
1686
|
-
|
|
1687
|
-
return uniforms.specularMap.value;
|
|
1688
|
-
|
|
1689
|
-
},
|
|
1690
|
-
set: function ( v ) {
|
|
1691
|
-
|
|
1692
|
-
uniforms.specularMap.value = v;
|
|
1693
|
-
|
|
1694
|
-
if ( v ) {
|
|
1695
|
-
|
|
1696
|
-
this.defines.USE_SPECULARMAP = ''; // USE_UV is set by the renderer for specular maps
|
|
1697
|
-
|
|
1698
|
-
} else {
|
|
1699
|
-
|
|
1700
|
-
delete this.defines.USE_SPECULARMAP;
|
|
1701
|
-
|
|
1702
|
-
}
|
|
1703
|
-
|
|
1704
|
-
}
|
|
1705
|
-
},
|
|
1706
|
-
|
|
1707
|
-
glossiness: {
|
|
1708
|
-
get: function () {
|
|
1709
|
-
|
|
1710
|
-
return uniforms.glossiness.value;
|
|
1711
|
-
|
|
1712
|
-
},
|
|
1713
|
-
set: function ( v ) {
|
|
1714
|
-
|
|
1715
|
-
uniforms.glossiness.value = v;
|
|
1716
|
-
|
|
1717
|
-
}
|
|
1718
|
-
},
|
|
1719
|
-
|
|
1720
|
-
glossinessMap: {
|
|
1721
|
-
get: function () {
|
|
1722
|
-
|
|
1723
|
-
return uniforms.glossinessMap.value;
|
|
1724
|
-
|
|
1725
|
-
},
|
|
1726
|
-
set: function ( v ) {
|
|
1727
|
-
|
|
1728
|
-
uniforms.glossinessMap.value = v;
|
|
1729
|
-
|
|
1730
|
-
if ( v ) {
|
|
1731
|
-
|
|
1732
|
-
this.defines.USE_GLOSSINESSMAP = '';
|
|
1733
|
-
this.defines.USE_UV = '';
|
|
1734
|
-
|
|
1735
|
-
} else {
|
|
1736
|
-
|
|
1737
|
-
delete this.defines.USE_GLOSSINESSMAP;
|
|
1738
|
-
delete this.defines.USE_UV;
|
|
1739
|
-
|
|
1740
|
-
}
|
|
1741
|
-
|
|
1742
|
-
}
|
|
1743
|
-
}
|
|
1744
|
-
|
|
1745
|
-
} );
|
|
1746
|
-
|
|
1747
|
-
delete this.metalness;
|
|
1748
|
-
delete this.roughness;
|
|
1749
|
-
delete this.metalnessMap;
|
|
1750
|
-
delete this.roughnessMap;
|
|
1751
|
-
|
|
1752
|
-
this.setValues( params );
|
|
1753
|
-
|
|
1754
|
-
}
|
|
1755
|
-
|
|
1756
|
-
copy( source ) {
|
|
1757
|
-
|
|
1758
|
-
super.copy( source );
|
|
1759
|
-
|
|
1760
|
-
this.specularMap = source.specularMap;
|
|
1761
|
-
this.specular.copy( source.specular );
|
|
1762
|
-
this.glossinessMap = source.glossinessMap;
|
|
1763
|
-
this.glossiness = source.glossiness;
|
|
1764
|
-
delete this.metalness;
|
|
1765
|
-
delete this.roughness;
|
|
1766
|
-
delete this.metalnessMap;
|
|
1767
|
-
delete this.roughnessMap;
|
|
1768
|
-
return this;
|
|
1769
|
-
|
|
1770
|
-
}
|
|
1771
|
-
|
|
1772
|
-
}
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
class GLTFMaterialsPbrSpecularGlossinessExtension {
|
|
1776
|
-
|
|
1777
|
-
constructor() {
|
|
1778
|
-
|
|
1779
|
-
this.name = EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS;
|
|
1780
|
-
|
|
1781
|
-
this.specularGlossinessParams = [
|
|
1782
|
-
'color',
|
|
1783
|
-
'map',
|
|
1784
|
-
'lightMap',
|
|
1785
|
-
'lightMapIntensity',
|
|
1786
|
-
'aoMap',
|
|
1787
|
-
'aoMapIntensity',
|
|
1788
|
-
'emissive',
|
|
1789
|
-
'emissiveIntensity',
|
|
1790
|
-
'emissiveMap',
|
|
1791
|
-
'bumpMap',
|
|
1792
|
-
'bumpScale',
|
|
1793
|
-
'normalMap',
|
|
1794
|
-
'normalMapType',
|
|
1795
|
-
'displacementMap',
|
|
1796
|
-
'displacementScale',
|
|
1797
|
-
'displacementBias',
|
|
1798
|
-
'specularMap',
|
|
1799
|
-
'specular',
|
|
1800
|
-
'glossinessMap',
|
|
1801
|
-
'glossiness',
|
|
1802
|
-
'alphaMap',
|
|
1803
|
-
'envMap',
|
|
1804
|
-
'envMapIntensity'
|
|
1805
|
-
];
|
|
1806
|
-
|
|
1807
|
-
}
|
|
1808
|
-
|
|
1809
|
-
getMaterialType() {
|
|
1810
|
-
|
|
1811
|
-
return GLTFMeshStandardSGMaterial;
|
|
1812
|
-
|
|
1813
|
-
}
|
|
1814
|
-
|
|
1815
|
-
extendParams( materialParams, materialDef, parser ) {
|
|
1816
|
-
|
|
1817
|
-
const pbrSpecularGlossiness = materialDef.extensions[ this.name ];
|
|
1818
|
-
|
|
1819
|
-
materialParams.color = new Color( 1.0, 1.0, 1.0 );
|
|
1820
|
-
materialParams.opacity = 1.0;
|
|
1821
|
-
|
|
1822
|
-
const pending = [];
|
|
1823
|
-
|
|
1824
|
-
if ( Array.isArray( pbrSpecularGlossiness.diffuseFactor ) ) {
|
|
1825
|
-
|
|
1826
|
-
const array = pbrSpecularGlossiness.diffuseFactor;
|
|
1827
|
-
|
|
1828
|
-
materialParams.color.fromArray( array );
|
|
1829
|
-
materialParams.opacity = array[ 3 ];
|
|
1830
|
-
|
|
1831
|
-
}
|
|
1832
|
-
|
|
1833
|
-
if ( pbrSpecularGlossiness.diffuseTexture !== undefined ) {
|
|
1834
|
-
|
|
1835
|
-
pending.push( parser.assignTexture( materialParams, 'map', pbrSpecularGlossiness.diffuseTexture, sRGBEncoding ) );
|
|
1836
|
-
|
|
1837
|
-
}
|
|
1838
|
-
|
|
1839
|
-
materialParams.emissive = new Color( 0.0, 0.0, 0.0 );
|
|
1840
|
-
materialParams.glossiness = pbrSpecularGlossiness.glossinessFactor !== undefined ? pbrSpecularGlossiness.glossinessFactor : 1.0;
|
|
1841
|
-
materialParams.specular = new Color( 1.0, 1.0, 1.0 );
|
|
1842
|
-
|
|
1843
|
-
if ( Array.isArray( pbrSpecularGlossiness.specularFactor ) ) {
|
|
1844
|
-
|
|
1845
|
-
materialParams.specular.fromArray( pbrSpecularGlossiness.specularFactor );
|
|
1846
|
-
|
|
1847
|
-
}
|
|
1848
|
-
|
|
1849
|
-
if ( pbrSpecularGlossiness.specularGlossinessTexture !== undefined ) {
|
|
1850
|
-
|
|
1851
|
-
const specGlossMapDef = pbrSpecularGlossiness.specularGlossinessTexture;
|
|
1852
|
-
pending.push( parser.assignTexture( materialParams, 'glossinessMap', specGlossMapDef ) );
|
|
1853
|
-
pending.push( parser.assignTexture( materialParams, 'specularMap', specGlossMapDef, sRGBEncoding ) );
|
|
1854
|
-
|
|
1855
|
-
}
|
|
1856
|
-
|
|
1857
|
-
return Promise.all( pending );
|
|
1858
|
-
|
|
1859
|
-
}
|
|
1860
|
-
|
|
1861
|
-
createMaterial( materialParams ) {
|
|
1862
|
-
|
|
1863
|
-
const material = new GLTFMeshStandardSGMaterial( materialParams );
|
|
1864
|
-
material.fog = true;
|
|
1865
|
-
|
|
1866
|
-
material.color = materialParams.color;
|
|
1867
|
-
|
|
1868
|
-
material.map = materialParams.map === undefined ? null : materialParams.map;
|
|
1869
|
-
|
|
1870
|
-
material.lightMap = null;
|
|
1871
|
-
material.lightMapIntensity = 1.0;
|
|
1872
|
-
|
|
1873
|
-
material.aoMap = materialParams.aoMap === undefined ? null : materialParams.aoMap;
|
|
1874
|
-
material.aoMapIntensity = 1.0;
|
|
1875
|
-
|
|
1876
|
-
material.emissive = materialParams.emissive;
|
|
1877
|
-
material.emissiveIntensity = materialParams.emissiveIntensity === undefined ? 1.0 : materialParams.emissiveIntensity;
|
|
1878
|
-
material.emissiveMap = materialParams.emissiveMap === undefined ? null : materialParams.emissiveMap;
|
|
1879
|
-
|
|
1880
|
-
material.bumpMap = materialParams.bumpMap === undefined ? null : materialParams.bumpMap;
|
|
1881
|
-
material.bumpScale = 1;
|
|
1882
|
-
|
|
1883
|
-
material.normalMap = materialParams.normalMap === undefined ? null : materialParams.normalMap;
|
|
1884
|
-
material.normalMapType = TangentSpaceNormalMap;
|
|
1885
|
-
|
|
1886
|
-
if ( materialParams.normalScale ) material.normalScale = materialParams.normalScale;
|
|
1887
|
-
|
|
1888
|
-
material.displacementMap = null;
|
|
1889
|
-
material.displacementScale = 1;
|
|
1890
|
-
material.displacementBias = 0;
|
|
1891
|
-
|
|
1892
|
-
material.specularMap = materialParams.specularMap === undefined ? null : materialParams.specularMap;
|
|
1893
|
-
material.specular = materialParams.specular;
|
|
1894
|
-
|
|
1895
|
-
material.glossinessMap = materialParams.glossinessMap === undefined ? null : materialParams.glossinessMap;
|
|
1896
|
-
material.glossiness = materialParams.glossiness;
|
|
1897
|
-
|
|
1898
|
-
material.alphaMap = null;
|
|
1899
|
-
|
|
1900
|
-
material.envMap = materialParams.envMap === undefined ? null : materialParams.envMap;
|
|
1901
|
-
material.envMapIntensity = 1.0;
|
|
1902
|
-
|
|
1903
|
-
return material;
|
|
1904
|
-
|
|
1905
|
-
}
|
|
1906
|
-
|
|
1907
|
-
}
|
|
1908
|
-
|
|
1909
1765
|
/**
|
|
1910
1766
|
* Mesh Quantization Extension
|
|
1911
1767
|
*
|
|
@@ -1955,47 +1811,47 @@ class GLTFCubicSplineInterpolant extends Interpolant {
|
|
|
1955
1811
|
|
|
1956
1812
|
}
|
|
1957
1813
|
|
|
1958
|
-
|
|
1814
|
+
interpolate_( i1, t0, t, t1 ) {
|
|
1959
1815
|
|
|
1960
|
-
|
|
1816
|
+
const result = this.resultBuffer;
|
|
1817
|
+
const values = this.sampleValues;
|
|
1818
|
+
const stride = this.valueSize;
|
|
1961
1819
|
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
const stride = this.valueSize;
|
|
1820
|
+
const stride2 = stride * 2;
|
|
1821
|
+
const stride3 = stride * 3;
|
|
1965
1822
|
|
|
1966
|
-
|
|
1967
|
-
const stride3 = stride * 3;
|
|
1823
|
+
const td = t1 - t0;
|
|
1968
1824
|
|
|
1969
|
-
|
|
1825
|
+
const p = ( t - t0 ) / td;
|
|
1826
|
+
const pp = p * p;
|
|
1827
|
+
const ppp = pp * p;
|
|
1970
1828
|
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
const ppp = pp * p;
|
|
1829
|
+
const offset1 = i1 * stride3;
|
|
1830
|
+
const offset0 = offset1 - stride3;
|
|
1974
1831
|
|
|
1975
|
-
|
|
1976
|
-
|
|
1832
|
+
const s2 = - 2 * ppp + 3 * pp;
|
|
1833
|
+
const s3 = ppp - pp;
|
|
1834
|
+
const s0 = 1 - s2;
|
|
1835
|
+
const s1 = s3 - pp + p;
|
|
1977
1836
|
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
const s1 = s3 - pp + p;
|
|
1837
|
+
// Layout of keyframe output values for CUBICSPLINE animations:
|
|
1838
|
+
// [ inTangent_1, splineVertex_1, outTangent_1, inTangent_2, splineVertex_2, ... ]
|
|
1839
|
+
for ( let i = 0; i !== stride; i ++ ) {
|
|
1982
1840
|
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1841
|
+
const p0 = values[ offset0 + i + stride ]; // splineVertex_k
|
|
1842
|
+
const m0 = values[ offset0 + i + stride2 ] * td; // outTangent_k * (t_k+1 - t_k)
|
|
1843
|
+
const p1 = values[ offset1 + i + stride ]; // splineVertex_k+1
|
|
1844
|
+
const m1 = values[ offset1 + i ] * td; // inTangent_k+1 * (t_k+1 - t_k)
|
|
1986
1845
|
|
|
1987
|
-
|
|
1988
|
-
const m0 = values[ offset0 + i + stride2 ] * td; // outTangent_k * (t_k+1 - t_k)
|
|
1989
|
-
const p1 = values[ offset1 + i + stride ]; // splineVertex_k+1
|
|
1990
|
-
const m1 = values[ offset1 + i ] * td; // inTangent_k+1 * (t_k+1 - t_k)
|
|
1846
|
+
result[ i ] = s0 * p0 + s1 * m0 + s2 * p1 + s3 * m1;
|
|
1991
1847
|
|
|
1992
|
-
|
|
1848
|
+
}
|
|
1993
1849
|
|
|
1994
|
-
|
|
1850
|
+
return result;
|
|
1995
1851
|
|
|
1996
|
-
|
|
1852
|
+
}
|
|
1997
1853
|
|
|
1998
|
-
}
|
|
1854
|
+
}
|
|
1999
1855
|
|
|
2000
1856
|
const _q = new Quaternion();
|
|
2001
1857
|
|
|
@@ -2406,10 +2262,18 @@ class GLTFParser {
|
|
|
2406
2262
|
|
|
2407
2263
|
// Use an ImageBitmapLoader if imageBitmaps are supported. Moves much of the
|
|
2408
2264
|
// expensive work of uploading a texture to the GPU off the main thread.
|
|
2265
|
+
|
|
2266
|
+
let isSafari = false;
|
|
2267
|
+
let isFirefox = false;
|
|
2268
|
+
let firefoxVersion = - 1;
|
|
2269
|
+
|
|
2270
|
+
if ( typeof navigator !== 'undefined' ) {
|
|
2409
2271
|
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2272
|
+
isSafari = /^((?!chrome|android).)*safari/i.test( navigator.userAgent ) === true;
|
|
2273
|
+
isFirefox = navigator.userAgent.indexOf( 'Firefox' ) > - 1;
|
|
2274
|
+
firefoxVersion = isFirefox ? navigator.userAgent.match( /Firefox\/([0-9]+)\./ )[ 1 ] : - 1;
|
|
2275
|
+
|
|
2276
|
+
}
|
|
2413
2277
|
|
|
2414
2278
|
if ( typeof createImageBitmap === 'undefined' || isSafari || ( isFirefox && firefoxVersion < 98 ) ) {
|
|
2415
2279
|
|
|
@@ -2734,7 +2598,19 @@ class GLTFParser {
|
|
|
2734
2598
|
break;
|
|
2735
2599
|
|
|
2736
2600
|
default:
|
|
2737
|
-
|
|
2601
|
+
dependency = this._invokeOne( function ( ext ) {
|
|
2602
|
+
|
|
2603
|
+
return ext != this && ext.getDependency && ext.getDependency( type, index );
|
|
2604
|
+
|
|
2605
|
+
} );
|
|
2606
|
+
|
|
2607
|
+
if ( ! dependency ) {
|
|
2608
|
+
|
|
2609
|
+
throw new Error( 'Unknown type: ' + type );
|
|
2610
|
+
|
|
2611
|
+
}
|
|
2612
|
+
|
|
2613
|
+
break;
|
|
2738
2614
|
|
|
2739
2615
|
}
|
|
2740
2616
|
|
|
@@ -2844,10 +2720,12 @@ class GLTFParser {
|
|
|
2844
2720
|
|
|
2845
2721
|
if ( accessorDef.bufferView === undefined && accessorDef.sparse === undefined ) {
|
|
2846
2722
|
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2723
|
+
const itemSize = WEBGL_TYPE_SIZES[ accessorDef.type ];
|
|
2724
|
+
const TypedArray = WEBGL_COMPONENT_TYPES[ accessorDef.componentType ];
|
|
2725
|
+
const normalized = accessorDef.normalized === true;
|
|
2726
|
+
|
|
2727
|
+
const array = new TypedArray( accessorDef.count * itemSize );
|
|
2728
|
+
return Promise.resolve( new BufferAttribute( array, itemSize, normalized ) );
|
|
2851
2729
|
|
|
2852
2730
|
}
|
|
2853
2731
|
|
|
@@ -2965,7 +2843,7 @@ class GLTFParser {
|
|
|
2965
2843
|
/**
|
|
2966
2844
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#textures
|
|
2967
2845
|
* @param {number} textureIndex
|
|
2968
|
-
* @return {Promise<THREE.Texture>}
|
|
2846
|
+
* @return {Promise<THREE.Texture|null>}
|
|
2969
2847
|
*/
|
|
2970
2848
|
loadTexture( textureIndex ) {
|
|
2971
2849
|
|
|
@@ -3009,7 +2887,7 @@ class GLTFParser {
|
|
|
3009
2887
|
|
|
3010
2888
|
texture.flipY = false;
|
|
3011
2889
|
|
|
3012
|
-
|
|
2890
|
+
texture.name = textureDef.name || sourceDef.name || '';
|
|
3013
2891
|
|
|
3014
2892
|
const samplers = json.samplers || {};
|
|
3015
2893
|
const sampler = samplers[ textureDef.sampler ] || {};
|
|
@@ -3135,6 +3013,8 @@ class GLTFParser {
|
|
|
3135
3013
|
|
|
3136
3014
|
return this.getDependency( 'texture', mapDef.index ).then( function ( texture ) {
|
|
3137
3015
|
|
|
3016
|
+
if ( ! texture ) return null;
|
|
3017
|
+
|
|
3138
3018
|
// Materials sample aoMap from UV set 1 and other maps from UV set 0 - this can't be configured
|
|
3139
3019
|
// However, we will copy UV set 0 to UV set 1 on demand for aoMap
|
|
3140
3020
|
if ( mapDef.texCoord !== undefined && mapDef.texCoord != 0 && ! ( mapName === 'aoMap' && mapDef.texCoord == 1 ) ) {
|
|
@@ -3233,7 +3113,6 @@ class GLTFParser {
|
|
|
3233
3113
|
|
|
3234
3114
|
let cacheKey = 'ClonedMaterial:' + material.uuid + ':';
|
|
3235
3115
|
|
|
3236
|
-
if ( material.isGLTFSpecularGlossinessMaterial ) cacheKey += 'specular-glossiness:';
|
|
3237
3116
|
if ( useDerivativeTangents ) cacheKey += 'derivative-tangents:';
|
|
3238
3117
|
if ( useVertexColors ) cacheKey += 'vertex-colors:';
|
|
3239
3118
|
if ( useFlatShading ) cacheKey += 'flat-shading:';
|
|
@@ -3301,13 +3180,7 @@ class GLTFParser {
|
|
|
3301
3180
|
|
|
3302
3181
|
const pending = [];
|
|
3303
3182
|
|
|
3304
|
-
if ( materialExtensions[ EXTENSIONS.
|
|
3305
|
-
|
|
3306
|
-
const sgExtension = extensions[ EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS ];
|
|
3307
|
-
materialType = sgExtension.getMaterialType();
|
|
3308
|
-
pending.push( sgExtension.extendParams( materialParams, materialDef, parser ) );
|
|
3309
|
-
|
|
3310
|
-
} else if ( materialExtensions[ EXTENSIONS.KHR_MATERIALS_UNLIT ] ) {
|
|
3183
|
+
if ( materialExtensions[ EXTENSIONS.KHR_MATERIALS_UNLIT ] ) {
|
|
3311
3184
|
|
|
3312
3185
|
const kmuExtension = extensions[ EXTENSIONS.KHR_MATERIALS_UNLIT ];
|
|
3313
3186
|
materialType = kmuExtension.getMaterialType();
|
|
@@ -3431,17 +3304,7 @@ class GLTFParser {
|
|
|
3431
3304
|
|
|
3432
3305
|
return Promise.all( pending ).then( function () {
|
|
3433
3306
|
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
if ( materialType === GLTFMeshStandardSGMaterial ) {
|
|
3437
|
-
|
|
3438
|
-
material = extensions[ EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS ].createMaterial( materialParams );
|
|
3439
|
-
|
|
3440
|
-
} else {
|
|
3441
|
-
|
|
3442
|
-
material = new materialType( materialParams );
|
|
3443
|
-
|
|
3444
|
-
}
|
|
3307
|
+
const material = new materialType( materialParams );
|
|
3445
3308
|
|
|
3446
3309
|
if ( materialDef.name ) material.name = materialDef.name;
|
|
3447
3310
|
|
|
@@ -3730,25 +3593,65 @@ class GLTFParser {
|
|
|
3730
3593
|
/**
|
|
3731
3594
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
|
|
3732
3595
|
* @param {number} skinIndex
|
|
3733
|
-
* @return {Promise<
|
|
3596
|
+
* @return {Promise<Skeleton>}
|
|
3734
3597
|
*/
|
|
3735
3598
|
loadSkin( skinIndex ) {
|
|
3736
3599
|
|
|
3737
3600
|
const skinDef = this.json.skins[ skinIndex ];
|
|
3738
3601
|
|
|
3739
|
-
const
|
|
3602
|
+
const pending = [];
|
|
3740
3603
|
|
|
3741
|
-
|
|
3604
|
+
for ( let i = 0, il = skinDef.joints.length; i < il; i ++ ) {
|
|
3742
3605
|
|
|
3743
|
-
|
|
3606
|
+
pending.push( this.getDependency( 'node', skinDef.joints[ i ] ) );
|
|
3744
3607
|
|
|
3745
3608
|
}
|
|
3746
3609
|
|
|
3747
|
-
|
|
3610
|
+
if ( skinDef.inverseBindMatrices !== undefined ) {
|
|
3611
|
+
|
|
3612
|
+
pending.push( this.getDependency( 'accessor', skinDef.inverseBindMatrices ) );
|
|
3613
|
+
|
|
3614
|
+
} else {
|
|
3615
|
+
|
|
3616
|
+
pending.push( null );
|
|
3617
|
+
|
|
3618
|
+
}
|
|
3619
|
+
|
|
3620
|
+
return Promise.all( pending ).then( function ( results ) {
|
|
3621
|
+
|
|
3622
|
+
const inverseBindMatrices = results.pop();
|
|
3623
|
+
const jointNodes = results;
|
|
3624
|
+
|
|
3625
|
+
const bones = [];
|
|
3626
|
+
const boneInverses = [];
|
|
3748
3627
|
|
|
3749
|
-
|
|
3628
|
+
for ( let i = 0, il = jointNodes.length; i < il; i ++ ) {
|
|
3750
3629
|
|
|
3751
|
-
|
|
3630
|
+
const jointNode = jointNodes[ i ];
|
|
3631
|
+
|
|
3632
|
+
if ( jointNode ) {
|
|
3633
|
+
|
|
3634
|
+
bones.push( jointNode );
|
|
3635
|
+
|
|
3636
|
+
const mat = new Matrix4();
|
|
3637
|
+
|
|
3638
|
+
if ( inverseBindMatrices !== null ) {
|
|
3639
|
+
|
|
3640
|
+
mat.fromArray( inverseBindMatrices.array, i * 16 );
|
|
3641
|
+
|
|
3642
|
+
}
|
|
3643
|
+
|
|
3644
|
+
boneInverses.push( mat );
|
|
3645
|
+
|
|
3646
|
+
} else {
|
|
3647
|
+
|
|
3648
|
+
console.warn( 'THREE.GLTFLoader: Joint "%s" could not be found.', skinDef.joints[ i ] );
|
|
3649
|
+
|
|
3650
|
+
}
|
|
3651
|
+
|
|
3652
|
+
}
|
|
3653
|
+
|
|
3654
|
+
return new Skeleton( bones, boneInverses );
|
|
3752
3655
|
|
|
3753
3656
|
} );
|
|
3754
3657
|
|
|
@@ -3776,7 +3679,7 @@ class GLTFParser {
|
|
|
3776
3679
|
const channel = animationDef.channels[ i ];
|
|
3777
3680
|
const sampler = animationDef.samplers[ channel.sampler ];
|
|
3778
3681
|
const target = channel.target;
|
|
3779
|
-
const name = target.node
|
|
3682
|
+
const name = target.node;
|
|
3780
3683
|
const input = animationDef.parameters !== undefined ? animationDef.parameters[ sampler.input ] : sampler.input;
|
|
3781
3684
|
const output = animationDef.parameters !== undefined ? animationDef.parameters[ sampler.output ] : sampler.output;
|
|
3782
3685
|
|
|
@@ -3817,7 +3720,6 @@ class GLTFParser {
|
|
|
3817
3720
|
if ( node === undefined ) continue;
|
|
3818
3721
|
|
|
3819
3722
|
node.updateMatrix();
|
|
3820
|
-
node.matrixAutoUpdate = true;
|
|
3821
3723
|
|
|
3822
3724
|
let TypedKeyframeTrack;
|
|
3823
3725
|
|
|
@@ -4186,58 +4088,13 @@ function buildNodeHierarchy( nodeId, parentObject, json, parser ) {
|
|
|
4186
4088
|
|
|
4187
4089
|
// build skeleton here as well
|
|
4188
4090
|
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
return parser.getDependency( 'skin', nodeDef.skin ).then( function ( skin ) {
|
|
4192
|
-
|
|
4193
|
-
skinEntry = skin;
|
|
4194
|
-
|
|
4195
|
-
const pendingJoints = [];
|
|
4196
|
-
|
|
4197
|
-
for ( let i = 0, il = skinEntry.joints.length; i < il; i ++ ) {
|
|
4198
|
-
|
|
4199
|
-
pendingJoints.push( parser.getDependency( 'node', skinEntry.joints[ i ] ) );
|
|
4200
|
-
|
|
4201
|
-
}
|
|
4202
|
-
|
|
4203
|
-
return Promise.all( pendingJoints );
|
|
4204
|
-
|
|
4205
|
-
} ).then( function ( jointNodes ) {
|
|
4091
|
+
return parser.getDependency( 'skin', nodeDef.skin ).then( function ( skeleton ) {
|
|
4206
4092
|
|
|
4207
4093
|
node.traverse( function ( mesh ) {
|
|
4208
4094
|
|
|
4209
|
-
if ( ! mesh.
|
|
4210
|
-
|
|
4211
|
-
const bones = [];
|
|
4212
|
-
const boneInverses = [];
|
|
4213
|
-
|
|
4214
|
-
for ( let j = 0, jl = jointNodes.length; j < jl; j ++ ) {
|
|
4215
|
-
|
|
4216
|
-
const jointNode = jointNodes[ j ];
|
|
4217
|
-
|
|
4218
|
-
if ( jointNode ) {
|
|
4219
|
-
|
|
4220
|
-
bones.push( jointNode );
|
|
4221
|
-
|
|
4222
|
-
const mat = new Matrix4();
|
|
4223
|
-
|
|
4224
|
-
if ( skinEntry.inverseBindMatrices !== undefined ) {
|
|
4225
|
-
|
|
4226
|
-
mat.fromArray( skinEntry.inverseBindMatrices.array, j * 16 );
|
|
4227
|
-
|
|
4228
|
-
}
|
|
4229
|
-
|
|
4230
|
-
boneInverses.push( mat );
|
|
4231
|
-
|
|
4232
|
-
} else {
|
|
4233
|
-
|
|
4234
|
-
console.warn( 'THREE.GLTFLoader: Joint "%s" could not be found.', skinEntry.joints[ j ] );
|
|
4235
|
-
|
|
4236
|
-
}
|
|
4237
|
-
|
|
4238
|
-
}
|
|
4095
|
+
if ( ! mesh.isSkinnedMesh ) return;
|
|
4239
4096
|
|
|
4240
|
-
mesh.bind(
|
|
4097
|
+
mesh.bind( skeleton, mesh.matrixWorld );
|
|
4241
4098
|
|
|
4242
4099
|
} );
|
|
4243
4100
|
|