@plastic-software/three 0.181.3 → 0.183.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +3 -4
- package/build/three.cjs +11330 -10017
- package/build/three.core.js +10011 -9493
- package/build/three.core.min.js +2 -2
- package/build/three.module.js +1414 -631
- package/build/three.module.min.js +2 -2
- package/build/three.tsl.js +21 -13
- package/build/three.tsl.min.js +2 -2
- package/build/three.webgpu.js +8007 -5427
- package/build/three.webgpu.min.js +2 -2
- package/build/three.webgpu.nodes.js +8005 -5426
- package/build/three.webgpu.nodes.min.js +2 -2
- package/examples/jsm/Addons.js +0 -3
- package/examples/jsm/animation/CCDIKSolver.js +2 -2
- package/examples/jsm/controls/ArcballControls.js +3 -3
- package/examples/jsm/controls/MapControls.js +55 -1
- package/examples/jsm/controls/OrbitControls.js +109 -6
- package/examples/jsm/controls/TrackballControls.js +6 -6
- package/examples/jsm/csm/CSM.js +2 -1
- package/examples/jsm/effects/AnaglyphEffect.js +102 -7
- package/examples/jsm/environments/ColorEnvironment.js +59 -0
- package/examples/jsm/environments/RoomEnvironment.js +3 -0
- package/examples/jsm/exporters/EXRExporter.js +1 -1
- package/examples/jsm/exporters/GLTFExporter.js +131 -4
- package/examples/jsm/exporters/USDZExporter.js +22 -3
- package/examples/jsm/geometries/DecalGeometry.js +1 -1
- package/examples/jsm/helpers/AnimationPathHelper.js +302 -0
- package/examples/jsm/helpers/LightProbeHelperGPU.js +1 -1
- package/examples/jsm/helpers/TextureHelperGPU.js +1 -1
- package/examples/jsm/helpers/ViewHelper.js +67 -8
- package/examples/jsm/inspector/Inspector.js +74 -14
- package/examples/jsm/inspector/RendererInspector.js +12 -2
- package/examples/jsm/inspector/tabs/Console.js +41 -7
- package/examples/jsm/inspector/tabs/Parameters.js +18 -2
- package/examples/jsm/inspector/tabs/Performance.js +2 -2
- package/examples/jsm/inspector/tabs/Viewer.js +4 -4
- package/examples/jsm/inspector/ui/Profiler.js +1836 -31
- package/examples/jsm/inspector/ui/Style.js +973 -14
- package/examples/jsm/inspector/ui/Tab.js +188 -1
- package/examples/jsm/inspector/ui/Values.js +17 -1
- package/examples/jsm/libs/meshopt_decoder.module.js +6 -5
- package/examples/jsm/lines/LineMaterial.js +6 -0
- package/examples/jsm/loaders/3DMLoader.js +5 -4
- package/examples/jsm/loaders/3MFLoader.js +2 -2
- package/examples/jsm/loaders/AMFLoader.js +2 -2
- package/examples/jsm/loaders/ColladaLoader.js +24 -4026
- package/examples/jsm/loaders/DRACOLoader.js +5 -5
- package/examples/jsm/loaders/EXRLoader.js +5 -5
- package/examples/jsm/loaders/FBXLoader.js +2 -4
- package/examples/jsm/loaders/GCodeLoader.js +34 -8
- package/examples/jsm/loaders/GLTFLoader.js +122 -171
- package/examples/jsm/loaders/HDRLoader.js +0 -1
- package/examples/jsm/loaders/KMZLoader.js +5 -5
- package/examples/jsm/loaders/KTX2Loader.js +19 -3
- package/examples/jsm/loaders/LDrawLoader.js +2 -3
- package/examples/jsm/loaders/LWOLoader.js +7 -39
- package/examples/jsm/loaders/NRRDLoader.js +2 -2
- package/examples/jsm/loaders/PCDLoader.js +4 -2
- package/examples/jsm/loaders/SVGLoader.js +1 -1
- package/examples/jsm/loaders/TDSLoader.js +0 -2
- package/examples/jsm/loaders/TGALoader.js +0 -2
- package/examples/jsm/loaders/USDLoader.js +100 -40
- package/examples/jsm/loaders/UltraHDRLoader.js +285 -160
- package/examples/jsm/loaders/VOXLoader.js +660 -117
- package/examples/jsm/loaders/VRMLLoader.js +79 -2
- package/examples/jsm/loaders/VTKLoader.js +37 -24
- package/examples/jsm/loaders/collada/ColladaComposer.js +2950 -0
- package/examples/jsm/loaders/collada/ColladaParser.js +1962 -0
- package/examples/jsm/loaders/usd/USDAParser.js +447 -366
- package/examples/jsm/loaders/usd/USDCParser.js +1841 -6
- package/examples/jsm/loaders/usd/USDComposer.js +4041 -0
- package/examples/jsm/materials/LDrawConditionalLineNodeMaterial.js +2 -2
- package/examples/jsm/materials/WoodNodeMaterial.js +11 -11
- package/examples/jsm/math/Octree.js +131 -1
- package/examples/jsm/misc/Volume.js +0 -1
- package/examples/jsm/misc/VolumeSlice.js +0 -1
- package/examples/jsm/objects/LensflareMesh.js +1 -1
- package/examples/jsm/objects/Sky.js +76 -4
- package/examples/jsm/objects/SkyMesh.js +127 -10
- package/examples/jsm/objects/Water.js +4 -3
- package/examples/jsm/objects/Water2.js +5 -3
- package/examples/jsm/objects/WaterMesh.js +5 -7
- package/examples/jsm/physics/AmmoPhysics.js +12 -7
- package/examples/jsm/physics/JoltPhysics.js +10 -6
- package/examples/jsm/physics/RapierPhysics.js +9 -5
- package/examples/jsm/postprocessing/EffectComposer.js +7 -5
- package/examples/jsm/postprocessing/OutputPass.js +9 -0
- package/examples/jsm/postprocessing/RenderPass.js +10 -0
- package/examples/jsm/postprocessing/RenderTransitionPass.js +1 -1
- package/examples/jsm/postprocessing/UnrealBloomPass.js +48 -18
- package/examples/jsm/renderers/CSS3DRenderer.js +1 -1
- package/examples/jsm/renderers/Projector.js +268 -30
- package/examples/jsm/renderers/SVGRenderer.js +193 -60
- package/examples/jsm/shaders/GTAOShader.js +19 -6
- package/examples/jsm/shaders/HalftoneShader.js +12 -1
- package/examples/jsm/shaders/PoissonDenoiseShader.js +6 -2
- package/examples/jsm/shaders/SAOShader.js +17 -4
- package/examples/jsm/shaders/SSAOShader.js +11 -1
- package/examples/jsm/shaders/SSRShader.js +6 -5
- package/examples/jsm/shaders/UnpackDepthRGBAShader.js +2 -4
- package/examples/jsm/shaders/VignetteShader.js +1 -1
- package/examples/jsm/transpiler/AST.js +44 -0
- package/examples/jsm/transpiler/GLSLDecoder.js +61 -4
- package/examples/jsm/transpiler/ShaderToyDecoder.js +2 -0
- package/examples/jsm/transpiler/TSLEncoder.js +46 -3
- package/examples/jsm/transpiler/TranspilerUtils.js +3 -3
- package/examples/jsm/transpiler/WGSLEncoder.js +27 -0
- package/examples/jsm/tsl/display/AfterImageNode.js +1 -1
- package/examples/jsm/tsl/display/AnaglyphPassNode.js +458 -16
- package/examples/jsm/tsl/display/AnamorphicNode.js +1 -1
- package/examples/jsm/tsl/display/BilateralBlurNode.js +364 -0
- package/examples/jsm/tsl/display/BloomNode.js +16 -6
- package/examples/jsm/tsl/display/CRT.js +150 -0
- package/examples/jsm/tsl/display/DenoiseNode.js +1 -1
- package/examples/jsm/tsl/display/DepthOfFieldNode.js +1 -1
- package/examples/jsm/tsl/display/DotScreenNode.js +1 -1
- package/examples/jsm/tsl/display/FXAANode.js +2 -2
- package/examples/jsm/tsl/display/GTAONode.js +5 -4
- package/examples/jsm/tsl/display/GaussianBlurNode.js +11 -2
- package/examples/jsm/tsl/display/GodraysNode.js +624 -0
- package/examples/jsm/tsl/display/LensflareNode.js +1 -1
- package/examples/jsm/tsl/display/Lut3DNode.js +1 -1
- package/examples/jsm/tsl/display/OutlineNode.js +3 -3
- package/examples/jsm/tsl/display/ParallaxBarrierPassNode.js +2 -2
- package/examples/jsm/tsl/display/PixelationPassNode.js +7 -6
- package/examples/jsm/tsl/display/RGBShiftNode.js +2 -2
- package/examples/jsm/tsl/display/RetroPassNode.js +263 -0
- package/examples/jsm/tsl/display/SMAANode.js +2 -2
- package/examples/jsm/tsl/display/SSAAPassNode.js +2 -2
- package/examples/jsm/tsl/display/SSGINode.js +8 -20
- package/examples/jsm/tsl/display/SSRNode.js +8 -8
- package/examples/jsm/tsl/display/SSSNode.js +6 -4
- package/examples/jsm/tsl/display/Shape.js +29 -0
- package/examples/jsm/tsl/display/SobelOperatorNode.js +2 -2
- package/examples/jsm/tsl/display/StereoCompositePassNode.js +8 -1
- package/examples/jsm/tsl/display/StereoPassNode.js +1 -2
- package/examples/jsm/tsl/display/TRAANode.js +273 -125
- package/examples/jsm/tsl/display/TransitionNode.js +1 -1
- package/examples/jsm/tsl/display/depthAwareBlend.js +80 -0
- package/examples/jsm/tsl/display/radialBlur.js +68 -0
- package/examples/jsm/tsl/math/Bayer.js +40 -1
- package/examples/jsm/utils/LDrawUtils.js +1 -1
- package/examples/jsm/utils/ShadowMapViewer.js +24 -10
- package/examples/jsm/utils/ShadowMapViewerGPU.js +1 -1
- package/examples/jsm/utils/WebGPUTextureUtils.js +1 -1
- package/package.json +20 -26
- package/src/Three.Core.js +2 -1
- package/src/Three.TSL.js +19 -11
- package/src/Three.WebGPU.Nodes.js +2 -0
- package/src/Three.WebGPU.js +3 -0
- package/src/Three.js +1 -0
- package/src/animation/AnimationAction.js +1 -1
- package/src/animation/AnimationClip.js +1 -1
- package/src/animation/AnimationMixer.js +6 -0
- package/src/animation/AnimationUtils.js +1 -12
- package/src/animation/KeyframeTrack.js +47 -8
- package/src/animation/PropertyMixer.js +4 -4
- package/src/animation/tracks/BooleanKeyframeTrack.js +1 -1
- package/src/animation/tracks/ColorKeyframeTrack.js +1 -1
- package/src/animation/tracks/NumberKeyframeTrack.js +1 -1
- package/src/animation/tracks/QuaternionKeyframeTrack.js +1 -1
- package/src/animation/tracks/StringKeyframeTrack.js +1 -1
- package/src/animation/tracks/VectorKeyframeTrack.js +1 -1
- package/src/audio/Audio.js +1 -1
- package/src/audio/AudioListener.js +5 -3
- package/src/cameras/Camera.js +32 -2
- package/src/cameras/CubeCamera.js +20 -0
- package/src/constants.js +90 -5
- package/src/core/BufferGeometry.js +14 -2
- package/src/core/Clock.js +7 -0
- package/src/core/Object3D.js +56 -4
- package/src/core/Raycaster.js +2 -2
- package/src/core/RenderTarget.js +3 -4
- package/src/extras/PMREMGenerator.js +7 -18
- package/src/extras/TextureUtils.js +5 -1
- package/src/geometries/ExtrudeGeometry.js +2 -2
- package/src/geometries/PolyhedronGeometry.js +1 -1
- package/src/geometries/TorusGeometry.js +8 -3
- package/src/helpers/CameraHelper.js +3 -0
- package/src/helpers/DirectionalLightHelper.js +4 -1
- package/src/helpers/HemisphereLightHelper.js +3 -0
- package/src/helpers/PointLightHelper.js +1 -25
- package/src/helpers/SpotLightHelper.js +3 -0
- package/src/lights/DirectionalLight.js +13 -0
- package/src/lights/HemisphereLight.js +10 -0
- package/src/lights/Light.js +1 -11
- package/src/lights/LightProbe.js +0 -15
- package/src/lights/LightShadow.js +15 -6
- package/src/lights/PointLight.js +15 -0
- package/src/lights/PointLightShadow.js +0 -86
- package/src/lights/SpotLight.js +22 -1
- package/src/lights/webgpu/IESSpotLight.js +2 -1
- package/src/loaders/Cache.js +28 -0
- package/src/loaders/FileLoader.js +1 -1
- package/src/loaders/ImageBitmapLoader.js +8 -3
- package/src/loaders/Loader.js +6 -0
- package/src/loaders/MaterialLoader.js +2 -1
- package/src/loaders/ObjectLoader.js +21 -2
- package/src/loaders/nodes/NodeLoader.js +2 -2
- package/src/materials/Material.js +2 -0
- package/src/materials/MeshLambertMaterial.js +9 -0
- package/src/materials/MeshPhongMaterial.js +9 -0
- package/src/materials/ShaderMaterial.js +20 -1
- package/src/materials/nodes/Line2NodeMaterial.js +7 -7
- package/src/materials/nodes/MeshPhysicalNodeMaterial.js +5 -2
- package/src/materials/nodes/MeshStandardNodeMaterial.js +5 -4
- package/src/materials/nodes/NodeMaterial.js +72 -25
- package/src/materials/nodes/manager/NodeMaterialObserver.js +10 -4
- package/src/math/Line3.js +3 -5
- package/src/math/MathUtils.js +10 -10
- package/src/math/Matrix4.js +74 -65
- package/src/math/Quaternion.js +3 -29
- package/src/math/Sphere.js +1 -1
- package/src/math/Vector3.js +3 -5
- package/src/math/interpolants/BezierInterpolant.js +108 -0
- package/src/nodes/Nodes.js +87 -68
- package/src/nodes/TSL.js +6 -6
- package/src/nodes/accessors/Arrays.js +1 -1
- package/src/nodes/accessors/BatchNode.js +10 -10
- package/src/nodes/accessors/Bitangent.js +5 -5
- package/src/nodes/accessors/BufferAttributeNode.js +98 -12
- package/src/nodes/accessors/BufferNode.js +29 -2
- package/src/nodes/accessors/Camera.js +149 -28
- package/src/nodes/accessors/ClippingNode.js +4 -4
- package/src/nodes/accessors/CubeTextureNode.js +20 -1
- package/src/nodes/accessors/InstanceNode.js +148 -43
- package/src/nodes/accessors/MaterialNode.js +9 -1
- package/src/nodes/accessors/MaterialReferenceNode.js +1 -2
- package/src/nodes/accessors/ModelNode.js +1 -1
- package/src/nodes/accessors/Normal.js +11 -11
- package/src/nodes/accessors/Position.js +34 -2
- package/src/nodes/accessors/ReferenceBaseNode.js +4 -4
- package/src/nodes/accessors/ReferenceNode.js +4 -4
- package/src/nodes/accessors/RendererReferenceNode.js +1 -2
- package/src/nodes/accessors/SceneProperties.js +53 -0
- package/src/nodes/accessors/SkinningNode.js +27 -26
- package/src/nodes/accessors/StorageBufferNode.js +4 -21
- package/src/nodes/accessors/StorageTextureNode.js +37 -1
- package/src/nodes/accessors/Tangent.js +4 -14
- package/src/nodes/accessors/Texture3DNode.js +32 -35
- package/src/nodes/accessors/TextureNode.js +58 -22
- package/src/nodes/accessors/UniformArrayNode.js +4 -2
- package/src/nodes/accessors/UserDataNode.js +1 -2
- package/src/nodes/accessors/VertexColorNode.js +1 -2
- package/src/nodes/code/FunctionNode.js +1 -2
- package/src/nodes/core/ArrayNode.js +20 -1
- package/src/nodes/core/AssignNode.js +2 -2
- package/src/nodes/core/AttributeNode.js +2 -2
- package/src/nodes/core/ContextNode.js +103 -4
- package/src/nodes/core/MRTNode.js +48 -2
- package/src/nodes/core/Node.js +29 -3
- package/src/nodes/core/NodeBuilder.js +170 -53
- package/src/nodes/core/NodeError.js +28 -0
- package/src/nodes/core/NodeFrame.js +12 -4
- package/src/nodes/core/NodeUtils.js +10 -8
- package/src/nodes/core/OutputStructNode.js +12 -10
- package/src/nodes/core/ParameterNode.js +3 -3
- package/src/nodes/core/PropertyNode.js +19 -3
- package/src/nodes/core/StackNode.js +65 -16
- package/src/nodes/core/StackTrace.js +139 -0
- package/src/nodes/core/StructNode.js +16 -2
- package/src/nodes/core/StructTypeNode.js +11 -17
- package/src/nodes/core/SubBuildNode.js +1 -1
- package/src/nodes/core/UniformNode.js +21 -5
- package/src/nodes/core/VarNode.js +47 -22
- package/src/nodes/core/VaryingNode.js +1 -18
- package/src/nodes/display/BlendModes.js +0 -64
- package/src/nodes/display/ColorAdjustment.js +17 -0
- package/src/nodes/display/ColorSpaceNode.js +3 -3
- package/src/nodes/display/NormalMapNode.js +39 -4
- package/src/nodes/display/PassNode.js +98 -9
- package/src/nodes/display/RenderOutputNode.js +3 -3
- package/src/nodes/display/ScreenNode.js +3 -1
- package/src/nodes/display/ToneMappingNode.js +1 -1
- package/src/nodes/display/ToonOutlinePassNode.js +2 -2
- package/src/nodes/display/ViewportDepthNode.js +52 -4
- package/src/nodes/display/ViewportTextureNode.js +21 -4
- package/src/nodes/fog/Fog.js +18 -35
- package/src/nodes/functions/BSDF/BRDF_GGX_Multiscatter.js +3 -3
- package/src/nodes/functions/BSDF/DFGLUT.js +56 -0
- package/src/nodes/functions/BSDF/EnvironmentBRDF.js +2 -2
- package/src/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.js +1 -1
- package/src/nodes/functions/PhysicalLightingModel.js +126 -45
- package/src/nodes/geometry/RangeNode.js +4 -2
- package/src/nodes/gpgpu/ComputeBuiltinNode.js +1 -2
- package/src/nodes/gpgpu/ComputeNode.js +5 -4
- package/src/nodes/gpgpu/SubgroupFunctionNode.js +1 -1
- package/src/nodes/gpgpu/WorkgroupInfoNode.js +4 -4
- package/src/nodes/lighting/AnalyticLightNode.js +53 -0
- package/src/nodes/lighting/EnvironmentNode.js +28 -3
- package/src/nodes/lighting/LightsNode.js +2 -2
- package/src/nodes/lighting/PointShadowNode.js +162 -149
- package/src/nodes/lighting/ShadowFilterNode.js +53 -65
- package/src/nodes/lighting/ShadowNode.js +97 -41
- package/src/nodes/math/BitcountNode.js +433 -0
- package/src/nodes/math/ConditionalNode.js +2 -2
- package/src/nodes/math/MathNode.js +3 -40
- package/src/nodes/math/OperatorNode.js +2 -1
- package/src/nodes/math/PackFloatNode.js +98 -0
- package/src/nodes/math/UnpackFloatNode.js +96 -0
- package/src/nodes/pmrem/PMREMNode.js +1 -1
- package/src/nodes/pmrem/PMREMUtils.js +9 -15
- package/src/nodes/tsl/TSLCore.js +17 -14
- package/src/nodes/utils/ArrayElementNode.js +13 -0
- package/src/nodes/utils/DebugNode.js +11 -11
- package/src/nodes/utils/EventNode.js +1 -2
- package/src/nodes/utils/JoinNode.js +2 -2
- package/src/nodes/utils/LoopNode.js +1 -1
- package/src/nodes/utils/MemberNode.js +1 -1
- package/src/nodes/utils/Packing.js +13 -1
- package/src/nodes/utils/PostProcessingUtils.js +33 -1
- package/src/nodes/utils/RTTNode.js +1 -1
- package/src/nodes/utils/ReflectorNode.js +3 -4
- package/src/nodes/utils/SampleNode.js +1 -1
- package/src/nodes/utils/SpriteSheetUV.js +35 -0
- package/src/nodes/utils/UVUtils.js +28 -0
- package/src/objects/BatchedMesh.js +27 -14
- package/src/objects/InstancedMesh.js +11 -0
- package/src/objects/Line.js +1 -1
- package/src/objects/Mesh.js +1 -1
- package/src/objects/Points.js +1 -1
- package/src/objects/Skeleton.js +9 -0
- package/src/renderers/WebGLRenderer.js +178 -92
- package/src/renderers/common/Backend.js +29 -0
- package/src/renderers/common/Background.js +24 -11
- package/src/renderers/common/BindGroup.js +1 -9
- package/src/renderers/common/Binding.js +11 -0
- package/src/renderers/common/Bindings.js +27 -12
- package/src/renderers/common/BlendMode.js +143 -0
- package/src/renderers/common/Buffer.js +40 -0
- package/src/renderers/common/BundleGroup.js +1 -1
- package/src/renderers/common/ChainMap.js +30 -6
- package/src/renderers/common/CubeRenderTarget.js +50 -6
- package/src/renderers/common/Geometries.js +29 -3
- package/src/renderers/common/Lighting.js +5 -21
- package/src/renderers/common/Pipelines.js +4 -4
- package/src/renderers/common/PostProcessing.js +8 -206
- package/src/renderers/common/RenderBundles.js +2 -1
- package/src/renderers/common/RenderContext.js +16 -0
- package/src/renderers/common/RenderContexts.js +33 -49
- package/src/renderers/common/RenderLists.js +2 -1
- package/src/renderers/common/RenderObject.js +15 -3
- package/src/renderers/common/RenderObjectPipeline.js +40 -0
- package/src/renderers/common/RenderObjects.js +18 -2
- package/src/renderers/common/RenderPipeline.js +203 -17
- package/src/renderers/common/Renderer.js +257 -72
- package/src/renderers/common/Sampler.js +4 -4
- package/src/renderers/common/StorageBuffer.js +13 -1
- package/src/renderers/common/Textures.js +17 -1
- package/src/renderers/common/TimestampQueryPool.js +5 -3
- package/src/renderers/common/Uniform.js +8 -0
- package/src/renderers/common/UniformsGroup.js +61 -0
- package/src/renderers/common/XRManager.js +3 -2
- package/src/renderers/common/extras/PMREMGenerator.js +2 -8
- package/src/renderers/common/nodes/NodeBuilderState.js +1 -1
- package/src/renderers/common/nodes/{Nodes.js → NodeManager.js} +18 -6
- package/src/renderers/common/nodes/NodeStorageBuffer.js +13 -2
- package/src/renderers/common/nodes/NodeUniformBuffer.js +52 -0
- package/src/renderers/shaders/DFGLUTData.js +19 -34
- package/src/renderers/shaders/ShaderChunk/batching_pars_vertex.glsl.js +2 -2
- package/src/renderers/shaders/ShaderChunk/color_fragment.glsl.js +1 -5
- package/src/renderers/shaders/ShaderChunk/color_pars_fragment.glsl.js +1 -5
- package/src/renderers/shaders/ShaderChunk/color_pars_vertex.glsl.js +1 -5
- package/src/renderers/shaders/ShaderChunk/color_vertex.glsl.js +8 -10
- package/src/renderers/shaders/ShaderChunk/envmap_fragment.glsl.js +7 -11
- 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 +112 -51
- package/src/renderers/shaders/ShaderChunk/packing.glsl.js +20 -4
- package/src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js +225 -186
- package/src/renderers/shaders/ShaderChunk/shadowmask_pars_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/transmission_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk.js +3 -3
- package/src/renderers/shaders/ShaderLib/depth.glsl.js +3 -0
- package/src/renderers/shaders/ShaderLib/{distanceRGBA.glsl.js → distance.glsl.js} +1 -2
- package/src/renderers/shaders/ShaderLib/meshlambert.glsl.js +2 -1
- package/src/renderers/shaders/ShaderLib/meshnormal.glsl.js +1 -2
- package/src/renderers/shaders/ShaderLib/meshphong.glsl.js +2 -1
- package/src/renderers/shaders/ShaderLib/meshphysical.glsl.js +4 -9
- package/src/renderers/shaders/ShaderLib/meshtoon.glsl.js +0 -1
- package/src/renderers/shaders/ShaderLib/shadow.glsl.js +1 -1
- package/src/renderers/shaders/ShaderLib/vsm.glsl.js +4 -6
- package/src/renderers/shaders/ShaderLib.js +7 -5
- package/src/renderers/shaders/UniformsLib.js +0 -3
- package/src/renderers/webgl/WebGLBackground.js +2 -2
- package/src/renderers/webgl/WebGLBindingStates.js +99 -27
- package/src/renderers/webgl/WebGLCapabilities.js +3 -4
- package/src/renderers/webgl/WebGLEnvironments.js +228 -0
- package/src/renderers/webgl/WebGLGeometries.js +10 -7
- 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 +45 -109
- package/src/renderers/webgl/WebGLPrograms.js +45 -49
- package/src/renderers/webgl/WebGLRenderLists.js +15 -0
- package/src/renderers/webgl/WebGLShadowMap.js +188 -24
- package/src/renderers/webgl/WebGLState.js +32 -37
- package/src/renderers/webgl/WebGLTextures.js +89 -28
- package/src/renderers/webgl/WebGLUniforms.js +40 -3
- package/src/renderers/webgl/WebGLUtils.js +6 -2
- package/src/renderers/webgl-fallback/WebGLBackend.js +148 -18
- package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +156 -35
- package/src/renderers/webgl-fallback/utils/WebGLState.js +181 -5
- package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +5 -3
- package/src/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.js +9 -9
- package/src/renderers/webgl-fallback/utils/WebGLUtils.js +6 -2
- package/src/renderers/webgpu/WebGPUBackend.js +119 -13
- package/src/renderers/webgpu/WebGPURenderer.js +2 -1
- package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +322 -68
- package/src/renderers/webgpu/utils/WebGPUAttributeUtils.js +4 -17
- package/src/renderers/webgpu/utils/WebGPUBindingUtils.js +357 -200
- package/src/renderers/webgpu/utils/WebGPUConstants.js +2 -0
- package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +61 -23
- package/src/renderers/webgpu/utils/WebGPUTexturePassUtils.js +152 -200
- package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +65 -42
- package/src/renderers/webgpu/utils/WebGPUTimestampQueryPool.js +7 -7
- package/src/renderers/webgpu/utils/WebGPUUtils.js +17 -11
- package/src/renderers/webxr/WebXRManager.js +2 -2
- package/src/textures/CubeDepthTexture.js +76 -0
- package/src/textures/Source.js +1 -1
- package/src/textures/Texture.js +3 -3
- package/src/utils.js +258 -3
- package/examples/jsm/materials/MeshGouraudMaterial.js +0 -434
- package/examples/jsm/materials/MeshPostProcessingMaterial.js +0 -167
- package/examples/jsm/shaders/GodRaysShader.js +0 -333
- package/src/nodes/accessors/SceneNode.js +0 -145
- package/src/nodes/code/ScriptableNode.js +0 -726
- package/src/nodes/code/ScriptableValueNode.js +0 -253
- package/src/nodes/display/PosterizeNode.js +0 -65
- package/src/nodes/functions/BSDF/DFGApprox.js +0 -71
- package/src/nodes/utils/SpriteSheetUVNode.js +0 -90
- package/src/renderers/webgl/WebGLCubeMaps.js +0 -99
- package/src/renderers/webgl/WebGLCubeUVMaps.js +0 -134
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
InterpolateLinear,
|
|
3
3
|
InterpolateSmooth,
|
|
4
|
-
InterpolateDiscrete
|
|
4
|
+
InterpolateDiscrete,
|
|
5
|
+
InterpolateBezier
|
|
5
6
|
} from '../constants.js';
|
|
6
7
|
import { CubicInterpolant } from '../math/interpolants/CubicInterpolant.js';
|
|
7
8
|
import { LinearInterpolant } from '../math/interpolants/LinearInterpolant.js';
|
|
8
9
|
import { DiscreteInterpolant } from '../math/interpolants/DiscreteInterpolant.js';
|
|
10
|
+
import { BezierInterpolant } from '../math/interpolants/BezierInterpolant.js';
|
|
9
11
|
import * as AnimationUtils from './AnimationUtils.js';
|
|
10
12
|
import { warn, error } from '../utils.js';
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
|
-
* Represents
|
|
15
|
+
* Represents a timed sequence of keyframes, which are composed of lists of
|
|
14
16
|
* times and related values, and which are used to animate a specific property
|
|
15
17
|
* of an object.
|
|
16
18
|
*/
|
|
@@ -22,7 +24,7 @@ class KeyframeTrack {
|
|
|
22
24
|
* @param {string} name - The keyframe track's name.
|
|
23
25
|
* @param {Array<number>} times - A list of keyframe times.
|
|
24
26
|
* @param {Array<number|string|boolean>} values - A list of keyframe values.
|
|
25
|
-
* @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.
|
|
27
|
+
* @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth|InterpolateBezier)} [interpolation] - The interpolation type.
|
|
26
28
|
*/
|
|
27
29
|
constructor( name, times, values, interpolation ) {
|
|
28
30
|
|
|
@@ -140,10 +142,37 @@ class KeyframeTrack {
|
|
|
140
142
|
|
|
141
143
|
}
|
|
142
144
|
|
|
145
|
+
/**
|
|
146
|
+
* Factory method for creating a new Bezier interpolant.
|
|
147
|
+
*
|
|
148
|
+
* The Bezier interpolant requires tangent data to be set via the `settings` property
|
|
149
|
+
* on the track before creating the interpolant. The settings should contain:
|
|
150
|
+
* - `inTangents`: Float32Array with [time, value] pairs per keyframe per component
|
|
151
|
+
* - `outTangents`: Float32Array with [time, value] pairs per keyframe per component
|
|
152
|
+
*
|
|
153
|
+
* @static
|
|
154
|
+
* @param {TypedArray} [result] - The result buffer.
|
|
155
|
+
* @return {BezierInterpolant} The new interpolant.
|
|
156
|
+
*/
|
|
157
|
+
InterpolantFactoryMethodBezier( result ) {
|
|
158
|
+
|
|
159
|
+
const interpolant = new BezierInterpolant( this.times, this.values, this.getValueSize(), result );
|
|
160
|
+
|
|
161
|
+
// Pass tangent data from track settings to interpolant
|
|
162
|
+
if ( this.settings ) {
|
|
163
|
+
|
|
164
|
+
interpolant.settings = this.settings;
|
|
165
|
+
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return interpolant;
|
|
169
|
+
|
|
170
|
+
}
|
|
171
|
+
|
|
143
172
|
/**
|
|
144
173
|
* Defines the interpolation factor method for this keyframe track.
|
|
145
174
|
*
|
|
146
|
-
* @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} interpolation - The interpolation type.
|
|
175
|
+
* @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth|InterpolateBezier)} interpolation - The interpolation type.
|
|
147
176
|
* @return {KeyframeTrack} A reference to this keyframe track.
|
|
148
177
|
*/
|
|
149
178
|
setInterpolation( interpolation ) {
|
|
@@ -170,6 +199,12 @@ class KeyframeTrack {
|
|
|
170
199
|
|
|
171
200
|
break;
|
|
172
201
|
|
|
202
|
+
case InterpolateBezier:
|
|
203
|
+
|
|
204
|
+
factoryMethod = this.InterpolantFactoryMethodBezier;
|
|
205
|
+
|
|
206
|
+
break;
|
|
207
|
+
|
|
173
208
|
}
|
|
174
209
|
|
|
175
210
|
if ( factoryMethod === undefined ) {
|
|
@@ -206,7 +241,7 @@ class KeyframeTrack {
|
|
|
206
241
|
/**
|
|
207
242
|
* Returns the current interpolation type.
|
|
208
243
|
*
|
|
209
|
-
* @return {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} The interpolation type.
|
|
244
|
+
* @return {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth|InterpolateBezier)} The interpolation type.
|
|
210
245
|
*/
|
|
211
246
|
getInterpolation() {
|
|
212
247
|
|
|
@@ -224,6 +259,10 @@ class KeyframeTrack {
|
|
|
224
259
|
|
|
225
260
|
return InterpolateSmooth;
|
|
226
261
|
|
|
262
|
+
case this.InterpolantFactoryMethodBezier:
|
|
263
|
+
|
|
264
|
+
return InterpolateBezier;
|
|
265
|
+
|
|
227
266
|
}
|
|
228
267
|
|
|
229
268
|
}
|
|
@@ -425,7 +464,7 @@ class KeyframeTrack {
|
|
|
425
464
|
* Optimizes this keyframe track by removing equivalent sequential keys (which are
|
|
426
465
|
* common in morph target sequences).
|
|
427
466
|
*
|
|
428
|
-
* @return {
|
|
467
|
+
* @return {KeyframeTrack} A reference to this keyframe track.
|
|
429
468
|
*/
|
|
430
469
|
optimize() {
|
|
431
470
|
|
|
@@ -565,7 +604,7 @@ class KeyframeTrack {
|
|
|
565
604
|
/**
|
|
566
605
|
* The value type name.
|
|
567
606
|
*
|
|
568
|
-
* @type {
|
|
607
|
+
* @type {string}
|
|
569
608
|
* @default ''
|
|
570
609
|
*/
|
|
571
610
|
KeyframeTrack.prototype.ValueTypeName = '';
|
|
@@ -589,7 +628,7 @@ KeyframeTrack.prototype.ValueBufferType = Float32Array;
|
|
|
589
628
|
/**
|
|
590
629
|
* The default interpolation type of this keyframe track.
|
|
591
630
|
*
|
|
592
|
-
* @type {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)}
|
|
631
|
+
* @type {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth|InterpolateBezier)}
|
|
593
632
|
* @default InterpolateLinear
|
|
594
633
|
*/
|
|
595
634
|
KeyframeTrack.prototype.DefaultInterpolation = InterpolateLinear;
|
|
@@ -88,7 +88,7 @@ class PropertyMixer {
|
|
|
88
88
|
this._addIndex = 4;
|
|
89
89
|
|
|
90
90
|
/**
|
|
91
|
-
*
|
|
91
|
+
* Accumulated weight of the property binding.
|
|
92
92
|
*
|
|
93
93
|
* @type {number}
|
|
94
94
|
* @default 0
|
|
@@ -96,7 +96,7 @@ class PropertyMixer {
|
|
|
96
96
|
this.cumulativeWeight = 0;
|
|
97
97
|
|
|
98
98
|
/**
|
|
99
|
-
*
|
|
99
|
+
* Accumulated additive weight of the property binding.
|
|
100
100
|
*
|
|
101
101
|
* @type {number}
|
|
102
102
|
* @default 0
|
|
@@ -104,7 +104,7 @@ class PropertyMixer {
|
|
|
104
104
|
this.cumulativeWeightAdditive = 0;
|
|
105
105
|
|
|
106
106
|
/**
|
|
107
|
-
*
|
|
107
|
+
* Number of active keyframe tracks currently using this property binding.
|
|
108
108
|
*
|
|
109
109
|
* @type {number}
|
|
110
110
|
* @default 0
|
|
@@ -112,7 +112,7 @@ class PropertyMixer {
|
|
|
112
112
|
this.useCount = 0;
|
|
113
113
|
|
|
114
114
|
/**
|
|
115
|
-
*
|
|
115
|
+
* Number of keyframe tracks referencing this property binding.
|
|
116
116
|
*
|
|
117
117
|
* @type {number}
|
|
118
118
|
* @default 0
|
package/src/audio/Audio.js
CHANGED
|
@@ -191,7 +191,7 @@ class Audio extends Object3D {
|
|
|
191
191
|
/**
|
|
192
192
|
* Defines the source type.
|
|
193
193
|
*
|
|
194
|
-
* The property is automatically by one of the `set*()` methods.
|
|
194
|
+
* The property is automatically set by one of the `set*()` methods.
|
|
195
195
|
*
|
|
196
196
|
* @type {('empty'|'audioNode'|'mediaNode'|'mediaStreamNode'|'buffer')}
|
|
197
197
|
* @readonly
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Vector3 } from '../math/Vector3.js';
|
|
2
2
|
import { Quaternion } from '../math/Quaternion.js';
|
|
3
|
-
import {
|
|
3
|
+
import { Timer } from '../core/Timer.js';
|
|
4
4
|
import { Object3D } from '../core/Object3D.js';
|
|
5
5
|
import { AudioContext } from './AudioContext.js';
|
|
6
6
|
|
|
@@ -71,7 +71,7 @@ class AudioListener extends Object3D {
|
|
|
71
71
|
|
|
72
72
|
// private
|
|
73
73
|
|
|
74
|
-
this.
|
|
74
|
+
this._timer = new Timer();
|
|
75
75
|
|
|
76
76
|
}
|
|
77
77
|
|
|
@@ -176,9 +176,11 @@ class AudioListener extends Object3D {
|
|
|
176
176
|
|
|
177
177
|
super.updateMatrixWorld( force );
|
|
178
178
|
|
|
179
|
+
this._timer.update();
|
|
180
|
+
|
|
179
181
|
const listener = this.context.listener;
|
|
180
182
|
|
|
181
|
-
this.timeDelta = this.
|
|
183
|
+
this.timeDelta = this._timer.getDelta();
|
|
182
184
|
|
|
183
185
|
this.matrixWorld.decompose( _position, _quaternion, _scale );
|
|
184
186
|
|
package/src/cameras/Camera.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { WebGLCoordinateSystem } from '../constants.js';
|
|
2
2
|
import { Matrix4 } from '../math/Matrix4.js';
|
|
3
3
|
import { Object3D } from '../core/Object3D.js';
|
|
4
|
+
import { Vector3 } from '../math/Vector3.js';
|
|
5
|
+
import { Quaternion } from '../math/Quaternion.js';
|
|
6
|
+
|
|
7
|
+
const _position = /*@__PURE__*/ new Vector3();
|
|
8
|
+
const _quaternion = /*@__PURE__*/ new Quaternion();
|
|
9
|
+
const _scale = /*@__PURE__*/ new Vector3();
|
|
4
10
|
|
|
5
11
|
/**
|
|
6
12
|
* Abstract base class for cameras. This class should always be inherited
|
|
@@ -107,7 +113,19 @@ class Camera extends Object3D {
|
|
|
107
113
|
|
|
108
114
|
super.updateMatrixWorld( force );
|
|
109
115
|
|
|
110
|
-
|
|
116
|
+
// exclude scale from view matrix to be glTF conform
|
|
117
|
+
|
|
118
|
+
this.matrixWorld.decompose( _position, _quaternion, _scale );
|
|
119
|
+
|
|
120
|
+
if ( _scale.x === 1 && _scale.y === 1 && _scale.z === 1 ) {
|
|
121
|
+
|
|
122
|
+
this.matrixWorldInverse.copy( this.matrixWorld ).invert();
|
|
123
|
+
|
|
124
|
+
} else {
|
|
125
|
+
|
|
126
|
+
this.matrixWorldInverse.compose( _position, _quaternion, _scale.set( 1, 1, 1 ) ).invert();
|
|
127
|
+
|
|
128
|
+
}
|
|
111
129
|
|
|
112
130
|
}
|
|
113
131
|
|
|
@@ -115,7 +133,19 @@ class Camera extends Object3D {
|
|
|
115
133
|
|
|
116
134
|
super.updateWorldMatrix( updateParents, updateChildren );
|
|
117
135
|
|
|
118
|
-
|
|
136
|
+
// exclude scale from view matrix to be glTF conform
|
|
137
|
+
|
|
138
|
+
this.matrixWorld.decompose( _position, _quaternion, _scale );
|
|
139
|
+
|
|
140
|
+
if ( _scale.x === 1 && _scale.y === 1 && _scale.z === 1 ) {
|
|
141
|
+
|
|
142
|
+
this.matrixWorldInverse.copy( this.matrixWorld ).invert();
|
|
143
|
+
|
|
144
|
+
} else {
|
|
145
|
+
|
|
146
|
+
this.matrixWorldInverse.compose( _position, _quaternion, _scale.set( 1, 1, 1 ) ).invert();
|
|
147
|
+
|
|
148
|
+
}
|
|
119
149
|
|
|
120
150
|
}
|
|
121
151
|
|
|
@@ -203,19 +203,38 @@ class CubeCamera extends Object3D {
|
|
|
203
203
|
|
|
204
204
|
renderTarget.texture.generateMipmaps = false;
|
|
205
205
|
|
|
206
|
+
// https://github.com/mrdoob/three.js/issues/31413#issuecomment-3095966812
|
|
207
|
+
|
|
208
|
+
let reversedDepthBuffer = false;
|
|
209
|
+
|
|
210
|
+
if ( renderer.isWebGLRenderer === true ) {
|
|
211
|
+
|
|
212
|
+
reversedDepthBuffer = renderer.state.buffers.depth.getReversed();
|
|
213
|
+
|
|
214
|
+
} else {
|
|
215
|
+
|
|
216
|
+
reversedDepthBuffer = renderer.reversedDepthBuffer;
|
|
217
|
+
|
|
218
|
+
}
|
|
219
|
+
|
|
206
220
|
renderer.setRenderTarget( renderTarget, 0, activeMipmapLevel );
|
|
221
|
+
if ( reversedDepthBuffer && renderer.autoClear === false ) renderer.clearDepth();
|
|
207
222
|
renderer.render( scene, cameraPX );
|
|
208
223
|
|
|
209
224
|
renderer.setRenderTarget( renderTarget, 1, activeMipmapLevel );
|
|
225
|
+
if ( reversedDepthBuffer && renderer.autoClear === false ) renderer.clearDepth();
|
|
210
226
|
renderer.render( scene, cameraNX );
|
|
211
227
|
|
|
212
228
|
renderer.setRenderTarget( renderTarget, 2, activeMipmapLevel );
|
|
229
|
+
if ( reversedDepthBuffer && renderer.autoClear === false ) renderer.clearDepth();
|
|
213
230
|
renderer.render( scene, cameraPY );
|
|
214
231
|
|
|
215
232
|
renderer.setRenderTarget( renderTarget, 3, activeMipmapLevel );
|
|
233
|
+
if ( reversedDepthBuffer && renderer.autoClear === false ) renderer.clearDepth();
|
|
216
234
|
renderer.render( scene, cameraNY );
|
|
217
235
|
|
|
218
236
|
renderer.setRenderTarget( renderTarget, 4, activeMipmapLevel );
|
|
237
|
+
if ( reversedDepthBuffer && renderer.autoClear === false ) renderer.clearDepth();
|
|
219
238
|
renderer.render( scene, cameraPZ );
|
|
220
239
|
|
|
221
240
|
// mipmaps are generated during the last call of render()
|
|
@@ -224,6 +243,7 @@ class CubeCamera extends Object3D {
|
|
|
224
243
|
renderTarget.texture.generateMipmaps = generateMipmaps;
|
|
225
244
|
|
|
226
245
|
renderer.setRenderTarget( renderTarget, 5, activeMipmapLevel );
|
|
246
|
+
if ( reversedDepthBuffer && renderer.autoClear === false ) renderer.clearDepth();
|
|
227
247
|
renderer.render( scene, cameraNZ );
|
|
228
248
|
|
|
229
249
|
renderer.setRenderTarget( currentRenderTarget, currentActiveCubeFace, currentActiveMipmapLevel );
|
package/src/constants.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const REVISION = '
|
|
1
|
+
export const REVISION = '183';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Represents mouse buttons and interaction types in context of controls.
|
|
@@ -155,6 +155,14 @@ export const MultiplyBlending = 4;
|
|
|
155
155
|
*/
|
|
156
156
|
export const CustomBlending = 5;
|
|
157
157
|
|
|
158
|
+
/**
|
|
159
|
+
* Represents material blending.
|
|
160
|
+
*
|
|
161
|
+
* @type {number}
|
|
162
|
+
* @constant
|
|
163
|
+
*/
|
|
164
|
+
export const MaterialBlending = 6;
|
|
165
|
+
|
|
158
166
|
/**
|
|
159
167
|
* A `source + destination` blending equation.
|
|
160
168
|
*
|
|
@@ -910,6 +918,38 @@ export const RGB_ETC2_Format = 37492;
|
|
|
910
918
|
*/
|
|
911
919
|
export const RGBA_ETC2_EAC_Format = 37496;
|
|
912
920
|
|
|
921
|
+
/**
|
|
922
|
+
* EAC R11 UNORM format.
|
|
923
|
+
*
|
|
924
|
+
* @type {number}
|
|
925
|
+
* @constant
|
|
926
|
+
*/
|
|
927
|
+
export const R11_EAC_Format = 37488; // 0x9270
|
|
928
|
+
|
|
929
|
+
/**
|
|
930
|
+
* EAC R11 SNORM format.
|
|
931
|
+
*
|
|
932
|
+
* @type {number}
|
|
933
|
+
* @constant
|
|
934
|
+
*/
|
|
935
|
+
export const SIGNED_R11_EAC_Format = 37489; // 0x9271
|
|
936
|
+
|
|
937
|
+
/**
|
|
938
|
+
* EAC RG11 UNORM format.
|
|
939
|
+
*
|
|
940
|
+
* @type {number}
|
|
941
|
+
* @constant
|
|
942
|
+
*/
|
|
943
|
+
export const RG11_EAC_Format = 37490; // 0x9272
|
|
944
|
+
|
|
945
|
+
/**
|
|
946
|
+
* EAC RG11 SNORM format.
|
|
947
|
+
*
|
|
948
|
+
* @type {number}
|
|
949
|
+
* @constant
|
|
950
|
+
*/
|
|
951
|
+
export const SIGNED_RG11_EAC_Format = 37491; // 0x9273
|
|
952
|
+
|
|
913
953
|
/**
|
|
914
954
|
* ASTC RGBA 4x4 format.
|
|
915
955
|
*
|
|
@@ -1128,6 +1168,17 @@ export const InterpolateLinear = 2301;
|
|
|
1128
1168
|
*/
|
|
1129
1169
|
export const InterpolateSmooth = 2302;
|
|
1130
1170
|
|
|
1171
|
+
/**
|
|
1172
|
+
* Bezier interpolation mode for keyframe tracks.
|
|
1173
|
+
*
|
|
1174
|
+
* Uses cubic Bezier curves with explicit 2D control points.
|
|
1175
|
+
* Requires tangent data to be set on the track.
|
|
1176
|
+
*
|
|
1177
|
+
* @type {number}
|
|
1178
|
+
* @constant
|
|
1179
|
+
*/
|
|
1180
|
+
export const InterpolateBezier = 2303;
|
|
1181
|
+
|
|
1131
1182
|
/**
|
|
1132
1183
|
* Zero curvature ending for animations.
|
|
1133
1184
|
*
|
|
@@ -1194,7 +1245,7 @@ export const TriangleStripDrawMode = 1;
|
|
|
1194
1245
|
export const TriangleFanDrawMode = 2;
|
|
1195
1246
|
|
|
1196
1247
|
/**
|
|
1197
|
-
*
|
|
1248
|
+
* The depth value is inverted (1.0 - z) for visualization purposes.
|
|
1198
1249
|
*
|
|
1199
1250
|
* @type {number}
|
|
1200
1251
|
* @constant
|
|
@@ -1202,7 +1253,7 @@ export const TriangleFanDrawMode = 2;
|
|
|
1202
1253
|
export const BasicDepthPacking = 3200;
|
|
1203
1254
|
|
|
1204
1255
|
/**
|
|
1205
|
-
*
|
|
1256
|
+
* The depth value is packed into 32 bit RGBA.
|
|
1206
1257
|
*
|
|
1207
1258
|
* @type {number}
|
|
1208
1259
|
* @constant
|
|
@@ -1210,7 +1261,7 @@ export const BasicDepthPacking = 3200;
|
|
|
1210
1261
|
export const RGBADepthPacking = 3201;
|
|
1211
1262
|
|
|
1212
1263
|
/**
|
|
1213
|
-
*
|
|
1264
|
+
* The depth value is packed into 24 bit RGB.
|
|
1214
1265
|
*
|
|
1215
1266
|
* @type {number}
|
|
1216
1267
|
* @constant
|
|
@@ -1218,7 +1269,7 @@ export const RGBADepthPacking = 3201;
|
|
|
1218
1269
|
export const RGBDepthPacking = 3202;
|
|
1219
1270
|
|
|
1220
1271
|
/**
|
|
1221
|
-
*
|
|
1272
|
+
* The depth value is packed into 16 bit RG.
|
|
1222
1273
|
*
|
|
1223
1274
|
* @type {number}
|
|
1224
1275
|
* @constant
|
|
@@ -1283,6 +1334,30 @@ export const LinearTransfer = 'linear';
|
|
|
1283
1334
|
*/
|
|
1284
1335
|
export const SRGBTransfer = 'srgb';
|
|
1285
1336
|
|
|
1337
|
+
/**
|
|
1338
|
+
* No normal map packing.
|
|
1339
|
+
*
|
|
1340
|
+
* @type {string}
|
|
1341
|
+
* @constant
|
|
1342
|
+
*/
|
|
1343
|
+
export const NoNormalPacking = '';
|
|
1344
|
+
|
|
1345
|
+
/**
|
|
1346
|
+
* Normal RG packing.
|
|
1347
|
+
*
|
|
1348
|
+
* @type {string}
|
|
1349
|
+
* @constant
|
|
1350
|
+
*/
|
|
1351
|
+
export const NormalRGPacking = 'rg';
|
|
1352
|
+
|
|
1353
|
+
/**
|
|
1354
|
+
* Normal GA packing.
|
|
1355
|
+
*
|
|
1356
|
+
* @type {string}
|
|
1357
|
+
* @constant
|
|
1358
|
+
*/
|
|
1359
|
+
export const NormalGAPacking = 'ga';
|
|
1360
|
+
|
|
1286
1361
|
/**
|
|
1287
1362
|
* Sets the stencil buffer value to `0`.
|
|
1288
1363
|
*
|
|
@@ -1627,6 +1702,16 @@ export const InterpolationSamplingMode = {
|
|
|
1627
1702
|
EITHER: 'either'
|
|
1628
1703
|
};
|
|
1629
1704
|
|
|
1705
|
+
/**
|
|
1706
|
+
* Compatibility flags for features that may not be supported across all platforms.
|
|
1707
|
+
*
|
|
1708
|
+
* @type {Object}
|
|
1709
|
+
* @constant
|
|
1710
|
+
*/
|
|
1711
|
+
export const Compatibility = {
|
|
1712
|
+
TEXTURE_COMPARE: 'depthTextureCompare'
|
|
1713
|
+
};
|
|
1714
|
+
|
|
1630
1715
|
/**
|
|
1631
1716
|
* This type represents mouse buttons and interaction types in context of controls.
|
|
1632
1717
|
*
|
|
@@ -111,6 +111,16 @@ class BufferGeometry extends EventDispatcher {
|
|
|
111
111
|
*/
|
|
112
112
|
this.indirect = null;
|
|
113
113
|
|
|
114
|
+
/**
|
|
115
|
+
* The offset, in bytes, into the indirect drawing buffer where the value data begins. If an array is provided, multiple indirect draw calls will be made for each offset.
|
|
116
|
+
*
|
|
117
|
+
* Can only be used with {@link WebGPURenderer} and a WebGPU backend.
|
|
118
|
+
*
|
|
119
|
+
* @type {number|Array<number>}
|
|
120
|
+
* @default 0
|
|
121
|
+
*/
|
|
122
|
+
this.indirectOffset = 0;
|
|
123
|
+
|
|
114
124
|
/**
|
|
115
125
|
* This dictionary has as id the name of the attribute to be set and as value
|
|
116
126
|
* the buffer attribute to set it to. Rather than accessing this property directly,
|
|
@@ -124,7 +134,7 @@ class BufferGeometry extends EventDispatcher {
|
|
|
124
134
|
* This dictionary holds the morph targets of the geometry.
|
|
125
135
|
*
|
|
126
136
|
* Note: Once the geometry has been rendered, the morph attribute data cannot
|
|
127
|
-
* be changed. You will have to call `dispose()
|
|
137
|
+
* be changed. You will have to call `dispose()`, and create a new geometry instance.
|
|
128
138
|
*
|
|
129
139
|
* @type {Object}
|
|
130
140
|
*/
|
|
@@ -224,11 +234,13 @@ class BufferGeometry extends EventDispatcher {
|
|
|
224
234
|
* Sets the given indirect attribute to this geometry.
|
|
225
235
|
*
|
|
226
236
|
* @param {BufferAttribute} indirect - The attribute holding indirect draw calls.
|
|
237
|
+
* @param {number|Array<number>} [indirectOffset=0] - The offset, in bytes, into the indirect drawing buffer where the value data begins. If an array is provided, multiple indirect draw calls will be made for each offset.
|
|
227
238
|
* @return {BufferGeometry} A reference to this instance.
|
|
228
239
|
*/
|
|
229
|
-
setIndirect( indirect ) {
|
|
240
|
+
setIndirect( indirect, indirectOffset = 0 ) {
|
|
230
241
|
|
|
231
242
|
this.indirect = indirect;
|
|
243
|
+
this.indirectOffset = indirectOffset;
|
|
232
244
|
|
|
233
245
|
return this;
|
|
234
246
|
|
package/src/core/Clock.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
import { warn } from '../utils.js';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Class for keeping track of time.
|
|
5
|
+
*
|
|
6
|
+
* @deprecated since r183.
|
|
3
7
|
*/
|
|
4
8
|
class Clock {
|
|
5
9
|
|
|
6
10
|
/**
|
|
7
11
|
* Constructs a new clock.
|
|
8
12
|
*
|
|
13
|
+
* @deprecated since 183.
|
|
9
14
|
* @param {boolean} [autoStart=true] - Whether to automatically start the clock when
|
|
10
15
|
* `getDelta()` is called for the first time.
|
|
11
16
|
*/
|
|
@@ -53,6 +58,8 @@ class Clock {
|
|
|
53
58
|
*/
|
|
54
59
|
this.running = false;
|
|
55
60
|
|
|
61
|
+
warn( 'THREE.Clock: This module has been deprecated. Please use THREE.Timer instead.' ); // @deprecated, r183
|
|
62
|
+
|
|
56
63
|
}
|
|
57
64
|
|
|
58
65
|
/**
|