@types/three 0.181.0 → 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.
- three/README.md +1 -1
- three/examples/jsm/Addons.d.ts +0 -3
- three/examples/jsm/controls/ArcballControls.d.ts +1 -1
- three/examples/jsm/controls/DragControls.d.ts +1 -1
- three/examples/jsm/controls/FirstPersonControls.d.ts +1 -1
- three/examples/jsm/controls/FlyControls.d.ts +1 -1
- three/examples/jsm/controls/OrbitControls.d.ts +40 -1
- three/examples/jsm/controls/PointerLockControls.d.ts +1 -1
- three/examples/jsm/controls/TrackballControls.d.ts +1 -1
- three/examples/jsm/controls/TransformControls.d.ts +1 -1
- three/examples/jsm/effects/AnaglyphEffect.d.ts +4 -0
- three/examples/jsm/environments/ColorEnvironment.d.ts +9 -0
- three/examples/jsm/gpgpu/BitonicSort.d.ts +5 -5
- three/examples/jsm/helpers/AnimationPathHelper.d.ts +38 -0
- three/examples/jsm/helpers/ViewHelper.d.ts +4 -1
- three/examples/jsm/inspector/tabs/Parameters.d.ts +3 -0
- three/examples/jsm/inspector/ui/Item.d.ts +5 -0
- three/examples/jsm/libs/meshopt_decoder.module.d.ts +1 -1
- three/examples/jsm/lights/LightProbeGenerator.d.ts +11 -5
- three/examples/jsm/loaders/ColladaLoader.d.ts +27 -4
- three/examples/jsm/loaders/UltraHDRLoader.d.ts +7 -0
- three/examples/jsm/loaders/VOXLoader.d.ts +22 -5
- three/examples/jsm/math/Octree.d.ts +36 -14
- three/examples/jsm/objects/SkyMesh.d.ts +16 -6
- three/examples/jsm/objects/Water2Mesh.d.ts +7 -7
- three/examples/jsm/objects/WaterMesh.d.ts +6 -6
- three/examples/jsm/physics/AmmoPhysics.d.ts +1 -1
- three/examples/jsm/postprocessing/EffectComposer.d.ts +9 -10
- three/examples/jsm/postprocessing/OutputPass.d.ts +10 -6
- three/examples/jsm/postprocessing/RenderPass.d.ts +15 -10
- three/examples/jsm/postprocessing/UnrealBloomPass.d.ts +4 -9
- three/examples/jsm/transpiler/AST.d.ts +17 -0
- three/examples/jsm/transpiler/TSLEncoder.d.ts +2 -0
- three/examples/jsm/tsl/display/AnaglyphPassNode.d.ts +30 -0
- three/examples/jsm/tsl/display/AnamorphicNode.d.ts +1 -1
- three/examples/jsm/tsl/display/BilateralBlurNode.d.ts +27 -0
- three/examples/jsm/tsl/display/BleachBypass.d.ts +1 -1
- three/examples/jsm/tsl/display/BloomNode.d.ts +5 -5
- three/examples/jsm/tsl/display/CRT.d.ts +22 -0
- three/examples/jsm/tsl/display/DenoiseNode.d.ts +5 -5
- three/examples/jsm/tsl/display/DotScreenNode.d.ts +4 -6
- three/examples/jsm/tsl/display/GTAONode.d.ts +8 -8
- three/examples/jsm/tsl/display/GaussianBlurNode.d.ts +4 -2
- three/examples/jsm/tsl/display/GodraysNode.d.ts +20 -0
- three/examples/jsm/tsl/display/LensflareNode.d.ts +6 -6
- three/examples/jsm/tsl/display/Lut3DNode.d.ts +5 -5
- three/examples/jsm/tsl/display/MotionBlur.d.ts +1 -1
- three/examples/jsm/tsl/display/OutlineNode.d.ts +6 -6
- three/examples/jsm/tsl/display/PixelationPassNode.d.ts +10 -10
- three/examples/jsm/tsl/display/RGBShiftNode.d.ts +2 -2
- three/examples/jsm/tsl/display/RetroPassNode.d.ts +17 -0
- three/examples/jsm/tsl/display/SSAAPassNode.d.ts +1 -1
- three/examples/jsm/tsl/display/SSGINode.d.ts +11 -11
- three/examples/jsm/tsl/display/SSRNode.d.ts +6 -6
- three/examples/jsm/tsl/display/SSSNode.d.ts +7 -5
- three/examples/jsm/tsl/display/Shape.d.ts +3 -0
- three/examples/jsm/tsl/display/TRAANode.d.ts +5 -0
- three/examples/jsm/tsl/display/TransitionNode.d.ts +3 -3
- three/examples/jsm/tsl/display/boxBlur.d.ts +1 -1
- three/examples/jsm/tsl/display/depthAwareBlend.d.ts +15 -0
- three/examples/jsm/tsl/display/hashBlur.d.ts +1 -1
- three/examples/jsm/tsl/display/radialBlur.d.ts +12 -0
- three/examples/jsm/tsl/math/Bayer.d.ts +2 -0
- three/examples/jsm/tsl/utils/Raymarching.d.ts +2 -2
- three/package.json +4 -4
- three/src/Three.Core.d.ts +1 -1
- three/src/Three.TSL.d.ts +20 -13
- three/src/Three.WebGPU.Nodes.d.ts +2 -0
- three/src/Three.WebGPU.d.ts +3 -0
- three/src/Three.d.ts +2 -2
- three/src/animation/AnimationClip.d.ts +1 -1
- three/src/animation/AnimationMixer.d.ts +42 -0
- three/src/animation/AnimationUtils.d.ts +3 -8
- three/src/animation/KeyframeTrack.d.ts +19 -5
- three/src/animation/PropertyMixer.d.ts +5 -4
- three/src/audio/Audio.d.ts +224 -157
- three/src/audio/AudioAnalyser.d.ts +32 -27
- three/src/audio/AudioContext.d.ts +12 -12
- three/src/audio/AudioListener.d.ts +44 -65
- three/src/audio/PositionalAudio.d.ts +69 -62
- three/src/cameras/ArrayCamera.d.ts +21 -24
- three/src/cameras/Camera.d.ts +14 -53
- three/src/cameras/CubeCamera.d.ts +32 -28
- three/src/cameras/OrthographicCamera.d.ts +70 -100
- three/src/cameras/PerspectiveCamera.d.ts +133 -146
- three/src/cameras/StereoCamera.d.ts +24 -30
- three/src/constants.d.ts +28 -2
- three/src/core/BufferGeometry.d.ts +3 -1
- three/src/core/Clock.d.ts +3 -0
- three/src/core/Object3D.d.ts +31 -7
- three/src/extras/Controls.d.ts +3 -3
- three/src/geometries/TorusGeometry.d.ts +22 -3
- three/src/helpers/ArrowHelper.d.ts +34 -50
- three/src/helpers/AxesHelper.d.ts +22 -36
- three/src/helpers/Box3Helper.d.ts +14 -25
- three/src/helpers/BoxHelper.d.ts +28 -39
- three/src/helpers/CameraHelper.d.ts +31 -52
- three/src/helpers/DirectionalLightHelper.d.ts +32 -53
- three/src/helpers/GridHelper.d.ts +15 -29
- three/src/helpers/HemisphereLightHelper.d.ts +26 -49
- three/src/helpers/PlaneHelper.d.ts +21 -33
- three/src/helpers/PointLightHelper.d.ts +25 -50
- three/src/helpers/PolarGridHelper.d.ts +19 -32
- three/src/helpers/SkeletonHelper.d.ts +26 -50
- three/src/helpers/SpotLightHelper.d.ts +28 -55
- three/src/lights/AmbientLight.d.ts +15 -23
- three/src/lights/DirectionalLight.d.ts +49 -83
- three/src/lights/DirectionalLightShadow.d.ts +6 -61
- three/src/lights/HemisphereLight.d.ts +27 -47
- three/src/lights/Light.d.ts +22 -56
- three/src/lights/LightProbe.d.ts +31 -32
- three/src/lights/LightShadow.d.ts +107 -91
- three/src/lights/PointLight.d.ts +47 -77
- three/src/lights/PointLightShadow.d.ts +7 -11
- three/src/lights/RectAreaLight.d.ts +39 -59
- three/src/lights/SpotLight.d.ts +78 -117
- three/src/lights/SpotLightShadow.d.ts +17 -59
- three/src/lights/webgpu/IESSpotLight.d.ts +13 -1
- three/src/lights/webgpu/ProjectorLight.d.ts +9 -10
- three/src/materials/Material.d.ts +1 -0
- three/src/materials/MeshLambertMaterial.d.ts +6 -0
- three/src/materials/MeshPhongMaterial.d.ts +6 -0
- three/src/materials/ShaderMaterial.d.ts +18 -3
- three/src/materials/nodes/Line2NodeMaterial.d.ts +0 -6
- three/src/materials/nodes/LineBasicNodeMaterial.d.ts +0 -4
- three/src/materials/nodes/MeshBasicNodeMaterial.d.ts +1 -2
- three/src/materials/nodes/MeshLambertNodeMaterial.d.ts +0 -2
- three/src/materials/nodes/MeshNormalNodeMaterial.d.ts +0 -2
- three/src/materials/nodes/MeshSSSNodeMaterial.d.ts +5 -8
- three/src/materials/nodes/MeshToonNodeMaterial.d.ts +0 -4
- three/src/materials/nodes/NodeMaterial.d.ts +15 -2
- three/src/materials/nodes/SpriteNodeMaterial.d.ts +0 -3
- three/src/materials/nodes/VolumeNodeMaterial.d.ts +0 -2
- three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +39 -93
- three/src/math/Color.d.ts +1 -0
- three/src/math/Vector3.d.ts +2 -2
- three/src/math/interpolants/BezierInterpolant.d.ts +7 -0
- three/src/nodes/Nodes.d.ts +55 -35
- three/src/nodes/TSL.d.ts +6 -6
- three/src/nodes/accessors/Arrays.d.ts +19 -10
- three/src/nodes/accessors/BufferAttributeNode.d.ts +108 -41
- three/src/nodes/accessors/BufferNode.d.ts +21 -7
- three/src/nodes/accessors/Camera.d.ts +10 -10
- three/src/nodes/accessors/CubeTextureNode.d.ts +1 -1
- three/src/nodes/accessors/InstanceNode.d.ts +13 -6
- three/src/nodes/accessors/Lights.d.ts +9 -6
- three/src/nodes/accessors/MaterialNode.d.ts +1 -3
- three/src/nodes/accessors/MaterialProperties.d.ts +4 -4
- three/src/nodes/accessors/MaterialReferenceNode.d.ts +1 -1
- three/src/nodes/accessors/ModelNode.d.ts +34 -17
- three/src/nodes/accessors/MorphNode.d.ts +1 -1
- three/src/nodes/accessors/Normal.d.ts +13 -15
- three/src/nodes/accessors/Object3DNode.d.ts +35 -16
- three/src/nodes/accessors/Position.d.ts +9 -7
- three/src/nodes/accessors/ReferenceNode.d.ts +16 -7
- three/src/nodes/accessors/ReflectVector.d.ts +4 -5
- three/src/nodes/accessors/RendererReferenceNode.d.ts +1 -1
- three/src/nodes/accessors/SceneProperties.d.ts +5 -0
- three/src/nodes/accessors/SkinningNode.d.ts +5 -3
- three/src/nodes/accessors/StorageBufferNode.d.ts +49 -22
- three/src/nodes/accessors/StorageTextureNode.d.ts +1 -1
- three/src/nodes/accessors/Tangent.d.ts +5 -7
- three/src/nodes/accessors/Texture3DNode.d.ts +13 -1
- three/src/nodes/accessors/TextureBicubic.d.ts +3 -2
- three/src/nodes/accessors/TextureNode.d.ts +19 -18
- three/src/nodes/accessors/UV.d.ts +1 -1
- three/src/nodes/accessors/UniformArrayNode.d.ts +10 -8
- three/src/nodes/accessors/UserDataNode.d.ts +1 -1
- three/src/nodes/accessors/VelocityNode.d.ts +3 -3
- three/src/nodes/accessors/VertexColorNode.d.ts +1 -1
- three/src/nodes/code/FunctionCallNode.d.ts +0 -1
- three/src/nodes/code/FunctionNode.d.ts +7 -3
- three/src/nodes/core/ArrayNode.d.ts +2 -3
- three/src/nodes/core/AttributeNode.d.ts +12 -6
- three/src/nodes/core/BypassNode.d.ts +2 -3
- three/src/nodes/core/ConstNode.d.ts +10 -3
- three/src/nodes/core/ContextNode.d.ts +32 -21
- three/src/nodes/core/IndexNode.d.ts +1 -1
- three/src/nodes/core/InputNode.d.ts +12 -4
- three/src/nodes/core/InspectorNode.d.ts +2 -3
- three/src/nodes/core/IsolateNode.d.ts +2 -7
- three/src/nodes/core/MRTNode.d.ts +7 -0
- three/src/nodes/core/Node.d.ts +258 -39
- three/src/nodes/core/NodeAttribute.d.ts +30 -5
- three/src/nodes/core/NodeBuilder.d.ts +5 -3
- three/src/nodes/core/NodeCache.d.ts +24 -48
- three/src/nodes/core/NodeError.d.ts +9 -0
- three/src/nodes/core/NodeParser.d.ts +2 -0
- three/src/nodes/core/NodeUniform.d.ts +33 -9
- three/src/nodes/core/NodeUtils.d.ts +1 -1
- three/src/nodes/core/NodeVar.d.ts +33 -5
- three/src/nodes/core/NodeVarying.d.ts +32 -4
- three/src/nodes/core/ParameterNode.d.ts +11 -4
- three/src/nodes/core/PropertyNode.d.ts +45 -33
- three/src/nodes/core/StackTrace.d.ts +9 -0
- three/src/nodes/core/StructType.d.ts +3 -1
- three/src/nodes/core/StructTypeNode.d.ts +19 -5
- three/src/nodes/core/TempNode.d.ts +9 -3
- three/src/nodes/core/UniformNode.d.ts +53 -15
- three/src/nodes/core/VarNode.d.ts +15 -14
- three/src/nodes/core/VaryingNode.d.ts +14 -19
- three/src/nodes/core/constants.d.ts +9 -4
- three/src/nodes/display/BlendModes.d.ts +7 -27
- three/src/nodes/display/ColorAdjustment.d.ts +8 -9
- three/src/nodes/display/ColorSpaceNode.d.ts +2 -8
- three/src/nodes/display/FrontFacingNode.d.ts +1 -1
- three/src/nodes/display/NormalMapNode.d.ts +3 -1
- three/src/nodes/display/PassNode.d.ts +16 -4
- three/src/nodes/display/RenderOutputNode.d.ts +3 -7
- three/src/nodes/display/ScreenNode.d.ts +25 -17
- three/src/nodes/display/ToneMappingNode.d.ts +3 -7
- three/src/nodes/display/ViewportDepthNode.d.ts +11 -7
- three/src/nodes/display/ViewportTextureNode.d.ts +2 -0
- three/src/nodes/fog/Fog.d.ts +5 -3
- three/src/nodes/functions/BSDF/DFGLUT.d.ts +12 -0
- three/src/nodes/functions/PhysicalLightingModel.d.ts +8 -1
- three/src/nodes/geometry/RangeNode.d.ts +51 -9
- three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +2 -0
- three/src/nodes/gpgpu/BarrierNode.d.ts +2 -0
- three/src/nodes/gpgpu/ComputeNode.d.ts +2 -7
- three/src/nodes/lighting/AnalyticLightNode.d.ts +3 -1
- three/src/nodes/lighting/HemisphereLightNode.d.ts +3 -2
- three/src/nodes/lighting/LightProbeNode.d.ts +1 -1
- three/src/nodes/lighting/LightUtils.d.ts +1 -1
- three/src/nodes/lighting/LightingContextNode.d.ts +1 -1
- three/src/nodes/lighting/PointShadowNode.d.ts +11 -15
- three/src/nodes/lighting/ShadowFilterNode.d.ts +2 -0
- three/src/nodes/lighting/SpotLightNode.d.ts +0 -6
- three/src/nodes/materialx/MaterialXNodes.d.ts +11 -11
- three/src/nodes/math/BitcountNode.d.ts +23 -0
- three/src/nodes/math/ConditionalNode.d.ts +43 -22
- three/src/nodes/math/Hash.d.ts +1 -1
- three/src/nodes/math/MathNode.d.ts +603 -267
- three/src/nodes/math/MathUtils.d.ts +9 -5
- three/src/nodes/math/OperatorNode.d.ts +490 -227
- three/src/nodes/math/PackFloatNode.d.ts +19 -0
- three/src/nodes/math/TriNoise3D.d.ts +3 -3
- three/src/nodes/math/UnpackFloatNode.d.ts +18 -0
- three/src/nodes/pmrem/PMREMNode.d.ts +1 -1
- three/src/nodes/procedural/Checker.d.ts +1 -1
- three/src/nodes/tsl/TSLCore.d.ts +1683 -224
- three/src/nodes/utils/ArrayElementNode.d.ts +9 -4
- three/src/nodes/utils/DebugNode.d.ts +2 -5
- three/src/nodes/utils/Discard.d.ts +2 -3
- three/src/nodes/utils/FlipNode.d.ts +11 -0
- three/src/nodes/utils/LoopNode.d.ts +17 -13
- three/src/nodes/utils/MaxMipLevelNode.d.ts +1 -1
- three/src/nodes/utils/Oscillators.d.ts +4 -4
- three/src/nodes/utils/Packing.d.ts +3 -2
- three/src/nodes/utils/PostProcessingUtils.d.ts +6 -4
- three/src/nodes/utils/RemapNode.d.ts +33 -39
- three/src/nodes/utils/RotateNode.d.ts +17 -8
- three/src/nodes/utils/SplitNode.d.ts +1 -2
- three/src/nodes/utils/SpriteSheetUV.d.ts +7 -0
- three/src/nodes/utils/StorageArrayElementNode.d.ts +18 -9
- three/src/nodes/utils/Timer.d.ts +4 -4
- three/src/nodes/utils/TriplanarTextures.d.ts +2 -2
- three/src/nodes/utils/UVUtils.d.ts +8 -3
- three/src/objects/BatchedMesh.d.ts +6 -4
- three/src/objects/InstancedMesh.d.ts +32 -24
- three/src/objects/LOD.d.ts +1 -1
- three/src/objects/Skeleton.d.ts +4 -2
- three/src/renderers/WebGLRenderer.d.ts +25 -96
- three/src/renderers/common/Animation.d.ts +46 -9
- three/src/renderers/common/Attributes.d.ts +11 -13
- three/src/renderers/common/Backend.d.ts +0 -2
- three/src/renderers/common/Background.d.ts +17 -15
- three/src/renderers/common/BindGroup.d.ts +27 -13
- three/src/renderers/common/Binding.d.ts +21 -3
- three/src/renderers/common/Bindings.d.ts +41 -17
- three/src/renderers/common/BlendMode.d.ts +22 -0
- three/src/renderers/common/Buffer.d.ts +53 -5
- three/src/renderers/common/BufferUtils.d.ts +3 -4
- three/src/renderers/common/BundleGroup.d.ts +16 -6
- three/src/renderers/common/CanvasTarget.d.ts +76 -13
- three/src/renderers/common/ChainMap.d.ts +18 -8
- three/src/renderers/common/ClippingContext.d.ts +61 -10
- three/src/renderers/common/Color4.d.ts +10 -5
- three/src/renderers/common/ComputePipeline.d.ts +16 -2
- three/src/renderers/common/Constants.d.ts +5 -3
- three/src/renderers/common/CubeRenderTarget.d.ts +24 -7
- three/src/renderers/common/DataMap.d.ts +10 -18
- three/src/renderers/common/Geometries.d.ts +45 -19
- three/src/renderers/common/Info.d.ts +62 -9
- three/src/renderers/common/InspectorBase.d.ts +19 -7
- three/src/renderers/common/Lighting.d.ts +2 -6
- three/src/renderers/common/Pipeline.d.ts +14 -2
- three/src/renderers/common/Pipelines.d.ts +58 -60
- three/src/renderers/common/PostProcessing.d.ts +14 -17
- three/src/renderers/common/ProgrammableStage.d.ts +48 -8
- three/src/renderers/common/RenderBundle.d.ts +4 -2
- three/src/renderers/common/RenderBundles.d.ts +6 -3
- three/src/renderers/common/RenderContext.d.ts +175 -7
- three/src/renderers/common/RenderContexts.d.ts +21 -24
- three/src/renderers/common/RenderList.d.ts +77 -11
- three/src/renderers/common/RenderLists.d.ts +16 -4
- three/src/renderers/common/RenderObject.d.ts +229 -47
- three/src/renderers/common/{RenderPipeline.d.ts → RenderObjectPipeline.d.ts} +17 -5
- three/src/renderers/common/RenderObjects.d.ts +55 -22
- three/src/renderers/common/Renderer.d.ts +645 -216
- three/src/renderers/common/Textures.d.ts +24 -46
- three/src/renderers/common/TimestampQueryPool.d.ts +62 -8
- three/src/renderers/common/Uniform.d.ts +143 -58
- three/src/renderers/common/UniformBuffer.d.ts +7 -5
- three/src/renderers/common/UniformsGroup.d.ts +51 -35
- three/src/renderers/common/XRManager.d.ts +321 -83
- three/src/renderers/common/XRRenderTarget.d.ts +49 -6
- three/src/renderers/common/nodes/NodeBuilderState.d.ts +75 -15
- three/src/renderers/common/nodes/NodeLibrary.d.ts +25 -5
- three/src/renderers/common/nodes/{Nodes.d.ts → NodeManager.d.ts} +54 -73
- three/src/renderers/common/nodes/NodeUniform.d.ts +60 -70
- three/src/renderers/common/nodes/NodeUniformsGroup.d.ts +23 -4
- three/src/renderers/shaders/ShaderLib.d.ts +1 -1
- three/src/renderers/shaders/UniformsLib.d.ts +0 -3
- three/src/renderers/webgl/WebGLAttributes.d.ts +9 -7
- three/src/renderers/webgl/WebGLCapabilities.d.ts +2 -2
- three/src/renderers/webgl/WebGLEnvironments.d.ts +8 -0
- three/src/renderers/webgl/WebGLExtensions.d.ts +1 -1
- three/src/renderers/webgl/WebGLIndexedBufferRenderer.d.ts +9 -5
- three/src/renderers/webgl/WebGLLights.d.ts +19 -18
- three/src/renderers/webgl/WebGLObjects.d.ts +15 -2
- three/src/renderers/webgl/WebGLProgram.d.ts +2 -10
- three/src/renderers/webgl/WebGLPrograms.d.ts +2 -3
- three/src/renderers/webgl/WebGLRenderLists.d.ts +1 -3
- three/src/renderers/webgl/WebGLShadowMap.d.ts +0 -5
- three/src/renderers/webgl/WebGLState.d.ts +305 -28
- three/src/renderers/webgl/WebGLTextures.d.ts +10 -9
- three/src/renderers/webgl/WebGLUniforms.d.ts +0 -7
- three/src/renderers/webgpu/WebGPUBackend.d.ts +0 -1
- three/src/renderers/webgpu/nodes/BasicNodeLibrary.d.ts +2 -4
- three/src/renderers/webgpu/nodes/StandardNodeLibrary.d.ts +15 -4
- three/src/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts +1 -1
- three/src/scenes/Fog.d.ts +31 -37
- three/src/scenes/FogExp2.d.ts +26 -31
- three/src/scenes/Scene.d.ts +51 -65
- three/src/textures/CompressedArrayTexture.d.ts +1 -1
- three/src/textures/CubeDepthTexture.d.ts +41 -0
- three/src/textures/CubeTexture.d.ts +4 -4
- three/src/textures/DataArrayTexture.d.ts +1 -1
- three/src/utils.d.ts +18 -1
- three/examples/jsm/materials/MeshGouraudMaterial.d.ts +0 -18
- three/examples/jsm/materials/MeshPostProcessingMaterial.d.ts +0 -13
- three/examples/jsm/shaders/GodRaysShader.d.ts +0 -44
- three/src/nodes/accessors/SceneNode.d.ts +0 -21
- three/src/nodes/code/ScriptableNode.d.ts +0 -21
- three/src/nodes/code/ScriptableValueNode.d.ts +0 -9
- three/src/nodes/display/PosterizeNode.d.ts +0 -13
- three/src/nodes/functions/BSDF/DFGApprox.d.ts +0 -10
- three/src/nodes/utils/SpriteSheetUVNode.d.ts +0 -15
- three/src/renderers/webgl/WebGLCubeMaps.d.ts +0 -8
- three/src/renderers/webgl/WebGLCubeUVMaps.d.ts +0 -9
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Camera } from "../../cameras/Camera.js";
|
|
2
|
-
import { ShadowMapType, TextureDataType, TimestampQuery, ToneMapping } from "../../constants.js";
|
|
3
|
-
import { BufferAttribute } from "../../core/BufferAttribute.js";
|
|
2
|
+
import { CoordinateSystem, ShadowMapType, TextureDataType, TimestampQuery, ToneMapping } from "../../constants.js";
|
|
3
|
+
import { BufferAttribute, TypedArray } from "../../core/BufferAttribute.js";
|
|
4
4
|
import { BufferGeometry, GeometryGroup } from "../../core/BufferGeometry.js";
|
|
5
5
|
import { Object3D } from "../../core/Object3D.js";
|
|
6
6
|
import { RenderTarget } from "../../core/RenderTarget.js";
|
|
@@ -11,164 +11,630 @@ import { ColorRepresentation } from "../../math/Color.js";
|
|
|
11
11
|
import { Vector2 } from "../../math/Vector2.js";
|
|
12
12
|
import { Vector3 } from "../../math/Vector3.js";
|
|
13
13
|
import { Vector4 } from "../../math/Vector4.js";
|
|
14
|
+
import ContextNode from "../../nodes/core/ContextNode.js";
|
|
14
15
|
import MRTNode from "../../nodes/core/MRTNode.js";
|
|
15
16
|
import ComputeNode from "../../nodes/gpgpu/ComputeNode.js";
|
|
16
17
|
import LightsNode from "../../nodes/lighting/LightsNode.js";
|
|
17
|
-
import { Group } from "../../objects/Group.js";
|
|
18
18
|
import { Scene } from "../../scenes/Scene.js";
|
|
19
19
|
import { FramebufferTexture } from "../../textures/FramebufferTexture.js";
|
|
20
20
|
import { Texture } from "../../textures/Texture.js";
|
|
21
|
-
import Animation from "./Animation.js";
|
|
22
|
-
import Attributes from "./Attributes.js";
|
|
23
21
|
import Backend from "./Backend.js";
|
|
24
|
-
import Background from "./Background.js";
|
|
25
|
-
import Bindings from "./Bindings.js";
|
|
26
22
|
import CanvasTarget from "./CanvasTarget.js";
|
|
27
23
|
import ClippingContext from "./ClippingContext.js";
|
|
28
24
|
import Color4 from "./Color4.js";
|
|
29
|
-
import Geometries from "./Geometries.js";
|
|
30
25
|
import IndirectStorageBufferAttribute from "./IndirectStorageBufferAttribute.js";
|
|
31
26
|
import Info from "./Info.js";
|
|
32
27
|
import InspectorBase from "./InspectorBase.js";
|
|
33
28
|
import Lighting from "./Lighting.js";
|
|
34
29
|
import NodeLibrary from "./nodes/NodeLibrary.js";
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import QuadMesh from "./QuadMesh.js";
|
|
38
|
-
import RenderBundle from "./RenderBundle.js";
|
|
39
|
-
import RenderBundles from "./RenderBundles.js";
|
|
40
|
-
import RenderContext from "./RenderContext.js";
|
|
41
|
-
import RenderContexts from "./RenderContexts.js";
|
|
42
|
-
import RenderList, { Bundle, RenderItem } from "./RenderList.js";
|
|
43
|
-
import RenderLists from "./RenderLists.js";
|
|
44
|
-
import RenderObjects from "./RenderObjects.js";
|
|
45
|
-
import Textures from "./Textures.js";
|
|
30
|
+
import { RenderItem } from "./RenderList.js";
|
|
31
|
+
import StorageBufferAttribute from "./StorageBufferAttribute.js";
|
|
46
32
|
import XRManager from "./XRManager.js";
|
|
47
|
-
|
|
48
|
-
x: number;
|
|
49
|
-
y: number;
|
|
50
|
-
z: number;
|
|
51
|
-
w: number;
|
|
52
|
-
}
|
|
33
|
+
|
|
53
34
|
interface DeviceLostInfo {
|
|
54
35
|
api: "WebGL" | "WebGPU";
|
|
55
36
|
message: string;
|
|
56
37
|
reason: string | null;
|
|
57
38
|
originalEvent: unknown;
|
|
58
39
|
}
|
|
40
|
+
|
|
59
41
|
export interface RendererParameters {
|
|
60
42
|
logarithmicDepthBuffer?: boolean | undefined;
|
|
43
|
+
reversedDepthBuffer?: boolean | undefined;
|
|
61
44
|
alpha?: boolean | undefined;
|
|
62
45
|
depth?: boolean | undefined;
|
|
63
46
|
stencil?: boolean | undefined;
|
|
64
47
|
antialias?: boolean | undefined;
|
|
65
48
|
samples?: number | undefined;
|
|
66
49
|
getFallback?: ((error: unknown) => Backend) | null | undefined;
|
|
67
|
-
|
|
50
|
+
outputBufferType?: TextureDataType | undefined;
|
|
68
51
|
multiview?: boolean | undefined;
|
|
69
52
|
}
|
|
53
|
+
|
|
70
54
|
/**
|
|
71
55
|
* Base class for renderers.
|
|
72
56
|
*/
|
|
73
57
|
declare class Renderer {
|
|
74
|
-
|
|
58
|
+
/**
|
|
59
|
+
* Renderer options.
|
|
60
|
+
*
|
|
61
|
+
* @typedef {Object} Renderer~Options
|
|
62
|
+
* @property {boolean} [logarithmicDepthBuffer=false] - Whether logarithmic depth buffer is enabled or not.
|
|
63
|
+
* @property {boolean} [reversedDepthBuffer=false] - Whether reversed depth buffer is enabled or not.
|
|
64
|
+
* @property {boolean} [alpha=true] - Whether the default framebuffer (which represents the final contents of the canvas) should be transparent or opaque.
|
|
65
|
+
* @property {boolean} [depth=true] - Whether the default framebuffer should have a depth buffer or not.
|
|
66
|
+
* @property {boolean} [stencil=false] - Whether the default framebuffer should have a stencil buffer or not.
|
|
67
|
+
* @property {boolean} [antialias=false] - Whether MSAA as the default anti-aliasing should be enabled or not.
|
|
68
|
+
* @property {number} [samples=0] - When `antialias` is `true`, `4` samples are used by default. This parameter can set to any other integer value than 0
|
|
69
|
+
* to overwrite the default.
|
|
70
|
+
* @property {?Function} [getFallback=null] - This callback function can be used to provide a fallback backend, if the primary backend can't be targeted.
|
|
71
|
+
* @property {number} [outputBufferType=HalfFloatType] - Defines the type of output buffers. The default `HalfFloatType` is recommend for best
|
|
72
|
+
* quality. To save memory and bandwidth, `UnsignedByteType` might be used. This will reduce rendering quality though.
|
|
73
|
+
* @property {boolean} [multiview=false] - If set to `true`, the renderer will use multiview during WebXR rendering if supported.
|
|
74
|
+
*/
|
|
75
|
+
/**
|
|
76
|
+
* Constructs a new renderer.
|
|
77
|
+
*
|
|
78
|
+
* @param {Backend} backend - The backend the renderer is targeting (e.g. WebGPU or WebGL 2).
|
|
79
|
+
* @param {Renderer~Options} [parameters] - The configuration parameter.
|
|
80
|
+
*/
|
|
81
|
+
constructor(backend: Backend, parameters?: RendererParameters);
|
|
82
|
+
/**
|
|
83
|
+
* This flag can be used for type testing.
|
|
84
|
+
*
|
|
85
|
+
* @type {boolean}
|
|
86
|
+
* @readonly
|
|
87
|
+
* @default true
|
|
88
|
+
*/
|
|
89
|
+
readonly isRenderer: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* A reference to the current backend.
|
|
92
|
+
*
|
|
93
|
+
* @type {Backend}
|
|
94
|
+
*/
|
|
75
95
|
backend: Backend;
|
|
96
|
+
/**
|
|
97
|
+
* Whether the renderer should automatically clear the current rendering target
|
|
98
|
+
* before execute a `render()` call. The target can be the canvas (default framebuffer)
|
|
99
|
+
* or the current bound render target (custom framebuffer).
|
|
100
|
+
*
|
|
101
|
+
* @type {boolean}
|
|
102
|
+
* @default true
|
|
103
|
+
*/
|
|
76
104
|
autoClear: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* When `autoClear` is set to `true`, this property defines whether the renderer
|
|
107
|
+
* should clear the color buffer.
|
|
108
|
+
*
|
|
109
|
+
* @type {boolean}
|
|
110
|
+
* @default true
|
|
111
|
+
*/
|
|
77
112
|
autoClearColor: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* When `autoClear` is set to `true`, this property defines whether the renderer
|
|
115
|
+
* should clear the depth buffer.
|
|
116
|
+
*
|
|
117
|
+
* @type {boolean}
|
|
118
|
+
* @default true
|
|
119
|
+
*/
|
|
78
120
|
autoClearDepth: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* When `autoClear` is set to `true`, this property defines whether the renderer
|
|
123
|
+
* should clear the stencil buffer.
|
|
124
|
+
*
|
|
125
|
+
* @type {boolean}
|
|
126
|
+
* @default true
|
|
127
|
+
*/
|
|
79
128
|
autoClearStencil: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Whether the default framebuffer should be transparent or opaque.
|
|
131
|
+
*
|
|
132
|
+
* @type {boolean}
|
|
133
|
+
* @default true
|
|
134
|
+
*/
|
|
80
135
|
alpha: boolean;
|
|
81
|
-
|
|
136
|
+
/**
|
|
137
|
+
* Whether logarithmic depth buffer is enabled or not.
|
|
138
|
+
*
|
|
139
|
+
* @type {boolean}
|
|
140
|
+
* @default false
|
|
141
|
+
* @readonly
|
|
142
|
+
*/
|
|
143
|
+
readonly logarithmicDepthBuffer: boolean;
|
|
144
|
+
/**
|
|
145
|
+
* Whether reversed depth buffer is enabled or not.
|
|
146
|
+
*
|
|
147
|
+
* @type {boolean}
|
|
148
|
+
* @default false
|
|
149
|
+
* @readonly
|
|
150
|
+
*/
|
|
151
|
+
readonly reversedDepthBuffer: boolean;
|
|
152
|
+
/**
|
|
153
|
+
* Defines the output color space of the renderer.
|
|
154
|
+
*
|
|
155
|
+
* @type {string}
|
|
156
|
+
* @default SRGBColorSpace
|
|
157
|
+
*/
|
|
82
158
|
outputColorSpace: string;
|
|
159
|
+
/**
|
|
160
|
+
* Defines the tone mapping of the renderer.
|
|
161
|
+
*
|
|
162
|
+
* @type {number}
|
|
163
|
+
* @default NoToneMapping
|
|
164
|
+
*/
|
|
83
165
|
toneMapping: ToneMapping;
|
|
166
|
+
/**
|
|
167
|
+
* Defines the tone mapping exposure.
|
|
168
|
+
*
|
|
169
|
+
* @type {number}
|
|
170
|
+
* @default 1
|
|
171
|
+
*/
|
|
84
172
|
toneMappingExposure: number;
|
|
173
|
+
/**
|
|
174
|
+
* Whether the renderer should sort its render lists or not.
|
|
175
|
+
*
|
|
176
|
+
* Note: Sorting is used to attempt to properly render objects that have some degree of transparency.
|
|
177
|
+
* By definition, sorting objects may not work in all cases. Depending on the needs of application,
|
|
178
|
+
* it may be necessary to turn off sorting and use other methods to deal with transparency rendering
|
|
179
|
+
* e.g. manually determining each object's rendering order.
|
|
180
|
+
*
|
|
181
|
+
* @type {boolean}
|
|
182
|
+
* @default true
|
|
183
|
+
*/
|
|
85
184
|
sortObjects: boolean;
|
|
185
|
+
/**
|
|
186
|
+
* Whether the default framebuffer should have a depth buffer or not.
|
|
187
|
+
*
|
|
188
|
+
* @type {boolean}
|
|
189
|
+
* @default true
|
|
190
|
+
*/
|
|
86
191
|
depth: boolean;
|
|
192
|
+
/**
|
|
193
|
+
* Whether the default framebuffer should have a stencil buffer or not.
|
|
194
|
+
*
|
|
195
|
+
* @type {boolean}
|
|
196
|
+
* @default false
|
|
197
|
+
*/
|
|
87
198
|
stencil: boolean;
|
|
199
|
+
/**
|
|
200
|
+
* Holds a series of statistical information about the GPU memory
|
|
201
|
+
* and the rendering process. Useful for debugging and monitoring.
|
|
202
|
+
*
|
|
203
|
+
* @type {Info}
|
|
204
|
+
*/
|
|
88
205
|
info: Info;
|
|
206
|
+
/**
|
|
207
|
+
* A global context node that stores override nodes for specific transformations or calculations.
|
|
208
|
+
* These nodes can be used to replace default behavior in the rendering pipeline.
|
|
209
|
+
*
|
|
210
|
+
* @type {ContextNode}
|
|
211
|
+
* @property {Object} value - The context value object.
|
|
212
|
+
*/
|
|
213
|
+
contextNode: ContextNode<unknown>;
|
|
214
|
+
/**
|
|
215
|
+
* The node library defines how certain library objects like materials, lights
|
|
216
|
+
* or tone mapping functions are mapped to node types. This is required since
|
|
217
|
+
* although instances of classes like `MeshBasicMaterial` or `PointLight` can
|
|
218
|
+
* be part of the scene graph, they are internally represented as nodes for
|
|
219
|
+
* further processing.
|
|
220
|
+
*
|
|
221
|
+
* @type {NodeLibrary}
|
|
222
|
+
*/
|
|
89
223
|
library: NodeLibrary;
|
|
224
|
+
/**
|
|
225
|
+
* A map-like data structure for managing lights.
|
|
226
|
+
*
|
|
227
|
+
* @type {Lighting}
|
|
228
|
+
*/
|
|
90
229
|
lighting: Lighting;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
230
|
+
/**
|
|
231
|
+
* The number of MSAA samples.
|
|
232
|
+
*
|
|
233
|
+
* @private
|
|
234
|
+
* @type {number}
|
|
235
|
+
* @default 0
|
|
236
|
+
*/
|
|
237
|
+
private _samples;
|
|
238
|
+
/**
|
|
239
|
+
* Callback when the canvas has been resized.
|
|
240
|
+
*
|
|
241
|
+
* @private
|
|
242
|
+
*/
|
|
243
|
+
private _onCanvasTargetResize;
|
|
244
|
+
/**
|
|
245
|
+
* The canvas target for rendering.
|
|
246
|
+
*
|
|
247
|
+
* @private
|
|
248
|
+
* @type {CanvasTarget}
|
|
249
|
+
*/
|
|
250
|
+
private _canvasTarget;
|
|
251
|
+
/**
|
|
252
|
+
* The inspector provides information about the internal renderer state.
|
|
253
|
+
*
|
|
254
|
+
* @private
|
|
255
|
+
* @type {InspectorBase}
|
|
256
|
+
*/
|
|
257
|
+
private _inspector;
|
|
258
|
+
/**
|
|
259
|
+
* This callback function can be used to provide a fallback backend, if the primary backend can't be targeted.
|
|
260
|
+
*
|
|
261
|
+
* @private
|
|
262
|
+
* @type {?Function}
|
|
263
|
+
*/
|
|
264
|
+
private _getFallback;
|
|
265
|
+
/**
|
|
266
|
+
* A reference to a renderer module for managing shader attributes.
|
|
267
|
+
*
|
|
268
|
+
* @private
|
|
269
|
+
* @type {?Attributes}
|
|
270
|
+
* @default null
|
|
271
|
+
*/
|
|
272
|
+
private _attributes;
|
|
273
|
+
/**
|
|
274
|
+
* A reference to a renderer module for managing geometries.
|
|
275
|
+
*
|
|
276
|
+
* @private
|
|
277
|
+
* @type {?Geometries}
|
|
278
|
+
* @default null
|
|
279
|
+
*/
|
|
280
|
+
private _geometries;
|
|
281
|
+
/**
|
|
282
|
+
* A reference to a renderer module for managing node related logic.
|
|
283
|
+
*
|
|
284
|
+
* @private
|
|
285
|
+
* @type {?NodeManager}
|
|
286
|
+
* @default null
|
|
287
|
+
*/
|
|
288
|
+
private _nodes;
|
|
289
|
+
/**
|
|
290
|
+
* A reference to a renderer module for managing the internal animation loop.
|
|
291
|
+
*
|
|
292
|
+
* @private
|
|
293
|
+
* @type {?Animation}
|
|
294
|
+
* @default null
|
|
295
|
+
*/
|
|
296
|
+
private _animation;
|
|
297
|
+
/**
|
|
298
|
+
* A reference to a renderer module for managing shader program bindings.
|
|
299
|
+
*
|
|
300
|
+
* @private
|
|
301
|
+
* @type {?Bindings}
|
|
302
|
+
* @default null
|
|
303
|
+
*/
|
|
304
|
+
private _bindings;
|
|
305
|
+
/**
|
|
306
|
+
* A reference to a renderer module for managing render objects.
|
|
307
|
+
*
|
|
308
|
+
* @private
|
|
309
|
+
* @type {?RenderObjects}
|
|
310
|
+
* @default null
|
|
311
|
+
*/
|
|
312
|
+
private _objects;
|
|
313
|
+
/**
|
|
314
|
+
* A reference to a renderer module for managing render and compute pipelines.
|
|
315
|
+
*
|
|
316
|
+
* @private
|
|
317
|
+
* @type {?Pipelines}
|
|
318
|
+
* @default null
|
|
319
|
+
*/
|
|
320
|
+
private _pipelines;
|
|
321
|
+
/**
|
|
322
|
+
* A reference to a renderer module for managing render bundles.
|
|
323
|
+
*
|
|
324
|
+
* @private
|
|
325
|
+
* @type {?RenderBundles}
|
|
326
|
+
* @default null
|
|
327
|
+
*/
|
|
328
|
+
private _bundles;
|
|
329
|
+
/**
|
|
330
|
+
* A reference to a renderer module for managing render lists.
|
|
331
|
+
*
|
|
332
|
+
* @private
|
|
333
|
+
* @type {?RenderLists}
|
|
334
|
+
* @default null
|
|
335
|
+
*/
|
|
336
|
+
private _renderLists;
|
|
337
|
+
/**
|
|
338
|
+
* A reference to a renderer module for managing render contexts.
|
|
339
|
+
*
|
|
340
|
+
* @private
|
|
341
|
+
* @type {?RenderContexts}
|
|
342
|
+
* @default null
|
|
343
|
+
*/
|
|
344
|
+
private _renderContexts;
|
|
345
|
+
/**
|
|
346
|
+
* A reference to a renderer module for managing textures.
|
|
347
|
+
*
|
|
348
|
+
* @private
|
|
349
|
+
* @type {?Textures}
|
|
350
|
+
* @default null
|
|
351
|
+
*/
|
|
352
|
+
private _textures;
|
|
353
|
+
/**
|
|
354
|
+
* A reference to a renderer module for backgrounds.
|
|
355
|
+
*
|
|
356
|
+
* @private
|
|
357
|
+
* @type {?Background}
|
|
358
|
+
* @default null
|
|
359
|
+
*/
|
|
360
|
+
private _background;
|
|
361
|
+
/**
|
|
362
|
+
* This fullscreen quad is used for internal render passes
|
|
363
|
+
* like the tone mapping and color space output pass.
|
|
364
|
+
*
|
|
365
|
+
* @private
|
|
366
|
+
* @type {QuadMesh}
|
|
367
|
+
*/
|
|
368
|
+
private _quad;
|
|
369
|
+
/**
|
|
370
|
+
* A reference to the current render context.
|
|
371
|
+
*
|
|
372
|
+
* @private
|
|
373
|
+
* @type {?RenderContext}
|
|
374
|
+
* @default null
|
|
375
|
+
*/
|
|
376
|
+
private _currentRenderContext;
|
|
377
|
+
/**
|
|
378
|
+
* A custom sort function for the opaque render list.
|
|
379
|
+
*
|
|
380
|
+
* @private
|
|
381
|
+
* @type {?Function}
|
|
382
|
+
* @default null
|
|
383
|
+
*/
|
|
384
|
+
private _opaqueSort;
|
|
385
|
+
/**
|
|
386
|
+
* A custom sort function for the transparent render list.
|
|
387
|
+
*
|
|
388
|
+
* @private
|
|
389
|
+
* @type {?Function}
|
|
390
|
+
* @default null
|
|
391
|
+
*/
|
|
392
|
+
private _transparentSort;
|
|
393
|
+
/**
|
|
394
|
+
* The framebuffer target.
|
|
395
|
+
*
|
|
396
|
+
* @private
|
|
397
|
+
* @type {?RenderTarget}
|
|
398
|
+
* @default null
|
|
399
|
+
*/
|
|
400
|
+
private _frameBufferTarget;
|
|
401
|
+
/**
|
|
402
|
+
* The clear color value.
|
|
403
|
+
*
|
|
404
|
+
* @private
|
|
405
|
+
* @type {Color4}
|
|
406
|
+
*/
|
|
407
|
+
private _clearColor;
|
|
408
|
+
/**
|
|
409
|
+
* The clear depth value.
|
|
410
|
+
*
|
|
411
|
+
* @private
|
|
412
|
+
* @type {number}
|
|
413
|
+
* @default 1
|
|
414
|
+
*/
|
|
415
|
+
private _clearDepth;
|
|
416
|
+
/**
|
|
417
|
+
* The clear stencil value.
|
|
418
|
+
*
|
|
419
|
+
* @private
|
|
420
|
+
* @type {number}
|
|
421
|
+
* @default 0
|
|
422
|
+
*/
|
|
423
|
+
private _clearStencil;
|
|
424
|
+
/**
|
|
425
|
+
* The current render target.
|
|
426
|
+
*
|
|
427
|
+
* @private
|
|
428
|
+
* @type {?RenderTarget}
|
|
429
|
+
* @default null
|
|
430
|
+
*/
|
|
431
|
+
private _renderTarget;
|
|
432
|
+
/**
|
|
433
|
+
* The active cube face.
|
|
434
|
+
*
|
|
435
|
+
* @private
|
|
436
|
+
* @type {number}
|
|
437
|
+
* @default 0
|
|
438
|
+
*/
|
|
439
|
+
private _activeCubeFace;
|
|
440
|
+
/**
|
|
441
|
+
* The active mipmap level.
|
|
442
|
+
*
|
|
443
|
+
* @private
|
|
444
|
+
* @type {number}
|
|
445
|
+
* @default 0
|
|
446
|
+
*/
|
|
447
|
+
private _activeMipmapLevel;
|
|
448
|
+
/**
|
|
449
|
+
* The current output render target.
|
|
450
|
+
*
|
|
451
|
+
* @private
|
|
452
|
+
* @type {?RenderTarget}
|
|
453
|
+
* @default null
|
|
454
|
+
*/
|
|
455
|
+
private _outputRenderTarget;
|
|
456
|
+
/**
|
|
457
|
+
* The MRT setting.
|
|
458
|
+
*
|
|
459
|
+
* @private
|
|
460
|
+
* @type {?MRTNode}
|
|
461
|
+
* @default null
|
|
462
|
+
*/
|
|
463
|
+
private _mrt;
|
|
464
|
+
/**
|
|
465
|
+
* This function defines how a render object is going
|
|
466
|
+
* to be rendered.
|
|
467
|
+
*
|
|
468
|
+
* @private
|
|
469
|
+
* @type {?Function}
|
|
470
|
+
* @default null
|
|
471
|
+
*/
|
|
472
|
+
private _renderObjectFunction;
|
|
473
|
+
/**
|
|
474
|
+
* Used to keep track of the current render object function.
|
|
475
|
+
*
|
|
476
|
+
* @private
|
|
477
|
+
* @type {?Function}
|
|
478
|
+
* @default null
|
|
479
|
+
*/
|
|
480
|
+
private _currentRenderObjectFunction;
|
|
481
|
+
/**
|
|
482
|
+
* Used to keep track of the current render bundle.
|
|
483
|
+
*
|
|
484
|
+
* @private
|
|
485
|
+
* @type {?RenderBundle}
|
|
486
|
+
* @default null
|
|
487
|
+
*/
|
|
488
|
+
private _currentRenderBundle;
|
|
489
|
+
/**
|
|
490
|
+
* Next to `_renderObjectFunction()`, this function provides another hook
|
|
491
|
+
* for influencing the render process of a render object. It is meant for internal
|
|
492
|
+
* use and only relevant for `compileAsync()` right now. Instead of using
|
|
493
|
+
* the default logic of `_renderObjectDirect()` which actually draws the render object,
|
|
494
|
+
* a different function might be used which performs no draw but just the node
|
|
495
|
+
* and pipeline updates.
|
|
496
|
+
*
|
|
497
|
+
* @private
|
|
498
|
+
* @type {Function}
|
|
499
|
+
*/
|
|
500
|
+
private _handleObjectFunction;
|
|
501
|
+
/**
|
|
502
|
+
* Indicates whether the device has been lost or not. In WebGL terms, the device
|
|
503
|
+
* lost is considered as a context lost. When this is set to `true`, rendering
|
|
504
|
+
* isn't possible anymore.
|
|
505
|
+
*
|
|
506
|
+
* @private
|
|
507
|
+
* @type {boolean}
|
|
508
|
+
* @default false
|
|
509
|
+
*/
|
|
510
|
+
private _isDeviceLost;
|
|
511
|
+
/**
|
|
512
|
+
* A callback function that defines what should happen when a device/context lost occurs.
|
|
513
|
+
*
|
|
514
|
+
* @type {Function}
|
|
515
|
+
*/
|
|
158
516
|
onDeviceLost: (info: DeviceLostInfo) => void;
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
517
|
+
/**
|
|
518
|
+
* Defines the type of output buffers. The default `HalfFloatType` is recommend for
|
|
519
|
+
* best quality. To save memory and bandwidth, `UnsignedByteType` might be used.
|
|
520
|
+
* This will reduce rendering quality though.
|
|
521
|
+
*
|
|
522
|
+
* @private
|
|
523
|
+
* @type {number}
|
|
524
|
+
* @default HalfFloatType
|
|
525
|
+
*/
|
|
526
|
+
private _outputBufferType;
|
|
527
|
+
/**
|
|
528
|
+
* A cache for shadow nodes per material
|
|
529
|
+
*
|
|
530
|
+
* @private
|
|
531
|
+
* @type {WeakMap<Material, Object>}
|
|
532
|
+
*/
|
|
533
|
+
private _cacheShadowNodes;
|
|
534
|
+
/**
|
|
535
|
+
* Whether the renderer has been initialized or not.
|
|
536
|
+
*
|
|
537
|
+
* @private
|
|
538
|
+
* @type {boolean}
|
|
539
|
+
* @default false
|
|
540
|
+
*/
|
|
541
|
+
private _initialized;
|
|
542
|
+
/**
|
|
543
|
+
* The call depth of the renderer. Counts the number of
|
|
544
|
+
* nested render calls.
|
|
545
|
+
*
|
|
546
|
+
* @private
|
|
547
|
+
* @type {number}
|
|
548
|
+
* @default - 1
|
|
549
|
+
*/
|
|
550
|
+
private _callDepth;
|
|
551
|
+
/**
|
|
552
|
+
* A reference to the promise which initializes the renderer.
|
|
553
|
+
*
|
|
554
|
+
* @private
|
|
555
|
+
* @type {?Promise<this>}
|
|
556
|
+
* @default null
|
|
557
|
+
*/
|
|
558
|
+
private _initPromise;
|
|
559
|
+
/**
|
|
560
|
+
* An array of compilation promises which are used in `compileAsync()`.
|
|
561
|
+
*
|
|
562
|
+
* @private
|
|
563
|
+
* @type {?Array<Promise>}
|
|
564
|
+
* @default null
|
|
565
|
+
*/
|
|
566
|
+
private _compilationPromises;
|
|
567
|
+
/**
|
|
568
|
+
* Whether the renderer should render transparent render objects or not.
|
|
569
|
+
*
|
|
570
|
+
* @type {boolean}
|
|
571
|
+
* @default true
|
|
572
|
+
*/
|
|
163
573
|
transparent: boolean;
|
|
574
|
+
/**
|
|
575
|
+
* Whether the renderer should render opaque render objects or not.
|
|
576
|
+
*
|
|
577
|
+
* @type {boolean}
|
|
578
|
+
* @default true
|
|
579
|
+
*/
|
|
164
580
|
opaque: boolean;
|
|
581
|
+
/**
|
|
582
|
+
* Shadow map configuration
|
|
583
|
+
* @typedef {Object} ShadowMapConfig
|
|
584
|
+
* @property {boolean} enabled - Whether to globally enable shadows or not.
|
|
585
|
+
* @property {boolean} transmitted - Whether to enable light transmission through non-opaque materials.
|
|
586
|
+
* @property {number} type - The shadow map type.
|
|
587
|
+
*/
|
|
588
|
+
/**
|
|
589
|
+
* The renderer's shadow configuration.
|
|
590
|
+
*
|
|
591
|
+
* @type {ShadowMapConfig}
|
|
592
|
+
*/
|
|
165
593
|
shadowMap: {
|
|
594
|
+
/**
|
|
595
|
+
* - Whether to globally enable shadows or not.
|
|
596
|
+
*/
|
|
166
597
|
enabled: boolean;
|
|
167
|
-
|
|
598
|
+
/**
|
|
599
|
+
* - Whether to enable light transmission through non-opaque materials.
|
|
600
|
+
*/
|
|
601
|
+
transmitted: boolean;
|
|
602
|
+
/**
|
|
603
|
+
* - The shadow map type.
|
|
604
|
+
*/
|
|
605
|
+
type: ShadowMapType;
|
|
168
606
|
};
|
|
607
|
+
/**
|
|
608
|
+
* XR configuration.
|
|
609
|
+
* @typedef {Object} XRConfig
|
|
610
|
+
* @property {boolean} enabled - Whether to globally enable XR or not.
|
|
611
|
+
*/
|
|
612
|
+
/**
|
|
613
|
+
* The renderer's XR manager.
|
|
614
|
+
*
|
|
615
|
+
* @type {XRManager}
|
|
616
|
+
*/
|
|
169
617
|
xr: XRManager;
|
|
618
|
+
/**
|
|
619
|
+
* Debug configuration.
|
|
620
|
+
* @typedef {Object} DebugConfig
|
|
621
|
+
* @property {boolean} checkShaderErrors - Whether shader errors should be checked or not.
|
|
622
|
+
* @property {?Function} onShaderError - A callback function that is executed when a shader error happens. Only supported with WebGL 2 right now.
|
|
623
|
+
* @property {Function} getShaderAsync - Allows the get the raw shader code for the given scene, camera and 3D object.
|
|
624
|
+
*/
|
|
625
|
+
/**
|
|
626
|
+
* The renderer's debug configuration.
|
|
627
|
+
*
|
|
628
|
+
* @type {DebugConfig}
|
|
629
|
+
*/
|
|
170
630
|
debug: {
|
|
631
|
+
/**
|
|
632
|
+
* - Whether shader errors should be checked or not.
|
|
633
|
+
*/
|
|
171
634
|
checkShaderErrors: boolean;
|
|
635
|
+
/**
|
|
636
|
+
* - A callback function that is executed when a shader error happens. Only supported with WebGL 2 right now.
|
|
637
|
+
*/
|
|
172
638
|
onShaderError:
|
|
173
639
|
| ((
|
|
174
640
|
gl: WebGL2RenderingContext,
|
|
@@ -177,35 +643,14 @@ declare class Renderer {
|
|
|
177
643
|
glFragmentShader: WebGLShader,
|
|
178
644
|
) => void)
|
|
179
645
|
| null;
|
|
646
|
+
/**
|
|
647
|
+
* - Allows the get the raw shader code for the given scene, camera and 3D object.
|
|
648
|
+
*/
|
|
180
649
|
getShaderAsync: (scene: Scene, camera: Camera, object: Object3D) => Promise<{
|
|
181
650
|
fragmentShader: string | null;
|
|
182
651
|
vertexShader: string | null;
|
|
183
652
|
}>;
|
|
184
653
|
};
|
|
185
|
-
localClippingEnabled?: boolean | undefined;
|
|
186
|
-
/**
|
|
187
|
-
* Renderer options.
|
|
188
|
-
*
|
|
189
|
-
* @typedef {Object} Renderer~Options
|
|
190
|
-
* @property {boolean} [logarithmicDepthBuffer=false] - Whether logarithmic depth buffer is enabled or not.
|
|
191
|
-
* @property {boolean} [alpha=true] - Whether the default framebuffer (which represents the final contents of the canvas) should be transparent or opaque.
|
|
192
|
-
* @property {boolean} [depth=true] - Whether the default framebuffer should have a depth buffer or not.
|
|
193
|
-
* @property {boolean} [stencil=false] - Whether the default framebuffer should have a stencil buffer or not.
|
|
194
|
-
* @property {boolean} [antialias=false] - Whether MSAA as the default anti-aliasing should be enabled or not.
|
|
195
|
-
* @property {number} [samples=0] - When `antialias` is `true`, `4` samples are used by default. This parameter can set to any other integer value than 0
|
|
196
|
-
* to overwrite the default.
|
|
197
|
-
* @property {?Function} [getFallback=null] - This callback function can be used to provide a fallback backend, if the primary backend can't be targeted.
|
|
198
|
-
* @property {number} [colorBufferType=HalfFloatType] - Defines the type of color buffers. The default `HalfFloatType` is recommend for best
|
|
199
|
-
* quality. To save memory and bandwidth, `UnsignedByteType` might be used. This will reduce rendering quality though.
|
|
200
|
-
* @property {boolean} [multiview=false] - If set to `true`, the renderer will use multiview during WebXR rendering if supported.
|
|
201
|
-
*/
|
|
202
|
-
/**
|
|
203
|
-
* Constructs a new renderer.
|
|
204
|
-
*
|
|
205
|
-
* @param {Backend} backend - The backend the renderer is targeting (e.g. WebGPU or WebGL 2).
|
|
206
|
-
* @param {Renderer~Options} [parameters] - The configuration parameter.
|
|
207
|
-
*/
|
|
208
|
-
constructor(backend: Backend, parameters?: RendererParameters);
|
|
209
654
|
/**
|
|
210
655
|
* Initializes the renderer so it is ready for usage.
|
|
211
656
|
*
|
|
@@ -229,7 +674,7 @@ declare class Renderer {
|
|
|
229
674
|
* @readonly
|
|
230
675
|
* @type {number}
|
|
231
676
|
*/
|
|
232
|
-
get coordinateSystem():
|
|
677
|
+
get coordinateSystem(): CoordinateSystem;
|
|
233
678
|
/**
|
|
234
679
|
* Compiles all materials in the given scene. This can be useful to avoid a
|
|
235
680
|
* phenomenon which is called "shader compilation stutter", which occurs when
|
|
@@ -243,7 +688,7 @@ declare class Renderer {
|
|
|
243
688
|
* @param {Object3D} scene - The scene or 3D object to precompile.
|
|
244
689
|
* @param {Camera} camera - The camera that is used to render the scene.
|
|
245
690
|
* @param {?Scene} targetScene - If the first argument is a 3D object, this parameter must represent the scene the 3D object is going to be added.
|
|
246
|
-
* @return {Promise
|
|
691
|
+
* @return {Promise} A Promise that resolves when the compile has been finished.
|
|
247
692
|
*/
|
|
248
693
|
compileAsync(scene: Object3D, camera: Camera, targetScene?: Scene | null): Promise<void>;
|
|
249
694
|
/**
|
|
@@ -265,12 +710,12 @@ declare class Renderer {
|
|
|
265
710
|
* @return {Promise} A Promise that resolves when synchronization has been finished.
|
|
266
711
|
*/
|
|
267
712
|
waitForGPU(): Promise<void>;
|
|
713
|
+
set inspector(value: InspectorBase);
|
|
268
714
|
/**
|
|
269
|
-
*
|
|
715
|
+
* The inspector instance. The inspector can be any class that extends from `InspectorBase`.
|
|
270
716
|
*
|
|
271
|
-
* @
|
|
717
|
+
* @type {InspectorBase}
|
|
272
718
|
*/
|
|
273
|
-
set inspector(value: InspectorBase);
|
|
274
719
|
get inspector(): InspectorBase;
|
|
275
720
|
/**
|
|
276
721
|
* Enables or disables high precision for model-view and normal-view matrices.
|
|
@@ -295,17 +740,24 @@ declare class Renderer {
|
|
|
295
740
|
* @param {MRTNode} mrt - The MRT node to set.
|
|
296
741
|
* @return {Renderer} A reference to this renderer.
|
|
297
742
|
*/
|
|
298
|
-
setMRT(mrt: MRTNode | null):
|
|
743
|
+
setMRT(mrt: MRTNode | null): Renderer;
|
|
299
744
|
/**
|
|
300
745
|
* Returns the MRT configuration.
|
|
301
746
|
*
|
|
302
747
|
* @return {MRTNode} The MRT configuration.
|
|
303
748
|
*/
|
|
304
|
-
getMRT(): MRTNode
|
|
749
|
+
getMRT(): MRTNode;
|
|
750
|
+
/**
|
|
751
|
+
* Returns the output buffer type.
|
|
752
|
+
*
|
|
753
|
+
* @return {number} The output buffer type.
|
|
754
|
+
*/
|
|
755
|
+
getOutputBufferType(): TextureDataType;
|
|
305
756
|
/**
|
|
306
|
-
* Returns the
|
|
757
|
+
* Returns the output buffer type.
|
|
307
758
|
*
|
|
308
|
-
* @
|
|
759
|
+
* @deprecated since r182. Use `.getOutputBufferType()` instead.
|
|
760
|
+
* @return {number} The output buffer type.
|
|
309
761
|
*/
|
|
310
762
|
getColorBufferType(): TextureDataType;
|
|
311
763
|
/**
|
|
@@ -314,7 +766,7 @@ declare class Renderer {
|
|
|
314
766
|
* @private
|
|
315
767
|
* @param {Object} info - Information about the context lost.
|
|
316
768
|
*/
|
|
317
|
-
_onDeviceLost
|
|
769
|
+
private _onDeviceLost;
|
|
318
770
|
/**
|
|
319
771
|
* Renders the given render bundle.
|
|
320
772
|
*
|
|
@@ -323,7 +775,7 @@ declare class Renderer {
|
|
|
323
775
|
* @param {Scene} sceneRef - The scene the render bundle belongs to.
|
|
324
776
|
* @param {LightsNode} lightsNode - The lights node.
|
|
325
777
|
*/
|
|
326
|
-
_renderBundle
|
|
778
|
+
private _renderBundle;
|
|
327
779
|
/**
|
|
328
780
|
* Renders the scene or 3D object with the given camera. This method can only be called
|
|
329
781
|
* if the renderer has been initialized. When using `render()` inside an animation loop,
|
|
@@ -355,7 +807,7 @@ declare class Renderer {
|
|
|
355
807
|
* @private
|
|
356
808
|
* @return {?RenderTarget} The render target. The method returns `null` if no output conversion should be applied.
|
|
357
809
|
*/
|
|
358
|
-
_getFrameBufferTarget
|
|
810
|
+
private _getFrameBufferTarget;
|
|
359
811
|
/**
|
|
360
812
|
* Renders the scene or 3D object with the given camera.
|
|
361
813
|
*
|
|
@@ -365,7 +817,7 @@ declare class Renderer {
|
|
|
365
817
|
* @param {boolean} [useFrameBufferTarget=true] - Whether to use a framebuffer target or not.
|
|
366
818
|
* @return {RenderContext} The current render context.
|
|
367
819
|
*/
|
|
368
|
-
_renderScene
|
|
820
|
+
private _renderScene;
|
|
369
821
|
_setXRLayerSize(width: number, height: number): void;
|
|
370
822
|
/**
|
|
371
823
|
* The output pass performs tone mapping and color space conversion.
|
|
@@ -373,7 +825,7 @@ declare class Renderer {
|
|
|
373
825
|
* @private
|
|
374
826
|
* @param {RenderTarget} renderTarget - The current render target.
|
|
375
827
|
*/
|
|
376
|
-
_renderOutput
|
|
828
|
+
private _renderOutput;
|
|
377
829
|
/**
|
|
378
830
|
* Returns the maximum available anisotropy for texture filtering.
|
|
379
831
|
*
|
|
@@ -422,7 +874,7 @@ declare class Renderer {
|
|
|
422
874
|
*
|
|
423
875
|
* @return {GPUCanvasContext|WebGL2RenderingContext} The rendering context.
|
|
424
876
|
*/
|
|
425
|
-
getContext():
|
|
877
|
+
getContext(): unknown;
|
|
426
878
|
/**
|
|
427
879
|
* Returns the pixel ratio.
|
|
428
880
|
*
|
|
@@ -492,16 +944,18 @@ declare class Renderer {
|
|
|
492
944
|
* @return {Vector4} The scissor rectangle.
|
|
493
945
|
*/
|
|
494
946
|
getScissor(target: Vector4): Vector4;
|
|
947
|
+
/**
|
|
948
|
+
* Defines the scissor rectangle.
|
|
949
|
+
*/
|
|
950
|
+
setScissor(x: Vector4): void;
|
|
495
951
|
/**
|
|
496
952
|
* Defines the scissor rectangle.
|
|
497
953
|
*
|
|
498
|
-
* @param {number
|
|
499
|
-
*
|
|
500
|
-
* @param {number} y - The vertical coordinate for the lower left corner of the box in logical pixel unit.
|
|
954
|
+
* @param {number} x - The horizontal coordinate for the upper left corner of the box in logical pixel unit.
|
|
955
|
+
* @param {number} y - The vertical coordinate for the upper left corner of the box in logical pixel unit.
|
|
501
956
|
* @param {number} width - The width of the scissor box in logical pixel unit.
|
|
502
957
|
* @param {number} height - The height of the scissor box in logical pixel unit.
|
|
503
958
|
*/
|
|
504
|
-
setScissor(x: Vector4): void;
|
|
505
959
|
setScissor(x: number, y: number, width: number, height: number): void;
|
|
506
960
|
/**
|
|
507
961
|
* Returns the scissor test value.
|
|
@@ -522,17 +976,20 @@ declare class Renderer {
|
|
|
522
976
|
* @return {Vector4} The viewport definition.
|
|
523
977
|
*/
|
|
524
978
|
getViewport(target: Vector4): Vector4;
|
|
979
|
+
/**
|
|
980
|
+
* Defines the viewport.
|
|
981
|
+
*/
|
|
982
|
+
setViewport(x: Vector4): void;
|
|
525
983
|
/**
|
|
526
984
|
* Defines the viewport.
|
|
527
985
|
*
|
|
528
|
-
* @param {number
|
|
529
|
-
* @param {number} y - The vertical coordinate for the
|
|
986
|
+
* @param {number} x - The horizontal coordinate for the upper left corner of the viewport origin in logical pixel unit.
|
|
987
|
+
* @param {number} y - The vertical coordinate for the upper left corner of the viewport origin in logical pixel unit.
|
|
530
988
|
* @param {number} width - The width of the viewport in logical pixel unit.
|
|
531
989
|
* @param {number} height - The height of the viewport in logical pixel unit.
|
|
532
990
|
* @param {number} minDepth - The minimum depth value of the viewport. WebGPU only.
|
|
533
991
|
* @param {number} maxDepth - The maximum depth value of the viewport. WebGPU only.
|
|
534
992
|
*/
|
|
535
|
-
setViewport(x: Vector4): void;
|
|
536
993
|
setViewport(x: number, y: number, width: number, height: number, minDepth?: number, maxDepth?: number): void;
|
|
537
994
|
/**
|
|
538
995
|
* Returns the clear color.
|
|
@@ -592,7 +1049,7 @@ declare class Renderer {
|
|
|
592
1049
|
* @param {Object3D} object - The 3D object to test.
|
|
593
1050
|
* @return {boolean} Whether the 3D object is fully occluded or not.
|
|
594
1051
|
*/
|
|
595
|
-
isOccluded(object: Object3D): boolean
|
|
1052
|
+
isOccluded(object: Object3D): boolean;
|
|
596
1053
|
/**
|
|
597
1054
|
* Performs a manual clear operation. This method ignores `autoClear` properties.
|
|
598
1055
|
*
|
|
@@ -716,7 +1173,7 @@ declare class Renderer {
|
|
|
716
1173
|
*
|
|
717
1174
|
* @param {Object} renderTarget - The render target to set as the output target.
|
|
718
1175
|
*/
|
|
719
|
-
setOutputRenderTarget(renderTarget: RenderTarget
|
|
1176
|
+
setOutputRenderTarget(renderTarget: RenderTarget): void;
|
|
720
1177
|
/**
|
|
721
1178
|
* Returns the current output target.
|
|
722
1179
|
*
|
|
@@ -738,8 +1195,10 @@ declare class Renderer {
|
|
|
738
1195
|
getCanvasTarget(): CanvasTarget;
|
|
739
1196
|
/**
|
|
740
1197
|
* Resets the renderer to the initial state before WebXR started.
|
|
1198
|
+
*
|
|
1199
|
+
* @private
|
|
741
1200
|
*/
|
|
742
|
-
_resetXRState
|
|
1201
|
+
private _resetXRState;
|
|
743
1202
|
/**
|
|
744
1203
|
* Callback for {@link Renderer#setRenderObjectFunction}.
|
|
745
1204
|
*
|
|
@@ -773,8 +1232,10 @@ declare class Renderer {
|
|
|
773
1232
|
camera: Camera,
|
|
774
1233
|
geometry: BufferGeometry,
|
|
775
1234
|
material: Material,
|
|
776
|
-
group: GeometryGroup,
|
|
1235
|
+
group: GeometryGroup | null,
|
|
777
1236
|
lightsNode: LightsNode,
|
|
1237
|
+
clippingContext: ClippingContext,
|
|
1238
|
+
passId?: string | null | undefined,
|
|
778
1239
|
) => void)
|
|
779
1240
|
| null,
|
|
780
1241
|
): void;
|
|
@@ -790,10 +1251,10 @@ declare class Renderer {
|
|
|
790
1251
|
camera: Camera,
|
|
791
1252
|
geometry: BufferGeometry,
|
|
792
1253
|
material: Material,
|
|
793
|
-
group: GeometryGroup,
|
|
1254
|
+
group: GeometryGroup | null,
|
|
794
1255
|
lightsNode: LightsNode,
|
|
795
|
-
clippingContext: ClippingContext
|
|
796
|
-
passId
|
|
1256
|
+
clippingContext: ClippingContext,
|
|
1257
|
+
passId?: string | null | undefined,
|
|
797
1258
|
) => void)
|
|
798
1259
|
| null;
|
|
799
1260
|
/**
|
|
@@ -809,7 +1270,7 @@ declare class Renderer {
|
|
|
809
1270
|
*/
|
|
810
1271
|
compute(
|
|
811
1272
|
computeNodes: ComputeNode | ComputeNode[],
|
|
812
|
-
dispatchSize?: number
|
|
1273
|
+
dispatchSize?: number | number[] | IndirectStorageBufferAttribute,
|
|
813
1274
|
): Promise<void> | undefined;
|
|
814
1275
|
/**
|
|
815
1276
|
* Execute a single or an array of compute nodes.
|
|
@@ -824,7 +1285,7 @@ declare class Renderer {
|
|
|
824
1285
|
*/
|
|
825
1286
|
computeAsync(
|
|
826
1287
|
computeNodes: ComputeNode | ComputeNode[],
|
|
827
|
-
dispatchSize?: number
|
|
1288
|
+
dispatchSize?: number | number[] | IndirectStorageBufferAttribute,
|
|
828
1289
|
): Promise<void>;
|
|
829
1290
|
/**
|
|
830
1291
|
* Checks if the given feature is supported by the selected backend.
|
|
@@ -834,7 +1295,7 @@ declare class Renderer {
|
|
|
834
1295
|
* @param {string} name - The feature's name.
|
|
835
1296
|
* @return {Promise<boolean>} A Promise that resolves with a bool that indicates whether the feature is supported or not.
|
|
836
1297
|
*/
|
|
837
|
-
hasFeatureAsync(name: string): Promise<
|
|
1298
|
+
hasFeatureAsync(name: string): Promise<boolean>;
|
|
838
1299
|
resolveTimestampsAsync(type?: TimestampQuery): Promise<number | undefined>;
|
|
839
1300
|
/**
|
|
840
1301
|
* Checks if the given feature is supported by the selected backend. If the
|
|
@@ -843,7 +1304,7 @@ declare class Renderer {
|
|
|
843
1304
|
* @param {string} name - The feature's name.
|
|
844
1305
|
* @return {boolean} Whether the feature is supported or not.
|
|
845
1306
|
*/
|
|
846
|
-
hasFeature(name: string):
|
|
1307
|
+
hasFeature(name: string): boolean;
|
|
847
1308
|
/**
|
|
848
1309
|
* Returns `true` when the renderer has been initialized.
|
|
849
1310
|
*
|
|
@@ -869,13 +1330,19 @@ declare class Renderer {
|
|
|
869
1330
|
* @param {Texture} texture - The texture.
|
|
870
1331
|
*/
|
|
871
1332
|
initTexture(texture: Texture): void;
|
|
1333
|
+
/**
|
|
1334
|
+
* Initializes the given render target.
|
|
1335
|
+
*
|
|
1336
|
+
* @param {RenderTarget} renderTarget - The render target to intialize.
|
|
1337
|
+
*/
|
|
1338
|
+
initRenderTarget(renderTarget: RenderTarget): void;
|
|
872
1339
|
/**
|
|
873
1340
|
* Copies the current bound framebuffer into the given texture.
|
|
874
1341
|
*
|
|
875
1342
|
* @param {FramebufferTexture} framebufferTexture - The texture.
|
|
876
1343
|
* @param {?(Vector2|Vector4)} [rectangle=null] - A two or four dimensional vector that defines the rectangular portion of the framebuffer that should be copied.
|
|
877
1344
|
*/
|
|
878
|
-
copyFramebufferToTexture(framebufferTexture: FramebufferTexture, rectangle?:
|
|
1345
|
+
copyFramebufferToTexture(framebufferTexture: FramebufferTexture, rectangle?: (Vector2 | Vector4) | null): void;
|
|
879
1346
|
/**
|
|
880
1347
|
* Copies data of the given source texture into a destination texture.
|
|
881
1348
|
*
|
|
@@ -915,24 +1382,19 @@ declare class Renderer {
|
|
|
915
1382
|
height: number,
|
|
916
1383
|
textureIndex?: number,
|
|
917
1384
|
faceIndex?: number,
|
|
918
|
-
): Promise<
|
|
1385
|
+
): Promise<TypedArray>;
|
|
919
1386
|
/**
|
|
920
1387
|
* Analyzes the given 3D object's hierarchy and builds render lists from the
|
|
921
1388
|
* processed hierarchy.
|
|
922
1389
|
*
|
|
1390
|
+
* @private
|
|
923
1391
|
* @param {Object3D} object - The 3D object to process (usually a scene).
|
|
924
1392
|
* @param {Camera} camera - The camera the object is rendered with.
|
|
925
1393
|
* @param {number} groupOrder - The group order is derived from the `renderOrder` of groups and is used to group 3D objects within groups.
|
|
926
1394
|
* @param {RenderList} renderList - The current render list.
|
|
927
1395
|
* @param {ClippingContext} clippingContext - The current clipping context.
|
|
928
1396
|
*/
|
|
929
|
-
_projectObject
|
|
930
|
-
object: Object3D,
|
|
931
|
-
camera: Camera,
|
|
932
|
-
groupOrder: number,
|
|
933
|
-
renderList: RenderList,
|
|
934
|
-
clippingContext: ClippingContext | null,
|
|
935
|
-
): void;
|
|
1397
|
+
private _projectObject;
|
|
936
1398
|
/**
|
|
937
1399
|
* Renders the given render bundles.
|
|
938
1400
|
*
|
|
@@ -941,7 +1403,7 @@ declare class Renderer {
|
|
|
941
1403
|
* @param {Scene} sceneRef - The scene the render bundles belong to.
|
|
942
1404
|
* @param {LightsNode} lightsNode - The current lights node.
|
|
943
1405
|
*/
|
|
944
|
-
_renderBundles
|
|
1406
|
+
private _renderBundles;
|
|
945
1407
|
/**
|
|
946
1408
|
* Renders the transparent objects from the given render lists.
|
|
947
1409
|
*
|
|
@@ -952,13 +1414,7 @@ declare class Renderer {
|
|
|
952
1414
|
* @param {Scene} scene - The scene the render list belongs to.
|
|
953
1415
|
* @param {LightsNode} lightsNode - The current lights node.
|
|
954
1416
|
*/
|
|
955
|
-
_renderTransparents
|
|
956
|
-
renderList: RenderItem[],
|
|
957
|
-
doublePassList: RenderItem[],
|
|
958
|
-
camera: Camera,
|
|
959
|
-
scene: Scene,
|
|
960
|
-
lightsNode: LightsNode,
|
|
961
|
-
): void;
|
|
1417
|
+
private _renderTransparents;
|
|
962
1418
|
/**
|
|
963
1419
|
* Renders the objects from the given render list.
|
|
964
1420
|
*
|
|
@@ -969,21 +1425,16 @@ declare class Renderer {
|
|
|
969
1425
|
* @param {LightsNode} lightsNode - The current lights node.
|
|
970
1426
|
* @param {?string} [passId=null] - An optional ID for identifying the pass.
|
|
971
1427
|
*/
|
|
972
|
-
_renderObjects
|
|
973
|
-
renderList: RenderItem[],
|
|
974
|
-
camera: Camera,
|
|
975
|
-
scene: Scene,
|
|
976
|
-
lightsNode: LightsNode,
|
|
977
|
-
passId?: string | null,
|
|
978
|
-
): void;
|
|
1428
|
+
private _renderObjects;
|
|
979
1429
|
/**
|
|
980
1430
|
* Retrieves shadow nodes for the given material. This is used to setup shadow passes.
|
|
981
1431
|
* The result is cached per material and updated when the material's version changes.
|
|
982
1432
|
*
|
|
1433
|
+
* @private
|
|
983
1434
|
* @param {Material} material
|
|
984
1435
|
* @returns {Object} - The shadow nodes for the material.
|
|
985
1436
|
*/
|
|
986
|
-
_getShadowNodes
|
|
1437
|
+
private _getShadowNodes;
|
|
987
1438
|
/**
|
|
988
1439
|
* This method represents the default render object function that manages the render lifecycle
|
|
989
1440
|
* of the object.
|
|
@@ -1004,11 +1455,19 @@ declare class Renderer {
|
|
|
1004
1455
|
camera: Camera,
|
|
1005
1456
|
geometry: BufferGeometry,
|
|
1006
1457
|
material: Material,
|
|
1007
|
-
group: GeometryGroup,
|
|
1458
|
+
group: GeometryGroup | null,
|
|
1008
1459
|
lightsNode: LightsNode,
|
|
1009
1460
|
clippingContext?: ClippingContext | null,
|
|
1010
1461
|
passId?: string | null,
|
|
1011
1462
|
): void;
|
|
1463
|
+
/**
|
|
1464
|
+
* Checks if the given compatibility is supported by the selected backend. If the
|
|
1465
|
+
* renderer has not been initialized, this method always returns `false`.
|
|
1466
|
+
*
|
|
1467
|
+
* @param {string} name - The compatibility's name.
|
|
1468
|
+
* @return {boolean} Whether the compatibility is supported or not.
|
|
1469
|
+
*/
|
|
1470
|
+
hasCompatibility(name: string): boolean;
|
|
1012
1471
|
/**
|
|
1013
1472
|
* This method represents the default `_handleObjectFunction` implementation which creates
|
|
1014
1473
|
* a render object from the given data and performs the draw command with the selected backend.
|
|
@@ -1023,16 +1482,7 @@ declare class Renderer {
|
|
|
1023
1482
|
* @param {ClippingContext} clippingContext - The clipping context.
|
|
1024
1483
|
* @param {string} [passId] - An optional ID for identifying the pass.
|
|
1025
1484
|
*/
|
|
1026
|
-
_renderObjectDirect
|
|
1027
|
-
object: Object3D,
|
|
1028
|
-
material: Material,
|
|
1029
|
-
scene: Scene,
|
|
1030
|
-
camera: Camera,
|
|
1031
|
-
lightsNode: LightsNode,
|
|
1032
|
-
group: GeometryGroup,
|
|
1033
|
-
clippingContext: ClippingContext | null,
|
|
1034
|
-
passId?: string,
|
|
1035
|
-
): void;
|
|
1485
|
+
private _renderObjectDirect;
|
|
1036
1486
|
/**
|
|
1037
1487
|
* A different implementation for `_handleObjectFunction` which only makes sure the object is ready for rendering.
|
|
1038
1488
|
* Used in `compileAsync()`.
|
|
@@ -1047,22 +1497,7 @@ declare class Renderer {
|
|
|
1047
1497
|
* @param {ClippingContext} clippingContext - The clipping context.
|
|
1048
1498
|
* @param {string} [passId] - An optional ID for identifying the pass.
|
|
1049
1499
|
*/
|
|
1050
|
-
_createObjectPipeline
|
|
1051
|
-
object: Object3D,
|
|
1052
|
-
material: Material,
|
|
1053
|
-
scene: Scene,
|
|
1054
|
-
camera: Camera,
|
|
1055
|
-
lightsNode: LightsNode,
|
|
1056
|
-
group: Group,
|
|
1057
|
-
clippingContext: ClippingContext | null,
|
|
1058
|
-
passId?: string,
|
|
1059
|
-
): void;
|
|
1060
|
-
/**
|
|
1061
|
-
* Callback when the canvas has been resized.
|
|
1062
|
-
*
|
|
1063
|
-
* @private
|
|
1064
|
-
*/
|
|
1065
|
-
_onCanvasTargetResize(): void;
|
|
1500
|
+
private _createObjectPipeline;
|
|
1066
1501
|
/**
|
|
1067
1502
|
* Alias for `compileAsync()`.
|
|
1068
1503
|
*
|
|
@@ -1074,11 +1509,5 @@ declare class Renderer {
|
|
|
1074
1509
|
*/
|
|
1075
1510
|
get compile(): (scene: Object3D, camera: Camera, targetScene?: Scene | null) => Promise<void>;
|
|
1076
1511
|
}
|
|
1077
|
-
|
|
1078
|
-
* Animation loop parameter of `renderer.setAnimationLoop()`.
|
|
1079
|
-
*
|
|
1080
|
-
* @callback onAnimationCallback
|
|
1081
|
-
* @param {DOMHighResTimeStamp} time - A timestamp indicating the end time of the previous frame's rendering.
|
|
1082
|
-
* @param {XRFrame} [frame] - A reference to the current XR frame. Only relevant when using XR rendering.
|
|
1083
|
-
*/
|
|
1512
|
+
|
|
1084
1513
|
export default Renderer;
|