@plastic-software/three 0.174.0 → 0.175.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/three.cjs +10655 -1446
- package/build/three.core.js +9626 -1094
- package/build/three.core.min.js +1 -1
- package/build/three.module.js +834 -157
- package/build/three.module.min.js +1 -1
- package/build/three.tsl.js +4 -2
- package/build/three.tsl.min.js +1 -1
- package/build/three.webgpu.js +2658 -1697
- package/build/three.webgpu.min.js +1 -1
- package/build/three.webgpu.nodes.js +2654 -1709
- package/build/three.webgpu.nodes.min.js +1 -1
- package/examples/jsm/Addons.js +1 -1
- package/examples/jsm/animation/AnimationClipCreator.js +57 -6
- package/examples/jsm/animation/CCDIKSolver.js +93 -39
- package/examples/jsm/capabilities/WebGL.js +28 -3
- package/examples/jsm/capabilities/WebGPU.js +16 -6
- package/examples/jsm/controls/ArcballControls.js +424 -154
- package/examples/jsm/controls/DragControls.js +93 -2
- package/examples/jsm/controls/FirstPersonControls.js +113 -4
- package/examples/jsm/controls/FlyControls.js +49 -2
- package/examples/jsm/controls/MapControls.js +42 -9
- package/examples/jsm/controls/OrbitControls.js +345 -42
- package/examples/jsm/controls/PointerLockControls.js +111 -9
- package/examples/jsm/controls/TrackballControls.js +159 -8
- package/examples/jsm/controls/TransformControls.js +252 -6
- package/examples/jsm/csm/CSM.js +226 -15
- package/examples/jsm/csm/CSMFrustum.js +52 -0
- package/examples/jsm/csm/CSMHelper.js +47 -0
- package/examples/jsm/csm/CSMShader.js +10 -1
- package/examples/jsm/csm/CSMShadowNode.js +156 -13
- package/examples/jsm/curves/CurveExtras.js +289 -31
- package/examples/jsm/curves/NURBSCurve.js +57 -14
- package/examples/jsm/curves/NURBSSurface.js +50 -6
- package/examples/jsm/curves/NURBSUtils.js +96 -112
- package/examples/jsm/curves/NURBSVolume.js +22 -4
- package/examples/jsm/effects/AnaglyphEffect.js +30 -0
- package/examples/jsm/effects/AsciiEffect.js +60 -15
- package/examples/jsm/effects/OutlineEffect.js +59 -111
- package/examples/jsm/effects/ParallaxBarrierEffect.js +28 -0
- package/examples/jsm/effects/PeppersGhostEffect.js +21 -2
- package/examples/jsm/effects/StereoEffect.js +29 -0
- package/examples/jsm/environments/DebugEnvironment.js +49 -0
- package/examples/jsm/environments/RoomEnvironment.js +23 -4
- package/examples/jsm/exporters/DRACOExporter.js +53 -13
- package/examples/jsm/exporters/EXRExporter.js +37 -8
- package/examples/jsm/exporters/GLTFExporter.js +171 -48
- package/examples/jsm/exporters/KTX2Exporter.js +20 -0
- package/examples/jsm/exporters/OBJExporter.js +18 -0
- package/examples/jsm/exporters/PLYExporter.js +39 -9
- package/examples/jsm/exporters/STLExporter.js +25 -5
- package/examples/jsm/exporters/USDZExporter.js +70 -3
- package/examples/jsm/geometries/BoxLineGeometry.js +22 -0
- package/examples/jsm/geometries/ConvexGeometry.js +18 -0
- package/examples/jsm/geometries/DecalGeometry.js +20 -9
- package/examples/jsm/geometries/ParametricFunctions.js +97 -0
- package/examples/jsm/geometries/ParametricGeometry.js +37 -5
- package/examples/jsm/geometries/RoundedBoxGeometry.js +21 -0
- package/examples/jsm/geometries/TeapotGeometry.js +22 -38
- package/examples/jsm/geometries/TextGeometry.js +44 -16
- package/examples/jsm/helpers/LightProbeHelper.js +35 -0
- package/examples/jsm/helpers/LightProbeHelperGPU.js +36 -0
- package/examples/jsm/helpers/OctreeHelper.js +35 -0
- package/examples/jsm/helpers/PositionalAudioHelper.js +59 -0
- package/examples/jsm/helpers/RectAreaLightHelper.js +35 -3
- package/examples/jsm/helpers/TextureHelper.js +27 -0
- package/examples/jsm/helpers/TextureHelperGPU.js +28 -0
- package/examples/jsm/helpers/VertexNormalsHelper.js +58 -2
- package/examples/jsm/helpers/VertexTangentsHelper.js +46 -2
- package/examples/jsm/helpers/ViewHelper.js +75 -1
- package/examples/jsm/interactive/HTMLMesh.js +25 -0
- package/examples/jsm/interactive/InteractiveGroup.js +65 -5
- package/examples/jsm/interactive/SelectionBox.js +74 -9
- package/examples/jsm/interactive/SelectionHelper.js +71 -29
- package/examples/jsm/libs/motion-controllers.module.js +1 -1
- package/examples/jsm/lighting/TiledLighting.js +23 -0
- package/examples/jsm/lights/LightProbeGenerator.js +26 -1
- package/examples/jsm/lights/RectAreaLightTexturesLib.js +48 -13
- package/examples/jsm/lights/RectAreaLightUniformsLib.js +15 -0
- package/examples/jsm/lines/Line2.js +36 -0
- package/examples/jsm/lines/LineGeometry.js +52 -0
- package/examples/jsm/lines/LineMaterial.js +95 -0
- package/examples/jsm/lines/LineSegments2.js +51 -2
- package/examples/jsm/lines/LineSegmentsGeometry.js +62 -8
- package/examples/jsm/lines/Wireframe.js +38 -2
- package/examples/jsm/lines/WireframeGeometry2.js +24 -0
- package/examples/jsm/lines/webgpu/Line2.js +25 -1
- package/examples/jsm/lines/webgpu/LineSegments2.js +44 -6
- package/examples/jsm/lines/webgpu/Wireframe.js +30 -2
- package/examples/jsm/loaders/3DMLoader.js +71 -2
- package/examples/jsm/loaders/3MFLoader.js +41 -3
- package/examples/jsm/loaders/AMFLoader.js +31 -12
- package/examples/jsm/loaders/BVHLoader.js +57 -11
- package/examples/jsm/loaders/ColladaLoader.js +35 -0
- package/examples/jsm/loaders/DDSLoader.js +24 -0
- package/examples/jsm/loaders/DRACOLoader.js +73 -1
- package/examples/jsm/loaders/EXRLoader.js +40 -8
- package/examples/jsm/loaders/FBXLoader.js +42 -14
- package/examples/jsm/loaders/FontLoader.js +60 -2
- package/examples/jsm/loaders/GCodeLoader.js +33 -5
- package/examples/jsm/loaders/GLTFLoader.js +218 -5
- package/examples/jsm/loaders/HDRCubeTextureLoader.js +48 -0
- package/examples/jsm/loaders/IESLoader.js +41 -0
- package/examples/jsm/loaders/KMZLoader.js +32 -0
- package/examples/jsm/loaders/KTX2Loader.js +86 -18
- package/examples/jsm/loaders/KTXLoader.js +26 -6
- package/examples/jsm/loaders/LDrawLoader.js +115 -5
- package/examples/jsm/loaders/LUT3dlLoader.js +46 -10
- package/examples/jsm/loaders/LUTCubeLoader.js +45 -9
- package/examples/jsm/loaders/LUTImageLoader.js +78 -38
- package/examples/jsm/loaders/LWOLoader.js +46 -7
- package/examples/jsm/loaders/LottieLoader.js +37 -0
- package/examples/jsm/loaders/MD2Loader.js +36 -1
- package/examples/jsm/loaders/MDDLoader.js +56 -12
- package/examples/jsm/loaders/MTLLoader.js +38 -33
- package/examples/jsm/loaders/MaterialXLoader.js +33 -0
- package/examples/jsm/loaders/NRRDLoader.js +36 -5
- package/examples/jsm/loaders/OBJLoader.js +48 -1
- package/examples/jsm/loaders/PCDLoader.js +47 -0
- package/examples/jsm/loaders/PDBLoader.js +40 -2
- package/examples/jsm/loaders/PLYLoader.js +62 -32
- package/examples/jsm/loaders/PVRLoader.js +23 -5
- package/examples/jsm/loaders/RGBELoader.js +38 -5
- package/examples/jsm/loaders/RGBMLoader.js +67 -1
- package/examples/jsm/loaders/STLLoader.js +47 -38
- package/examples/jsm/loaders/SVGLoader.js +113 -20
- package/examples/jsm/loaders/TDSLoader.js +81 -61
- package/examples/jsm/loaders/TGALoader.js +22 -0
- package/examples/jsm/loaders/TIFFLoader.js +22 -0
- package/examples/jsm/loaders/TTFLoader.js +36 -2
- package/examples/jsm/loaders/USDZLoader.js +34 -1
- package/examples/jsm/loaders/UltraHDRLoader.js +58 -12
- package/examples/jsm/loaders/VOXLoader.js +57 -0
- package/examples/jsm/loaders/VRMLLoader.js +32 -1
- package/examples/jsm/loaders/VTKLoader.js +38 -0
- package/examples/jsm/loaders/XYZLoader.js +35 -0
- package/examples/jsm/materials/LDrawConditionalLineMaterial.js +39 -0
- package/examples/jsm/materials/LDrawConditionalLineNodeMaterial.js +39 -0
- package/examples/jsm/materials/MeshPostProcessingMaterial.js +24 -2
- package/examples/jsm/math/Capsule.js +89 -14
- package/examples/jsm/math/ColorConverter.js +21 -0
- package/examples/jsm/math/ColorSpaces.js +53 -0
- package/examples/jsm/math/ConvexHull.js +514 -92
- package/examples/jsm/math/ImprovedNoise.js +14 -2
- package/examples/jsm/math/Lut.js +111 -0
- package/examples/jsm/math/MeshSurfaceSampler.js +76 -13
- package/examples/jsm/math/OBB.js +139 -46
- package/examples/jsm/math/Octree.js +132 -5
- package/examples/jsm/math/SimplexNoise.js +66 -42
- package/examples/jsm/misc/ConvexObjectBreaker.js +43 -25
- package/examples/jsm/misc/GPUComputationRenderer.js +92 -17
- package/examples/jsm/misc/Gyroscope.js +11 -0
- package/examples/jsm/misc/MD2Character.js +115 -2
- package/examples/jsm/misc/MD2CharacterComplex.js +170 -8
- package/examples/jsm/misc/MorphAnimMesh.js +43 -0
- package/examples/jsm/misc/MorphBlendMesh.js +102 -0
- package/examples/jsm/misc/ProgressiveLightMap.js +40 -15
- package/examples/jsm/misc/ProgressiveLightMapGPU.js +33 -13
- package/examples/jsm/misc/RollerCoaster.js +52 -0
- package/examples/jsm/misc/Timer.js +79 -2
- package/examples/jsm/misc/TubePainter.js +53 -0
- package/examples/jsm/misc/Volume.js +108 -72
- package/examples/jsm/misc/VolumeSlice.js +88 -45
- package/examples/jsm/modifiers/CurveModifier.js +57 -34
- package/examples/jsm/modifiers/CurveModifierGPU.js +36 -17
- package/examples/jsm/modifiers/EdgeSplitModifier.js +18 -0
- package/examples/jsm/modifiers/SimplifyModifier.js +20 -8
- package/examples/jsm/modifiers/TessellateModifier.js +33 -2
- package/examples/jsm/objects/GroundedSkybox.js +23 -5
- package/examples/jsm/objects/Lensflare.js +91 -2
- package/examples/jsm/objects/LensflareMesh.js +53 -2
- package/examples/jsm/objects/MarchingCubes.js +88 -5
- package/examples/jsm/objects/Reflector.js +70 -0
- package/examples/jsm/objects/ReflectorForSSRPass.js +39 -0
- package/examples/jsm/objects/Refractor.js +61 -0
- package/examples/jsm/objects/ShadowMesh.js +53 -4
- package/examples/jsm/objects/Sky.js +26 -9
- package/examples/jsm/objects/SkyMesh.js +60 -9
- package/examples/jsm/objects/Water.js +44 -5
- package/examples/jsm/objects/Water2.js +42 -3
- package/examples/jsm/objects/Water2Mesh.js +38 -3
- package/examples/jsm/objects/WaterMesh.js +94 -7
- package/examples/jsm/physics/AmmoPhysics.js +47 -0
- package/examples/jsm/physics/JoltPhysics.js +48 -0
- package/examples/jsm/physics/RapierPhysics.js +56 -0
- package/examples/jsm/postprocessing/AfterimagePass.js +90 -38
- package/examples/jsm/postprocessing/BloomPass.js +125 -24
- package/examples/jsm/postprocessing/BokehPass.js +98 -22
- package/examples/jsm/postprocessing/ClearPass.js +53 -3
- package/examples/jsm/postprocessing/CubeTexturePass.js +81 -21
- package/examples/jsm/postprocessing/DotScreenPass.js +58 -10
- package/examples/jsm/postprocessing/EffectComposer.js +131 -0
- package/examples/jsm/postprocessing/FilmPass.js +53 -5
- package/examples/jsm/postprocessing/GTAOPass.js +191 -48
- package/examples/jsm/postprocessing/GlitchPass.js +84 -33
- package/examples/jsm/postprocessing/HalftonePass.js +64 -10
- package/examples/jsm/postprocessing/LUTPass.js +37 -8
- package/examples/jsm/postprocessing/MaskPass.js +90 -0
- package/examples/jsm/postprocessing/OutlinePass.js +266 -133
- package/examples/jsm/postprocessing/OutputPass.js +53 -14
- package/examples/jsm/postprocessing/Pass.js +98 -4
- package/examples/jsm/postprocessing/RenderPass.js +83 -0
- package/examples/jsm/postprocessing/RenderPixelatedPass.js +123 -45
- package/examples/jsm/postprocessing/RenderTransitionPass.js +119 -21
- package/examples/jsm/postprocessing/SAOPass.js +126 -53
- package/examples/jsm/postprocessing/SMAAPass.js +103 -71
- package/examples/jsm/postprocessing/SSAARenderPass.js +117 -35
- package/examples/jsm/postprocessing/SSAOPass.js +160 -47
- package/examples/jsm/postprocessing/SSRPass.js +230 -49
- package/examples/jsm/postprocessing/SavePass.js +68 -16
- package/examples/jsm/postprocessing/ShaderPass.js +64 -7
- package/examples/jsm/postprocessing/TAARenderPass.js +78 -24
- package/examples/jsm/postprocessing/TexturePass.js +71 -8
- package/examples/jsm/postprocessing/UnrealBloomPass.js +113 -37
- package/examples/jsm/renderers/CSS2DRenderer.js +77 -1
- package/examples/jsm/renderers/CSS3DRenderer.js +99 -3
- package/examples/jsm/renderers/Projector.js +18 -2
- package/examples/jsm/renderers/SVGRenderer.js +124 -0
- package/examples/jsm/shaders/ACESFilmicToneMappingShader.js +9 -5
- package/examples/jsm/shaders/AfterimageShader.js +6 -4
- package/examples/jsm/shaders/BasicShader.js +6 -2
- package/examples/jsm/shaders/BleachBypassShader.js +8 -4
- package/examples/jsm/shaders/BlendShader.js +6 -2
- package/examples/jsm/shaders/BokehShader.js +7 -4
- package/examples/jsm/shaders/BokehShader2.js +7 -3
- package/examples/jsm/shaders/BrightnessContrastShader.js +8 -5
- package/examples/jsm/shaders/ColorCorrectionShader.js +6 -2
- package/examples/jsm/shaders/ColorifyShader.js +6 -2
- package/examples/jsm/shaders/ConvolutionShader.js +7 -39
- package/examples/jsm/shaders/CopyShader.js +6 -2
- package/examples/jsm/shaders/DOFMipMapShader.js +8 -4
- package/examples/jsm/shaders/DepthLimitedBlurShader.js +7 -1
- package/examples/jsm/shaders/DigitalGlitch.js +7 -7
- package/examples/jsm/shaders/DotScreenShader.js +6 -4
- package/examples/jsm/shaders/ExposureShader.js +6 -2
- package/examples/jsm/shaders/FXAAShader.js +15 -7
- package/examples/jsm/shaders/FilmShader.js +10 -0
- package/examples/jsm/shaders/FocusShader.js +6 -4
- package/examples/jsm/shaders/FreiChenShader.js +7 -3
- package/examples/jsm/shaders/GTAOShader.js +33 -39
- package/examples/jsm/shaders/GammaCorrectionShader.js +8 -2
- package/examples/jsm/shaders/GodRaysShader.js +14 -5
- package/examples/jsm/shaders/HalftoneShader.js +11 -5
- package/examples/jsm/shaders/HorizontalBlurShader.js +9 -3
- package/examples/jsm/shaders/HorizontalTiltShiftShader.js +6 -2
- package/examples/jsm/shaders/HueSaturationShader.js +7 -3
- package/examples/jsm/shaders/KaleidoShader.js +8 -4
- package/examples/jsm/shaders/LuminosityHighPassShader.js +6 -5
- package/examples/jsm/shaders/LuminosityShader.js +6 -3
- package/examples/jsm/shaders/MirrorShader.js +7 -4
- package/examples/jsm/shaders/NormalMapShader.js +5 -3
- package/examples/jsm/shaders/OutputShader.js +11 -0
- package/examples/jsm/shaders/PoissonDenoiseShader.js +21 -15
- package/examples/jsm/shaders/RGBShiftShader.js +5 -1
- package/examples/jsm/shaders/SAOShader.js +8 -2
- package/examples/jsm/shaders/SMAAShader.js +23 -1
- package/examples/jsm/shaders/SSAOShader.js +23 -5
- package/examples/jsm/shaders/SSRShader.js +25 -1
- package/examples/jsm/shaders/SepiaShader.js +6 -4
- package/examples/jsm/shaders/SobelOperatorShader.js +5 -2
- package/examples/jsm/shaders/SubsurfaceScatteringShader.js +10 -8
- package/examples/jsm/shaders/TechnicolorShader.js +7 -4
- package/examples/jsm/shaders/ToonShader.js +29 -7
- package/examples/jsm/shaders/TriangleBlurShader.js +6 -4
- package/examples/jsm/shaders/UnpackDepthRGBAShader.js +6 -3
- package/examples/jsm/shaders/VelocityShader.js +6 -2
- package/examples/jsm/shaders/VerticalBlurShader.js +6 -2
- package/examples/jsm/shaders/VerticalTiltShiftShader.js +5 -1
- package/examples/jsm/shaders/VignetteShader.js +6 -4
- package/examples/jsm/shaders/VolumeShader.js +7 -1
- package/examples/jsm/shaders/WaterRefractionShader.js +8 -0
- package/examples/jsm/textures/FlakesTexture.js +12 -0
- package/examples/jsm/transpiler/Transpiler.js +31 -0
- package/examples/jsm/tsl/display/AfterImageNode.js +1 -1
- package/examples/jsm/tsl/display/BloomNode.js +1 -1
- package/examples/jsm/tsl/display/PixelationPassNode.js +4 -4
- package/examples/jsm/tsl/display/SSRNode.js +1 -1
- package/examples/jsm/tsl/lighting/TiledLightsNode.js +29 -3
- package/examples/jsm/tsl/math/Bayer.js +14 -1
- package/examples/jsm/tsl/utils/Raymarching.js +4 -2
- package/examples/jsm/utils/BufferGeometryUtils.js +88 -29
- package/examples/jsm/utils/CameraUtils.js +10 -7
- package/examples/jsm/utils/GeometryCompressionUtils.js +20 -30
- package/examples/jsm/utils/GeometryUtils.js +12 -13
- package/examples/jsm/utils/LDrawUtils.js +11 -4
- package/examples/jsm/utils/SceneOptimizer.js +66 -20
- package/examples/jsm/utils/SceneUtils.js +50 -3
- package/examples/jsm/utils/ShadowMapViewer.js +47 -24
- package/examples/jsm/utils/ShadowMapViewerGPU.js +47 -24
- package/examples/jsm/utils/SkeletonUtils.js +45 -0
- package/examples/jsm/utils/SortUtils.js +14 -5
- package/examples/jsm/utils/UVsDebug.js +9 -4
- package/examples/jsm/utils/WebGLTextureUtils.js +13 -0
- package/examples/jsm/utils/WebGPUTextureUtils.js +14 -0
- package/examples/jsm/utils/WorkerPool.js +65 -2
- package/examples/jsm/webxr/ARButton.js +18 -0
- package/examples/jsm/webxr/OculusHandModel.js +83 -0
- package/examples/jsm/webxr/OculusHandPointerModel.js +125 -0
- package/examples/jsm/webxr/Text2D.js +11 -0
- package/examples/jsm/webxr/VRButton.js +30 -0
- package/examples/jsm/webxr/XRButton.js +22 -0
- package/examples/jsm/webxr/XRControllerModelFactory.js +87 -3
- package/examples/jsm/webxr/XREstimatedLight.js +33 -3
- package/examples/jsm/webxr/XRHandMeshModel.js +35 -0
- package/examples/jsm/webxr/XRHandModelFactory.js +92 -0
- package/examples/jsm/webxr/XRHandPrimitiveModel.js +42 -0
- package/examples/jsm/webxr/XRPlanes.js +17 -0
- package/package.json +1 -1
- package/src/Three.TSL.js +3 -1
- package/src/animation/AnimationAction.js +262 -30
- package/src/animation/AnimationClip.js +141 -2
- package/src/animation/AnimationMixer.js +99 -15
- package/src/animation/AnimationObjectGroup.js +41 -18
- package/src/animation/AnimationUtils.js +168 -18
- package/src/animation/KeyframeTrack.js +144 -10
- package/src/animation/PropertyBinding.js +77 -3
- package/src/animation/PropertyMixer.js +72 -5
- package/src/animation/tracks/BooleanKeyframeTrack.js +33 -6
- package/src/animation/tracks/ColorKeyframeTrack.js +26 -5
- package/src/animation/tracks/NumberKeyframeTrack.js +26 -2
- package/src/animation/tracks/QuaternionKeyframeTrack.js +30 -1
- package/src/animation/tracks/StringKeyframeTrack.js +33 -2
- package/src/animation/tracks/VectorKeyframeTrack.js +26 -2
- package/src/audio/AudioAnalyser.js +1 -1
- package/src/audio/AudioListener.js +2 -2
- package/src/audio/PositionalAudio.js +5 -5
- package/src/constants.js +1429 -5
- package/src/core/BufferAttribute.js +413 -3
- package/src/core/BufferGeometry.js +337 -1
- package/src/core/Clock.js +60 -0
- package/src/core/GLBufferAttribute.js +99 -0
- package/src/core/InstancedBufferAttribute.js +29 -0
- package/src/core/InstancedBufferGeometry.js +20 -0
- package/src/core/InstancedInterleavedBuffer.js +26 -0
- package/src/core/InterleavedBuffer.js +137 -3
- package/src/core/InterleavedBufferAttribute.js +197 -0
- package/src/core/Layers.js +71 -10
- package/src/core/Object3D.js +23 -0
- package/src/core/Raycaster.js +134 -1
- package/src/core/RenderTarget.js +166 -7
- package/src/core/RenderTarget3D.js +25 -0
- package/src/core/RenderTargetArray.js +18 -0
- package/src/core/Uniform.js +29 -0
- package/src/core/UniformsGroup.js +84 -2
- package/src/extras/Controls.js +16 -1
- package/src/extras/Earcut.js +3 -781
- package/src/extras/ImageUtils.js +3 -2
- package/src/extras/PMREMGenerator.js +22 -17
- package/src/extras/core/Curve.js +1 -1
- package/src/extras/core/Path.js +1 -1
- package/src/extras/lib/earcut.js +685 -0
- package/src/geometries/ConeGeometry.js +2 -2
- package/src/geometries/CylinderGeometry.js +2 -2
- package/src/geometries/ExtrudeGeometry.js +71 -39
- package/src/geometries/LatheGeometry.js +1 -1
- package/src/lights/LightShadow.js +1 -1
- package/src/lights/webgpu/IESSpotLight.js +1 -1
- package/src/loaders/AnimationLoader.js +31 -0
- package/src/loaders/AudioLoader.js +31 -0
- package/src/loaders/BufferGeometryLoader.js +34 -0
- package/src/loaders/Cache.js +45 -0
- package/src/loaders/CompressedTextureLoader.js +36 -3
- package/src/loaders/CubeTextureLoader.js +45 -0
- package/src/loaders/DataTextureLoader.js +44 -3
- package/src/loaders/FileLoader.js +57 -1
- package/src/loaders/ImageBitmapLoader.js +57 -0
- package/src/loaders/ImageLoader.js +30 -0
- package/src/loaders/Loader.js +4 -6
- package/src/loaders/LoaderUtils.js +18 -36
- package/src/loaders/LoadingManager.js +142 -0
- package/src/loaders/MaterialLoader.js +57 -0
- package/src/loaders/ObjectLoader.js +53 -0
- package/src/loaders/TextureLoader.js +33 -0
- package/src/loaders/nodes/NodeLoader.js +6 -2
- package/src/loaders/nodes/NodeMaterialLoader.js +1 -1
- package/src/loaders/nodes/NodeObjectLoader.js +3 -3
- package/src/materials/LineBasicMaterial.js +74 -1
- package/src/materials/LineDashedMaterial.js +52 -0
- package/src/materials/Material.js +18 -3
- package/src/materials/MeshBasicMaterial.js +165 -0
- package/src/materials/MeshDepthMaterial.js +93 -0
- package/src/materials/MeshDistanceMaterial.js +76 -0
- package/src/materials/MeshLambertMaterial.js +273 -0
- package/src/materials/MeshMatcapMaterial.js +142 -0
- package/src/materials/MeshNormalMaterial.js +113 -0
- package/src/materials/MeshPhongMaterial.js +288 -0
- package/src/materials/MeshPhysicalMaterial.js +292 -1
- package/src/materials/MeshStandardMaterial.js +297 -0
- package/src/materials/MeshToonMaterial.js +218 -0
- package/src/materials/PointsMaterial.js +89 -0
- package/src/materials/RawShaderMaterial.js +25 -0
- package/src/materials/ShaderMaterial.js +215 -6
- package/src/materials/ShadowMaterial.js +54 -0
- package/src/materials/SpriteMaterial.js +82 -0
- package/src/materials/nodes/Line2NodeMaterial.js +1 -1
- package/src/materials/nodes/LineBasicNodeMaterial.js +2 -2
- package/src/materials/nodes/LineDashedNodeMaterial.js +2 -2
- package/src/materials/nodes/MeshBasicNodeMaterial.js +2 -2
- package/src/materials/nodes/MeshLambertNodeMaterial.js +2 -2
- package/src/materials/nodes/MeshMatcapNodeMaterial.js +2 -2
- package/src/materials/nodes/MeshNormalNodeMaterial.js +2 -2
- package/src/materials/nodes/MeshPhongNodeMaterial.js +2 -2
- package/src/materials/nodes/MeshPhysicalNodeMaterial.js +2 -2
- package/src/materials/nodes/MeshSSSNodeMaterial.js +1 -1
- package/src/materials/nodes/MeshStandardNodeMaterial.js +2 -2
- package/src/materials/nodes/MeshToonNodeMaterial.js +2 -2
- package/src/materials/nodes/NodeMaterial.js +7 -3
- package/src/materials/nodes/PointsNodeMaterial.js +1 -1
- package/src/materials/nodes/ShadowNodeMaterial.js +11 -2
- package/src/materials/nodes/SpriteNodeMaterial.js +1 -1
- package/src/materials/nodes/VolumeNodeMaterial.js +10 -1
- package/src/math/Color.js +1 -1
- package/src/math/MathUtils.js +223 -0
- package/src/nodes/Nodes.js +1 -0
- package/src/nodes/accessors/BatchNode.js +8 -8
- package/src/nodes/accessors/BuiltinNode.js +1 -1
- package/src/nodes/accessors/CubeTextureNode.js +1 -1
- package/src/nodes/accessors/InstanceNode.js +5 -5
- package/src/nodes/accessors/InstancedMeshNode.js +1 -1
- package/src/nodes/accessors/MorphNode.js +27 -23
- package/src/nodes/accessors/Normal.js +1 -1
- package/src/nodes/accessors/Object3DNode.js +12 -12
- package/src/nodes/accessors/ReferenceBaseNode.js +2 -2
- package/src/nodes/accessors/ReferenceNode.js +1 -1
- package/src/nodes/accessors/SkinningNode.js +46 -37
- package/src/nodes/accessors/StorageBufferNode.js +1 -1
- package/src/nodes/accessors/StorageTextureNode.js +3 -3
- package/src/nodes/accessors/Texture3DNode.js +1 -1
- package/src/nodes/accessors/TextureNode.js +25 -5
- package/src/nodes/accessors/TextureSizeNode.js +1 -1
- package/src/nodes/accessors/UniformArrayNode.js +2 -2
- package/src/nodes/code/CodeNode.js +4 -4
- package/src/nodes/code/ExpressionNode.js +4 -4
- package/src/nodes/code/FunctionCallNode.js +23 -3
- package/src/nodes/code/ScriptableNode.js +4 -4
- package/src/nodes/code/ScriptableValueNode.js +2 -2
- package/src/nodes/core/AssignNode.js +1 -1
- package/src/nodes/core/AttributeNode.js +1 -1
- package/src/nodes/core/BypassNode.js +1 -1
- package/src/nodes/core/CacheNode.js +1 -1
- package/src/nodes/core/ContextNode.js +1 -1
- package/src/nodes/core/InputNode.js +2 -2
- package/src/nodes/core/Node.js +14 -2
- package/src/nodes/core/NodeBuilder.js +86 -14
- package/src/nodes/core/StackNode.js +5 -5
- package/src/nodes/core/StructNode.js +1 -1
- package/src/nodes/core/StructTypeNode.js +2 -2
- package/src/nodes/core/VarNode.js +2 -8
- package/src/nodes/core/VaryingNode.js +3 -3
- package/src/nodes/display/BlendModes.js +4 -4
- package/src/nodes/display/BumpMapNode.js +1 -1
- package/src/nodes/display/NormalMapNode.js +1 -1
- package/src/nodes/display/PosterizeNode.js +1 -1
- package/src/nodes/display/ScreenNode.js +3 -3
- package/src/nodes/display/ViewportDepthNode.js +2 -2
- package/src/nodes/display/ViewportDepthTextureNode.js +2 -2
- package/src/nodes/display/ViewportSharedTextureNode.js +2 -2
- package/src/nodes/display/ViewportTextureNode.js +4 -4
- package/src/nodes/functions/ShadowMaskModel.js +4 -4
- package/src/nodes/functions/material/getParallaxCorrectNormal.js +6 -6
- package/src/nodes/geometry/RangeNode.js +1 -1
- package/src/nodes/gpgpu/AtomicFunctionNode.js +16 -40
- package/src/nodes/gpgpu/ComputeBuiltinNode.js +1 -1
- package/src/nodes/gpgpu/ComputeNode.js +30 -2
- package/src/nodes/lighting/AnalyticLightNode.js +9 -1
- package/src/nodes/lighting/LightsNode.js +3 -3
- package/src/nodes/lighting/ShadowNode.js +1 -1
- package/src/nodes/math/ConditionalNode.js +20 -3
- package/src/nodes/math/MathNode.js +83 -78
- package/src/nodes/math/OperatorNode.js +171 -82
- package/src/nodes/pmrem/PMREMNode.js +4 -4
- package/src/nodes/pmrem/PMREMUtils.js +2 -2
- package/src/nodes/tsl/TSLBase.js +2 -1
- package/src/nodes/tsl/TSLCore.js +115 -12
- package/src/nodes/utils/ArrayElementNode.js +3 -1
- package/src/nodes/utils/CubeMapNode.js +3 -3
- package/src/nodes/utils/DebugNode.js +70 -0
- package/src/nodes/utils/EquirectUVNode.js +2 -2
- package/src/nodes/utils/JoinNode.js +27 -2
- package/src/nodes/utils/LoopNode.js +58 -28
- package/src/nodes/utils/MaxMipLevelNode.js +1 -1
- package/src/nodes/utils/ReflectorNode.js +2 -2
- package/src/nodes/utils/RemapNode.js +6 -6
- package/src/nodes/utils/RotateNode.js +1 -1
- package/src/nodes/utils/SpriteSheetUVNode.js +3 -3
- package/src/nodes/utils/StorageArrayElementNode.js +1 -1
- package/src/nodes/utils/TriplanarTexturesNode.js +3 -3
- package/src/objects/BatchedMesh.js +4 -4
- package/src/objects/InstancedMesh.js +2 -2
- package/src/objects/LOD.js +1 -1
- package/src/objects/Skeleton.js +1 -1
- package/src/renderers/WebGL3DRenderTarget.js +25 -0
- package/src/renderers/WebGLArrayRenderTarget.js +25 -0
- package/src/renderers/WebGLCubeRenderTarget.js +39 -1
- package/src/renderers/WebGLRenderTarget.js +19 -0
- package/src/renderers/WebGLRenderer.js +617 -79
- package/src/renderers/common/Animation.js +2 -2
- package/src/renderers/common/Attributes.js +2 -2
- package/src/renderers/common/Backend.js +12 -3
- package/src/renderers/common/Background.js +1 -0
- package/src/renderers/common/Color4.js +1 -1
- package/src/renderers/common/CubeRenderTarget.js +13 -0
- package/src/renderers/common/PostProcessing.js +2 -0
- package/src/renderers/common/QuadMesh.js +2 -0
- package/src/renderers/common/RenderList.js +2 -2
- package/src/renderers/common/RenderObject.js +1 -1
- package/src/renderers/common/RenderObjects.js +2 -2
- package/src/renderers/common/Renderer.js +52 -31
- package/src/renderers/common/XRManager.js +333 -10
- package/src/renderers/common/extras/PMREMGenerator.js +6 -0
- package/src/renderers/common/nodes/NodeBuilderState.js +3 -3
- package/src/renderers/shaders/UniformsLib.js +1 -4
- package/src/renderers/shaders/UniformsUtils.js +1 -3
- package/src/renderers/webgl/WebGLBackground.js +4 -2
- package/src/renderers/webgl/WebGLState.js +9 -9
- package/src/renderers/webgl-fallback/WebGLBackend.js +25 -26
- package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +3 -12
- package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +67 -19
- package/src/renderers/webgl-fallback/utils/WebGLUtils.js +1 -1
- package/src/renderers/webgpu/WebGPUBackend.js +128 -87
- package/src/renderers/webgpu/WebGPURenderer.Nodes.js +1 -11
- package/src/renderers/webgpu/WebGPURenderer.js +17 -11
- package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +4 -4
- package/src/renderers/webgpu/utils/WebGPUAttributeUtils.js +5 -3
- package/src/renderers/webgpu/utils/WebGPUConstants.js +1 -1
- package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +1 -1
- package/src/renderers/webxr/WebXRController.js +87 -2
- package/src/renderers/webxr/WebXRDepthSensing.js +49 -0
- package/src/renderers/webxr/WebXRManager.js +173 -1
- package/src/scenes/Scene.js +2 -1
- package/src/textures/CanvasTexture.js +28 -0
- package/src/textures/CompressedArrayTexture.js +57 -0
- package/src/textures/CompressedCubeTexture.js +29 -0
- package/src/textures/CompressedTexture.js +64 -6
- package/src/textures/CubeTexture.js +52 -4
- package/src/textures/Data3DTexture.js +77 -0
- package/src/textures/DataArrayTexture.js +93 -0
- package/src/textures/DataTexture.js +65 -0
- package/src/textures/DepthTexture.js +59 -9
- package/src/textures/FramebufferTexture.js +62 -0
- package/src/textures/Source.js +69 -0
- package/src/textures/Texture.js +5 -5
- package/src/textures/VideoFrameTexture.js +43 -6
- package/src/textures/VideoTexture.js +49 -4
- package/examples/jsm/geometries/ParametricGeometries.js +0 -254
|
@@ -67,8 +67,62 @@ import {
|
|
|
67
67
|
} from 'three';
|
|
68
68
|
import { toTrianglesDrawMode } from '../utils/BufferGeometryUtils.js';
|
|
69
69
|
|
|
70
|
+
/**
|
|
71
|
+
* A loader for the glTF 2.0 format.
|
|
72
|
+
*
|
|
73
|
+
* [glTF]{@link 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
|
+
* for efficient delivery and loading of 3D content. Assets may be provided either in JSON (.gltf) or binary (.glb)
|
|
75
|
+
* format. External files store textures (.jpg, .png) and additional binary data (.bin). A glTF asset may deliver
|
|
76
|
+
* one or more scenes, including meshes, materials, textures, skins, skeletons, morph targets, animations, lights,
|
|
77
|
+
* and/or cameras.
|
|
78
|
+
*
|
|
79
|
+
* `GLTFLoader` uses {@link ImageBitmapLoader} whenever possible. Be advised that image bitmaps are not
|
|
80
|
+
* automatically GC-collected when they are no longer referenced, and they require special handling during
|
|
81
|
+
* the disposal process.
|
|
82
|
+
*
|
|
83
|
+
* `GLTFLoader` supports the following glTF 2.0 extensions:
|
|
84
|
+
* - KHR_draco_mesh_compression
|
|
85
|
+
* - KHR_materials_clearcoat
|
|
86
|
+
* - KHR_materials_dispersion
|
|
87
|
+
* - KHR_materials_ior
|
|
88
|
+
* - KHR_materials_specular
|
|
89
|
+
* - KHR_materials_transmission
|
|
90
|
+
* - KHR_materials_iridescence
|
|
91
|
+
* - KHR_materials_unlit
|
|
92
|
+
* - KHR_materials_volume
|
|
93
|
+
* - KHR_mesh_quantization
|
|
94
|
+
* - KHR_lights_punctual
|
|
95
|
+
* - KHR_texture_basisu
|
|
96
|
+
* - KHR_texture_transform
|
|
97
|
+
* - EXT_texture_webp
|
|
98
|
+
* - EXT_meshopt_compression
|
|
99
|
+
* - EXT_mesh_gpu_instancing
|
|
100
|
+
*
|
|
101
|
+
* The following glTF 2.0 extension is supported by an external user plugin:
|
|
102
|
+
* - [KHR_materials_variants]{@link https://github.com/takahirox/three-gltf-extensions}
|
|
103
|
+
* - [MSFT_texture_dds]{@link https://github.com/takahirox/three-gltf-extensions}
|
|
104
|
+
*
|
|
105
|
+
* ```js
|
|
106
|
+
* const loader = new GLTFLoader();
|
|
107
|
+
*
|
|
108
|
+
* // Optional: Provide a DRACOLoader instance to decode compressed mesh data
|
|
109
|
+
* const dracoLoader = new DRACOLoader();
|
|
110
|
+
* dracoLoader.setDecoderPath( '/examples/jsm/libs/draco/' );
|
|
111
|
+
* loader.setDRACOLoader( dracoLoader );
|
|
112
|
+
*
|
|
113
|
+
* const gltf = await loader.loadAsync( 'models/gltf/duck/duck.gltf' );
|
|
114
|
+
* scene.add( gltf.scene );
|
|
115
|
+
* ```
|
|
116
|
+
*
|
|
117
|
+
* @augments Loader
|
|
118
|
+
*/
|
|
70
119
|
class GLTFLoader extends Loader {
|
|
71
120
|
|
|
121
|
+
/**
|
|
122
|
+
* Constructs a new glTF loader.
|
|
123
|
+
*
|
|
124
|
+
* @param {LoadingManager} [manager] - The loading manager.
|
|
125
|
+
*/
|
|
72
126
|
constructor( manager ) {
|
|
73
127
|
|
|
74
128
|
super( manager );
|
|
@@ -183,6 +237,15 @@ class GLTFLoader extends Loader {
|
|
|
183
237
|
|
|
184
238
|
}
|
|
185
239
|
|
|
240
|
+
/**
|
|
241
|
+
* Starts loading from the given URL and passes the loaded glTF asset
|
|
242
|
+
* to the `onLoad()` callback.
|
|
243
|
+
*
|
|
244
|
+
* @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.
|
|
245
|
+
* @param {function(GLTFLoader~LoadObject)} onLoad - Executed when the loading process has been finished.
|
|
246
|
+
* @param {onProgressCallback} onProgress - Executed while the loading is in progress.
|
|
247
|
+
* @param {onErrorCallback} onError - Executed when errors occur.
|
|
248
|
+
*/
|
|
186
249
|
load( url, onLoad, onProgress, onError ) {
|
|
187
250
|
|
|
188
251
|
const scope = this;
|
|
@@ -260,6 +323,13 @@ class GLTFLoader extends Loader {
|
|
|
260
323
|
|
|
261
324
|
}
|
|
262
325
|
|
|
326
|
+
/**
|
|
327
|
+
* Sets the given Draco loader to this loader. Required for decoding assets
|
|
328
|
+
* compressed with the `KHR_draco_mesh_compression` extension.
|
|
329
|
+
*
|
|
330
|
+
* @param {DRACOLoader} dracoLoader - The Draco loader to set.
|
|
331
|
+
* @return {GLTFLoader} A reference to this loader.
|
|
332
|
+
*/
|
|
263
333
|
setDRACOLoader( dracoLoader ) {
|
|
264
334
|
|
|
265
335
|
this.dracoLoader = dracoLoader;
|
|
@@ -267,6 +337,13 @@ class GLTFLoader extends Loader {
|
|
|
267
337
|
|
|
268
338
|
}
|
|
269
339
|
|
|
340
|
+
/**
|
|
341
|
+
* Sets the given KTX2 loader to this loader. Required for loading KTX2
|
|
342
|
+
* compressed textures.
|
|
343
|
+
*
|
|
344
|
+
* @param {KTX2Loader} ktx2Loader - The KTX2 loader to set.
|
|
345
|
+
* @return {GLTFLoader} A reference to this loader.
|
|
346
|
+
*/
|
|
270
347
|
setKTX2Loader( ktx2Loader ) {
|
|
271
348
|
|
|
272
349
|
this.ktx2Loader = ktx2Loader;
|
|
@@ -274,6 +351,13 @@ class GLTFLoader extends Loader {
|
|
|
274
351
|
|
|
275
352
|
}
|
|
276
353
|
|
|
354
|
+
/**
|
|
355
|
+
* Sets the given meshopt decoder. Required for decoding assets
|
|
356
|
+
* compressed with the `EXT_meshopt_compression` extension.
|
|
357
|
+
*
|
|
358
|
+
* @param {Object} meshoptDecoder - The meshopt decoder to set.
|
|
359
|
+
* @return {GLTFLoader} A reference to this loader.
|
|
360
|
+
*/
|
|
277
361
|
setMeshoptDecoder( meshoptDecoder ) {
|
|
278
362
|
|
|
279
363
|
this.meshoptDecoder = meshoptDecoder;
|
|
@@ -281,6 +365,14 @@ class GLTFLoader extends Loader {
|
|
|
281
365
|
|
|
282
366
|
}
|
|
283
367
|
|
|
368
|
+
/**
|
|
369
|
+
* Registers a plugin callback. This API is internally used to implement the various
|
|
370
|
+
* glTF extensions but can also used by third-party code to add additional logic
|
|
371
|
+
* to the loader.
|
|
372
|
+
*
|
|
373
|
+
* @param {function(parser:GLTFParser)} callback - The callback function to register.
|
|
374
|
+
* @return {GLTFLoader} A reference to this loader.
|
|
375
|
+
*/
|
|
284
376
|
register( callback ) {
|
|
285
377
|
|
|
286
378
|
if ( this.pluginCallbacks.indexOf( callback ) === - 1 ) {
|
|
@@ -293,6 +385,12 @@ class GLTFLoader extends Loader {
|
|
|
293
385
|
|
|
294
386
|
}
|
|
295
387
|
|
|
388
|
+
/**
|
|
389
|
+
* Unregisters a plugin callback.
|
|
390
|
+
*
|
|
391
|
+
* @param {Function} callback - The callback function to unregister.
|
|
392
|
+
* @return {GLTFLoader} A reference to this loader.
|
|
393
|
+
*/
|
|
296
394
|
unregister( callback ) {
|
|
297
395
|
|
|
298
396
|
if ( this.pluginCallbacks.indexOf( callback ) !== - 1 ) {
|
|
@@ -305,6 +403,14 @@ class GLTFLoader extends Loader {
|
|
|
305
403
|
|
|
306
404
|
}
|
|
307
405
|
|
|
406
|
+
/**
|
|
407
|
+
* Parses the given FBX data and returns the resulting group.
|
|
408
|
+
*
|
|
409
|
+
* @param {string|ArrayBuffer} data - The raw glTF data.
|
|
410
|
+
* @param {string} path - The URL base path.
|
|
411
|
+
* @param {function(GLTFLoader~LoadObject)} onLoad - Executed when the loading process has been finished.
|
|
412
|
+
* @param {onErrorCallback} onError - Executed when errors occur.
|
|
413
|
+
*/
|
|
308
414
|
parse( data, path, onLoad, onError ) {
|
|
309
415
|
|
|
310
416
|
let json;
|
|
@@ -428,6 +534,14 @@ class GLTFLoader extends Loader {
|
|
|
428
534
|
|
|
429
535
|
}
|
|
430
536
|
|
|
537
|
+
/**
|
|
538
|
+
* Async version of {@link GLTFLoader#parse}.
|
|
539
|
+
*
|
|
540
|
+
* @async
|
|
541
|
+
* @param {string|ArrayBuffer} data - The raw glTF data.
|
|
542
|
+
* @param {string} path - The URL base path.
|
|
543
|
+
* @return {Promise<GLTFLoader~LoadObject>} A Promise that resolves with the loaded glTF when the parsing has been finished.
|
|
544
|
+
*/
|
|
431
545
|
parseAsync( data, path ) {
|
|
432
546
|
|
|
433
547
|
const scope = this;
|
|
@@ -511,6 +625,8 @@ const EXTENSIONS = {
|
|
|
511
625
|
* Punctual Lights Extension
|
|
512
626
|
*
|
|
513
627
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_lights_punctual
|
|
628
|
+
*
|
|
629
|
+
* @private
|
|
514
630
|
*/
|
|
515
631
|
class GLTFLightsExtension {
|
|
516
632
|
|
|
@@ -647,6 +763,8 @@ class GLTFLightsExtension {
|
|
|
647
763
|
* Unlit Materials Extension
|
|
648
764
|
*
|
|
649
765
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit
|
|
766
|
+
*
|
|
767
|
+
* @private
|
|
650
768
|
*/
|
|
651
769
|
class GLTFMaterialsUnlitExtension {
|
|
652
770
|
|
|
@@ -700,6 +818,8 @@ class GLTFMaterialsUnlitExtension {
|
|
|
700
818
|
* Materials Emissive Strength Extension
|
|
701
819
|
*
|
|
702
820
|
* Specification: https://github.com/KhronosGroup/glTF/blob/5768b3ce0ef32bc39cdf1bef10b948586635ead3/extensions/2.0/Khronos/KHR_materials_emissive_strength/README.md
|
|
821
|
+
*
|
|
822
|
+
* @private
|
|
703
823
|
*/
|
|
704
824
|
class GLTFMaterialsEmissiveStrengthExtension {
|
|
705
825
|
|
|
@@ -739,6 +859,8 @@ class GLTFMaterialsEmissiveStrengthExtension {
|
|
|
739
859
|
* Clearcoat Materials Extension
|
|
740
860
|
*
|
|
741
861
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_clearcoat
|
|
862
|
+
*
|
|
863
|
+
* @private
|
|
742
864
|
*/
|
|
743
865
|
class GLTFMaterialsClearcoatExtension {
|
|
744
866
|
|
|
@@ -823,6 +945,8 @@ class GLTFMaterialsClearcoatExtension {
|
|
|
823
945
|
* Materials dispersion Extension
|
|
824
946
|
*
|
|
825
947
|
* Specification: https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_dispersion
|
|
948
|
+
*
|
|
949
|
+
* @private
|
|
826
950
|
*/
|
|
827
951
|
class GLTFMaterialsDispersionExtension {
|
|
828
952
|
|
|
@@ -869,6 +993,8 @@ class GLTFMaterialsDispersionExtension {
|
|
|
869
993
|
* Iridescence Materials Extension
|
|
870
994
|
*
|
|
871
995
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_iridescence
|
|
996
|
+
*
|
|
997
|
+
* @private
|
|
872
998
|
*/
|
|
873
999
|
class GLTFMaterialsIridescenceExtension {
|
|
874
1000
|
|
|
@@ -957,6 +1083,8 @@ class GLTFMaterialsIridescenceExtension {
|
|
|
957
1083
|
* Sheen Materials Extension
|
|
958
1084
|
*
|
|
959
1085
|
* Specification: https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_sheen
|
|
1086
|
+
*
|
|
1087
|
+
* @private
|
|
960
1088
|
*/
|
|
961
1089
|
class GLTFMaterialsSheenExtension {
|
|
962
1090
|
|
|
@@ -1033,6 +1161,8 @@ class GLTFMaterialsSheenExtension {
|
|
|
1033
1161
|
*
|
|
1034
1162
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_transmission
|
|
1035
1163
|
* Draft: https://github.com/KhronosGroup/glTF/pull/1698
|
|
1164
|
+
*
|
|
1165
|
+
* @private
|
|
1036
1166
|
*/
|
|
1037
1167
|
class GLTFMaterialsTransmissionExtension {
|
|
1038
1168
|
|
|
@@ -1091,6 +1221,8 @@ class GLTFMaterialsTransmissionExtension {
|
|
|
1091
1221
|
* Materials Volume Extension
|
|
1092
1222
|
*
|
|
1093
1223
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_volume
|
|
1224
|
+
*
|
|
1225
|
+
* @private
|
|
1094
1226
|
*/
|
|
1095
1227
|
class GLTFMaterialsVolumeExtension {
|
|
1096
1228
|
|
|
@@ -1150,6 +1282,8 @@ class GLTFMaterialsVolumeExtension {
|
|
|
1150
1282
|
* Materials ior Extension
|
|
1151
1283
|
*
|
|
1152
1284
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_ior
|
|
1285
|
+
*
|
|
1286
|
+
* @private
|
|
1153
1287
|
*/
|
|
1154
1288
|
class GLTFMaterialsIorExtension {
|
|
1155
1289
|
|
|
@@ -1196,6 +1330,8 @@ class GLTFMaterialsIorExtension {
|
|
|
1196
1330
|
* Materials specular Extension
|
|
1197
1331
|
*
|
|
1198
1332
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_specular
|
|
1333
|
+
*
|
|
1334
|
+
* @private
|
|
1199
1335
|
*/
|
|
1200
1336
|
class GLTFMaterialsSpecularExtension {
|
|
1201
1337
|
|
|
@@ -1260,6 +1396,8 @@ class GLTFMaterialsSpecularExtension {
|
|
|
1260
1396
|
* Materials bump Extension
|
|
1261
1397
|
*
|
|
1262
1398
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/EXT_materials_bump
|
|
1399
|
+
*
|
|
1400
|
+
* @private
|
|
1263
1401
|
*/
|
|
1264
1402
|
class GLTFMaterialsBumpExtension {
|
|
1265
1403
|
|
|
@@ -1314,6 +1452,8 @@ class GLTFMaterialsBumpExtension {
|
|
|
1314
1452
|
* Materials anisotropy Extension
|
|
1315
1453
|
*
|
|
1316
1454
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_anisotropy
|
|
1455
|
+
*
|
|
1456
|
+
* @private
|
|
1317
1457
|
*/
|
|
1318
1458
|
class GLTFMaterialsAnisotropyExtension {
|
|
1319
1459
|
|
|
@@ -1378,6 +1518,8 @@ class GLTFMaterialsAnisotropyExtension {
|
|
|
1378
1518
|
* BasisU Texture Extension
|
|
1379
1519
|
*
|
|
1380
1520
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_basisu
|
|
1521
|
+
*
|
|
1522
|
+
* @private
|
|
1381
1523
|
*/
|
|
1382
1524
|
class GLTFTextureBasisUExtension {
|
|
1383
1525
|
|
|
@@ -1429,6 +1571,8 @@ class GLTFTextureBasisUExtension {
|
|
|
1429
1571
|
* WebP Texture Extension
|
|
1430
1572
|
*
|
|
1431
1573
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_texture_webp
|
|
1574
|
+
*
|
|
1575
|
+
* @private
|
|
1432
1576
|
*/
|
|
1433
1577
|
class GLTFTextureWebPExtension {
|
|
1434
1578
|
|
|
@@ -1514,6 +1658,8 @@ class GLTFTextureWebPExtension {
|
|
|
1514
1658
|
* AVIF Texture Extension
|
|
1515
1659
|
*
|
|
1516
1660
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_texture_avif
|
|
1661
|
+
*
|
|
1662
|
+
* @private
|
|
1517
1663
|
*/
|
|
1518
1664
|
class GLTFTextureAVIFExtension {
|
|
1519
1665
|
|
|
@@ -1597,6 +1743,8 @@ class GLTFTextureAVIFExtension {
|
|
|
1597
1743
|
* meshopt BufferView Compression Extension
|
|
1598
1744
|
*
|
|
1599
1745
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_meshopt_compression
|
|
1746
|
+
*
|
|
1747
|
+
* @private
|
|
1600
1748
|
*/
|
|
1601
1749
|
class GLTFMeshoptCompression {
|
|
1602
1750
|
|
|
@@ -1682,6 +1830,7 @@ class GLTFMeshoptCompression {
|
|
|
1682
1830
|
*
|
|
1683
1831
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_mesh_gpu_instancing
|
|
1684
1832
|
*
|
|
1833
|
+
* @private
|
|
1685
1834
|
*/
|
|
1686
1835
|
class GLTFMeshGpuInstancing {
|
|
1687
1836
|
|
|
@@ -1910,6 +2059,8 @@ class GLTFBinaryExtension {
|
|
|
1910
2059
|
* DRACO Mesh Compression Extension
|
|
1911
2060
|
*
|
|
1912
2061
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression
|
|
2062
|
+
*
|
|
2063
|
+
* @private
|
|
1913
2064
|
*/
|
|
1914
2065
|
class GLTFDracoMeshCompressionExtension {
|
|
1915
2066
|
|
|
@@ -1993,6 +2144,8 @@ class GLTFDracoMeshCompressionExtension {
|
|
|
1993
2144
|
* Texture Transform Extension
|
|
1994
2145
|
*
|
|
1995
2146
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_transform
|
|
2147
|
+
*
|
|
2148
|
+
* @private
|
|
1996
2149
|
*/
|
|
1997
2150
|
class GLTFTextureTransformExtension {
|
|
1998
2151
|
|
|
@@ -2052,6 +2205,8 @@ class GLTFTextureTransformExtension {
|
|
|
2052
2205
|
* Mesh Quantization Extension
|
|
2053
2206
|
*
|
|
2054
2207
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_mesh_quantization
|
|
2208
|
+
*
|
|
2209
|
+
* @private
|
|
2055
2210
|
*/
|
|
2056
2211
|
class GLTFMeshQuantizationExtension {
|
|
2057
2212
|
|
|
@@ -2254,6 +2409,7 @@ const ALPHA_MODES = {
|
|
|
2254
2409
|
/**
|
|
2255
2410
|
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#default-material
|
|
2256
2411
|
*
|
|
2412
|
+
* @private
|
|
2257
2413
|
* @param {Object<string, Material>} cache
|
|
2258
2414
|
* @return {Material}
|
|
2259
2415
|
*/
|
|
@@ -2295,7 +2451,9 @@ function addUnknownExtensionsToUserData( knownExtensions, object, objectDef ) {
|
|
|
2295
2451
|
}
|
|
2296
2452
|
|
|
2297
2453
|
/**
|
|
2298
|
-
*
|
|
2454
|
+
*
|
|
2455
|
+
* @private
|
|
2456
|
+
* @param {Object3D|Material|BufferGeometry|Object} object
|
|
2299
2457
|
* @param {GLTF.definition} gltfDef
|
|
2300
2458
|
*/
|
|
2301
2459
|
function assignExtrasToUserData( object, gltfDef ) {
|
|
@@ -2319,6 +2477,7 @@ function assignExtrasToUserData( object, gltfDef ) {
|
|
|
2319
2477
|
/**
|
|
2320
2478
|
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#morph-targets
|
|
2321
2479
|
*
|
|
2480
|
+
* @private
|
|
2322
2481
|
* @param {BufferGeometry} geometry
|
|
2323
2482
|
* @param {Array<GLTF.Target>} targets
|
|
2324
2483
|
* @param {GLTFParser} parser
|
|
@@ -2406,6 +2565,8 @@ function addMorphTargets( geometry, targets, parser ) {
|
|
|
2406
2565
|
}
|
|
2407
2566
|
|
|
2408
2567
|
/**
|
|
2568
|
+
*
|
|
2569
|
+
* @private
|
|
2409
2570
|
* @param {Mesh} mesh
|
|
2410
2571
|
* @param {GLTF.Mesh} meshDef
|
|
2411
2572
|
*/
|
|
@@ -2694,6 +2855,8 @@ class GLTFParser {
|
|
|
2694
2855
|
|
|
2695
2856
|
/**
|
|
2696
2857
|
* Marks the special nodes/meshes in json for efficient parse.
|
|
2858
|
+
*
|
|
2859
|
+
* @private
|
|
2697
2860
|
*/
|
|
2698
2861
|
_markDefs() {
|
|
2699
2862
|
|
|
@@ -2755,6 +2918,7 @@ class GLTFParser {
|
|
|
2755
2918
|
*
|
|
2756
2919
|
* Example: CesiumMilkTruck sample model reuses "Wheel" meshes.
|
|
2757
2920
|
*
|
|
2921
|
+
* @private
|
|
2758
2922
|
* @param {Object} cache
|
|
2759
2923
|
* @param {Object3D} index
|
|
2760
2924
|
*/
|
|
@@ -2775,6 +2939,7 @@ class GLTFParser {
|
|
|
2775
2939
|
/**
|
|
2776
2940
|
* Returns a reference to a shared resource, cloning it if necessary.
|
|
2777
2941
|
*
|
|
2942
|
+
* @private
|
|
2778
2943
|
* @param {Object} cache
|
|
2779
2944
|
* @param {number} index
|
|
2780
2945
|
* @param {Object} object
|
|
@@ -2851,6 +3016,8 @@ class GLTFParser {
|
|
|
2851
3016
|
|
|
2852
3017
|
/**
|
|
2853
3018
|
* Requests the specified dependency asynchronously, with caching.
|
|
3019
|
+
*
|
|
3020
|
+
* @private
|
|
2854
3021
|
* @param {string} type
|
|
2855
3022
|
* @param {number} index
|
|
2856
3023
|
* @return {Promise<Object3D|Material|THREE.Texture|AnimationClip|ArrayBuffer|Object>}
|
|
@@ -2959,6 +3126,8 @@ class GLTFParser {
|
|
|
2959
3126
|
|
|
2960
3127
|
/**
|
|
2961
3128
|
* Requests all dependencies of the specified type asynchronously, with caching.
|
|
3129
|
+
*
|
|
3130
|
+
* @private
|
|
2962
3131
|
* @param {string} type
|
|
2963
3132
|
* @return {Promise<Array<Object>>}
|
|
2964
3133
|
*/
|
|
@@ -2987,6 +3156,8 @@ class GLTFParser {
|
|
|
2987
3156
|
|
|
2988
3157
|
/**
|
|
2989
3158
|
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views
|
|
3159
|
+
*
|
|
3160
|
+
* @private
|
|
2990
3161
|
* @param {number} bufferIndex
|
|
2991
3162
|
* @return {Promise<ArrayBuffer>}
|
|
2992
3163
|
*/
|
|
@@ -3024,6 +3195,8 @@ class GLTFParser {
|
|
|
3024
3195
|
|
|
3025
3196
|
/**
|
|
3026
3197
|
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views
|
|
3198
|
+
*
|
|
3199
|
+
* @private
|
|
3027
3200
|
* @param {number} bufferViewIndex
|
|
3028
3201
|
* @return {Promise<ArrayBuffer>}
|
|
3029
3202
|
*/
|
|
@@ -3043,6 +3216,8 @@ class GLTFParser {
|
|
|
3043
3216
|
|
|
3044
3217
|
/**
|
|
3045
3218
|
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#accessors
|
|
3219
|
+
*
|
|
3220
|
+
* @private
|
|
3046
3221
|
* @param {number} accessorIndex
|
|
3047
3222
|
* @return {Promise<BufferAttribute|InterleavedBufferAttribute>}
|
|
3048
3223
|
*/
|
|
@@ -3182,6 +3357,8 @@ class GLTFParser {
|
|
|
3182
3357
|
|
|
3183
3358
|
/**
|
|
3184
3359
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#textures
|
|
3360
|
+
*
|
|
3361
|
+
* @private
|
|
3185
3362
|
* @param {number} textureIndex
|
|
3186
3363
|
* @return {Promise<THREE.Texture|null>}
|
|
3187
3364
|
*/
|
|
@@ -3352,10 +3529,11 @@ class GLTFParser {
|
|
|
3352
3529
|
/**
|
|
3353
3530
|
* Asynchronously assigns a texture to the given material parameters.
|
|
3354
3531
|
*
|
|
3532
|
+
* @private
|
|
3355
3533
|
* @param {Object} materialParams
|
|
3356
3534
|
* @param {string} mapName
|
|
3357
3535
|
* @param {Object} mapDef
|
|
3358
|
-
* @param {string} colorSpace
|
|
3536
|
+
* @param {string} [colorSpace]
|
|
3359
3537
|
* @return {Promise<Texture>}
|
|
3360
3538
|
*/
|
|
3361
3539
|
assignTexture( materialParams, mapName, mapDef, colorSpace ) {
|
|
@@ -3407,7 +3585,9 @@ class GLTFParser {
|
|
|
3407
3585
|
* but reuse of the same glTF material may require multiple threejs materials
|
|
3408
3586
|
* to accommodate different primitive types, defines, etc. New materials will
|
|
3409
3587
|
* be created if necessary, and reused from a cache.
|
|
3410
|
-
*
|
|
3588
|
+
*
|
|
3589
|
+
* @private
|
|
3590
|
+
* @param {Object3D} mesh Mesh, Line, or Points instance.
|
|
3411
3591
|
*/
|
|
3412
3592
|
assignFinalMaterial( mesh ) {
|
|
3413
3593
|
|
|
@@ -3507,6 +3687,8 @@ class GLTFParser {
|
|
|
3507
3687
|
|
|
3508
3688
|
/**
|
|
3509
3689
|
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials
|
|
3690
|
+
*
|
|
3691
|
+
* @private
|
|
3510
3692
|
* @param {number} materialIndex
|
|
3511
3693
|
* @return {Promise<Material>}
|
|
3512
3694
|
*/
|
|
@@ -3667,6 +3849,7 @@ class GLTFParser {
|
|
|
3667
3849
|
/**
|
|
3668
3850
|
* When Object3D instances are targeted by animation, they need unique names.
|
|
3669
3851
|
*
|
|
3852
|
+
* @private
|
|
3670
3853
|
* @param {string} originalName
|
|
3671
3854
|
* @return {string}
|
|
3672
3855
|
*/
|
|
@@ -3693,6 +3876,7 @@ class GLTFParser {
|
|
|
3693
3876
|
*
|
|
3694
3877
|
* Creates BufferGeometries from primitives.
|
|
3695
3878
|
*
|
|
3879
|
+
* @private
|
|
3696
3880
|
* @param {Array<GLTF.Primitive>} primitives
|
|
3697
3881
|
* @return {Promise<Array<BufferGeometry>>}
|
|
3698
3882
|
*/
|
|
@@ -3760,8 +3944,10 @@ class GLTFParser {
|
|
|
3760
3944
|
|
|
3761
3945
|
/**
|
|
3762
3946
|
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#meshes
|
|
3947
|
+
*
|
|
3948
|
+
* @private
|
|
3763
3949
|
* @param {number} meshIndex
|
|
3764
|
-
* @return {Promise<Group|Mesh|SkinnedMesh>}
|
|
3950
|
+
* @return {Promise<Group|Mesh|SkinnedMesh|Line|Points>}
|
|
3765
3951
|
*/
|
|
3766
3952
|
loadMesh( meshIndex ) {
|
|
3767
3953
|
|
|
@@ -3908,6 +4094,8 @@ class GLTFParser {
|
|
|
3908
4094
|
|
|
3909
4095
|
/**
|
|
3910
4096
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#cameras
|
|
4097
|
+
*
|
|
4098
|
+
* @private
|
|
3911
4099
|
* @param {number} cameraIndex
|
|
3912
4100
|
* @return {Promise<THREE.Camera>}
|
|
3913
4101
|
*/
|
|
@@ -3944,6 +4132,8 @@ class GLTFParser {
|
|
|
3944
4132
|
|
|
3945
4133
|
/**
|
|
3946
4134
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
|
|
4135
|
+
*
|
|
4136
|
+
* @private
|
|
3947
4137
|
* @param {number} skinIndex
|
|
3948
4138
|
* @return {Promise<Skeleton>}
|
|
3949
4139
|
*/
|
|
@@ -4014,6 +4204,8 @@ class GLTFParser {
|
|
|
4014
4204
|
|
|
4015
4205
|
/**
|
|
4016
4206
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#animations
|
|
4207
|
+
*
|
|
4208
|
+
* @private
|
|
4017
4209
|
* @param {number} animationIndex
|
|
4018
4210
|
* @return {Promise<AnimationClip>}
|
|
4019
4211
|
*/
|
|
@@ -4141,6 +4333,8 @@ class GLTFParser {
|
|
|
4141
4333
|
|
|
4142
4334
|
/**
|
|
4143
4335
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#nodes-and-hierarchy
|
|
4336
|
+
*
|
|
4337
|
+
* @private
|
|
4144
4338
|
* @param {number} nodeIndex
|
|
4145
4339
|
* @return {Promise<Object3D>}
|
|
4146
4340
|
*/
|
|
@@ -4348,6 +4542,8 @@ class GLTFParser {
|
|
|
4348
4542
|
|
|
4349
4543
|
/**
|
|
4350
4544
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#scenes
|
|
4545
|
+
*
|
|
4546
|
+
* @private
|
|
4351
4547
|
* @param {number} sceneIndex
|
|
4352
4548
|
* @return {Promise<Group>}
|
|
4353
4549
|
*/
|
|
@@ -4463,7 +4659,7 @@ class GLTFParser {
|
|
|
4463
4659
|
TypedKeyframeTrack = QuaternionKeyframeTrack;
|
|
4464
4660
|
break;
|
|
4465
4661
|
|
|
4466
|
-
case PATH_PROPERTIES.
|
|
4662
|
+
case PATH_PROPERTIES.translation:
|
|
4467
4663
|
case PATH_PROPERTIES.scale:
|
|
4468
4664
|
|
|
4469
4665
|
TypedKeyframeTrack = VectorKeyframeTrack;
|
|
@@ -4562,6 +4758,8 @@ class GLTFParser {
|
|
|
4562
4758
|
}
|
|
4563
4759
|
|
|
4564
4760
|
/**
|
|
4761
|
+
*
|
|
4762
|
+
* @private
|
|
4565
4763
|
* @param {BufferGeometry} geometry
|
|
4566
4764
|
* @param {GLTF.Primitive} primitiveDef
|
|
4567
4765
|
* @param {GLTFParser} parser
|
|
@@ -4677,6 +4875,8 @@ function computeBounds( geometry, primitiveDef, parser ) {
|
|
|
4677
4875
|
}
|
|
4678
4876
|
|
|
4679
4877
|
/**
|
|
4878
|
+
*
|
|
4879
|
+
* @private
|
|
4680
4880
|
* @param {BufferGeometry} geometry
|
|
4681
4881
|
* @param {GLTF.Primitive} primitiveDef
|
|
4682
4882
|
* @param {GLTFParser} parser
|
|
@@ -4742,4 +4942,17 @@ function addPrimitiveAttributes( geometry, primitiveDef, parser ) {
|
|
|
4742
4942
|
|
|
4743
4943
|
}
|
|
4744
4944
|
|
|
4945
|
+
/**
|
|
4946
|
+
* Loader result of `GLTFLoader`.
|
|
4947
|
+
*
|
|
4948
|
+
* @typedef {Object} GLTFLoader~LoadObject
|
|
4949
|
+
* @property {Array<AnimationClip>} animations - An array of animation clips.
|
|
4950
|
+
* @property {Object} asset - Meta data about the loaded asset.
|
|
4951
|
+
* @property {Array<Camera>} cameras - An array of cameras.
|
|
4952
|
+
* @property {GLTFParser} parser - A reference to the internal parser.
|
|
4953
|
+
* @property {Group} scene - The default scene.
|
|
4954
|
+
* @property {Array<Group>} scenes - glTF assets might define multiple scenes.
|
|
4955
|
+
* @property {Object} userData - Additional data.
|
|
4956
|
+
**/
|
|
4957
|
+
|
|
4745
4958
|
export { GLTFLoader };
|
|
@@ -10,17 +10,59 @@ import {
|
|
|
10
10
|
} from 'three';
|
|
11
11
|
import { RGBELoader } from '../loaders/RGBELoader.js';
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* A loader for loading HDR cube textures.
|
|
15
|
+
*
|
|
16
|
+
* ```js
|
|
17
|
+
* const loader = new HDRCubeTextureLoader();
|
|
18
|
+
* loader.setPath( 'textures/cube/pisaHDR/' );
|
|
19
|
+
* const cubeTexture = await loader.loadAsync( [ 'px.hdr', 'nx.hdr', 'py.hdr', 'ny.hdr', 'pz.hdr', 'nz.hdr' ] );
|
|
20
|
+
*
|
|
21
|
+
* scene.background = cubeTexture;
|
|
22
|
+
* scene.environment = cubeTexture;
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @augments Loader
|
|
26
|
+
*/
|
|
13
27
|
class HDRCubeTextureLoader extends Loader {
|
|
14
28
|
|
|
29
|
+
/**
|
|
30
|
+
* Constructs a new HDR cube texture loader.
|
|
31
|
+
*
|
|
32
|
+
* @param {LoadingManager} [manager] - The loading manager.
|
|
33
|
+
*/
|
|
15
34
|
constructor( manager ) {
|
|
16
35
|
|
|
17
36
|
super( manager );
|
|
18
37
|
|
|
38
|
+
/**
|
|
39
|
+
* The internal HDR loader that loads the
|
|
40
|
+
* individual textures for each cube face.
|
|
41
|
+
*
|
|
42
|
+
* @type {RGBELoader}
|
|
43
|
+
*/
|
|
19
44
|
this.hdrLoader = new RGBELoader();
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The texture type.
|
|
48
|
+
*
|
|
49
|
+
* @type {(HalfFloatType|FloatType)}
|
|
50
|
+
* @default HalfFloatType
|
|
51
|
+
*/
|
|
20
52
|
this.type = HalfFloatType;
|
|
21
53
|
|
|
22
54
|
}
|
|
23
55
|
|
|
56
|
+
/**
|
|
57
|
+
* Starts loading from the given URLs and passes the loaded HDR cube texture
|
|
58
|
+
* to the `onLoad()` callback.
|
|
59
|
+
*
|
|
60
|
+
* @param {Array<string>} urls - The paths/URLs of the files to be loaded. This can also be a data URIs.
|
|
61
|
+
* @param {function(CubeTexture)} onLoad - Executed when the loading process has been finished.
|
|
62
|
+
* @param {onProgressCallback} onProgress - Executed while the loading is in progress.
|
|
63
|
+
* @param {onErrorCallback} onError - Executed when errors occur.
|
|
64
|
+
* @return {CubeTexture} The HDR cube texture.
|
|
65
|
+
*/
|
|
24
66
|
load( urls, onLoad, onProgress, onError ) {
|
|
25
67
|
|
|
26
68
|
const texture = new CubeTexture();
|
|
@@ -101,6 +143,12 @@ class HDRCubeTextureLoader extends Loader {
|
|
|
101
143
|
|
|
102
144
|
}
|
|
103
145
|
|
|
146
|
+
/**
|
|
147
|
+
* Sets the texture type.
|
|
148
|
+
*
|
|
149
|
+
* @param {(HalfFloatType|FloatType)} value - The texture type to set.
|
|
150
|
+
* @return {RGBELoader} A reference to this loader.
|
|
151
|
+
*/
|
|
104
152
|
setDataType( value ) {
|
|
105
153
|
|
|
106
154
|
this.type = value;
|