@needle-tools/three 0.169.20-experimental.0 → 0.183.2-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +5 -6
- package/build/three.cjs +54184 -56703
- package/build/three.core.js +59506 -0
- package/build/three.core.min.js +6 -0
- package/build/three.module.js +11645 -73000
- package/build/three.module.min.js +2 -2
- package/build/three.tsl.js +648 -0
- package/build/three.tsl.min.js +6 -0
- package/build/three.webgpu.js +53912 -51652
- package/build/three.webgpu.min.js +2 -2
- package/build/three.webgpu.nodes.js +53888 -51806
- package/build/three.webgpu.nodes.min.js +2 -2
- package/examples/fonts/MPLUSRounded1c/MPLUSRounded1c-Regular.typeface.json.zip +0 -0
- package/examples/fonts/MPLUSRounded1c/OFL.txt +91 -0
- package/examples/jsm/Addons.js +5 -15
- package/examples/jsm/animation/AnimationClipCreator.js +58 -6
- package/examples/jsm/animation/CCDIKSolver.js +152 -45
- package/examples/jsm/capabilities/WebGL.js +28 -29
- package/examples/jsm/capabilities/WebGPU.js +19 -17
- package/examples/jsm/controls/ArcballControls.js +474 -178
- package/examples/jsm/controls/DragControls.js +100 -58
- package/examples/jsm/controls/FirstPersonControls.js +116 -6
- package/examples/jsm/controls/FlyControls.js +50 -2
- package/examples/jsm/controls/MapControls.js +96 -8
- package/examples/jsm/controls/OrbitControls.js +496 -57
- package/examples/jsm/controls/PointerLockControls.js +115 -22
- package/examples/jsm/controls/TrackballControls.js +166 -14
- package/examples/jsm/controls/TransformControls.js +336 -26
- package/examples/jsm/csm/CSM.js +232 -18
- package/examples/jsm/csm/CSMFrustum.js +61 -4
- package/examples/jsm/csm/CSMHelper.js +50 -0
- package/examples/jsm/csm/CSMShader.js +13 -1
- package/examples/jsm/csm/CSMShadowNode.js +599 -0
- package/examples/jsm/curves/CurveExtras.js +303 -31
- package/examples/jsm/curves/NURBSCurve.js +91 -16
- package/examples/jsm/curves/NURBSSurface.js +52 -6
- package/examples/jsm/curves/NURBSUtils.js +102 -112
- package/examples/jsm/curves/NURBSVolume.js +24 -4
- package/examples/jsm/effects/AnaglyphEffect.js +134 -7
- package/examples/jsm/effects/AsciiEffect.js +69 -22
- package/examples/jsm/effects/OutlineEffect.js +61 -111
- package/examples/jsm/effects/ParallaxBarrierEffect.js +30 -0
- package/examples/jsm/effects/StereoEffect.js +31 -0
- package/examples/jsm/environments/ColorEnvironment.js +59 -0
- package/examples/jsm/environments/DebugEnvironment.js +50 -0
- package/examples/jsm/environments/RoomEnvironment.js +83 -42
- package/examples/jsm/exporters/DRACOExporter.js +56 -14
- package/examples/jsm/exporters/EXRExporter.js +40 -9
- package/examples/jsm/exporters/GLTFExporter.js +502 -169
- package/examples/jsm/exporters/OBJExporter.js +21 -1
- package/examples/jsm/exporters/PLYExporter.js +44 -12
- package/examples/jsm/exporters/STLExporter.js +27 -5
- package/examples/jsm/exporters/USDZExporter.js +781 -291
- package/examples/jsm/geometries/BoxLineGeometry.js +23 -0
- package/examples/jsm/geometries/ConvexGeometry.js +19 -0
- package/examples/jsm/geometries/DecalGeometry.js +91 -30
- package/examples/jsm/geometries/ParametricFunctions.js +100 -0
- package/examples/jsm/geometries/ParametricGeometry.js +38 -5
- package/examples/jsm/geometries/RoundedBoxGeometry.js +68 -7
- package/examples/jsm/geometries/TeapotGeometry.js +23 -38
- package/examples/jsm/geometries/TextGeometry.js +48 -29
- package/examples/jsm/gpgpu/BitonicSort.js +715 -0
- package/examples/jsm/helpers/AnimationPathHelper.js +302 -0
- package/examples/jsm/helpers/LightProbeHelper.js +36 -0
- package/examples/jsm/helpers/LightProbeHelperGPU.js +38 -1
- package/examples/jsm/helpers/OctreeHelper.js +36 -0
- package/examples/jsm/helpers/PositionalAudioHelper.js +60 -0
- package/examples/jsm/helpers/RapierHelper.js +59 -0
- package/examples/jsm/helpers/RectAreaLightHelper.js +36 -3
- package/examples/jsm/helpers/TextureHelper.js +28 -0
- package/examples/jsm/helpers/TextureHelperGPU.js +214 -0
- package/examples/jsm/helpers/VertexNormalsHelper.js +61 -2
- package/examples/jsm/helpers/VertexTangentsHelper.js +47 -2
- package/examples/jsm/helpers/ViewHelper.js +181 -9
- package/examples/jsm/inspector/Inspector.js +487 -0
- package/examples/jsm/inspector/RendererInspector.js +425 -0
- package/examples/jsm/inspector/tabs/Console.js +238 -0
- package/examples/jsm/inspector/tabs/Parameters.js +348 -0
- package/examples/jsm/inspector/tabs/Performance.js +268 -0
- package/examples/jsm/inspector/tabs/Viewer.js +166 -0
- package/examples/jsm/inspector/ui/Graph.js +95 -0
- package/examples/jsm/inspector/ui/Item.js +170 -0
- package/examples/jsm/inspector/ui/List.js +75 -0
- package/examples/jsm/inspector/ui/Profiler.js +1975 -0
- package/examples/jsm/inspector/ui/Style.js +1613 -0
- package/examples/jsm/inspector/ui/Tab.js +233 -0
- package/examples/jsm/inspector/ui/Values.js +439 -0
- package/examples/jsm/inspector/ui/utils.js +56 -0
- package/examples/jsm/interactive/HTMLMesh.js +43 -12
- package/examples/jsm/interactive/InteractiveGroup.js +170 -52
- package/examples/jsm/interactive/SelectionBox.js +106 -9
- package/examples/jsm/interactive/SelectionHelper.js +76 -30
- package/examples/jsm/libs/demuxer_mp4.js +109 -0
- package/examples/jsm/libs/meshopt_decoder.module.js +76 -58
- package/examples/jsm/libs/motion-controllers.module.js +1 -1
- package/examples/jsm/lighting/TiledLighting.js +42 -0
- package/examples/jsm/lights/LightProbeGenerator.js +44 -7
- package/examples/jsm/lights/RectAreaLightTexturesLib.js +50 -14
- package/examples/jsm/lights/RectAreaLightUniformsLib.js +16 -0
- package/examples/jsm/lines/Line2.js +41 -4
- package/examples/jsm/lines/LineGeometry.js +80 -2
- package/examples/jsm/lines/LineMaterial.js +105 -5
- package/examples/jsm/lines/LineSegments2.js +54 -4
- package/examples/jsm/lines/LineSegmentsGeometry.js +65 -8
- package/examples/jsm/lines/Wireframe.js +41 -4
- package/examples/jsm/lines/WireframeGeometry2.js +27 -2
- package/examples/jsm/lines/webgpu/Line2.js +28 -2
- package/examples/jsm/lines/webgpu/LineSegments2.js +59 -24
- package/examples/jsm/lines/webgpu/Wireframe.js +86 -0
- package/examples/jsm/loaders/3DMLoader.js +78 -6
- package/examples/jsm/loaders/3MFLoader.js +148 -7
- package/examples/jsm/loaders/AMFLoader.js +34 -14
- package/examples/jsm/loaders/BVHLoader.js +59 -12
- package/examples/jsm/loaders/ColladaLoader.js +61 -4027
- package/examples/jsm/loaders/DDSLoader.js +68 -1
- package/examples/jsm/loaders/DRACOLoader.js +146 -22
- package/examples/jsm/loaders/EXRLoader.js +255 -34
- package/examples/jsm/loaders/FBXLoader.js +80 -42
- package/examples/jsm/loaders/FontLoader.js +83 -6
- package/examples/jsm/loaders/GCodeLoader.js +71 -14
- package/examples/jsm/loaders/GLTFLoader.js +381 -263
- package/examples/jsm/loaders/HDRCubeTextureLoader.js +52 -3
- package/examples/jsm/loaders/HDRLoader.js +485 -0
- package/examples/jsm/loaders/IESLoader.js +42 -0
- package/examples/jsm/loaders/KMZLoader.js +39 -6
- package/examples/jsm/loaders/KTX2Loader.js +124 -48
- package/examples/jsm/loaders/KTXLoader.js +31 -10
- package/examples/jsm/loaders/LDrawLoader.js +192 -145
- package/examples/jsm/loaders/LUT3dlLoader.js +47 -10
- package/examples/jsm/loaders/LUTCubeLoader.js +46 -9
- package/examples/jsm/loaders/LUTImageLoader.js +79 -38
- package/examples/jsm/loaders/LWOLoader.js +54 -59
- package/examples/jsm/loaders/LottieLoader.js +54 -1
- package/examples/jsm/loaders/MD2Loader.js +37 -1
- package/examples/jsm/loaders/MDDLoader.js +57 -12
- package/examples/jsm/loaders/MTLLoader.js +60 -35
- package/examples/jsm/loaders/MaterialXLoader.js +268 -34
- package/examples/jsm/loaders/NRRDLoader.js +40 -8
- package/examples/jsm/loaders/OBJLoader.js +51 -2
- package/examples/jsm/loaders/PCDLoader.js +173 -21
- package/examples/jsm/loaders/PDBLoader.js +41 -2
- package/examples/jsm/loaders/PLYLoader.js +70 -39
- package/examples/jsm/loaders/PVRLoader.js +25 -6
- package/examples/jsm/loaders/RGBELoader.js +6 -438
- package/examples/jsm/loaders/STLLoader.js +48 -38
- package/examples/jsm/loaders/SVGLoader.js +119 -25
- package/examples/jsm/loaders/TDSLoader.js +92 -74
- package/examples/jsm/loaders/TGALoader.js +23 -2
- package/examples/jsm/loaders/TIFFLoader.js +23 -0
- package/examples/jsm/loaders/TTFLoader.js +50 -3
- package/examples/jsm/loaders/USDLoader.js +279 -0
- package/examples/jsm/loaders/USDZLoader.js +4 -858
- package/examples/jsm/loaders/UltraHDRLoader.js +338 -166
- package/examples/jsm/loaders/VOXLoader.js +688 -87
- package/examples/jsm/loaders/VRMLLoader.js +121 -12
- package/examples/jsm/loaders/VTKLoader.js +77 -25
- package/examples/jsm/loaders/XYZLoader.js +36 -0
- package/examples/jsm/loaders/collada/ColladaComposer.js +2950 -0
- package/examples/jsm/loaders/collada/ColladaParser.js +1962 -0
- package/examples/jsm/loaders/lwo/IFFParser.js +77 -77
- package/examples/jsm/loaders/usd/USDAParser.js +822 -0
- package/examples/jsm/loaders/usd/USDCParser.js +1852 -0
- package/examples/jsm/loaders/usd/USDComposer.js +4041 -0
- package/examples/jsm/materials/LDrawConditionalLineMaterial.js +183 -0
- package/examples/jsm/materials/LDrawConditionalLineNodeMaterial.js +154 -0
- package/examples/jsm/materials/WoodNodeMaterial.js +533 -0
- package/examples/jsm/math/Capsule.js +91 -14
- package/examples/jsm/math/ColorConverter.js +22 -0
- package/examples/jsm/math/ColorSpaces.js +74 -2
- package/examples/jsm/math/ConvexHull.js +517 -93
- package/examples/jsm/math/ImprovedNoise.js +32 -15
- package/examples/jsm/math/Lut.js +113 -0
- package/examples/jsm/math/MeshSurfaceSampler.js +78 -13
- package/examples/jsm/math/OBB.js +141 -29
- package/examples/jsm/math/Octree.js +283 -7
- package/examples/jsm/math/SimplexNoise.js +68 -42
- package/examples/jsm/misc/ConvexObjectBreaker.js +45 -25
- package/examples/jsm/misc/GPUComputationRenderer.js +96 -20
- package/examples/jsm/misc/Gyroscope.js +12 -0
- package/examples/jsm/misc/MD2Character.js +117 -2
- package/examples/jsm/misc/MD2CharacterComplex.js +175 -11
- package/examples/jsm/misc/MorphAnimMesh.js +44 -0
- package/examples/jsm/misc/MorphBlendMesh.js +103 -0
- package/examples/jsm/misc/ProgressiveLightMap.js +100 -54
- package/examples/jsm/misc/ProgressiveLightMapGPU.js +322 -0
- package/examples/jsm/misc/RollerCoaster.js +57 -0
- package/examples/jsm/misc/TubePainter.js +437 -40
- package/examples/jsm/misc/Volume.js +123 -76
- package/examples/jsm/misc/VolumeSlice.js +95 -49
- package/examples/jsm/modifiers/CurveModifier.js +66 -38
- package/examples/jsm/modifiers/CurveModifierGPU.js +42 -19
- package/examples/jsm/modifiers/EdgeSplitModifier.js +20 -0
- package/examples/jsm/modifiers/SimplifyModifier.js +24 -10
- package/examples/jsm/modifiers/TessellateModifier.js +35 -2
- package/examples/jsm/objects/GroundedSkybox.js +25 -6
- package/examples/jsm/objects/Lensflare.js +94 -2
- package/examples/jsm/objects/LensflareMesh.js +64 -10
- package/examples/jsm/objects/MarchingCubes.js +90 -5
- package/examples/jsm/objects/Reflector.js +76 -2
- package/examples/jsm/objects/ReflectorForSSRPass.js +41 -0
- package/examples/jsm/objects/Refractor.js +62 -0
- package/examples/jsm/objects/ShadowMesh.js +54 -4
- package/examples/jsm/objects/Sky.js +106 -16
- package/examples/jsm/objects/SkyMesh.js +211 -38
- package/examples/jsm/objects/Water.js +49 -8
- package/examples/jsm/objects/Water2.js +49 -7
- package/examples/jsm/objects/Water2Mesh.js +50 -9
- package/examples/jsm/objects/WaterMesh.js +136 -43
- package/examples/jsm/physics/AmmoPhysics.js +60 -7
- package/examples/jsm/physics/JoltPhysics.js +65 -12
- package/examples/jsm/physics/RapierPhysics.js +217 -21
- package/examples/jsm/postprocessing/AfterimagePass.js +110 -29
- package/examples/jsm/postprocessing/BloomPass.js +128 -26
- package/examples/jsm/postprocessing/BokehPass.js +99 -22
- package/examples/jsm/postprocessing/ClearPass.js +54 -3
- package/examples/jsm/postprocessing/CubeTexturePass.js +82 -21
- package/examples/jsm/postprocessing/DotScreenPass.js +59 -10
- package/examples/jsm/postprocessing/EffectComposer.js +140 -6
- package/examples/jsm/postprocessing/FXAAPass.js +40 -0
- package/examples/jsm/postprocessing/FilmPass.js +54 -5
- package/examples/jsm/postprocessing/GTAOPass.js +202 -57
- package/examples/jsm/postprocessing/GlitchPass.js +86 -34
- package/examples/jsm/postprocessing/HalftonePass.js +65 -10
- package/examples/jsm/postprocessing/LUTPass.js +38 -8
- package/examples/jsm/postprocessing/MaskPass.js +91 -0
- package/examples/jsm/postprocessing/OutlinePass.js +272 -135
- package/examples/jsm/postprocessing/OutputPass.js +65 -14
- package/examples/jsm/postprocessing/Pass.js +100 -4
- package/examples/jsm/postprocessing/RenderPass.js +94 -0
- package/examples/jsm/postprocessing/RenderPixelatedPass.js +124 -45
- package/examples/jsm/postprocessing/RenderTransitionPass.js +120 -21
- package/examples/jsm/postprocessing/SAOPass.js +128 -55
- package/examples/jsm/postprocessing/SMAAPass.js +106 -75
- package/examples/jsm/postprocessing/SSAARenderPass.js +118 -35
- package/examples/jsm/postprocessing/SSAOPass.js +173 -60
- package/examples/jsm/postprocessing/SSRPass.js +268 -53
- package/examples/jsm/postprocessing/SavePass.js +69 -16
- package/examples/jsm/postprocessing/ShaderPass.js +65 -7
- package/examples/jsm/postprocessing/TAARenderPass.js +79 -24
- package/examples/jsm/postprocessing/TexturePass.js +72 -8
- package/examples/jsm/postprocessing/UnrealBloomPass.js +168 -59
- package/examples/jsm/renderers/CSS2DRenderer.js +98 -5
- package/examples/jsm/renderers/CSS3DRenderer.js +111 -7
- package/examples/jsm/renderers/Projector.js +288 -32
- package/examples/jsm/renderers/SVGRenderer.js +323 -61
- package/examples/jsm/renderers/webgl-legacy/nodes/GLSL1NodeBuilder.js +3 -1
- package/examples/jsm/renderers/webgl-legacy/nodes/SlotNode.js +1 -1
- package/examples/jsm/renderers/webgl-legacy/nodes/WebGLNodeBuilder.js +5 -1
- package/examples/jsm/shaders/ACESFilmicToneMappingShader.js +12 -5
- package/examples/jsm/shaders/AfterimageShader.js +8 -3
- package/examples/jsm/shaders/BasicShader.js +8 -1
- package/examples/jsm/shaders/BleachBypassShader.js +10 -3
- package/examples/jsm/shaders/BlendShader.js +8 -1
- package/examples/jsm/shaders/BokehShader.js +9 -3
- package/examples/jsm/shaders/BokehShader2.js +11 -4
- package/examples/jsm/shaders/BrightnessContrastShader.js +10 -4
- package/examples/jsm/shaders/ColorCorrectionShader.js +8 -1
- package/examples/jsm/shaders/ColorifyShader.js +8 -1
- package/examples/jsm/shaders/ConvolutionShader.js +9 -38
- package/examples/jsm/shaders/CopyShader.js +8 -1
- package/examples/jsm/shaders/DOFMipMapShader.js +10 -3
- package/examples/jsm/shaders/DepthLimitedBlurShader.js +10 -1
- package/examples/jsm/shaders/DigitalGlitch.js +10 -7
- package/examples/jsm/shaders/DotScreenShader.js +8 -3
- package/examples/jsm/shaders/ExposureShader.js +8 -1
- package/examples/jsm/shaders/FXAAShader.js +233 -221
- package/examples/jsm/shaders/FilmShader.js +13 -0
- package/examples/jsm/shaders/FocusShader.js +8 -3
- package/examples/jsm/shaders/FreiChenShader.js +10 -3
- package/examples/jsm/shaders/GTAOShader.js +55 -45
- package/examples/jsm/shaders/GammaCorrectionShader.js +11 -2
- package/examples/jsm/shaders/HalftoneShader.js +24 -4
- package/examples/jsm/shaders/HorizontalBlurShader.js +12 -3
- package/examples/jsm/shaders/HorizontalTiltShiftShader.js +9 -2
- package/examples/jsm/shaders/HueSaturationShader.js +10 -3
- package/examples/jsm/shaders/KaleidoShader.js +11 -4
- package/examples/jsm/shaders/LuminosityHighPassShader.js +8 -4
- package/examples/jsm/shaders/LuminosityShader.js +8 -2
- package/examples/jsm/shaders/MirrorShader.js +10 -4
- package/examples/jsm/shaders/NormalMapShader.js +7 -2
- package/examples/jsm/shaders/OutputShader.js +19 -1
- package/examples/jsm/shaders/PoissonDenoiseShader.js +30 -17
- package/examples/jsm/shaders/RGBShiftShader.js +8 -1
- package/examples/jsm/shaders/SAOShader.js +27 -5
- package/examples/jsm/shaders/SMAAShader.js +24 -1
- package/examples/jsm/shaders/SSAOShader.js +37 -6
- package/examples/jsm/shaders/SSRShader.js +32 -6
- package/examples/jsm/shaders/SepiaShader.js +8 -3
- package/examples/jsm/shaders/SobelOperatorShader.js +9 -3
- package/examples/jsm/shaders/SubsurfaceScatteringShader.js +13 -8
- package/examples/jsm/shaders/TechnicolorShader.js +10 -4
- package/examples/jsm/shaders/ToonShader.js +29 -6
- package/examples/jsm/shaders/TriangleBlurShader.js +9 -4
- package/examples/jsm/shaders/UnpackDepthRGBAShader.js +19 -6
- package/examples/jsm/shaders/VelocityShader.js +8 -1
- package/examples/jsm/shaders/VerticalBlurShader.js +9 -2
- package/examples/jsm/shaders/VerticalTiltShiftShader.js +8 -1
- package/examples/jsm/shaders/VignetteShader.js +8 -3
- package/examples/jsm/shaders/VolumeShader.js +11 -2
- package/examples/jsm/shaders/WaterRefractionShader.js +11 -0
- package/examples/jsm/textures/FlakesTexture.js +14 -0
- package/examples/jsm/transpiler/AST.js +436 -31
- package/examples/jsm/transpiler/GLSLDecoder.js +380 -135
- package/examples/jsm/transpiler/Linker.js +327 -0
- package/examples/jsm/transpiler/ShaderToyDecoder.js +3 -1
- package/examples/jsm/transpiler/TSLEncoder.js +363 -97
- package/examples/jsm/transpiler/Transpiler.js +50 -1
- package/examples/jsm/transpiler/TranspilerUtils.js +29 -0
- package/examples/jsm/transpiler/WGSLEncoder.js +839 -0
- package/examples/jsm/tsl/display/AfterImageNode.js +244 -0
- package/examples/jsm/tsl/display/AnaglyphPassNode.js +549 -0
- package/examples/jsm/tsl/display/AnamorphicNode.js +282 -0
- package/examples/jsm/tsl/display/BilateralBlurNode.js +364 -0
- package/{src/nodes → examples/jsm/tsl}/display/BleachBypass.js +11 -4
- package/examples/jsm/tsl/display/BloomNode.js +534 -0
- package/examples/jsm/tsl/display/CRT.js +150 -0
- package/examples/jsm/tsl/display/ChromaticAberrationNode.js +207 -0
- package/examples/jsm/tsl/display/DenoiseNode.js +334 -0
- package/examples/jsm/tsl/display/DepthOfFieldNode.js +554 -0
- package/examples/jsm/tsl/display/DotScreenNode.js +104 -0
- package/examples/jsm/tsl/display/FXAANode.js +365 -0
- package/examples/jsm/tsl/display/FilmNode.js +101 -0
- package/examples/jsm/tsl/display/GTAONode.js +571 -0
- package/examples/jsm/tsl/display/GaussianBlurNode.js +389 -0
- package/examples/jsm/tsl/display/GodraysNode.js +624 -0
- package/examples/jsm/tsl/display/LensflareNode.js +279 -0
- package/examples/jsm/tsl/display/Lut3DNode.js +109 -0
- package/examples/jsm/tsl/display/MotionBlur.js +33 -0
- package/examples/jsm/tsl/display/OutlineNode.js +762 -0
- package/examples/jsm/tsl/display/ParallaxBarrierPassNode.js +89 -0
- package/examples/jsm/tsl/display/PixelationPassNode.js +335 -0
- package/examples/jsm/tsl/display/RGBShiftNode.js +96 -0
- package/examples/jsm/tsl/display/RetroPassNode.js +263 -0
- package/examples/jsm/tsl/display/SMAANode.js +768 -0
- package/{src/nodes → examples/jsm/tsl}/display/SSAAPassNode.js +120 -49
- package/examples/jsm/tsl/display/SSGINode.js +642 -0
- package/examples/jsm/tsl/display/SSRNode.js +656 -0
- package/examples/jsm/tsl/display/SSSNode.js +490 -0
- package/{src/nodes → examples/jsm/tsl}/display/Sepia.js +9 -2
- package/examples/jsm/tsl/display/Shape.js +29 -0
- package/{src/nodes → examples/jsm/tsl}/display/SobelOperatorNode.js +61 -19
- package/examples/jsm/tsl/display/StereoCompositePassNode.js +192 -0
- package/{src/nodes → examples/jsm/tsl}/display/StereoPassNode.js +48 -12
- package/examples/jsm/tsl/display/TRAANode.js +726 -0
- package/examples/jsm/tsl/display/TransitionNode.js +141 -0
- package/examples/jsm/tsl/display/boxBlur.js +65 -0
- package/examples/jsm/tsl/display/depthAwareBlend.js +80 -0
- package/examples/jsm/tsl/display/hashBlur.js +54 -0
- package/examples/jsm/tsl/display/radialBlur.js +68 -0
- package/examples/jsm/tsl/lighting/TiledLightsNode.js +442 -0
- package/examples/jsm/tsl/math/Bayer.js +73 -0
- package/examples/jsm/tsl/shadows/TileShadowNode.js +456 -0
- package/examples/jsm/tsl/shadows/TileShadowNodeHelper.js +212 -0
- package/examples/jsm/tsl/utils/Raymarching.js +70 -0
- package/examples/jsm/utils/BufferGeometryUtils.js +91 -29
- package/examples/jsm/utils/CameraUtils.js +15 -6
- package/examples/jsm/utils/GeometryCompressionUtils.js +23 -30
- package/examples/jsm/utils/GeometryUtils.js +32 -27
- package/examples/jsm/utils/LDrawUtils.js +14 -5
- package/examples/jsm/utils/SceneOptimizer.js +458 -0
- package/examples/jsm/utils/SceneUtils.js +53 -3
- package/examples/jsm/utils/ShadowMapViewer.js +72 -33
- package/examples/jsm/utils/ShadowMapViewerGPU.js +61 -29
- package/examples/jsm/utils/SkeletonUtils.js +48 -0
- package/examples/jsm/utils/SortUtils.js +17 -5
- package/examples/jsm/utils/UVsDebug.js +12 -4
- package/examples/jsm/utils/{TextureUtils.js → WebGLTextureUtils.js} +16 -0
- package/examples/jsm/utils/{TextureUtilsGPU.js → WebGPUTextureUtils.js} +20 -2
- package/examples/jsm/utils/WorkerPool.js +67 -2
- package/examples/jsm/webxr/ARButton.js +19 -0
- package/examples/jsm/webxr/OculusHandModel.js +84 -0
- package/examples/jsm/webxr/OculusHandPointerModel.js +148 -22
- package/examples/jsm/webxr/Text2D.js +20 -6
- package/examples/jsm/webxr/VRButton.js +31 -0
- package/examples/jsm/webxr/XRButton.js +23 -0
- package/examples/jsm/webxr/XRControllerModelFactory.js +94 -3
- package/examples/jsm/webxr/XREstimatedLight.js +35 -4
- package/examples/jsm/webxr/XRHandMeshModel.js +37 -0
- package/examples/jsm/webxr/XRHandModelFactory.js +96 -6
- package/examples/jsm/webxr/XRHandPrimitiveModel.js +44 -0
- package/examples/jsm/webxr/XRPlanes.js +18 -0
- package/package.json +29 -37
- package/src/Three.Core.js +198 -0
- package/src/Three.Legacy.js +0 -21
- package/src/Three.TSL.js +641 -0
- package/src/Three.WebGPU.Nodes.js +14 -186
- package/src/Three.WebGPU.js +16 -186
- package/src/Three.js +2 -197
- package/src/animation/AnimationAction.js +263 -31
- package/src/animation/AnimationClip.js +162 -7
- package/src/animation/AnimationMixer.js +105 -15
- package/src/animation/AnimationObjectGroup.js +45 -21
- package/src/animation/AnimationUtils.js +163 -24
- package/src/animation/KeyframeTrack.js +191 -17
- package/src/animation/PropertyBinding.js +91 -16
- 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/Audio.js +386 -8
- package/src/audio/AudioAnalyser.js +58 -1
- package/src/audio/AudioContext.js +15 -0
- package/src/audio/AudioListener.js +94 -13
- package/src/audio/PositionalAudio.js +107 -0
- package/src/cameras/ArrayCamera.js +37 -0
- package/src/cameras/Camera.js +61 -0
- package/src/cameras/CubeCamera.js +86 -0
- package/src/cameras/OrthographicCamera.js +110 -1
- package/src/cameras/PerspectiveCamera.js +174 -35
- package/src/cameras/StereoCamera.js +48 -2
- package/src/constants.js +1546 -11
- package/src/core/BufferAttribute.js +417 -3
- package/src/core/BufferGeometry.js +407 -22
- package/src/core/Clock.js +69 -8
- package/src/core/EventDispatcher.js +52 -8
- package/src/core/GLBufferAttribute.js +113 -2
- 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 +141 -7
- package/src/core/InterleavedBufferAttribute.js +200 -2
- package/src/core/Layers.js +71 -10
- package/src/core/Object3D.js +673 -26
- package/src/core/Raycaster.js +136 -2
- package/src/core/RenderTarget.js +256 -27
- package/src/core/RenderTarget3D.js +48 -0
- package/src/core/Timer.js +184 -0
- package/src/core/Uniform.js +29 -0
- package/src/core/UniformsGroup.js +84 -2
- package/src/extras/Controls.js +89 -1
- package/src/extras/DataUtils.js +50 -9
- package/src/extras/Earcut.js +18 -779
- package/src/extras/ImageUtils.js +22 -14
- package/src/extras/PMREMGenerator.js +316 -67
- package/src/extras/ShapeUtils.js +24 -2
- package/src/extras/TextureUtils.js +101 -15
- package/src/extras/core/Curve.js +156 -55
- package/src/extras/core/CurvePath.js +63 -22
- package/src/extras/core/Interpolations.js +34 -2
- package/src/extras/core/Path.js +134 -1
- package/src/extras/core/Shape.js +66 -3
- package/src/extras/core/ShapePath.js +80 -4
- package/src/extras/curves/ArcCurve.js +22 -0
- package/src/extras/curves/CatmullRomCurve3.js +89 -18
- package/src/extras/curves/CubicBezierCurve.js +67 -0
- package/src/extras/curves/CubicBezierCurve3.js +50 -0
- package/src/extras/curves/EllipseCurve.js +102 -0
- package/src/extras/curves/LineCurve.js +36 -0
- package/src/extras/curves/LineCurve3.js +36 -0
- package/src/extras/curves/QuadraticBezierCurve.js +59 -0
- package/src/extras/curves/QuadraticBezierCurve3.js +43 -0
- package/src/extras/curves/SplineCurve.js +48 -0
- package/src/extras/lib/earcut.js +685 -0
- package/src/geometries/BoxGeometry.js +39 -0
- package/src/geometries/CapsuleGeometry.js +196 -11
- package/src/geometries/CircleGeometry.js +41 -0
- package/src/geometries/ConeGeometry.js +39 -0
- package/src/geometries/CylinderGeometry.js +42 -2
- package/src/geometries/DodecahedronGeometry.js +33 -0
- package/src/geometries/EdgesGeometry.js +30 -2
- package/src/geometries/ExtrudeGeometry.js +148 -52
- package/src/geometries/IcosahedronGeometry.js +33 -0
- package/src/geometries/LatheGeometry.js +44 -3
- package/src/geometries/OctahedronGeometry.js +33 -0
- package/src/geometries/PlaneGeometry.js +35 -0
- package/src/geometries/PolyhedronGeometry.js +30 -1
- package/src/geometries/RingGeometry.js +37 -0
- package/src/geometries/ShapeGeometry.js +38 -0
- package/src/geometries/SphereGeometry.js +38 -0
- package/src/geometries/TetrahedronGeometry.js +33 -0
- package/src/geometries/TorusGeometry.js +44 -3
- package/src/geometries/TorusKnotGeometry.js +39 -0
- package/src/geometries/TubeGeometry.js +50 -0
- package/src/geometries/WireframeGeometry.js +32 -0
- package/src/helpers/ArrowHelper.js +62 -5
- package/src/helpers/AxesHelper.js +28 -0
- package/src/helpers/Box3Helper.js +28 -0
- package/src/helpers/BoxHelper.js +43 -7
- package/src/helpers/CameraHelper.js +103 -27
- package/src/helpers/DirectionalLightHelper.js +55 -0
- package/src/helpers/GridHelper.js +26 -0
- package/src/helpers/HemisphereLightHelper.js +42 -0
- package/src/helpers/PlaneHelper.js +33 -0
- package/src/helpers/PointLightHelper.js +43 -24
- package/src/helpers/PolarGridHelper.js +30 -0
- package/src/helpers/SkeletonHelper.js +73 -7
- package/src/helpers/SpotLightHelper.js +43 -0
- package/src/lights/AmbientLight.js +25 -0
- package/src/lights/DirectionalLight.js +70 -0
- package/src/lights/DirectionalLightShadow.js +15 -0
- package/src/lights/HemisphereLight.js +42 -0
- package/src/lights/Light.js +37 -11
- package/src/lights/LightProbe.js +37 -9
- package/src/lights/LightShadow.js +202 -7
- package/src/lights/PointLight.js +74 -0
- package/src/lights/PointLightShadow.js +15 -80
- package/src/lights/RectAreaLight.js +59 -0
- package/src/lights/SpotLight.js +124 -1
- package/src/lights/SpotLightShadow.js +33 -3
- package/src/lights/webgpu/IESSpotLight.js +22 -0
- package/src/lights/webgpu/ProjectorLight.js +46 -0
- package/src/loaders/AnimationLoader.js +34 -2
- package/src/loaders/AudioLoader.js +34 -2
- package/src/loaders/BufferGeometryLoader.js +38 -13
- package/src/loaders/Cache.js +75 -2
- package/src/loaders/CompressedTextureLoader.js +36 -3
- package/src/loaders/CubeTextureLoader.js +45 -0
- package/src/loaders/DataTextureLoader.js +45 -4
- package/src/loaders/FileLoader.js +85 -5
- package/src/loaders/ImageBitmapLoader.js +113 -11
- package/src/loaders/ImageLoader.js +85 -8
- package/src/loaders/Loader.js +150 -0
- package/src/loaders/LoaderUtils.js +18 -36
- package/src/loaders/LoadingManager.js +187 -0
- package/src/loaders/MaterialLoader.js +62 -3
- package/src/loaders/ObjectLoader.js +131 -31
- package/src/loaders/TextureLoader.js +33 -0
- package/src/loaders/nodes/NodeLoader.js +68 -4
- package/src/loaders/nodes/NodeMaterialLoader.js +45 -0
- package/src/loaders/nodes/NodeObjectLoader.js +61 -0
- package/src/materials/LineBasicMaterial.js +74 -1
- package/src/materials/LineDashedMaterial.js +52 -1
- package/src/materials/Material.js +502 -8
- package/src/materials/MeshBasicMaterial.js +168 -2
- package/src/materials/MeshDepthMaterial.js +94 -0
- package/src/materials/MeshDistanceMaterial.js +76 -0
- package/src/materials/MeshLambertMaterial.js +283 -0
- package/src/materials/MeshMatcapMaterial.js +164 -0
- package/src/materials/MeshNormalMaterial.js +114 -0
- package/src/materials/MeshPhongMaterial.js +298 -0
- package/src/materials/MeshPhysicalMaterial.js +296 -4
- package/src/materials/MeshStandardMaterial.js +300 -2
- package/src/materials/MeshToonMaterial.js +219 -0
- package/src/materials/PointsMaterial.js +89 -0
- package/src/materials/RawShaderMaterial.js +25 -0
- package/src/materials/ShaderMaterial.js +234 -6
- package/src/materials/ShadowMaterial.js +54 -0
- package/src/materials/SpriteMaterial.js +82 -0
- package/src/materials/nodes/Line2NodeMaterial.js +158 -53
- package/src/materials/nodes/LineBasicNodeMaterial.js +17 -2
- package/src/materials/nodes/LineDashedNodeMaterial.js +81 -6
- package/src/materials/nodes/MeshBasicNodeMaterial.js +59 -2
- package/src/materials/nodes/MeshLambertNodeMaterial.js +35 -0
- package/src/materials/nodes/MeshMatcapNodeMaterial.js +23 -3
- package/src/materials/nodes/MeshNormalNodeMaterial.js +27 -4
- package/src/materials/nodes/MeshPhongNodeMaterial.js +64 -1
- package/src/materials/nodes/MeshPhysicalNodeMaterial.js +276 -3
- package/src/materials/nodes/MeshSSSNodeMaterial.js +98 -10
- package/src/materials/nodes/MeshStandardNodeMaterial.js +83 -4
- package/src/materials/nodes/MeshToonNodeMaterial.js +28 -0
- package/src/materials/nodes/NodeMaterial.js +789 -74
- package/src/materials/nodes/NodeMaterials.js +0 -1
- package/src/materials/nodes/PointsNodeMaterial.js +180 -11
- package/src/materials/nodes/ShadowNodeMaterial.js +38 -0
- package/src/materials/nodes/SpriteNodeMaterial.js +86 -23
- package/src/materials/nodes/VolumeNodeMaterial.js +57 -84
- package/src/materials/nodes/manager/NodeMaterialObserver.js +329 -12
- package/src/math/Box2.js +177 -0
- package/src/math/Box3.js +271 -0
- package/src/math/Color.js +355 -11
- package/src/math/ColorManagement.js +158 -92
- package/src/math/Cylindrical.js +65 -6
- package/src/math/Euler.js +139 -5
- package/src/math/Frustum.js +108 -9
- package/src/math/FrustumArray.js +258 -0
- package/src/math/Interpolant.js +87 -8
- package/src/math/Line3.js +221 -2
- package/src/math/MathUtils.js +408 -20
- package/src/math/Matrix2.js +70 -0
- package/src/math/Matrix3.js +229 -4
- package/src/math/Matrix4.js +489 -94
- package/src/math/Plane.js +164 -2
- package/src/math/Quaternion.js +322 -90
- package/src/math/Ray.js +162 -0
- package/src/math/Sphere.js +175 -0
- package/src/math/Spherical.js +73 -11
- package/src/math/SphericalHarmonics3.js +112 -14
- package/src/math/Triangle.js +206 -2
- package/src/math/Vector2.js +396 -10
- package/src/math/Vector3.js +550 -15
- package/src/math/Vector4.js +415 -9
- package/src/math/interpolants/BezierInterpolant.js +108 -0
- package/src/math/interpolants/CubicInterpolant.js +10 -1
- package/src/math/interpolants/DiscreteInterpolant.js +10 -2
- package/src/math/interpolants/LinearInterpolant.js +13 -0
- package/src/math/interpolants/QuaternionLinearInterpolant.js +10 -1
- package/src/nodes/Nodes.js +91 -88
- package/src/nodes/TSL.js +32 -38
- package/src/nodes/accessors/AccessorsUtils.js +37 -9
- package/src/nodes/accessors/Arrays.js +68 -0
- package/src/nodes/accessors/BatchNode.js +49 -14
- package/src/nodes/accessors/Bitangent.js +82 -13
- package/src/nodes/accessors/BufferAttributeNode.js +269 -8
- package/src/nodes/accessors/BufferNode.js +91 -2
- package/src/nodes/accessors/BuiltinNode.js +63 -0
- package/src/nodes/accessors/Camera.js +400 -10
- package/src/nodes/accessors/ClippingNode.js +149 -45
- package/src/nodes/accessors/CubeTextureNode.js +137 -7
- package/src/nodes/accessors/InstanceNode.js +245 -40
- package/src/nodes/accessors/InstancedMeshNode.js +50 -0
- package/src/nodes/accessors/Lights.js +88 -0
- package/src/nodes/accessors/MaterialNode.js +355 -13
- package/src/nodes/accessors/MaterialProperties.js +57 -1
- package/src/nodes/accessors/MaterialReferenceNode.js +52 -14
- package/src/nodes/accessors/ModelNode.js +117 -5
- package/src/nodes/accessors/ModelViewProjectionNode.js +10 -39
- package/src/nodes/accessors/MorphNode.js +73 -26
- package/src/nodes/accessors/Normal.js +174 -19
- package/src/nodes/accessors/Object3DNode.js +146 -12
- package/src/nodes/accessors/PointUVNode.js +25 -0
- package/src/nodes/accessors/Position.js +119 -7
- package/src/nodes/accessors/ReferenceBaseNode.js +190 -4
- package/src/nodes/accessors/ReferenceNode.js +223 -8
- package/src/nodes/accessors/ReflectVector.js +29 -3
- package/src/nodes/accessors/RendererReferenceNode.js +45 -2
- package/src/nodes/accessors/SceneProperties.js +53 -0
- package/src/nodes/accessors/SkinningNode.js +180 -43
- package/src/nodes/accessors/StorageBufferNode.js +278 -26
- package/src/nodes/accessors/StorageTextureNode.js +205 -12
- package/src/nodes/accessors/Tangent.js +48 -10
- package/src/nodes/accessors/TangentUtils.js +46 -0
- package/src/nodes/accessors/Texture3DNode.js +104 -11
- package/src/nodes/accessors/TextureBicubic.js +31 -4
- package/src/nodes/accessors/TextureNode.js +564 -52
- package/src/nodes/accessors/TextureSizeNode.js +42 -1
- package/src/nodes/accessors/UV.js +9 -1
- package/src/nodes/accessors/UniformArrayNode.js +226 -34
- package/src/nodes/accessors/UserDataNode.js +46 -2
- package/src/nodes/accessors/VelocityNode.js +93 -3
- package/src/nodes/accessors/VertexColorNode.js +39 -4
- package/src/nodes/code/CodeNode.js +101 -8
- package/src/nodes/code/ExpressionNode.js +29 -2
- package/src/nodes/code/FunctionCallNode.js +98 -10
- package/src/nodes/code/FunctionNode.js +69 -2
- package/src/nodes/core/ArrayNode.js +174 -0
- package/src/nodes/core/AssignNode.js +80 -9
- package/src/nodes/core/AttributeNode.js +47 -4
- package/src/nodes/core/BypassNode.js +47 -3
- package/src/nodes/core/ConstNode.js +32 -0
- package/src/nodes/core/ContextNode.js +220 -14
- package/src/nodes/core/IndexNode.js +72 -7
- package/src/nodes/core/InputNode.js +50 -1
- package/src/nodes/core/InspectorNode.js +128 -0
- package/src/nodes/core/IsolateNode.js +133 -0
- package/src/nodes/core/LightingModel.js +65 -5
- package/src/nodes/core/MRTNode.js +113 -2
- package/src/nodes/core/Node.js +595 -36
- package/src/nodes/core/NodeAttribute.js +38 -0
- package/src/nodes/core/NodeBuilder.js +1840 -121
- package/src/nodes/core/NodeCache.js +41 -2
- package/src/nodes/core/NodeCode.js +31 -0
- package/src/nodes/core/NodeError.js +28 -0
- package/src/nodes/core/NodeFrame.js +153 -24
- package/src/nodes/core/NodeFunction.js +48 -1
- package/src/nodes/core/NodeFunctionInput.js +44 -0
- package/src/nodes/core/NodeParser.js +13 -1
- package/src/nodes/core/NodeUniform.js +53 -1
- package/src/nodes/core/NodeUtils.js +201 -51
- package/src/nodes/core/NodeVar.js +47 -1
- package/src/nodes/core/NodeVarying.js +47 -1
- package/src/nodes/core/OutputStructNode.js +54 -12
- package/src/nodes/core/ParameterNode.js +60 -2
- package/src/nodes/core/PropertyNode.js +286 -7
- package/src/nodes/core/StackNode.js +337 -20
- package/src/nodes/core/StackTrace.js +139 -0
- package/src/nodes/core/StructNode.js +134 -0
- package/src/nodes/core/StructType.js +13 -0
- package/src/nodes/core/StructTypeNode.js +126 -6
- package/src/nodes/core/SubBuildNode.js +89 -0
- package/src/nodes/core/TempNode.js +31 -5
- package/src/nodes/core/UniformGroupNode.js +85 -7
- package/src/nodes/core/UniformNode.js +163 -16
- package/src/nodes/core/VarNode.js +317 -10
- package/src/nodes/core/VaryingNode.js +115 -13
- package/src/nodes/core/constants.js +40 -0
- package/src/nodes/display/BlendModes.js +171 -0
- package/src/nodes/display/BumpMapNode.js +38 -2
- package/src/nodes/display/ColorAdjustment.js +118 -6
- package/src/nodes/display/ColorSpaceFunctions.js +22 -6
- package/src/nodes/display/ColorSpaceNode.js +97 -47
- package/src/nodes/display/FrontFacingNode.js +64 -7
- package/src/nodes/display/NormalMapNode.js +101 -54
- package/src/nodes/display/PassNode.js +690 -33
- package/src/nodes/display/RenderOutputNode.js +94 -4
- package/src/nodes/display/ScreenNode.js +138 -27
- package/src/nodes/display/ToneMappingFunctions.js +62 -10
- package/src/nodes/display/ToneMappingNode.js +88 -8
- package/src/nodes/display/ToonOutlinePassNode.js +84 -4
- package/src/nodes/display/ViewportDepthNode.js +227 -10
- package/src/nodes/display/ViewportDepthTextureNode.js +39 -5
- package/src/nodes/display/ViewportSharedTextureNode.js +35 -1
- package/src/nodes/display/ViewportTextureNode.js +171 -7
- package/src/nodes/fog/Fog.js +97 -0
- package/src/nodes/functions/BSDF/BRDF_GGX.js +2 -6
- package/src/nodes/functions/BSDF/BRDF_GGX_Multiscatter.js +52 -0
- package/src/nodes/functions/BSDF/BRDF_Sheen.js +4 -4
- package/src/nodes/functions/BSDF/DFGLUT.js +56 -0
- package/src/nodes/functions/BSDF/EnvironmentBRDF.js +2 -2
- package/src/nodes/functions/BSDF/LTC.js +45 -1
- package/src/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.js +1 -1
- package/src/nodes/functions/BasicLightingModel.js +28 -6
- package/src/nodes/functions/PhongLightingModel.js +36 -6
- package/src/nodes/functions/PhysicalLightingModel.js +336 -91
- package/src/nodes/functions/ShadowMaskModel.js +30 -3
- package/src/nodes/functions/ToonLightingModel.js +21 -2
- package/src/nodes/functions/VolumetricLightingModel.js +183 -0
- package/src/nodes/functions/material/getAlphaHashThreshold.js +68 -0
- package/src/nodes/functions/material/getGeometryRoughness.js +10 -4
- package/src/nodes/functions/material/getParallaxCorrectNormal.js +37 -0
- package/src/nodes/geometry/RangeNode.js +97 -8
- package/src/nodes/gpgpu/AtomicFunctionNode.js +198 -23
- package/src/nodes/gpgpu/BarrierNode.js +52 -3
- package/src/nodes/gpgpu/ComputeBuiltinNode.js +135 -6
- package/src/nodes/gpgpu/ComputeNode.js +212 -16
- package/src/nodes/gpgpu/SubgroupFunctionNode.js +455 -0
- package/src/nodes/gpgpu/WorkgroupInfoNode.js +143 -9
- package/src/nodes/lighting/AONode.js +18 -0
- package/src/nodes/lighting/AmbientLightNode.js +10 -0
- package/src/nodes/lighting/AnalyticLightNode.js +186 -399
- package/src/nodes/lighting/BasicEnvironmentNode.js +19 -0
- package/src/nodes/lighting/BasicLightMapNode.js +17 -0
- package/src/nodes/lighting/DirectionalLightNode.js +12 -11
- package/src/nodes/lighting/EnvironmentNode.js +59 -19
- package/src/nodes/lighting/HemisphereLightNode.js +33 -2
- package/src/nodes/lighting/IESSpotLightNode.js +13 -1
- package/src/nodes/lighting/IrradianceNode.js +17 -0
- package/src/nodes/lighting/LightProbeNode.js +20 -0
- package/src/nodes/lighting/LightUtils.js +11 -3
- package/src/nodes/lighting/LightingContextNode.js +52 -4
- package/src/nodes/lighting/LightingNode.js +15 -6
- package/src/nodes/lighting/LightsNode.js +238 -35
- package/src/nodes/lighting/PointLightNode.js +60 -25
- package/src/nodes/lighting/PointShadowNode.js +325 -0
- package/src/nodes/lighting/ProjectorLightNode.js +91 -0
- package/src/nodes/lighting/RectAreaLightNode.js +50 -14
- package/src/nodes/lighting/ShadowBaseNode.js +81 -0
- package/src/nodes/lighting/ShadowFilterNode.js +264 -0
- package/src/nodes/lighting/ShadowNode.js +867 -0
- package/src/nodes/lighting/SpotLightNode.js +99 -18
- package/src/nodes/materialx/MaterialXNodes.js +131 -2
- package/src/nodes/materialx/lib/mx_noise.js +166 -2
- package/src/nodes/math/BitcastNode.js +156 -0
- package/src/nodes/math/BitcountNode.js +433 -0
- package/src/nodes/math/ConditionalNode.js +110 -21
- package/src/nodes/math/Hash.js +8 -0
- package/src/nodes/math/MathNode.js +820 -97
- package/src/nodes/math/MathUtils.js +47 -1
- package/src/nodes/math/OperatorNode.js +517 -84
- package/src/nodes/math/PackFloatNode.js +98 -0
- package/src/nodes/math/TriNoise3D.js +17 -7
- package/src/nodes/math/UnpackFloatNode.js +96 -0
- package/src/nodes/parsers/GLSLNodeFunction.js +16 -0
- package/src/nodes/parsers/GLSLNodeParser.js +11 -0
- package/src/nodes/pmrem/PMREMNode.js +180 -23
- package/src/nodes/pmrem/PMREMUtils.js +114 -5
- package/src/nodes/procedural/Checker.js +8 -0
- package/src/nodes/shapes/Shapes.js +33 -0
- package/src/nodes/tsl/TSLBase.js +10 -4
- package/src/nodes/tsl/TSLCore.js +732 -160
- package/src/nodes/utils/ArrayElementNode.js +55 -4
- package/src/nodes/utils/ConvertNode.js +31 -0
- package/src/nodes/utils/CubeMapNode.js +79 -2
- package/src/nodes/utils/DebugNode.js +83 -0
- package/src/nodes/utils/Discard.js +18 -2
- package/src/nodes/utils/EquirectUV.js +27 -0
- package/src/nodes/utils/EventNode.js +118 -0
- package/src/nodes/utils/FlipNode.js +38 -0
- package/src/nodes/utils/FunctionOverloadingNode.js +91 -22
- package/src/nodes/utils/JoinNode.js +57 -4
- package/src/nodes/utils/LoopNode.js +193 -55
- package/src/nodes/utils/MatcapUV.js +22 -0
- package/src/nodes/utils/MaxMipLevelNode.js +49 -1
- package/src/nodes/utils/MemberNode.js +120 -0
- package/src/nodes/utils/Oscillators.js +41 -0
- package/src/nodes/utils/Packing.js +30 -1
- package/src/nodes/utils/PostProcessingUtils.js +154 -0
- package/src/nodes/utils/RTTNode.js +165 -9
- package/src/nodes/utils/ReflectorNode.js +407 -21
- package/src/nodes/utils/RemapNode.js +81 -2
- package/src/nodes/utils/RotateNode.js +41 -1
- package/src/nodes/utils/SampleNode.js +91 -0
- package/src/nodes/utils/SetNode.js +44 -1
- package/src/nodes/utils/SplitNode.js +66 -3
- package/src/nodes/utils/SpriteSheetUV.js +35 -0
- package/src/nodes/utils/SpriteUtils.js +16 -0
- package/src/nodes/utils/StorageArrayElementNode.js +56 -3
- package/src/nodes/utils/Timer.js +26 -0
- package/src/nodes/utils/TriplanarTextures.js +65 -0
- package/src/nodes/utils/UVUtils.js +48 -0
- package/src/nodes/utils/ViewportUtils.js +12 -0
- package/src/objects/BatchedMesh.js +798 -309
- package/src/objects/Bone.js +24 -0
- package/src/objects/ClippingGroup.js +68 -0
- package/src/objects/Group.js +24 -0
- package/src/objects/InstancedMesh.js +131 -2
- package/src/objects/LOD.js +99 -5
- package/src/objects/Line.js +90 -7
- package/src/objects/LineLoop.js +20 -0
- package/src/objects/LineSegments.js +20 -1
- package/src/objects/Mesh.js +84 -0
- package/src/objects/Points.js +60 -0
- package/src/objects/Skeleton.js +120 -5
- package/src/objects/SkinnedMesh.js +102 -6
- package/src/objects/Sprite.js +65 -1
- package/src/renderers/WebGL3DRenderTarget.js +26 -0
- package/src/renderers/WebGLArrayRenderTarget.js +26 -0
- package/src/renderers/WebGLCubeRenderTarget.js +41 -5
- package/src/renderers/WebGLRenderTarget.js +19 -0
- package/src/renderers/WebGLRenderer.js +1016 -278
- package/src/renderers/common/Animation.js +123 -14
- package/src/renderers/common/Attributes.js +41 -1
- package/src/renderers/common/Backend.js +623 -44
- package/src/renderers/common/Background.js +99 -16
- package/src/renderers/common/BindGroup.js +37 -2
- package/src/renderers/common/Binding.js +46 -0
- package/src/renderers/common/Bindings.js +211 -20
- package/src/renderers/common/BlendMode.js +143 -0
- package/src/renderers/common/Buffer.js +89 -0
- package/src/renderers/common/BufferUtils.js +25 -0
- package/src/renderers/common/BundleGroup.js +57 -0
- package/src/renderers/common/CanvasTarget.js +341 -0
- package/src/renderers/common/ChainMap.js +73 -10
- package/src/renderers/common/ClippingContext.js +172 -87
- package/src/renderers/common/Color4.js +40 -0
- package/src/renderers/common/ComputePipeline.js +24 -0
- package/src/renderers/common/Constants.js +2 -1
- package/src/renderers/common/CubeRenderTarget.js +77 -7
- package/src/renderers/common/DataMap.js +37 -1
- package/src/renderers/common/Geometries.js +163 -14
- package/src/renderers/common/IndirectStorageBufferAttribute.js +38 -0
- package/src/renderers/common/Info.js +81 -36
- package/src/renderers/common/InspectorBase.js +146 -0
- package/src/renderers/common/Lighting.js +57 -0
- package/src/renderers/common/Pipeline.js +22 -0
- package/src/renderers/common/Pipelines.js +150 -7
- package/src/renderers/common/PostProcessing.js +22 -84
- package/src/renderers/common/ProgrammableStage.js +60 -2
- package/src/renderers/common/QuadMesh.js +63 -6
- package/src/renderers/common/RenderBundle.js +14 -8
- package/src/renderers/common/RenderBundles.js +40 -10
- package/src/renderers/common/RenderContext.js +219 -4
- package/src/renderers/common/RenderContexts.js +54 -17
- package/src/renderers/common/RenderList.js +233 -24
- package/src/renderers/common/RenderLists.js +46 -6
- package/src/renderers/common/RenderObject.js +548 -46
- package/src/renderers/common/RenderObjectPipeline.js +40 -0
- package/src/renderers/common/RenderObjects.js +133 -15
- package/src/renderers/common/RenderPipeline.js +216 -6
- package/src/renderers/common/Renderer.js +2155 -332
- package/src/renderers/common/RendererUtils.js +200 -0
- package/src/renderers/common/SampledTexture.js +99 -39
- package/src/renderers/common/Sampler.js +148 -1
- package/src/renderers/common/Storage3DTexture.js +100 -0
- package/src/renderers/common/StorageArrayTexture.js +84 -0
- package/src/renderers/common/StorageBuffer.js +38 -2
- package/src/renderers/common/StorageBufferAttribute.js +31 -2
- package/src/renderers/common/StorageInstancedBufferAttribute.js +31 -2
- package/src/renderers/common/StorageTexture.js +65 -0
- package/src/renderers/common/Textures.js +273 -57
- package/src/renderers/common/TimestampQueryPool.js +163 -0
- package/src/renderers/common/Uniform.js +233 -3
- package/src/renderers/common/UniformBuffer.js +19 -0
- package/src/renderers/common/UniformsGroup.js +235 -26
- package/src/renderers/common/XRManager.js +1677 -0
- package/src/renderers/common/XRRenderTarget.js +91 -0
- package/src/renderers/common/extras/PMREMGenerator.js +371 -108
- package/src/renderers/common/nodes/NodeBuilderState.js +100 -6
- package/src/renderers/common/nodes/NodeLibrary.js +95 -17
- package/src/renderers/common/nodes/NodeManager.js +852 -0
- package/src/renderers/common/nodes/NodeSampledTexture.js +84 -8
- package/src/renderers/common/nodes/NodeSampler.js +41 -1
- package/src/renderers/common/nodes/NodeStorageBuffer.js +48 -3
- package/src/renderers/common/nodes/NodeUniform.js +285 -2
- package/src/renderers/common/nodes/NodeUniformBuffer.js +81 -0
- package/src/renderers/common/nodes/NodeUniformsGroup.js +31 -18
- package/src/renderers/shaders/DFGLUTData.js +49 -0
- package/src/renderers/shaders/ShaderChunk/batching_pars_vertex.glsl.js +2 -2
- package/src/renderers/shaders/ShaderChunk/color_fragment.glsl.js +1 -5
- package/src/renderers/shaders/ShaderChunk/color_pars_fragment.glsl.js +1 -5
- package/src/renderers/shaders/ShaderChunk/color_pars_vertex.glsl.js +1 -5
- package/src/renderers/shaders/ShaderChunk/color_vertex.glsl.js +8 -10
- package/src/renderers/shaders/ShaderChunk/colorspace_pars_fragment.glsl.js +4 -24
- package/src/renderers/shaders/ShaderChunk/common.glsl.js +0 -12
- package/src/renderers/shaders/ShaderChunk/emissivemap_fragment.glsl.js +8 -0
- package/src/renderers/shaders/ShaderChunk/envmap_common_pars_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/envmap_fragment.glsl.js +7 -11
- package/src/renderers/shaders/ShaderChunk/envmap_physical_pars_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/lights_fragment_begin.glsl.js +5 -2
- package/src/renderers/shaders/ShaderChunk/lights_fragment_end.glsl.js +6 -0
- package/src/renderers/shaders/ShaderChunk/lights_fragment_maps.glsl.js +6 -2
- package/src/renderers/shaders/ShaderChunk/lights_physical_fragment.glsl.js +8 -4
- package/src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js +154 -59
- package/src/renderers/shaders/ShaderChunk/logdepthbuf_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/logdepthbuf_pars_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/logdepthbuf_pars_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/logdepthbuf_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/map_fragment.glsl.js +2 -2
- package/src/renderers/shaders/ShaderChunk/packing.glsl.js +20 -4
- package/src/renderers/shaders/ShaderChunk/premultiplied_alpha_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js +230 -181
- package/src/renderers/shaders/ShaderChunk/shadowmask_pars_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/transmission_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/transmission_pars_fragment.glsl.js +7 -7
- package/src/renderers/shaders/ShaderChunk.js +3 -3
- package/src/renderers/shaders/ShaderLib/background.glsl.js +1 -1
- package/src/renderers/shaders/ShaderLib/depth.glsl.js +14 -2
- package/src/renderers/shaders/ShaderLib/{distanceRGBA.glsl.js → distance.glsl.js} +1 -2
- package/src/renderers/shaders/ShaderLib/meshlambert.glsl.js +2 -1
- package/src/renderers/shaders/ShaderLib/meshnormal.glsl.js +1 -2
- package/src/renderers/shaders/ShaderLib/meshphong.glsl.js +2 -1
- package/src/renderers/shaders/ShaderLib/meshphysical.glsl.js +4 -9
- package/src/renderers/shaders/ShaderLib/meshtoon.glsl.js +0 -1
- package/src/renderers/shaders/ShaderLib/shadow.glsl.js +1 -1
- package/src/renderers/shaders/ShaderLib/vsm.glsl.js +4 -6
- package/src/renderers/shaders/ShaderLib.js +7 -5
- package/src/renderers/shaders/UniformsLib.js +2 -7
- package/src/renderers/shaders/UniformsUtils.js +21 -2
- package/src/renderers/webgl/WebGLAttributes.js +4 -0
- package/src/renderers/webgl/WebGLBackground.js +30 -5
- package/src/renderers/webgl/WebGLBindingStates.js +99 -27
- package/src/renderers/webgl/WebGLBufferRenderer.js +2 -6
- package/src/renderers/webgl/WebGLCapabilities.js +7 -14
- package/src/renderers/webgl/WebGLEnvironments.js +228 -0
- package/src/renderers/webgl/WebGLExtensions.js +2 -25
- package/src/renderers/webgl/WebGLGeometries.js +10 -35
- package/src/renderers/webgl/WebGLIndexedBufferRenderer.js +2 -6
- package/src/renderers/webgl/WebGLInfo.js +3 -1
- package/src/renderers/webgl/WebGLLights.js +18 -1
- package/src/renderers/webgl/WebGLMaterials.js +12 -0
- package/src/renderers/webgl/WebGLObjects.js +3 -1
- package/src/renderers/webgl/WebGLOutput.js +267 -0
- package/src/renderers/webgl/WebGLProgram.js +87 -148
- package/src/renderers/webgl/WebGLPrograms.js +53 -51
- package/src/renderers/webgl/WebGLRenderLists.js +15 -0
- package/src/renderers/webgl/WebGLShadowMap.js +204 -28
- package/src/renderers/webgl/WebGLState.js +88 -56
- package/src/renderers/webgl/WebGLTextures.js +293 -59
- package/src/renderers/webgl/WebGLUniforms.js +40 -3
- package/src/renderers/webgl/WebGLUniformsGroups.js +5 -3
- package/src/renderers/webgl/WebGLUtils.js +7 -5
- package/src/renderers/webgl-fallback/WebGLBackend.js +1416 -293
- package/src/renderers/webgl-fallback/WebGLBufferRenderer.js +5 -10
- package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +785 -92
- package/src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js +62 -1
- package/src/renderers/webgl-fallback/utils/WebGLCapabilities.js +28 -0
- package/src/renderers/webgl-fallback/utils/WebGLConstants.js +3 -3
- package/src/renderers/webgl-fallback/utils/WebGLExtensions.js +45 -0
- package/src/renderers/webgl-fallback/utils/WebGLState.js +584 -20
- package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +468 -80
- package/src/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.js +396 -0
- package/src/renderers/webgl-fallback/utils/WebGLUtils.js +72 -24
- package/src/renderers/webgpu/WebGPUBackend.js +1517 -428
- package/src/renderers/webgpu/WebGPURenderer.Nodes.js +31 -4
- package/src/renderers/webgpu/WebGPURenderer.js +55 -4
- package/src/renderers/webgpu/nodes/BasicNodeLibrary.js +23 -16
- package/src/renderers/webgpu/nodes/StandardNodeLibrary.js +37 -42
- package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +1335 -241
- package/src/renderers/webgpu/nodes/WGSLNodeFunction.js +32 -4
- package/src/renderers/webgpu/nodes/WGSLNodeParser.js +11 -0
- package/src/renderers/webgpu/utils/WebGPUAttributeUtils.js +144 -20
- package/src/renderers/webgpu/utils/WebGPUBindingUtils.js +460 -116
- package/src/renderers/webgpu/utils/WebGPUConstants.js +17 -4
- package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +283 -69
- package/src/renderers/webgpu/utils/WebGPUTexturePassUtils.js +225 -178
- package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +583 -191
- package/src/renderers/webgpu/utils/WebGPUTimestampQueryPool.js +310 -0
- package/src/renderers/webgpu/utils/WebGPUUtils.js +150 -28
- package/src/renderers/webxr/WebXRController.js +87 -2
- package/src/renderers/webxr/WebXRDepthSensing.js +52 -7
- package/src/renderers/webxr/WebXRManager.js +275 -15
- package/src/scenes/Fog.js +60 -0
- package/src/scenes/FogExp2.js +51 -0
- package/src/scenes/Scene.js +88 -0
- 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/CubeDepthTexture.js +76 -0
- package/src/textures/CubeTexture.js +52 -4
- package/src/textures/Data3DTexture.js +79 -2
- package/src/textures/DataArrayTexture.js +93 -0
- package/src/textures/DataTexture.js +65 -0
- package/src/textures/DepthTexture.js +59 -11
- package/src/textures/ExternalTexture.js +56 -0
- package/src/textures/FramebufferTexture.js +62 -0
- package/src/textures/Source.js +106 -4
- package/src/textures/Texture.js +488 -6
- package/src/textures/VideoFrameTexture.js +72 -0
- package/src/textures/VideoTexture.js +78 -6
- package/src/utils.js +322 -3
- package/examples/jsm/animation/MMDAnimationHelper.js +0 -1207
- package/examples/jsm/animation/MMDPhysics.js +0 -1406
- package/examples/jsm/cameras/CinematicCamera.js +0 -208
- package/examples/jsm/effects/PeppersGhostEffect.js +0 -153
- package/examples/jsm/exporters/MMDExporter.js +0 -217
- package/examples/jsm/geometries/InstancedPointsGeometry.js +0 -174
- package/examples/jsm/geometries/ParametricGeometries.js +0 -254
- package/examples/jsm/libs/mmdparser.module.js +0 -11530
- package/examples/jsm/loaders/GLTFLoaderAnimationPointer.js +0 -729
- package/examples/jsm/loaders/MMDLoader.js +0 -2295
- package/examples/jsm/loaders/RGBMLoader.js +0 -1081
- package/examples/jsm/materials/MeshGouraudMaterial.js +0 -432
- package/examples/jsm/materials/MeshPostProcessingMaterial.js +0 -144
- package/examples/jsm/misc/Timer.js +0 -128
- package/examples/jsm/objects/InstancedPoints.js +0 -21
- package/examples/jsm/shaders/GodRaysShader.js +0 -321
- package/examples/jsm/shaders/MMDToonShader.js +0 -134
- package/src/materials/nodes/InstancedPointsNodeMaterial.js +0 -156
- package/src/nodes/accessors/InstancedPointsMaterialNode.js +0 -24
- package/src/nodes/accessors/SceneNode.js +0 -55
- package/src/nodes/code/ScriptableNode.js +0 -505
- package/src/nodes/code/ScriptableValueNode.js +0 -170
- package/src/nodes/core/CacheNode.js +0 -50
- package/src/nodes/core/UniformGroup.js +0 -13
- package/src/nodes/display/AfterImageNode.js +0 -158
- package/src/nodes/display/AnaglyphPassNode.js +0 -67
- package/src/nodes/display/AnamorphicNode.js +0 -151
- package/src/nodes/display/BlendMode.js +0 -54
- package/src/nodes/display/BloomNode.js +0 -341
- package/src/nodes/display/DenoiseNode.js +0 -204
- package/src/nodes/display/DepthOfFieldNode.js +0 -124
- package/src/nodes/display/DotScreenNode.js +0 -66
- package/src/nodes/display/FXAANode.js +0 -332
- package/src/nodes/display/FilmNode.js +0 -56
- package/src/nodes/display/GTAONode.js +0 -331
- package/src/nodes/display/GaussianBlurNode.js +0 -213
- package/src/nodes/display/Lut3DNode.js +0 -57
- package/src/nodes/display/MotionBlur.js +0 -25
- package/src/nodes/display/ParallaxBarrierPassNode.js +0 -58
- package/src/nodes/display/PixelationPassNode.js +0 -213
- package/src/nodes/display/PosterizeNode.js +0 -33
- package/src/nodes/display/RGBShiftNode.js +0 -53
- package/src/nodes/display/StereoCompositePassNode.js +0 -110
- package/src/nodes/display/TransitionNode.js +0 -80
- package/src/nodes/fog/FogExp2Node.js +0 -35
- package/src/nodes/fog/FogNode.js +0 -50
- package/src/nodes/fog/FogRangeNode.js +0 -36
- package/src/nodes/functions/BSDF/DFGApprox.js +0 -30
- package/src/nodes/utils/EquirectUVNode.js +0 -36
- package/src/nodes/utils/MatcapUVNode.js +0 -33
- package/src/nodes/utils/OscNode.js +0 -85
- package/src/nodes/utils/SpriteSheetUVNode.js +0 -45
- package/src/nodes/utils/TimerNode.js +0 -97
- package/src/nodes/utils/TriplanarTexturesNode.js +0 -64
- package/src/renderers/common/nodes/Nodes.js +0 -534
- package/src/renderers/webgl/WebGLCubeMaps.js +0 -99
- package/src/renderers/webgl/WebGLCubeUVMaps.js +0 -136
|
@@ -24,10 +24,9 @@ import {
|
|
|
24
24
|
CompressedTexture,
|
|
25
25
|
Vector3,
|
|
26
26
|
Quaternion,
|
|
27
|
-
REVISION
|
|
27
|
+
REVISION,
|
|
28
|
+
ImageUtils
|
|
28
29
|
} from 'three';
|
|
29
|
-
import { decompress } from './../utils/TextureUtils.js';
|
|
30
|
-
|
|
31
30
|
|
|
32
31
|
/**
|
|
33
32
|
* The KHR_mesh_quantization extension allows these extra attribute component types
|
|
@@ -63,11 +62,59 @@ const KHR_mesh_quantization_ExtraAttrTypes = {
|
|
|
63
62
|
],
|
|
64
63
|
};
|
|
65
64
|
|
|
66
|
-
|
|
65
|
+
/**
|
|
66
|
+
* An exporter for `glTF` 2.0.
|
|
67
|
+
*
|
|
68
|
+
* glTF (GL Transmission Format) is an [open format specification](https://github.com/KhronosGroup/glTF/tree/master/specification/2.0)
|
|
69
|
+
* for efficient delivery and loading of 3D content. Assets may be provided either in JSON (.gltf)
|
|
70
|
+
* or binary (.glb) format. External files store textures (.jpg, .png) and additional binary
|
|
71
|
+
* data (.bin). A glTF asset may deliver one or more scenes, including meshes, materials,
|
|
72
|
+
* textures, skins, skeletons, morph targets, animations, lights, and/or cameras.
|
|
73
|
+
*
|
|
74
|
+
* GLTFExporter supports the [glTF 2.0 extensions](https://github.com/KhronosGroup/glTF/tree/master/extensions/):
|
|
75
|
+
*
|
|
76
|
+
* - KHR_lights_punctual
|
|
77
|
+
* - KHR_materials_clearcoat
|
|
78
|
+
* - KHR_materials_dispersion
|
|
79
|
+
* - KHR_materials_emissive_strength
|
|
80
|
+
* - KHR_materials_ior
|
|
81
|
+
* - KHR_materials_iridescence
|
|
82
|
+
* - KHR_materials_specular
|
|
83
|
+
* - KHR_materials_sheen
|
|
84
|
+
* - KHR_materials_transmission
|
|
85
|
+
* - KHR_materials_unlit
|
|
86
|
+
* - KHR_materials_volume
|
|
87
|
+
* - KHR_mesh_quantization
|
|
88
|
+
* - KHR_texture_transform
|
|
89
|
+
* - EXT_materials_bump
|
|
90
|
+
* - EXT_mesh_gpu_instancing
|
|
91
|
+
*
|
|
92
|
+
* The following glTF 2.0 extension is supported by an external user plugin:
|
|
93
|
+
*
|
|
94
|
+
* - [KHR_materials_variants](https://github.com/takahirox/three-gltf-extensions)
|
|
95
|
+
*
|
|
96
|
+
* ```js
|
|
97
|
+
* const exporter = new GLTFExporter();
|
|
98
|
+
* const data = await exporter.parseAsync( scene, options );
|
|
99
|
+
* ```
|
|
100
|
+
*
|
|
101
|
+
* @three_import import { GLTFExporter } from 'three/addons/exporters/GLTFExporter.js';
|
|
102
|
+
*/
|
|
67
103
|
class GLTFExporter {
|
|
68
104
|
|
|
105
|
+
/**
|
|
106
|
+
* Constructs a new glTF exporter.
|
|
107
|
+
*/
|
|
69
108
|
constructor() {
|
|
70
109
|
|
|
110
|
+
/**
|
|
111
|
+
* A reference to a texture utils module.
|
|
112
|
+
*
|
|
113
|
+
* @type {?(WebGLTextureUtils|WebGPUTextureUtils)}
|
|
114
|
+
* @default null
|
|
115
|
+
*/
|
|
116
|
+
this.textureUtils = null;
|
|
117
|
+
|
|
71
118
|
this.pluginCallbacks = [];
|
|
72
119
|
|
|
73
120
|
this.register( function ( writer ) {
|
|
@@ -156,6 +203,14 @@ class GLTFExporter {
|
|
|
156
203
|
|
|
157
204
|
}
|
|
158
205
|
|
|
206
|
+
/**
|
|
207
|
+
* Registers a plugin callback. This API is internally used to implement the various
|
|
208
|
+
* glTF extensions but can also used by third-party code to add additional logic
|
|
209
|
+
* to the exporter.
|
|
210
|
+
*
|
|
211
|
+
* @param {function(writer:GLTFWriter)} callback - The callback function to register.
|
|
212
|
+
* @return {GLTFExporter} A reference to this exporter.
|
|
213
|
+
*/
|
|
159
214
|
register( callback ) {
|
|
160
215
|
|
|
161
216
|
if ( this.pluginCallbacks.indexOf( callback ) === - 1 ) {
|
|
@@ -168,6 +223,12 @@ class GLTFExporter {
|
|
|
168
223
|
|
|
169
224
|
}
|
|
170
225
|
|
|
226
|
+
/**
|
|
227
|
+
* Unregisters a plugin callback.
|
|
228
|
+
*
|
|
229
|
+
* @param {Function} callback - The callback function to unregister.
|
|
230
|
+
* @return {GLTFExporter} A reference to this exporter.
|
|
231
|
+
*/
|
|
171
232
|
unregister( callback ) {
|
|
172
233
|
|
|
173
234
|
if ( this.pluginCallbacks.indexOf( callback ) !== - 1 ) {
|
|
@@ -181,11 +242,29 @@ class GLTFExporter {
|
|
|
181
242
|
}
|
|
182
243
|
|
|
183
244
|
/**
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
* @
|
|
187
|
-
* @
|
|
188
|
-
*
|
|
245
|
+
* Sets the texture utils for this exporter. Only relevant when compressed textures have to be exported.
|
|
246
|
+
*
|
|
247
|
+
* Depending on whether you use {@link WebGLRenderer} or {@link WebGPURenderer}, you must inject the
|
|
248
|
+
* corresponding texture utils {@link WebGLTextureUtils} or {@link WebGPUTextureUtils}.
|
|
249
|
+
*
|
|
250
|
+
* @param {WebGLTextureUtils|WebGPUTextureUtils} utils - The texture utils.
|
|
251
|
+
* @return {GLTFExporter} A reference to this exporter.
|
|
252
|
+
*/
|
|
253
|
+
setTextureUtils( utils ) {
|
|
254
|
+
|
|
255
|
+
this.textureUtils = utils;
|
|
256
|
+
|
|
257
|
+
return this;
|
|
258
|
+
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Parses the given scenes and generates the glTF output.
|
|
263
|
+
*
|
|
264
|
+
* @param {Scene|Array<Scene>} input - A scene or an array of scenes.
|
|
265
|
+
* @param {GLTFExporter~OnDone} onDone - A callback function that is executed when the export has finished.
|
|
266
|
+
* @param {GLTFExporter~OnError} onError - A callback function that is executed when an error happens.
|
|
267
|
+
* @param {GLTFExporter~Options} options - options
|
|
189
268
|
*/
|
|
190
269
|
parse( input, onDone, onError, options ) {
|
|
191
270
|
|
|
@@ -199,10 +278,18 @@ class GLTFExporter {
|
|
|
199
278
|
}
|
|
200
279
|
|
|
201
280
|
writer.setPlugins( plugins );
|
|
202
|
-
writer.
|
|
281
|
+
writer.setTextureUtils( this.textureUtils );
|
|
282
|
+
writer.writeAsync( input, onDone, options ).catch( onError );
|
|
203
283
|
|
|
204
284
|
}
|
|
205
285
|
|
|
286
|
+
/**
|
|
287
|
+
* Async version of {@link GLTFExporter#parse}.
|
|
288
|
+
*
|
|
289
|
+
* @param {Scene|Array<Scene>} input - A scene or an array of scenes.
|
|
290
|
+
* @param {GLTFExporter~Options} options - options.
|
|
291
|
+
* @return {Promise<ArrayBuffer|string>} A Promise that resolved with the exported glTF data.
|
|
292
|
+
*/
|
|
206
293
|
parseAsync( input, options ) {
|
|
207
294
|
|
|
208
295
|
const scope = this;
|
|
@@ -294,9 +381,11 @@ const GLB_CHUNK_TYPE_BIN = 0x004E4942;
|
|
|
294
381
|
|
|
295
382
|
/**
|
|
296
383
|
* Compare two arrays
|
|
297
|
-
*
|
|
298
|
-
* @
|
|
299
|
-
* @
|
|
384
|
+
*
|
|
385
|
+
* @private
|
|
386
|
+
* @param {Array} array1 Array 1 to compare
|
|
387
|
+
* @param {Array} array2 Array 2 to compare
|
|
388
|
+
* @return {boolean} Returns true if both arrays are equal
|
|
300
389
|
*/
|
|
301
390
|
function equalArray( array1, array2 ) {
|
|
302
391
|
|
|
@@ -310,7 +399,9 @@ function equalArray( array1, array2 ) {
|
|
|
310
399
|
|
|
311
400
|
/**
|
|
312
401
|
* Converts a string to an ArrayBuffer.
|
|
313
|
-
*
|
|
402
|
+
*
|
|
403
|
+
* @private
|
|
404
|
+
* @param {string} text
|
|
314
405
|
* @return {ArrayBuffer}
|
|
315
406
|
*/
|
|
316
407
|
function stringToArrayBuffer( text ) {
|
|
@@ -322,8 +413,9 @@ function stringToArrayBuffer( text ) {
|
|
|
322
413
|
/**
|
|
323
414
|
* Is identity matrix
|
|
324
415
|
*
|
|
416
|
+
* @private
|
|
325
417
|
* @param {Matrix4} matrix
|
|
326
|
-
* @returns {
|
|
418
|
+
* @returns {boolean} Returns true, if parameter is identity matrix
|
|
327
419
|
*/
|
|
328
420
|
function isIdentityMatrix( matrix ) {
|
|
329
421
|
|
|
@@ -333,9 +425,11 @@ function isIdentityMatrix( matrix ) {
|
|
|
333
425
|
|
|
334
426
|
/**
|
|
335
427
|
* Get the min and max vectors from the given attribute
|
|
336
|
-
*
|
|
337
|
-
* @
|
|
338
|
-
* @param
|
|
428
|
+
*
|
|
429
|
+
* @private
|
|
430
|
+
* @param {BufferAttribute} attribute Attribute to find the min/max in range from start to start + count
|
|
431
|
+
* @param {number} start Start index
|
|
432
|
+
* @param {number} count Range to cover
|
|
339
433
|
* @return {Object} Object containing the `min` and `max` values (As an array of attribute.itemSize components)
|
|
340
434
|
*/
|
|
341
435
|
function getMinMax( attribute, start, count ) {
|
|
@@ -389,8 +483,9 @@ function getMinMax( attribute, start, count ) {
|
|
|
389
483
|
* Get the required size + padding for a buffer, rounded to the next 4-byte boundary.
|
|
390
484
|
* https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#data-alignment
|
|
391
485
|
*
|
|
392
|
-
* @
|
|
393
|
-
* @
|
|
486
|
+
* @private
|
|
487
|
+
* @param {number} bufferSize The size the original buffer. Should be an integer.
|
|
488
|
+
* @returns {number} new buffer size with required padding as an integer.
|
|
394
489
|
*
|
|
395
490
|
*/
|
|
396
491
|
function getPaddedBufferSize( bufferSize ) {
|
|
@@ -402,8 +497,9 @@ function getPaddedBufferSize( bufferSize ) {
|
|
|
402
497
|
/**
|
|
403
498
|
* Returns a buffer aligned to 4-byte boundary.
|
|
404
499
|
*
|
|
500
|
+
* @private
|
|
405
501
|
* @param {ArrayBuffer} arrayBuffer Buffer to pad
|
|
406
|
-
* @param {
|
|
502
|
+
* @param {number} [paddingByte=0] Should be an integer
|
|
407
503
|
* @returns {ArrayBuffer} The same buffer if it's already aligned to 4-byte boundary or a new buffer
|
|
408
504
|
*/
|
|
409
505
|
function getPaddedArrayBuffer( arrayBuffer, paddingByte = 0 ) {
|
|
@@ -447,37 +543,43 @@ function getCanvas() {
|
|
|
447
543
|
|
|
448
544
|
function getToBlobPromise( canvas, mimeType ) {
|
|
449
545
|
|
|
450
|
-
if (
|
|
546
|
+
if ( typeof OffscreenCanvas !== 'undefined' && canvas instanceof OffscreenCanvas ) {
|
|
451
547
|
|
|
452
|
-
|
|
548
|
+
let quality;
|
|
453
549
|
|
|
454
|
-
|
|
550
|
+
// Blink's implementation of convertToBlob seems to default to a quality level of 100%
|
|
551
|
+
// Use the Blink default quality levels of toBlob instead so that file sizes are comparable.
|
|
552
|
+
if ( mimeType === 'image/jpeg' ) {
|
|
455
553
|
|
|
456
|
-
|
|
554
|
+
quality = 0.92;
|
|
457
555
|
|
|
458
|
-
|
|
459
|
-
// Use the Blink default quality levels of toBlob instead so that file sizes are comparable.
|
|
460
|
-
if ( mimeType === 'image/jpeg' ) {
|
|
556
|
+
} else if ( mimeType === 'image/webp' ) {
|
|
461
557
|
|
|
462
|
-
|
|
558
|
+
quality = 0.8;
|
|
463
559
|
|
|
464
|
-
|
|
560
|
+
}
|
|
465
561
|
|
|
466
|
-
|
|
562
|
+
return canvas.convertToBlob( {
|
|
467
563
|
|
|
468
|
-
|
|
564
|
+
type: mimeType,
|
|
565
|
+
quality: quality
|
|
469
566
|
|
|
470
|
-
|
|
567
|
+
} );
|
|
471
568
|
|
|
472
|
-
|
|
473
|
-
quality: quality
|
|
569
|
+
} else {
|
|
474
570
|
|
|
475
|
-
|
|
571
|
+
// HTMLCanvasElement code path
|
|
572
|
+
|
|
573
|
+
return new Promise( ( resolve ) => canvas.toBlob( resolve, mimeType ) );
|
|
574
|
+
|
|
575
|
+
}
|
|
476
576
|
|
|
477
577
|
}
|
|
478
578
|
|
|
479
579
|
/**
|
|
480
580
|
* Writer
|
|
581
|
+
*
|
|
582
|
+
* @private
|
|
481
583
|
*/
|
|
482
584
|
class GLTFWriter {
|
|
483
585
|
|
|
@@ -516,6 +618,8 @@ class GLTFWriter {
|
|
|
516
618
|
images: new Map()
|
|
517
619
|
};
|
|
518
620
|
|
|
621
|
+
this.textureUtils = null;
|
|
622
|
+
|
|
519
623
|
}
|
|
520
624
|
|
|
521
625
|
setPlugins( plugins ) {
|
|
@@ -524,13 +628,20 @@ class GLTFWriter {
|
|
|
524
628
|
|
|
525
629
|
}
|
|
526
630
|
|
|
631
|
+
setTextureUtils( utils ) {
|
|
632
|
+
|
|
633
|
+
this.textureUtils = utils;
|
|
634
|
+
|
|
635
|
+
}
|
|
636
|
+
|
|
527
637
|
/**
|
|
528
638
|
* Parse scenes and generate GLTF output
|
|
529
|
-
*
|
|
530
|
-
* @param
|
|
531
|
-
* @param
|
|
639
|
+
*
|
|
640
|
+
* @param {Scene|Array<Scene>} input Scene or Array of THREE.Scenes
|
|
641
|
+
* @param {Function} onDone Callback on completed
|
|
642
|
+
* @param {Object} options options
|
|
532
643
|
*/
|
|
533
|
-
async
|
|
644
|
+
async writeAsync( input, onDone, options = {} ) {
|
|
534
645
|
|
|
535
646
|
this.options = Object.assign( {
|
|
536
647
|
// default options
|
|
@@ -549,7 +660,7 @@ class GLTFWriter {
|
|
|
549
660
|
|
|
550
661
|
}
|
|
551
662
|
|
|
552
|
-
this.
|
|
663
|
+
await this.processInputAsync( input );
|
|
553
664
|
|
|
554
665
|
await Promise.all( this.pending );
|
|
555
666
|
|
|
@@ -650,7 +761,7 @@ class GLTFWriter {
|
|
|
650
761
|
/**
|
|
651
762
|
* Serializes a userData.
|
|
652
763
|
*
|
|
653
|
-
* @param {THREE.Object3D|THREE.Material} object
|
|
764
|
+
* @param {THREE.Object3D|THREE.Material|THREE.BufferGeometry|THREE.AnimationClip} object
|
|
654
765
|
* @param {Object} objectDef
|
|
655
766
|
*/
|
|
656
767
|
serializeUserData( object, objectDef ) {
|
|
@@ -692,8 +803,10 @@ class GLTFWriter {
|
|
|
692
803
|
|
|
693
804
|
/**
|
|
694
805
|
* Returns ids for buffer attributes.
|
|
695
|
-
*
|
|
696
|
-
* @
|
|
806
|
+
*
|
|
807
|
+
* @param {Object} attribute
|
|
808
|
+
* @param {boolean} [isRelativeCopy=false]
|
|
809
|
+
* @return {number} An integer
|
|
697
810
|
*/
|
|
698
811
|
getUID( attribute, isRelativeCopy = false ) {
|
|
699
812
|
|
|
@@ -718,7 +831,7 @@ class GLTFWriter {
|
|
|
718
831
|
* Checks if normal attribute values are normalized.
|
|
719
832
|
*
|
|
720
833
|
* @param {BufferAttribute} normal
|
|
721
|
-
* @returns {
|
|
834
|
+
* @returns {boolean}
|
|
722
835
|
*/
|
|
723
836
|
isNormalizedNormalAttribute( normal ) {
|
|
724
837
|
|
|
@@ -823,7 +936,7 @@ class GLTFWriter {
|
|
|
823
936
|
|
|
824
937
|
}
|
|
825
938
|
|
|
826
|
-
|
|
939
|
+
async buildMetalRoughTextureAsync( metalnessMap, roughnessMap ) {
|
|
827
940
|
|
|
828
941
|
if ( metalnessMap === roughnessMap ) return metalnessMap;
|
|
829
942
|
|
|
@@ -847,17 +960,15 @@ class GLTFWriter {
|
|
|
847
960
|
|
|
848
961
|
}
|
|
849
962
|
|
|
850
|
-
console.warn( 'THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures.' );
|
|
851
|
-
|
|
852
963
|
if ( metalnessMap instanceof CompressedTexture ) {
|
|
853
964
|
|
|
854
|
-
metalnessMap =
|
|
965
|
+
metalnessMap = await this.decompressTextureAsync( metalnessMap );
|
|
855
966
|
|
|
856
967
|
}
|
|
857
968
|
|
|
858
969
|
if ( roughnessMap instanceof CompressedTexture ) {
|
|
859
970
|
|
|
860
|
-
roughnessMap =
|
|
971
|
+
roughnessMap = await this.decompressTextureAsync( roughnessMap );
|
|
861
972
|
|
|
862
973
|
}
|
|
863
974
|
|
|
@@ -927,14 +1038,29 @@ class GLTFWriter {
|
|
|
927
1038
|
|
|
928
1039
|
}
|
|
929
1040
|
|
|
1041
|
+
console.warn( 'THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures.' );
|
|
1042
|
+
|
|
930
1043
|
return texture;
|
|
931
1044
|
|
|
932
1045
|
}
|
|
933
1046
|
|
|
1047
|
+
|
|
1048
|
+
async decompressTextureAsync( texture, maxTextureSize = Infinity ) {
|
|
1049
|
+
|
|
1050
|
+
if ( this.textureUtils === null ) {
|
|
1051
|
+
|
|
1052
|
+
throw new Error( 'THREE.GLTFExporter: setTextureUtils() must be called to process compressed textures.' );
|
|
1053
|
+
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
return await this.textureUtils.decompress( texture, maxTextureSize );
|
|
1057
|
+
|
|
1058
|
+
}
|
|
1059
|
+
|
|
934
1060
|
/**
|
|
935
1061
|
* Process a buffer to append to the default one.
|
|
936
|
-
* @param
|
|
937
|
-
* @return {
|
|
1062
|
+
* @param {ArrayBuffer} buffer
|
|
1063
|
+
* @return {0}
|
|
938
1064
|
*/
|
|
939
1065
|
processBuffer( buffer ) {
|
|
940
1066
|
|
|
@@ -952,11 +1078,11 @@ class GLTFWriter {
|
|
|
952
1078
|
|
|
953
1079
|
/**
|
|
954
1080
|
* Process and generate a BufferView
|
|
955
|
-
* @param
|
|
956
|
-
* @param
|
|
957
|
-
* @param
|
|
958
|
-
* @param
|
|
959
|
-
* @param
|
|
1081
|
+
* @param {BufferAttribute} attribute
|
|
1082
|
+
* @param {number} componentType
|
|
1083
|
+
* @param {number} start
|
|
1084
|
+
* @param {number} count
|
|
1085
|
+
* @param {number} [target] Target usage of the BufferView
|
|
960
1086
|
* @return {Object}
|
|
961
1087
|
*/
|
|
962
1088
|
processBufferView( attribute, componentType, start, count, target ) {
|
|
@@ -1110,7 +1236,7 @@ class GLTFWriter {
|
|
|
1110
1236
|
/**
|
|
1111
1237
|
* Process and generate a BufferView from an image Blob.
|
|
1112
1238
|
* @param {Blob} blob
|
|
1113
|
-
* @return {Promise<
|
|
1239
|
+
* @return {Promise<number>} An integer
|
|
1114
1240
|
*/
|
|
1115
1241
|
processBufferViewImage( blob ) {
|
|
1116
1242
|
|
|
@@ -1144,11 +1270,11 @@ class GLTFWriter {
|
|
|
1144
1270
|
|
|
1145
1271
|
/**
|
|
1146
1272
|
* Process attribute to generate an accessor
|
|
1147
|
-
* @param
|
|
1148
|
-
* @param
|
|
1149
|
-
* @param
|
|
1150
|
-
* @param
|
|
1151
|
-
* @return {
|
|
1273
|
+
* @param {BufferAttribute} attribute Attribute to process
|
|
1274
|
+
* @param {?BufferGeometry} [geometry] Geometry used for truncated draw range
|
|
1275
|
+
* @param {number} [start=0]
|
|
1276
|
+
* @param {number} [count=Infinity]
|
|
1277
|
+
* @return {?number} Index of the processed accessor on the "accessors" array
|
|
1152
1278
|
*/
|
|
1153
1279
|
processAccessor( attribute, geometry, start, count ) {
|
|
1154
1280
|
|
|
@@ -1242,11 +1368,11 @@ class GLTFWriter {
|
|
|
1242
1368
|
|
|
1243
1369
|
/**
|
|
1244
1370
|
* Process image
|
|
1245
|
-
* @param
|
|
1246
|
-
* @param
|
|
1247
|
-
* @param
|
|
1248
|
-
* @param
|
|
1249
|
-
* @return {
|
|
1371
|
+
* @param {Image} image to process
|
|
1372
|
+
* @param {number} format Identifier of the format (RGBAFormat)
|
|
1373
|
+
* @param {boolean} flipY before writing out the image
|
|
1374
|
+
* @param {string} mimeType export format
|
|
1375
|
+
* @return {number} Index of the processed texture in the "images" array
|
|
1250
1376
|
*/
|
|
1251
1377
|
processImage( image, format, flipY, mimeType = 'image/png' ) {
|
|
1252
1378
|
|
|
@@ -1346,25 +1472,7 @@ class GLTFWriter {
|
|
|
1346
1472
|
|
|
1347
1473
|
} else {
|
|
1348
1474
|
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
imageDef.uri = canvas.toDataURL( mimeType );
|
|
1352
|
-
|
|
1353
|
-
} else {
|
|
1354
|
-
|
|
1355
|
-
pending.push(
|
|
1356
|
-
|
|
1357
|
-
getToBlobPromise( canvas, mimeType )
|
|
1358
|
-
.then( blob => new FileReader().readAsDataURL( blob ) )
|
|
1359
|
-
.then( dataURL => {
|
|
1360
|
-
|
|
1361
|
-
imageDef.uri = dataURL;
|
|
1362
|
-
|
|
1363
|
-
} )
|
|
1364
|
-
|
|
1365
|
-
);
|
|
1366
|
-
|
|
1367
|
-
}
|
|
1475
|
+
imageDef.uri = ImageUtils.getDataURL( canvas, mimeType );
|
|
1368
1476
|
|
|
1369
1477
|
}
|
|
1370
1478
|
|
|
@@ -1382,8 +1490,8 @@ class GLTFWriter {
|
|
|
1382
1490
|
|
|
1383
1491
|
/**
|
|
1384
1492
|
* Process sampler
|
|
1385
|
-
* @param
|
|
1386
|
-
* @return {
|
|
1493
|
+
* @param {Texture} map Texture to process
|
|
1494
|
+
* @return {number} Index of the processed texture in the "samplers" array
|
|
1387
1495
|
*/
|
|
1388
1496
|
processSampler( map ) {
|
|
1389
1497
|
|
|
@@ -1404,10 +1512,10 @@ class GLTFWriter {
|
|
|
1404
1512
|
|
|
1405
1513
|
/**
|
|
1406
1514
|
* Process texture
|
|
1407
|
-
* @param
|
|
1408
|
-
* @return {
|
|
1515
|
+
* @param {Texture} map Map to process
|
|
1516
|
+
* @return {Promise<number>} Index of the processed texture in the "textures" array
|
|
1409
1517
|
*/
|
|
1410
|
-
|
|
1518
|
+
async processTextureAsync( map ) {
|
|
1411
1519
|
|
|
1412
1520
|
const writer = this;
|
|
1413
1521
|
const options = writer.options;
|
|
@@ -1433,7 +1541,7 @@ class GLTFWriter {
|
|
|
1433
1541
|
// make non-readable textures (e.g. CompressedTexture) readable by blitting them into a new texture
|
|
1434
1542
|
if ( map instanceof CompressedTexture ) {
|
|
1435
1543
|
|
|
1436
|
-
map =
|
|
1544
|
+
map = await this.decompressTextureAsync( map, options.maxTextureSize );
|
|
1437
1545
|
|
|
1438
1546
|
}
|
|
1439
1547
|
|
|
@@ -1448,9 +1556,9 @@ class GLTFWriter {
|
|
|
1448
1556
|
|
|
1449
1557
|
if ( map.name ) textureDef.name = map.name;
|
|
1450
1558
|
|
|
1451
|
-
this.
|
|
1559
|
+
await this._invokeAllAsync( async function ( ext ) {
|
|
1452
1560
|
|
|
1453
|
-
ext.writeTexture && ext.writeTexture( map, textureDef );
|
|
1561
|
+
ext.writeTexture && await ext.writeTexture( map, textureDef );
|
|
1454
1562
|
|
|
1455
1563
|
} );
|
|
1456
1564
|
|
|
@@ -1462,10 +1570,10 @@ class GLTFWriter {
|
|
|
1462
1570
|
|
|
1463
1571
|
/**
|
|
1464
1572
|
* Process material
|
|
1465
|
-
* @param
|
|
1466
|
-
* @return {
|
|
1573
|
+
* @param {THREE.Material} material Material to process
|
|
1574
|
+
* @return {Promise<?number>} Index of the processed material in the "materials" array
|
|
1467
1575
|
*/
|
|
1468
|
-
|
|
1576
|
+
async processMaterialAsync( material ) {
|
|
1469
1577
|
|
|
1470
1578
|
const cache = this.cache;
|
|
1471
1579
|
const json = this.json;
|
|
@@ -1506,8 +1614,8 @@ class GLTFWriter {
|
|
|
1506
1614
|
|
|
1507
1615
|
} else {
|
|
1508
1616
|
|
|
1509
|
-
materialDef.pbrMetallicRoughness.metallicFactor = 0
|
|
1510
|
-
materialDef.pbrMetallicRoughness.roughnessFactor =
|
|
1617
|
+
materialDef.pbrMetallicRoughness.metallicFactor = 0;
|
|
1618
|
+
materialDef.pbrMetallicRoughness.roughnessFactor = 1;
|
|
1511
1619
|
|
|
1512
1620
|
}
|
|
1513
1621
|
|
|
@@ -1516,11 +1624,11 @@ class GLTFWriter {
|
|
|
1516
1624
|
const roughnessMap = material.roughnessMap?.image ? material.roughnessMap : undefined;
|
|
1517
1625
|
if ( metalnessMap || roughnessMap ) {
|
|
1518
1626
|
|
|
1519
|
-
const metalRoughTexture = this.
|
|
1627
|
+
const metalRoughTexture = await this.buildMetalRoughTextureAsync( metalnessMap, roughnessMap );
|
|
1520
1628
|
|
|
1521
1629
|
const metalRoughMapDef = {
|
|
1522
|
-
index: this.
|
|
1523
|
-
|
|
1630
|
+
index: await this.processTextureAsync( metalRoughTexture ),
|
|
1631
|
+
texCoord: metalRoughTexture.channel
|
|
1524
1632
|
};
|
|
1525
1633
|
this.applyTextureTransform( metalRoughMapDef, metalRoughTexture );
|
|
1526
1634
|
materialDef.pbrMetallicRoughness.metallicRoughnessTexture = metalRoughMapDef;
|
|
@@ -1531,7 +1639,7 @@ class GLTFWriter {
|
|
|
1531
1639
|
if ( material.map ) {
|
|
1532
1640
|
|
|
1533
1641
|
const baseColorMapDef = {
|
|
1534
|
-
index: this.
|
|
1642
|
+
index: await this.processTextureAsync( material.map ),
|
|
1535
1643
|
texCoord: material.map.channel
|
|
1536
1644
|
};
|
|
1537
1645
|
this.applyTextureTransform( baseColorMapDef, material.map );
|
|
@@ -1554,7 +1662,7 @@ class GLTFWriter {
|
|
|
1554
1662
|
if ( material.emissiveMap?.image ) {
|
|
1555
1663
|
|
|
1556
1664
|
const emissiveMapDef = {
|
|
1557
|
-
index: this.
|
|
1665
|
+
index: await this.processTextureAsync( material.emissiveMap ),
|
|
1558
1666
|
texCoord: material.emissiveMap.channel
|
|
1559
1667
|
};
|
|
1560
1668
|
this.applyTextureTransform( emissiveMapDef, material.emissiveMap );
|
|
@@ -1568,7 +1676,7 @@ class GLTFWriter {
|
|
|
1568
1676
|
if ( material.normalMap?.image ) {
|
|
1569
1677
|
|
|
1570
1678
|
const normalMapDef = {
|
|
1571
|
-
index: this.
|
|
1679
|
+
index: await this.processTextureAsync( material.normalMap ),
|
|
1572
1680
|
texCoord: material.normalMap.channel
|
|
1573
1681
|
};
|
|
1574
1682
|
|
|
@@ -1589,7 +1697,7 @@ class GLTFWriter {
|
|
|
1589
1697
|
if ( material.aoMap?.image ) {
|
|
1590
1698
|
|
|
1591
1699
|
const occlusionMapDef = {
|
|
1592
|
-
index: this.
|
|
1700
|
+
index: await this.processTextureAsync( material.aoMap ),
|
|
1593
1701
|
texCoord: material.aoMap.channel
|
|
1594
1702
|
};
|
|
1595
1703
|
|
|
@@ -1626,9 +1734,9 @@ class GLTFWriter {
|
|
|
1626
1734
|
|
|
1627
1735
|
this.serializeUserData( material, materialDef );
|
|
1628
1736
|
|
|
1629
|
-
this.
|
|
1737
|
+
await this._invokeAllAsync( async function ( ext ) {
|
|
1630
1738
|
|
|
1631
|
-
ext.
|
|
1739
|
+
ext.writeMaterialAsync && await ext.writeMaterialAsync( material, materialDef );
|
|
1632
1740
|
|
|
1633
1741
|
} );
|
|
1634
1742
|
|
|
@@ -1640,10 +1748,10 @@ class GLTFWriter {
|
|
|
1640
1748
|
|
|
1641
1749
|
/**
|
|
1642
1750
|
* Process mesh
|
|
1643
|
-
* @param
|
|
1644
|
-
* @return {
|
|
1751
|
+
* @param {THREE.Mesh} mesh Mesh to process
|
|
1752
|
+
* @return {Promise<?number>} Index of the processed mesh in the "meshes" array
|
|
1645
1753
|
*/
|
|
1646
|
-
|
|
1754
|
+
async processMeshAsync( mesh ) {
|
|
1647
1755
|
|
|
1648
1756
|
const beforeWriteArgs = { keep: true }
|
|
1649
1757
|
|
|
@@ -1761,7 +1869,9 @@ class GLTFWriter {
|
|
|
1761
1869
|
|
|
1762
1870
|
}
|
|
1763
1871
|
|
|
1764
|
-
//
|
|
1872
|
+
// Enforce glTF vertex attribute requirements:
|
|
1873
|
+
// - JOINTS_0 must be UNSIGNED_BYTE or UNSIGNED_SHORT
|
|
1874
|
+
// - Only custom attributes may be INT or UNSIGNED_INT
|
|
1765
1875
|
modifiedAttribute = null;
|
|
1766
1876
|
const array = attribute.array;
|
|
1767
1877
|
|
|
@@ -1770,7 +1880,12 @@ class GLTFWriter {
|
|
|
1770
1880
|
! ( array instanceof Uint8Array ) ) {
|
|
1771
1881
|
|
|
1772
1882
|
console.warn( 'GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.' );
|
|
1773
|
-
modifiedAttribute =
|
|
1883
|
+
modifiedAttribute = GLTFExporter.Utils.toTypedBufferAttribute( attribute, Uint16Array );
|
|
1884
|
+
|
|
1885
|
+
} else if ( ( array instanceof Uint32Array || array instanceof Int32Array ) && ! attributeName.startsWith( '_' ) ) {
|
|
1886
|
+
|
|
1887
|
+
console.warn( `GLTFExporter: Attribute "${ attributeName }" converted to type FLOAT.` );
|
|
1888
|
+
modifiedAttribute = GLTFExporter.Utils.toTypedBufferAttribute( attribute, Float32Array );
|
|
1774
1889
|
|
|
1775
1890
|
}
|
|
1776
1891
|
|
|
@@ -1958,7 +2073,7 @@ class GLTFWriter {
|
|
|
1958
2073
|
|
|
1959
2074
|
}
|
|
1960
2075
|
|
|
1961
|
-
const material = this.
|
|
2076
|
+
const material = await this.processMaterialAsync( materials[ groups[ i ].materialIndex ] );
|
|
1962
2077
|
|
|
1963
2078
|
if ( material !== null ) primitive.material = material;
|
|
1964
2079
|
|
|
@@ -1976,7 +2091,7 @@ class GLTFWriter {
|
|
|
1976
2091
|
|
|
1977
2092
|
if ( ! json.meshes ) json.meshes = [];
|
|
1978
2093
|
|
|
1979
|
-
this.
|
|
2094
|
+
await this._invokeAllAsync( function ( ext ) {
|
|
1980
2095
|
|
|
1981
2096
|
ext.writeMesh && ext.writeMesh( mesh, meshDef );
|
|
1982
2097
|
|
|
@@ -2052,8 +2167,8 @@ class GLTFWriter {
|
|
|
2052
2167
|
|
|
2053
2168
|
/**
|
|
2054
2169
|
* Process camera
|
|
2055
|
-
* @param
|
|
2056
|
-
* @return {
|
|
2170
|
+
* @param {THREE.Camera} camera Camera to process
|
|
2171
|
+
* @return {number} Index of the processed mesh in the "camera" array
|
|
2057
2172
|
*/
|
|
2058
2173
|
processCamera( camera ) {
|
|
2059
2174
|
|
|
@@ -2102,7 +2217,7 @@ class GLTFWriter {
|
|
|
2102
2217
|
*
|
|
2103
2218
|
* @param {THREE.AnimationClip} clip
|
|
2104
2219
|
* @param {THREE.Object3D} root
|
|
2105
|
-
* @return {number
|
|
2220
|
+
* @return {?number}
|
|
2106
2221
|
*/
|
|
2107
2222
|
processAnimation( clip, root ) {
|
|
2108
2223
|
|
|
@@ -2196,11 +2311,15 @@ class GLTFWriter {
|
|
|
2196
2311
|
|
|
2197
2312
|
}
|
|
2198
2313
|
|
|
2199
|
-
|
|
2314
|
+
const animationDef = {
|
|
2200
2315
|
name: clip.name || 'clip_' + json.animations.length,
|
|
2201
2316
|
samplers: samplers,
|
|
2202
2317
|
channels: channels
|
|
2203
|
-
}
|
|
2318
|
+
};
|
|
2319
|
+
|
|
2320
|
+
this.serializeUserData( clip, animationDef );
|
|
2321
|
+
|
|
2322
|
+
json.animations.push( animationDef );
|
|
2204
2323
|
|
|
2205
2324
|
return json.animations.length - 1;
|
|
2206
2325
|
|
|
@@ -2208,7 +2327,7 @@ class GLTFWriter {
|
|
|
2208
2327
|
|
|
2209
2328
|
/**
|
|
2210
2329
|
* @param {THREE.Object3D} object
|
|
2211
|
-
* @return {number
|
|
2330
|
+
* @return {?number}
|
|
2212
2331
|
*/
|
|
2213
2332
|
processSkin( object ) {
|
|
2214
2333
|
|
|
@@ -2253,10 +2372,10 @@ class GLTFWriter {
|
|
|
2253
2372
|
|
|
2254
2373
|
/**
|
|
2255
2374
|
* Process Object3D node
|
|
2256
|
-
* @param
|
|
2257
|
-
* @return {
|
|
2375
|
+
* @param {THREE.Object3D} object Object3D to processNodeAsync
|
|
2376
|
+
* @return {Promise<number>} Index of the node in the nodes list
|
|
2258
2377
|
*/
|
|
2259
|
-
|
|
2378
|
+
async processNodeAsync( object ) {
|
|
2260
2379
|
|
|
2261
2380
|
const beforeWriteArgs = { keep: true }
|
|
2262
2381
|
|
|
@@ -2278,6 +2397,13 @@ class GLTFWriter {
|
|
|
2278
2397
|
|
|
2279
2398
|
if ( ! json.nodes ) json.nodes = [];
|
|
2280
2399
|
|
|
2400
|
+
// Handle pivot by creating a container node
|
|
2401
|
+
if ( object.pivot !== null ) {
|
|
2402
|
+
|
|
2403
|
+
return await this._processNodeWithPivotAsync( object );
|
|
2404
|
+
|
|
2405
|
+
}
|
|
2406
|
+
|
|
2281
2407
|
const nodeDef = {};
|
|
2282
2408
|
|
|
2283
2409
|
if ( options.trs ) {
|
|
@@ -2327,7 +2453,7 @@ class GLTFWriter {
|
|
|
2327
2453
|
|
|
2328
2454
|
if ( object.isMesh || object.isLine || object.isPoints ) {
|
|
2329
2455
|
|
|
2330
|
-
const meshIndex = this.
|
|
2456
|
+
const meshIndex = await this.processMeshAsync( object );
|
|
2331
2457
|
|
|
2332
2458
|
if ( meshIndex !== null ) nodeDef.mesh = meshIndex;
|
|
2333
2459
|
|
|
@@ -2339,6 +2465,9 @@ class GLTFWriter {
|
|
|
2339
2465
|
|
|
2340
2466
|
if ( object.isSkinnedMesh ) this.skins.push( object );
|
|
2341
2467
|
|
|
2468
|
+
const nodeIndex = json.nodes.push( nodeDef ) - 1;
|
|
2469
|
+
nodeMap.set( object, nodeIndex );
|
|
2470
|
+
|
|
2342
2471
|
if ( object.children.length > 0 ) {
|
|
2343
2472
|
|
|
2344
2473
|
const children = [];
|
|
@@ -2349,9 +2478,9 @@ class GLTFWriter {
|
|
|
2349
2478
|
|
|
2350
2479
|
if ( child.visible || options.onlyVisible === false ) {
|
|
2351
2480
|
|
|
2352
|
-
const
|
|
2481
|
+
const childNodeIndex = await this.processNodeAsync( child );
|
|
2353
2482
|
|
|
2354
|
-
if (
|
|
2483
|
+
if ( childNodeIndex !== null ) children.push( childNodeIndex );
|
|
2355
2484
|
|
|
2356
2485
|
}
|
|
2357
2486
|
|
|
@@ -2361,23 +2490,141 @@ class GLTFWriter {
|
|
|
2361
2490
|
|
|
2362
2491
|
}
|
|
2363
2492
|
|
|
2364
|
-
this.
|
|
2493
|
+
await this._invokeAllAsync( function ( ext ) {
|
|
2365
2494
|
|
|
2366
2495
|
ext.writeNode && ext.writeNode( object, nodeDef );
|
|
2367
2496
|
|
|
2368
2497
|
} );
|
|
2369
2498
|
|
|
2370
|
-
const nodeIndex = json.nodes.push( nodeDef ) - 1;
|
|
2371
|
-
nodeMap.set( object, nodeIndex );
|
|
2372
2499
|
return nodeIndex;
|
|
2373
2500
|
|
|
2374
2501
|
}
|
|
2375
2502
|
|
|
2503
|
+
/**
|
|
2504
|
+
* Process Object3D node with pivot using container approach
|
|
2505
|
+
* @param {THREE.Object3D} object Object3D with pivot
|
|
2506
|
+
* @return {Promise<number>} Index of the container node
|
|
2507
|
+
*/
|
|
2508
|
+
async _processNodeWithPivotAsync( object ) {
|
|
2509
|
+
|
|
2510
|
+
const json = this.json;
|
|
2511
|
+
const options = this.options;
|
|
2512
|
+
const nodeMap = this.nodeMap;
|
|
2513
|
+
|
|
2514
|
+
const pivot = object.pivot;
|
|
2515
|
+
|
|
2516
|
+
// Container node: holds position + pivot offset, rotation, scale
|
|
2517
|
+
// Animations will target this node
|
|
2518
|
+
const containerDef = {};
|
|
2519
|
+
|
|
2520
|
+
const rotation = object.quaternion.toArray();
|
|
2521
|
+
const position = [
|
|
2522
|
+
object.position.x + pivot.x,
|
|
2523
|
+
object.position.y + pivot.y,
|
|
2524
|
+
object.position.z + pivot.z
|
|
2525
|
+
];
|
|
2526
|
+
const scale = object.scale.toArray();
|
|
2527
|
+
|
|
2528
|
+
if ( ! equalArray( rotation, [ 0, 0, 0, 1 ] ) ) {
|
|
2529
|
+
|
|
2530
|
+
containerDef.rotation = rotation;
|
|
2531
|
+
|
|
2532
|
+
}
|
|
2533
|
+
|
|
2534
|
+
if ( ! equalArray( position, [ 0, 0, 0 ] ) ) {
|
|
2535
|
+
|
|
2536
|
+
containerDef.translation = position;
|
|
2537
|
+
|
|
2538
|
+
}
|
|
2539
|
+
|
|
2540
|
+
if ( ! equalArray( scale, [ 1, 1, 1 ] ) ) {
|
|
2541
|
+
|
|
2542
|
+
containerDef.scale = scale;
|
|
2543
|
+
|
|
2544
|
+
}
|
|
2545
|
+
|
|
2546
|
+
// Store pivot in extras for round-trip reconstruction
|
|
2547
|
+
containerDef.extras = { pivot: pivot.toArray() };
|
|
2548
|
+
|
|
2549
|
+
if ( object.name !== '' ) containerDef.name = String( object.name );
|
|
2550
|
+
|
|
2551
|
+
this.serializeUserData( object, containerDef );
|
|
2552
|
+
|
|
2553
|
+
const containerIndex = json.nodes.push( containerDef ) - 1;
|
|
2554
|
+
|
|
2555
|
+
// Map original object to container so animations target it
|
|
2556
|
+
nodeMap.set( object, containerIndex );
|
|
2557
|
+
|
|
2558
|
+
// Child node: holds mesh with -pivot offset
|
|
2559
|
+
const childDef = {};
|
|
2560
|
+
|
|
2561
|
+
const childPosition = [ - pivot.x, - pivot.y, - pivot.z ];
|
|
2562
|
+
|
|
2563
|
+
if ( ! equalArray( childPosition, [ 0, 0, 0 ] ) ) {
|
|
2564
|
+
|
|
2565
|
+
childDef.translation = childPosition;
|
|
2566
|
+
|
|
2567
|
+
}
|
|
2568
|
+
|
|
2569
|
+
if ( object.isMesh || object.isLine || object.isPoints ) {
|
|
2570
|
+
|
|
2571
|
+
const meshIndex = await this.processMeshAsync( object );
|
|
2572
|
+
|
|
2573
|
+
if ( meshIndex !== null ) childDef.mesh = meshIndex;
|
|
2574
|
+
|
|
2575
|
+
} else if ( object.isCamera ) {
|
|
2576
|
+
|
|
2577
|
+
childDef.camera = this.processCamera( object );
|
|
2578
|
+
|
|
2579
|
+
}
|
|
2580
|
+
|
|
2581
|
+
if ( object.isSkinnedMesh ) this.skins.push( object );
|
|
2582
|
+
|
|
2583
|
+
const childIndex = json.nodes.push( childDef ) - 1;
|
|
2584
|
+
|
|
2585
|
+
// Build children array for container
|
|
2586
|
+
const containerChildren = [ childIndex ];
|
|
2587
|
+
|
|
2588
|
+
// Process object's children as children of the child node
|
|
2589
|
+
if ( object.children.length > 0 ) {
|
|
2590
|
+
|
|
2591
|
+
const grandchildren = [];
|
|
2592
|
+
|
|
2593
|
+
for ( let i = 0, l = object.children.length; i < l; i ++ ) {
|
|
2594
|
+
|
|
2595
|
+
const child = object.children[ i ];
|
|
2596
|
+
|
|
2597
|
+
if ( child.visible || options.onlyVisible === false ) {
|
|
2598
|
+
|
|
2599
|
+
const childNodeIndex = await this.processNodeAsync( child );
|
|
2600
|
+
|
|
2601
|
+
if ( childNodeIndex !== null ) grandchildren.push( childNodeIndex );
|
|
2602
|
+
|
|
2603
|
+
}
|
|
2604
|
+
|
|
2605
|
+
}
|
|
2606
|
+
|
|
2607
|
+
if ( grandchildren.length > 0 ) childDef.children = grandchildren;
|
|
2608
|
+
|
|
2609
|
+
}
|
|
2610
|
+
|
|
2611
|
+
containerDef.children = containerChildren;
|
|
2612
|
+
|
|
2613
|
+
await this._invokeAllAsync( function ( ext ) {
|
|
2614
|
+
|
|
2615
|
+
ext.writeNode && ext.writeNode( object, containerDef );
|
|
2616
|
+
|
|
2617
|
+
} );
|
|
2618
|
+
|
|
2619
|
+
return containerIndex;
|
|
2620
|
+
|
|
2621
|
+
}
|
|
2622
|
+
|
|
2376
2623
|
/**
|
|
2377
2624
|
* Process Scene
|
|
2378
|
-
* @param
|
|
2625
|
+
* @param {Scene} scene Scene to process
|
|
2379
2626
|
*/
|
|
2380
|
-
|
|
2627
|
+
async processSceneAsync( scene ) {
|
|
2381
2628
|
|
|
2382
2629
|
const json = this.json;
|
|
2383
2630
|
const options = this.options;
|
|
@@ -2403,7 +2650,7 @@ class GLTFWriter {
|
|
|
2403
2650
|
|
|
2404
2651
|
if ( child.visible || options.onlyVisible === false ) {
|
|
2405
2652
|
|
|
2406
|
-
const nodeIndex = this.
|
|
2653
|
+
const nodeIndex = await this.processNodeAsync( child );
|
|
2407
2654
|
|
|
2408
2655
|
if ( nodeIndex !== null ) nodes.push( nodeIndex );
|
|
2409
2656
|
|
|
@@ -2419,9 +2666,9 @@ class GLTFWriter {
|
|
|
2419
2666
|
|
|
2420
2667
|
/**
|
|
2421
2668
|
* Creates a Scene to hold a list of objects and parse it
|
|
2422
|
-
* @param
|
|
2669
|
+
* @param {Array<THREE.Object3D>} objects List of objects to process
|
|
2423
2670
|
*/
|
|
2424
|
-
|
|
2671
|
+
async processObjectsAsync( objects ) {
|
|
2425
2672
|
|
|
2426
2673
|
const scene = new Scene();
|
|
2427
2674
|
scene.name = 'AuxScene';
|
|
@@ -2434,20 +2681,20 @@ class GLTFWriter {
|
|
|
2434
2681
|
|
|
2435
2682
|
}
|
|
2436
2683
|
|
|
2437
|
-
this.
|
|
2684
|
+
await this.processSceneAsync( scene );
|
|
2438
2685
|
|
|
2439
2686
|
}
|
|
2440
2687
|
|
|
2441
2688
|
/**
|
|
2442
2689
|
* @param {THREE.Object3D|Array<THREE.Object3D>} input
|
|
2443
2690
|
*/
|
|
2444
|
-
|
|
2691
|
+
async processInputAsync( input ) {
|
|
2445
2692
|
|
|
2446
2693
|
const options = this.options;
|
|
2447
2694
|
|
|
2448
2695
|
input = input instanceof Array ? input : [ input ];
|
|
2449
2696
|
|
|
2450
|
-
this.
|
|
2697
|
+
await this._invokeAllAsync( function ( ext ) {
|
|
2451
2698
|
|
|
2452
2699
|
ext.beforeParse && ext.beforeParse( input );
|
|
2453
2700
|
|
|
@@ -2459,7 +2706,7 @@ class GLTFWriter {
|
|
|
2459
2706
|
|
|
2460
2707
|
if ( input[ i ] instanceof Scene ) {
|
|
2461
2708
|
|
|
2462
|
-
this.
|
|
2709
|
+
await this.processSceneAsync( input[ i ] );
|
|
2463
2710
|
|
|
2464
2711
|
} else {
|
|
2465
2712
|
|
|
@@ -2469,7 +2716,11 @@ class GLTFWriter {
|
|
|
2469
2716
|
|
|
2470
2717
|
}
|
|
2471
2718
|
|
|
2472
|
-
if ( objectsWithoutScene.length > 0 )
|
|
2719
|
+
if ( objectsWithoutScene.length > 0 ) {
|
|
2720
|
+
|
|
2721
|
+
await this.processObjectsAsync( objectsWithoutScene );
|
|
2722
|
+
|
|
2723
|
+
}
|
|
2473
2724
|
|
|
2474
2725
|
for ( let i = 0; i < this.skins.length; ++ i ) {
|
|
2475
2726
|
|
|
@@ -2483,7 +2734,7 @@ class GLTFWriter {
|
|
|
2483
2734
|
|
|
2484
2735
|
}
|
|
2485
2736
|
|
|
2486
|
-
this.
|
|
2737
|
+
await this._invokeAllAsync( function ( ext ) {
|
|
2487
2738
|
|
|
2488
2739
|
ext.afterParse && ext.afterParse( input );
|
|
2489
2740
|
|
|
@@ -2491,11 +2742,11 @@ class GLTFWriter {
|
|
|
2491
2742
|
|
|
2492
2743
|
}
|
|
2493
2744
|
|
|
2494
|
-
|
|
2745
|
+
async _invokeAllAsync( func ) {
|
|
2495
2746
|
|
|
2496
2747
|
for ( let i = 0, il = this.plugins.length; i < il; i ++ ) {
|
|
2497
2748
|
|
|
2498
|
-
func( this.plugins[ i ] );
|
|
2749
|
+
await func( this.plugins[ i ] );
|
|
2499
2750
|
|
|
2500
2751
|
}
|
|
2501
2752
|
|
|
@@ -2507,6 +2758,8 @@ class GLTFWriter {
|
|
|
2507
2758
|
* Punctual Lights Extension
|
|
2508
2759
|
*
|
|
2509
2760
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_lights_punctual
|
|
2761
|
+
*
|
|
2762
|
+
* @private
|
|
2510
2763
|
*/
|
|
2511
2764
|
class GLTFLightExtension {
|
|
2512
2765
|
|
|
@@ -2602,6 +2855,8 @@ class GLTFLightExtension {
|
|
|
2602
2855
|
* Unlit Materials Extension
|
|
2603
2856
|
*
|
|
2604
2857
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit
|
|
2858
|
+
*
|
|
2859
|
+
* @private
|
|
2605
2860
|
*/
|
|
2606
2861
|
class GLTFMaterialsUnlitExtension {
|
|
2607
2862
|
|
|
@@ -2612,7 +2867,7 @@ class GLTFMaterialsUnlitExtension {
|
|
|
2612
2867
|
|
|
2613
2868
|
}
|
|
2614
2869
|
|
|
2615
|
-
|
|
2870
|
+
async writeMaterialAsync( material, materialDef ) {
|
|
2616
2871
|
|
|
2617
2872
|
if ( ! material.isMeshBasicMaterial ) return;
|
|
2618
2873
|
|
|
@@ -2635,6 +2890,8 @@ class GLTFMaterialsUnlitExtension {
|
|
|
2635
2890
|
* Clearcoat Materials Extension
|
|
2636
2891
|
*
|
|
2637
2892
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_clearcoat
|
|
2893
|
+
*
|
|
2894
|
+
* @private
|
|
2638
2895
|
*/
|
|
2639
2896
|
class GLTFMaterialsClearcoatExtension {
|
|
2640
2897
|
|
|
@@ -2645,7 +2902,7 @@ class GLTFMaterialsClearcoatExtension {
|
|
|
2645
2902
|
|
|
2646
2903
|
}
|
|
2647
2904
|
|
|
2648
|
-
|
|
2905
|
+
async writeMaterialAsync( material, materialDef ) {
|
|
2649
2906
|
|
|
2650
2907
|
if ( ! material.isMeshPhysicalMaterial || material.clearcoat === 0 ) return;
|
|
2651
2908
|
|
|
@@ -2659,7 +2916,7 @@ class GLTFMaterialsClearcoatExtension {
|
|
|
2659
2916
|
if ( material.clearcoatMap ) {
|
|
2660
2917
|
|
|
2661
2918
|
const clearcoatMapDef = {
|
|
2662
|
-
index: writer.
|
|
2919
|
+
index: await writer.processTextureAsync( material.clearcoatMap ),
|
|
2663
2920
|
texCoord: material.clearcoatMap.channel
|
|
2664
2921
|
};
|
|
2665
2922
|
writer.applyTextureTransform( clearcoatMapDef, material.clearcoatMap );
|
|
@@ -2672,7 +2929,7 @@ class GLTFMaterialsClearcoatExtension {
|
|
|
2672
2929
|
if ( material.clearcoatRoughnessMap ) {
|
|
2673
2930
|
|
|
2674
2931
|
const clearcoatRoughnessMapDef = {
|
|
2675
|
-
index: writer.
|
|
2932
|
+
index: await writer.processTextureAsync( material.clearcoatRoughnessMap ),
|
|
2676
2933
|
texCoord: material.clearcoatRoughnessMap.channel
|
|
2677
2934
|
};
|
|
2678
2935
|
writer.applyTextureTransform( clearcoatRoughnessMapDef, material.clearcoatRoughnessMap );
|
|
@@ -2683,7 +2940,7 @@ class GLTFMaterialsClearcoatExtension {
|
|
|
2683
2940
|
if ( material.clearcoatNormalMap ) {
|
|
2684
2941
|
|
|
2685
2942
|
const clearcoatNormalMapDef = {
|
|
2686
|
-
index: writer.
|
|
2943
|
+
index: await writer.processTextureAsync( material.clearcoatNormalMap ),
|
|
2687
2944
|
texCoord: material.clearcoatNormalMap.channel
|
|
2688
2945
|
};
|
|
2689
2946
|
|
|
@@ -2708,6 +2965,8 @@ class GLTFMaterialsClearcoatExtension {
|
|
|
2708
2965
|
* Materials dispersion Extension
|
|
2709
2966
|
*
|
|
2710
2967
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_dispersion
|
|
2968
|
+
*
|
|
2969
|
+
* @private
|
|
2711
2970
|
*/
|
|
2712
2971
|
class GLTFMaterialsDispersionExtension {
|
|
2713
2972
|
|
|
@@ -2718,7 +2977,7 @@ class GLTFMaterialsDispersionExtension {
|
|
|
2718
2977
|
|
|
2719
2978
|
}
|
|
2720
2979
|
|
|
2721
|
-
|
|
2980
|
+
async writeMaterialAsync( material, materialDef ) {
|
|
2722
2981
|
|
|
2723
2982
|
if ( ! material.isMeshPhysicalMaterial || material.dispersion === 0 ) return;
|
|
2724
2983
|
|
|
@@ -2742,6 +3001,8 @@ class GLTFMaterialsDispersionExtension {
|
|
|
2742
3001
|
* Iridescence Materials Extension
|
|
2743
3002
|
*
|
|
2744
3003
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_iridescence
|
|
3004
|
+
*
|
|
3005
|
+
* @private
|
|
2745
3006
|
*/
|
|
2746
3007
|
class GLTFMaterialsIridescenceExtension {
|
|
2747
3008
|
|
|
@@ -2752,7 +3013,7 @@ class GLTFMaterialsIridescenceExtension {
|
|
|
2752
3013
|
|
|
2753
3014
|
}
|
|
2754
3015
|
|
|
2755
|
-
|
|
3016
|
+
async writeMaterialAsync( material, materialDef ) {
|
|
2756
3017
|
|
|
2757
3018
|
if ( ! material.isMeshPhysicalMaterial || material.iridescence === 0 ) return;
|
|
2758
3019
|
|
|
@@ -2766,7 +3027,7 @@ class GLTFMaterialsIridescenceExtension {
|
|
|
2766
3027
|
if ( material.iridescenceMap ) {
|
|
2767
3028
|
|
|
2768
3029
|
const iridescenceMapDef = {
|
|
2769
|
-
index: writer.
|
|
3030
|
+
index: await writer.processTextureAsync( material.iridescenceMap ),
|
|
2770
3031
|
texCoord: material.iridescenceMap.channel
|
|
2771
3032
|
};
|
|
2772
3033
|
writer.applyTextureTransform( iridescenceMapDef, material.iridescenceMap );
|
|
@@ -2781,7 +3042,7 @@ class GLTFMaterialsIridescenceExtension {
|
|
|
2781
3042
|
if ( material.iridescenceThicknessMap ) {
|
|
2782
3043
|
|
|
2783
3044
|
const iridescenceThicknessMapDef = {
|
|
2784
|
-
index: writer.
|
|
3045
|
+
index: await writer.processTextureAsync( material.iridescenceThicknessMap ),
|
|
2785
3046
|
texCoord: material.iridescenceThicknessMap.channel
|
|
2786
3047
|
};
|
|
2787
3048
|
writer.applyTextureTransform( iridescenceThicknessMapDef, material.iridescenceThicknessMap );
|
|
@@ -2802,6 +3063,8 @@ class GLTFMaterialsIridescenceExtension {
|
|
|
2802
3063
|
* Transmission Materials Extension
|
|
2803
3064
|
*
|
|
2804
3065
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_transmission
|
|
3066
|
+
*
|
|
3067
|
+
* @private
|
|
2805
3068
|
*/
|
|
2806
3069
|
class GLTFMaterialsTransmissionExtension {
|
|
2807
3070
|
|
|
@@ -2812,7 +3075,7 @@ class GLTFMaterialsTransmissionExtension {
|
|
|
2812
3075
|
|
|
2813
3076
|
}
|
|
2814
3077
|
|
|
2815
|
-
|
|
3078
|
+
async writeMaterialAsync( material, materialDef ) {
|
|
2816
3079
|
|
|
2817
3080
|
if ( ! material.isMeshPhysicalMaterial || material.transmission === 0 ) return;
|
|
2818
3081
|
|
|
@@ -2826,7 +3089,7 @@ class GLTFMaterialsTransmissionExtension {
|
|
|
2826
3089
|
if ( material.transmissionMap ) {
|
|
2827
3090
|
|
|
2828
3091
|
const transmissionMapDef = {
|
|
2829
|
-
index: writer.
|
|
3092
|
+
index: await writer.processTextureAsync( material.transmissionMap ),
|
|
2830
3093
|
texCoord: material.transmissionMap.channel
|
|
2831
3094
|
};
|
|
2832
3095
|
writer.applyTextureTransform( transmissionMapDef, material.transmissionMap );
|
|
@@ -2847,6 +3110,8 @@ class GLTFMaterialsTransmissionExtension {
|
|
|
2847
3110
|
* Materials Volume Extension
|
|
2848
3111
|
*
|
|
2849
3112
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_volume
|
|
3113
|
+
*
|
|
3114
|
+
* @private
|
|
2850
3115
|
*/
|
|
2851
3116
|
class GLTFMaterialsVolumeExtension {
|
|
2852
3117
|
|
|
@@ -2857,7 +3122,7 @@ class GLTFMaterialsVolumeExtension {
|
|
|
2857
3122
|
|
|
2858
3123
|
}
|
|
2859
3124
|
|
|
2860
|
-
|
|
3125
|
+
async writeMaterialAsync( material, materialDef ) {
|
|
2861
3126
|
|
|
2862
3127
|
if ( ! material.isMeshPhysicalMaterial || material.transmission === 0 ) return;
|
|
2863
3128
|
|
|
@@ -2871,7 +3136,7 @@ class GLTFMaterialsVolumeExtension {
|
|
|
2871
3136
|
if ( material.thicknessMap ) {
|
|
2872
3137
|
|
|
2873
3138
|
const thicknessMapDef = {
|
|
2874
|
-
index: writer.
|
|
3139
|
+
index: await writer.processTextureAsync( material.thicknessMap ),
|
|
2875
3140
|
texCoord: material.thicknessMap.channel
|
|
2876
3141
|
};
|
|
2877
3142
|
writer.applyTextureTransform( thicknessMapDef, material.thicknessMap );
|
|
@@ -2900,6 +3165,8 @@ class GLTFMaterialsVolumeExtension {
|
|
|
2900
3165
|
* Materials ior Extension
|
|
2901
3166
|
*
|
|
2902
3167
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_ior
|
|
3168
|
+
*
|
|
3169
|
+
* @private
|
|
2903
3170
|
*/
|
|
2904
3171
|
class GLTFMaterialsIorExtension {
|
|
2905
3172
|
|
|
@@ -2910,7 +3177,7 @@ class GLTFMaterialsIorExtension {
|
|
|
2910
3177
|
|
|
2911
3178
|
}
|
|
2912
3179
|
|
|
2913
|
-
|
|
3180
|
+
async writeMaterialAsync( material, materialDef ) {
|
|
2914
3181
|
|
|
2915
3182
|
if ( ! material.isMeshPhysicalMaterial || material.ior === 1.5 ) return;
|
|
2916
3183
|
|
|
@@ -2934,6 +3201,8 @@ class GLTFMaterialsIorExtension {
|
|
|
2934
3201
|
* Materials specular Extension
|
|
2935
3202
|
*
|
|
2936
3203
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_specular
|
|
3204
|
+
*
|
|
3205
|
+
* @private
|
|
2937
3206
|
*/
|
|
2938
3207
|
class GLTFMaterialsSpecularExtension {
|
|
2939
3208
|
|
|
@@ -2944,7 +3213,7 @@ class GLTFMaterialsSpecularExtension {
|
|
|
2944
3213
|
|
|
2945
3214
|
}
|
|
2946
3215
|
|
|
2947
|
-
|
|
3216
|
+
async writeMaterialAsync( material, materialDef ) {
|
|
2948
3217
|
|
|
2949
3218
|
if ( ! material.isMeshPhysicalMaterial || ( material.specularIntensity === 1.0 &&
|
|
2950
3219
|
material.specularColor.equals( DEFAULT_SPECULAR_COLOR ) &&
|
|
@@ -2958,7 +3227,7 @@ class GLTFMaterialsSpecularExtension {
|
|
|
2958
3227
|
if ( material.specularIntensityMap ) {
|
|
2959
3228
|
|
|
2960
3229
|
const specularIntensityMapDef = {
|
|
2961
|
-
index: writer.
|
|
3230
|
+
index: await writer.processTextureAsync( material.specularIntensityMap ),
|
|
2962
3231
|
texCoord: material.specularIntensityMap.channel
|
|
2963
3232
|
};
|
|
2964
3233
|
writer.applyTextureTransform( specularIntensityMapDef, material.specularIntensityMap );
|
|
@@ -2969,7 +3238,7 @@ class GLTFMaterialsSpecularExtension {
|
|
|
2969
3238
|
if ( material.specularColorMap ) {
|
|
2970
3239
|
|
|
2971
3240
|
const specularColorMapDef = {
|
|
2972
|
-
index: writer.
|
|
3241
|
+
index: await writer.processTextureAsync( material.specularColorMap ),
|
|
2973
3242
|
texCoord: material.specularColorMap.channel
|
|
2974
3243
|
};
|
|
2975
3244
|
writer.applyTextureTransform( specularColorMapDef, material.specularColorMap );
|
|
@@ -2993,6 +3262,8 @@ class GLTFMaterialsSpecularExtension {
|
|
|
2993
3262
|
* Sheen Materials Extension
|
|
2994
3263
|
*
|
|
2995
3264
|
* Specification: https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_sheen
|
|
3265
|
+
*
|
|
3266
|
+
* @private
|
|
2996
3267
|
*/
|
|
2997
3268
|
class GLTFMaterialsSheenExtension {
|
|
2998
3269
|
|
|
@@ -3003,7 +3274,7 @@ class GLTFMaterialsSheenExtension {
|
|
|
3003
3274
|
|
|
3004
3275
|
}
|
|
3005
3276
|
|
|
3006
|
-
|
|
3277
|
+
async writeMaterialAsync( material, materialDef ) {
|
|
3007
3278
|
|
|
3008
3279
|
if ( ! material.isMeshPhysicalMaterial || material.sheen == 0.0 ) return;
|
|
3009
3280
|
|
|
@@ -3015,7 +3286,7 @@ class GLTFMaterialsSheenExtension {
|
|
|
3015
3286
|
if ( material.sheenRoughnessMap ) {
|
|
3016
3287
|
|
|
3017
3288
|
const sheenRoughnessMapDef = {
|
|
3018
|
-
index: writer.
|
|
3289
|
+
index: await writer.processTextureAsync( material.sheenRoughnessMap ),
|
|
3019
3290
|
texCoord: material.sheenRoughnessMap.channel
|
|
3020
3291
|
};
|
|
3021
3292
|
writer.applyTextureTransform( sheenRoughnessMapDef, material.sheenRoughnessMap );
|
|
@@ -3026,7 +3297,7 @@ class GLTFMaterialsSheenExtension {
|
|
|
3026
3297
|
if ( material.sheenColorMap ) {
|
|
3027
3298
|
|
|
3028
3299
|
const sheenColorMapDef = {
|
|
3029
|
-
index: writer.
|
|
3300
|
+
index: await writer.processTextureAsync( material.sheenColorMap ),
|
|
3030
3301
|
texCoord: material.sheenColorMap.channel
|
|
3031
3302
|
};
|
|
3032
3303
|
writer.applyTextureTransform( sheenColorMapDef, material.sheenColorMap );
|
|
@@ -3050,6 +3321,8 @@ class GLTFMaterialsSheenExtension {
|
|
|
3050
3321
|
* Anisotropy Materials Extension
|
|
3051
3322
|
*
|
|
3052
3323
|
* Specification: https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_anisotropy
|
|
3324
|
+
*
|
|
3325
|
+
* @private
|
|
3053
3326
|
*/
|
|
3054
3327
|
class GLTFMaterialsAnisotropyExtension {
|
|
3055
3328
|
|
|
@@ -3060,7 +3333,7 @@ class GLTFMaterialsAnisotropyExtension {
|
|
|
3060
3333
|
|
|
3061
3334
|
}
|
|
3062
3335
|
|
|
3063
|
-
|
|
3336
|
+
async writeMaterialAsync( material, materialDef ) {
|
|
3064
3337
|
|
|
3065
3338
|
if ( ! material.isMeshPhysicalMaterial || material.anisotropy == 0.0 ) return;
|
|
3066
3339
|
|
|
@@ -3071,7 +3344,7 @@ class GLTFMaterialsAnisotropyExtension {
|
|
|
3071
3344
|
|
|
3072
3345
|
if ( material.anisotropyMap ) {
|
|
3073
3346
|
|
|
3074
|
-
const anisotropyMapDef = { index: writer.
|
|
3347
|
+
const anisotropyMapDef = { index: await writer.processTextureAsync( material.anisotropyMap ) };
|
|
3075
3348
|
writer.applyTextureTransform( anisotropyMapDef, material.anisotropyMap );
|
|
3076
3349
|
extensionDef.anisotropyTexture = anisotropyMapDef;
|
|
3077
3350
|
|
|
@@ -3093,6 +3366,8 @@ class GLTFMaterialsAnisotropyExtension {
|
|
|
3093
3366
|
* Materials Emissive Strength Extension
|
|
3094
3367
|
*
|
|
3095
3368
|
* Specification: https://github.com/KhronosGroup/glTF/blob/5768b3ce0ef32bc39cdf1bef10b948586635ead3/extensions/2.0/Khronos/KHR_materials_emissive_strength/README.md
|
|
3369
|
+
*
|
|
3370
|
+
* @private
|
|
3096
3371
|
*/
|
|
3097
3372
|
class GLTFMaterialsEmissiveStrengthExtension {
|
|
3098
3373
|
|
|
@@ -3103,7 +3378,7 @@ class GLTFMaterialsEmissiveStrengthExtension {
|
|
|
3103
3378
|
|
|
3104
3379
|
}
|
|
3105
3380
|
|
|
3106
|
-
|
|
3381
|
+
async writeMaterialAsync( material, materialDef ) {
|
|
3107
3382
|
|
|
3108
3383
|
if ( ! material.isMeshStandardMaterial || material.emissiveIntensity === 1.0 ) return;
|
|
3109
3384
|
|
|
@@ -3128,6 +3403,8 @@ class GLTFMaterialsEmissiveStrengthExtension {
|
|
|
3128
3403
|
* Materials bump Extension
|
|
3129
3404
|
*
|
|
3130
3405
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/EXT_materials_bump
|
|
3406
|
+
*
|
|
3407
|
+
* @private
|
|
3131
3408
|
*/
|
|
3132
3409
|
class GLTFMaterialsBumpExtension {
|
|
3133
3410
|
|
|
@@ -3138,7 +3415,7 @@ class GLTFMaterialsBumpExtension {
|
|
|
3138
3415
|
|
|
3139
3416
|
}
|
|
3140
3417
|
|
|
3141
|
-
|
|
3418
|
+
async writeMaterialAsync( material, materialDef ) {
|
|
3142
3419
|
|
|
3143
3420
|
if ( ! material.isMeshStandardMaterial || (
|
|
3144
3421
|
material.bumpScale === 1 &&
|
|
@@ -3152,7 +3429,7 @@ class GLTFMaterialsBumpExtension {
|
|
|
3152
3429
|
if ( material.bumpMap ) {
|
|
3153
3430
|
|
|
3154
3431
|
const bumpMapDef = {
|
|
3155
|
-
index: writer.
|
|
3432
|
+
index: await writer.processTextureAsync( material.bumpMap ),
|
|
3156
3433
|
texCoord: material.bumpMap.channel
|
|
3157
3434
|
};
|
|
3158
3435
|
writer.applyTextureTransform( bumpMapDef, material.bumpMap );
|
|
@@ -3175,6 +3452,8 @@ class GLTFMaterialsBumpExtension {
|
|
|
3175
3452
|
* GPU Instancing Extension
|
|
3176
3453
|
*
|
|
3177
3454
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_mesh_gpu_instancing
|
|
3455
|
+
*
|
|
3456
|
+
* @private
|
|
3178
3457
|
*/
|
|
3179
3458
|
class GLTFMeshGpuInstancing {
|
|
3180
3459
|
|
|
@@ -3234,6 +3513,8 @@ class GLTFMeshGpuInstancing {
|
|
|
3234
3513
|
|
|
3235
3514
|
/**
|
|
3236
3515
|
* Static utility functions
|
|
3516
|
+
*
|
|
3517
|
+
* @private
|
|
3237
3518
|
*/
|
|
3238
3519
|
GLTFExporter.Utils = {
|
|
3239
3520
|
|
|
@@ -3424,8 +3705,60 @@ GLTFExporter.Utils = {
|
|
|
3424
3705
|
|
|
3425
3706
|
return clip;
|
|
3426
3707
|
|
|
3708
|
+
},
|
|
3709
|
+
|
|
3710
|
+
toTypedBufferAttribute: function ( srcAttribute, TypedArray ) {
|
|
3711
|
+
|
|
3712
|
+
const dstAttribute = new BufferAttribute( new TypedArray( srcAttribute.count * srcAttribute.itemSize ), srcAttribute.itemSize, false );
|
|
3713
|
+
|
|
3714
|
+
if ( ! srcAttribute.normalized && ! srcAttribute.isInterleavedBufferAttribute ) {
|
|
3715
|
+
|
|
3716
|
+
dstAttribute.array.set( srcAttribute.array );
|
|
3717
|
+
|
|
3718
|
+
return dstAttribute;
|
|
3719
|
+
|
|
3720
|
+
}
|
|
3721
|
+
|
|
3722
|
+
for ( let i = 0, il = srcAttribute.count; i < il; i ++ ) {
|
|
3723
|
+
|
|
3724
|
+
for ( let j = 0; j < srcAttribute.itemSize; j ++ ) {
|
|
3725
|
+
|
|
3726
|
+
dstAttribute.setComponent( i, j, srcAttribute.getComponent( i, j ) );
|
|
3727
|
+
|
|
3728
|
+
}
|
|
3729
|
+
|
|
3730
|
+
}
|
|
3731
|
+
|
|
3732
|
+
return dstAttribute;
|
|
3733
|
+
|
|
3427
3734
|
}
|
|
3428
3735
|
|
|
3429
3736
|
};
|
|
3430
3737
|
|
|
3738
|
+
/**
|
|
3739
|
+
* Export options of `GLTFExporter`.
|
|
3740
|
+
*
|
|
3741
|
+
* @typedef {Object} GLTFExporter~Options
|
|
3742
|
+
* @property {boolean} [trs=false] - Export position, rotation and scale instead of matrix per node.
|
|
3743
|
+
* @property {boolean} [onlyVisible=true] - Export only visible 3D objects.
|
|
3744
|
+
* @property {boolean} [binary=false] - Export in binary (.glb) format, returning an ArrayBuffer.
|
|
3745
|
+
* @property {number} [maxTextureSize=Infinity] - Restricts the image maximum size (both width and height) to the given value.
|
|
3746
|
+
* @property {Array<AnimationClip>} [animations=[]] - List of animations to be included in the export.
|
|
3747
|
+
* @property {boolean} [includeCustomExtensions=false] - Export custom glTF extensions defined on an object's `userData.gltfExtensions` property.
|
|
3748
|
+
**/
|
|
3749
|
+
|
|
3750
|
+
/**
|
|
3751
|
+
* onDone callback of `GLTFExporter`.
|
|
3752
|
+
*
|
|
3753
|
+
* @callback GLTFExporter~OnDone
|
|
3754
|
+
* @param {ArrayBuffer|string} result - The generated .gltf (JSON) or .glb (binary).
|
|
3755
|
+
*/
|
|
3756
|
+
|
|
3757
|
+
/**
|
|
3758
|
+
* onError callback of `GLTFExporter`.
|
|
3759
|
+
*
|
|
3760
|
+
* @callback GLTFExporter~OnError
|
|
3761
|
+
* @param {Error} error - The error object.
|
|
3762
|
+
*/
|
|
3763
|
+
|
|
3431
3764
|
export { GLTFExporter };
|