@types/three 0.170.0 → 0.172.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/build/three.core.d.ts +1 -0
- three/build/three.core.min.d.ts +1 -0
- three/build/three.tsl.d.ts +1 -0
- three/build/three.tsl.min.d.ts +1 -0
- three/examples/jsm/Addons.d.ts +0 -5
- three/examples/jsm/controls/ArcballControls.d.ts +6 -1
- three/examples/jsm/controls/OrbitControls.d.ts +5 -0
- three/examples/jsm/controls/TransformControls.d.ts +1 -1
- three/examples/jsm/csm/CSMShadowNode.d.ts +2 -4
- three/examples/jsm/exporters/GLTFExporter.d.ts +23 -7
- three/examples/jsm/geometries/DecalGeometry.d.ts +1 -1
- three/examples/jsm/geometries/InstancedPointsGeometry.d.ts +13 -0
- three/examples/jsm/helpers/VertexNormalsHelper.d.ts +2 -0
- three/examples/jsm/lines/LineSegments2.d.ts +3 -1
- three/examples/jsm/materials/LDrawConditionalLineNodeMaterial.d.ts +1 -1
- three/examples/jsm/modifiers/CurveModifier.d.ts +1 -1
- three/examples/jsm/modifiers/CurveModifierGPU.d.ts +1 -1
- three/examples/jsm/objects/InstancedPoints.d.ts +10 -0
- three/examples/jsm/objects/SkyMesh.d.ts +2 -2
- three/examples/jsm/objects/Water2Mesh.d.ts +13 -2
- three/examples/jsm/objects/WaterMesh.d.ts +11 -2
- three/examples/jsm/postprocessing/OutlinePass.d.ts +1 -1
- three/examples/jsm/postprocessing/UnrealBloomPass.d.ts +1 -1
- three/examples/jsm/tsl/display/AfterImageNode.d.ts +2 -1
- three/examples/jsm/tsl/display/AnaglyphPassNode.d.ts +1 -1
- three/examples/jsm/tsl/display/AnamorphicNode.d.ts +2 -2
- three/examples/jsm/tsl/display/BleachBypass.d.ts +2 -1
- three/examples/jsm/tsl/display/BloomNode.d.ts +2 -1
- three/examples/jsm/tsl/display/DenoiseNode.d.ts +3 -4
- three/examples/jsm/tsl/display/DepthOfFieldNode.d.ts +2 -1
- three/examples/jsm/tsl/display/DotScreenNode.d.ts +2 -2
- three/examples/jsm/tsl/display/FXAANode.d.ts +2 -1
- three/examples/jsm/tsl/display/FilmNode.d.ts +2 -1
- three/examples/jsm/tsl/display/GTAONode.d.ts +5 -8
- three/examples/jsm/tsl/display/GaussianBlurNode.d.ts +2 -2
- three/examples/jsm/tsl/display/LensflareNode.d.ts +2 -2
- three/examples/jsm/tsl/display/Lut3DNode.d.ts +2 -2
- three/examples/jsm/tsl/display/MotionBlur.d.ts +2 -1
- three/examples/jsm/tsl/display/OutlineNode.d.ts +2 -2
- three/examples/jsm/tsl/display/ParallaxBarrierPassNode.d.ts +1 -1
- three/examples/jsm/tsl/display/PixelationPassNode.d.ts +2 -2
- three/examples/jsm/tsl/display/RGBShiftNode.d.ts +2 -1
- three/examples/jsm/tsl/display/SMAANode.d.ts +2 -1
- three/examples/jsm/tsl/display/SSAAPassNode.d.ts +2 -2
- three/examples/jsm/tsl/display/SSRNode.d.ts +2 -2
- three/examples/jsm/tsl/display/Sepia.d.ts +2 -1
- three/examples/jsm/tsl/display/SobelOperatorNode.d.ts +2 -1
- three/examples/jsm/tsl/display/StereoCompositePassNode.d.ts +1 -2
- three/examples/jsm/tsl/display/StereoPassNode.d.ts +2 -2
- three/examples/jsm/tsl/display/TRAAPassNode.d.ts +2 -2
- three/examples/jsm/tsl/display/TransitionNode.d.ts +2 -1
- three/examples/jsm/tsl/display/hashBlur.d.ts +2 -1
- three/examples/jsm/tsl/lighting/TiledLightsNode.d.ts +2 -1
- three/examples/jsm/utils/ShadowMapViewer.d.ts +2 -2
- three/package.json +4 -4
- three/src/Three.Core.d.ts +159 -0
- three/src/Three.TSL.d.ts +533 -0
- three/src/Three.WebGPU.Nodes.d.ts +14 -195
- three/src/Three.WebGPU.d.ts +14 -196
- three/src/Three.d.ts +2 -158
- three/src/animation/AnimationClip.d.ts +3 -1
- three/src/cameras/CubeCamera.d.ts +19 -2
- three/src/core/Clock.d.ts +4 -6
- three/src/core/InterleavedBuffer.d.ts +12 -0
- three/src/core/RenderTarget.d.ts +3 -5
- three/src/core/RenderTarget3D.d.ts +9 -0
- three/src/core/RenderTargetArray.d.ts +9 -0
- three/src/materials/Material.d.ts +9 -5
- three/src/materials/MeshDepthMaterial.d.ts +0 -5
- three/src/materials/MeshDistanceMaterial.d.ts +0 -5
- three/src/materials/nodes/Line2NodeMaterial.d.ts +1 -0
- three/src/materials/nodes/LineDashedNodeMaterial.d.ts +3 -0
- three/src/materials/nodes/MeshSSSNodeMaterial.d.ts +6 -6
- three/src/materials/nodes/NodeMaterial.d.ts +7 -1
- three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +56 -0
- three/src/nodes/Nodes.d.ts +2 -7
- three/src/nodes/TSL.d.ts +10 -5
- three/src/nodes/accessors/Arrays.d.ts +7 -0
- three/src/nodes/accessors/BufferAttributeNode.d.ts +117 -0
- three/src/nodes/accessors/BufferNode.d.ts +4 -4
- three/src/nodes/accessors/BuiltinNode.d.ts +14 -0
- three/src/nodes/accessors/ClippingNode.d.ts +6 -0
- three/src/nodes/accessors/InstanceNode.d.ts +15 -3
- three/src/nodes/accessors/InstancedMeshNode.d.ts +11 -0
- three/src/nodes/accessors/Lights.d.ts +15 -0
- three/src/nodes/accessors/MaterialNode.d.ts +3 -3
- three/src/nodes/accessors/ModelNode.d.ts +10 -2
- three/src/nodes/accessors/ModelViewProjectionNode.d.ts +2 -6
- three/src/nodes/accessors/StorageBufferNode.d.ts +25 -12
- three/src/nodes/accessors/StorageTextureNode.d.ts +5 -3
- three/src/nodes/accessors/TextureNode.d.ts +5 -0
- three/src/nodes/accessors/UniformArrayNode.d.ts +3 -2
- three/src/nodes/core/IndexNode.d.ts +2 -0
- three/src/nodes/core/Node.d.ts +237 -0
- three/src/nodes/core/NodeAttribute.d.ts +13 -0
- three/src/nodes/core/NodeBuilder.d.ts +1 -2
- three/src/nodes/core/NodeCache.d.ts +21 -0
- three/src/nodes/core/NodeParser.d.ts +11 -0
- three/src/nodes/core/NodeUniform.d.ts +28 -0
- three/src/nodes/core/NodeUtils.d.ts +7 -0
- three/src/nodes/core/NodeVar.d.ts +12 -0
- three/src/nodes/core/NodeVarying.d.ts +14 -0
- three/src/nodes/core/StackNode.d.ts +6 -1
- three/src/nodes/core/StructTypeNode.d.ts +19 -1
- three/src/nodes/core/UniformNode.d.ts +44 -0
- three/src/nodes/core/VaryingNode.d.ts +3 -0
- three/src/nodes/core/constants.d.ts +41 -0
- three/src/nodes/display/BlendModes.d.ts +32 -0
- three/src/nodes/display/PassNode.d.ts +1 -1
- three/src/nodes/display/ScreenNode.d.ts +5 -0
- three/src/nodes/display/ViewportDepthNode.d.ts +3 -1
- three/src/nodes/fog/Fog.d.ts +26 -0
- three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +88 -0
- three/src/nodes/gpgpu/BarrierNode.d.ts +12 -0
- three/src/nodes/gpgpu/ComputeBuiltinNode.d.ts +13 -0
- three/src/nodes/gpgpu/ComputeNode.d.ts +6 -1
- three/src/nodes/gpgpu/WorkgroupInfoNode.d.ts +19 -0
- three/src/nodes/lighting/AnalyticLightNode.d.ts +11 -0
- three/src/nodes/lighting/LightsNode.d.ts +2 -2
- three/src/nodes/lighting/PointLightNode.d.ts +3 -0
- three/src/nodes/lighting/PointShadowNode.d.ts +30 -0
- three/src/nodes/lighting/ShadowBaseNode.d.ts +15 -0
- three/src/nodes/lighting/ShadowNode.d.ts +28 -4
- three/src/nodes/math/MathNode.d.ts +13 -4
- three/src/nodes/math/OperatorNode.d.ts +3 -0
- three/src/nodes/tsl/TSLBase.d.ts +5 -0
- three/src/nodes/tsl/TSLCore.d.ts +51 -16
- three/src/nodes/utils/EquirectUVNode.d.ts +2 -2
- three/src/nodes/utils/LoopNode.d.ts +23 -2
- three/src/nodes/utils/SplitNode.d.ts +1 -1
- three/src/objects/BatchedMesh.d.ts +4 -4
- three/src/objects/ClippingGroup.d.ts +41 -0
- three/src/renderers/WebGLRenderer.d.ts +10 -8
- three/src/renderers/common/Animation.d.ts +41 -4
- three/src/renderers/common/Attributes.d.ts +31 -0
- three/src/renderers/common/Backend.d.ts +11 -0
- three/src/renderers/common/Background.d.ts +22 -0
- three/src/renderers/common/BindGroup.d.ts +15 -0
- three/src/renderers/common/Binding.d.ts +24 -0
- three/src/renderers/common/Bindings.d.ts +54 -0
- three/src/renderers/common/Buffer.d.ts +31 -0
- three/src/renderers/common/BufferUtils.d.ts +26 -0
- three/src/renderers/common/BundleGroup.d.ts +22 -0
- three/src/renderers/common/ChainMap.d.ts +31 -1
- three/src/renderers/common/ClippingContext.d.ts +61 -14
- three/src/renderers/common/Color4.d.ts +36 -0
- three/src/renderers/common/ComputePipeline.d.ts +12 -0
- three/src/renderers/common/CubeRenderTarget.d.ts +13 -0
- three/src/renderers/common/DataMap.d.ts +30 -0
- three/src/renderers/common/Geometries.d.ts +52 -0
- three/src/renderers/common/Info.d.ts +27 -0
- three/src/renderers/common/Pipeline.d.ts +11 -0
- three/src/renderers/common/Pipelines.d.ts +104 -0
- three/src/renderers/common/ProgrammableStage.d.ts +19 -1
- three/src/renderers/common/RenderBundle.d.ts +15 -4
- three/src/renderers/common/RenderBundles.d.ts +20 -2
- three/src/renderers/common/RenderContext.d.ts +22 -0
- three/src/renderers/common/RenderContexts.d.ts +42 -3
- three/src/renderers/common/RenderList.d.ts +90 -0
- three/src/renderers/common/RenderLists.d.ts +21 -0
- three/src/renderers/common/RenderObject.d.ts +160 -5
- three/src/renderers/common/RenderObjects.d.ts +56 -0
- three/src/renderers/common/RenderPipeline.d.ts +13 -0
- three/src/renderers/common/Renderer.d.ts +596 -6
- three/src/renderers/common/{PostProcessingUtils.d.ts → RendererUtils.d.ts} +16 -4
- three/src/renderers/common/StorageBufferAttribute.d.ts +1 -1
- three/src/renderers/common/Textures.d.ts +66 -0
- three/src/renderers/common/Uniform.d.ts +106 -0
- three/src/renderers/common/UniformBuffer.d.ts +12 -0
- three/src/renderers/common/UniformsGroup.d.ts +104 -0
- three/src/renderers/common/extras/PMREMGenerator.d.ts +15 -1
- three/src/renderers/common/nodes/NodeBuilderState.d.ts +30 -0
- three/src/renderers/common/nodes/NodeLibrary.d.ts +73 -4
- three/src/renderers/common/nodes/NodeUniform.d.ts +161 -0
- three/src/renderers/common/nodes/NodeUniformsGroup.d.ts +14 -2
- three/src/renderers/common/nodes/Nodes.d.ts +185 -11
- three/src/renderers/webgl/WebGLState.d.ts +1 -1
- three/src/renderers/webgpu/nodes/BasicNodeLibrary.d.ts +10 -0
- three/src/renderers/webgpu/nodes/StandardNodeLibrary.d.ts +11 -0
- three/src/textures/Data3DTexture.d.ts +4 -2
- three/src/textures/DataArrayTexture.d.ts +1 -1
- three/src/textures/DataTexture.d.ts +7 -2
- three/src/textures/Texture.d.ts +3 -0
- three/examples/jsm/animation/MMDAnimationHelper.d.ts +0 -99
- three/examples/jsm/animation/MMDPhysics.d.ts +0 -128
- three/examples/jsm/exporters/MMDExporter.d.ts +0 -11
- three/examples/jsm/loaders/MMDLoader.d.ts +0 -60
- three/examples/jsm/shaders/MMDToonShader.d.ts +0 -15
- three/src/Three.Legacy.d.ts +0 -20
- three/src/nodes/core/UniformGroup.d.ts +0 -7
- three/src/nodes/display/BlendMode.d.ts +0 -10
- three/src/nodes/fog/FogExp2Node.d.ts +0 -14
- three/src/nodes/fog/FogNode.d.ts +0 -20
- three/src/nodes/fog/FogRangeNode.d.ts +0 -19
- three/src/nodes/lighting/LightNode.d.ts +0 -18
- three/src/textures/types.d.ts +0 -9
|
@@ -6,13 +6,13 @@ import { Object3D } from "../../core/Object3D.js";
|
|
|
6
6
|
import { RenderTarget } from "../../core/RenderTarget.js";
|
|
7
7
|
import { Material } from "../../materials/Material.js";
|
|
8
8
|
import { Box2 } from "../../math/Box2.js";
|
|
9
|
-
import {
|
|
10
|
-
import { Plane } from "../../math/Plane.js";
|
|
9
|
+
import { ColorRepresentation } from "../../math/Color.js";
|
|
11
10
|
import { Vector2 } from "../../math/Vector2.js";
|
|
12
11
|
import { Vector4 } from "../../math/Vector4.js";
|
|
13
12
|
import MRTNode from "../../nodes/core/MRTNode.js";
|
|
14
13
|
import ComputeNode from "../../nodes/gpgpu/ComputeNode.js";
|
|
15
14
|
import LightsNode from "../../nodes/lighting/LightsNode.js";
|
|
15
|
+
import { Group } from "../../objects/Group.js";
|
|
16
16
|
import { Scene } from "../../scenes/Scene.js";
|
|
17
17
|
import { FramebufferTexture } from "../../textures/FramebufferTexture.js";
|
|
18
18
|
import { Texture } from "../../textures/Texture.js";
|
|
@@ -21,6 +21,7 @@ import Attributes from "./Attributes.js";
|
|
|
21
21
|
import Backend from "./Backend.js";
|
|
22
22
|
import Background from "./Background.js";
|
|
23
23
|
import Bindings from "./Bindings.js";
|
|
24
|
+
import ClippingContext from "./ClippingContext.js";
|
|
24
25
|
import Color4 from "./Color4.js";
|
|
25
26
|
import Geometries from "./Geometries.js";
|
|
26
27
|
import Info from "./Info.js";
|
|
@@ -58,6 +59,9 @@ export interface RendererParameters {
|
|
|
58
59
|
samples?: number | undefined;
|
|
59
60
|
getFallback?: ((error: unknown) => Backend) | null | undefined;
|
|
60
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Base class for renderers.
|
|
64
|
+
*/
|
|
61
65
|
declare class Renderer {
|
|
62
66
|
readonly isRenderer: true;
|
|
63
67
|
domElement: HTMLCanvasElement;
|
|
@@ -75,7 +79,6 @@ declare class Renderer {
|
|
|
75
79
|
sortObjects: boolean;
|
|
76
80
|
depth: boolean;
|
|
77
81
|
stencil: boolean;
|
|
78
|
-
clippingPlanes: readonly Plane[];
|
|
79
82
|
info: Info;
|
|
80
83
|
library: NodeLibrary;
|
|
81
84
|
lighting: Lighting;
|
|
@@ -172,63 +175,466 @@ declare class Renderer {
|
|
|
172
175
|
}>;
|
|
173
176
|
};
|
|
174
177
|
localClippingEnabled?: boolean | undefined;
|
|
178
|
+
/**
|
|
179
|
+
* Constructs a new renderer.
|
|
180
|
+
*
|
|
181
|
+
* @param {Backend} backend - The backend the renderer is targeting (e.g. WebGPU or WebGL 2).
|
|
182
|
+
* @param {Object} parameters - The configuration parameter.
|
|
183
|
+
* @param {Boolean} [parameters.logarithmicDepthBuffer=false] - Whether logarithmic depth buffer is enabled or not.
|
|
184
|
+
* @param {Boolean} [parameters.alpha=true] - Whether the default framebuffer (which represents the final contents of the canvas) should be transparent or opaque.
|
|
185
|
+
* @param {Boolean} [parameters.depth=true] - Whether the default framebuffer should have a depth buffer or not.
|
|
186
|
+
* @param {Boolean} [parameters.stencil=false] - Whether the default framebuffer should have a stencil buffer or not.
|
|
187
|
+
* @param {Boolean} [parameters.antialias=false] - Whether MSAA as the default anti-aliasing should be enabled or not.
|
|
188
|
+
* @param {Number} [parameters.samples=0] - When `antialias` is `true`, `4` samples are used by default. This parameter can set to any other integer value than 0
|
|
189
|
+
* to overwrite the default.
|
|
190
|
+
* @param {Function?} [parameters.getFallback=null] - This callback function can be used to provide a fallback backend, if the primary backend can't be targeted.
|
|
191
|
+
*/
|
|
175
192
|
constructor(backend: Backend, parameters?: RendererParameters);
|
|
193
|
+
/**
|
|
194
|
+
* Initializes the renderer so it is ready for usage.
|
|
195
|
+
*
|
|
196
|
+
* @async
|
|
197
|
+
* @return {Promise} A Promise that resolves when the renderer has been initialized.
|
|
198
|
+
*/
|
|
176
199
|
init(): Promise<void>;
|
|
200
|
+
/**
|
|
201
|
+
* The coordinate system of the renderer. The value of this property
|
|
202
|
+
* depends on the selected backend. Either `THREE.WebGLCoordinateSystem` or
|
|
203
|
+
* `THREE.WebGPUCoordinateSystem`.
|
|
204
|
+
*
|
|
205
|
+
* @readonly
|
|
206
|
+
* @type {Number}
|
|
207
|
+
*/
|
|
177
208
|
get coordinateSystem(): import("../../constants.js").CoordinateSystem;
|
|
209
|
+
/**
|
|
210
|
+
* Compiles all materials in the given scene. This can be useful to avoid a
|
|
211
|
+
* phenomenon which is called "shader compilation stutter", which occurs when
|
|
212
|
+
* rendering an object with a new shader for the first time.
|
|
213
|
+
*
|
|
214
|
+
* If you want to add a 3D object to an existing scene, use the third optional
|
|
215
|
+
* parameter for applying the target scene. Note that the (target) scene's lighting
|
|
216
|
+
* and environment must be configured before calling this method.
|
|
217
|
+
*
|
|
218
|
+
* @async
|
|
219
|
+
* @param {Object3D} scene - The scene or 3D object to precompile.
|
|
220
|
+
* @param {Camera} camera - The camera that is used to render the scene.
|
|
221
|
+
* @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.
|
|
222
|
+
* @return {Promise} A Promise that resolves when the compile has been finished.
|
|
223
|
+
*/
|
|
178
224
|
compileAsync(scene: Object3D, camera: Camera, targetScene?: Object3D | null): Promise<void>;
|
|
225
|
+
/**
|
|
226
|
+
* Renders the scene in an async fashion.
|
|
227
|
+
*
|
|
228
|
+
* @async
|
|
229
|
+
* @param {Object3D} scene - The scene or 3D object to render.
|
|
230
|
+
* @param {Camera} camera - The camera.
|
|
231
|
+
* @return {Promise} A Promise that resolves when the render has been finished.
|
|
232
|
+
*/
|
|
179
233
|
renderAsync(scene: Scene, camera: Camera): Promise<void>;
|
|
234
|
+
/**
|
|
235
|
+
* Can be used to synchronize CPU operations with GPU tasks. So when this method is called,
|
|
236
|
+
* the CPU waits for the GPU to complete its operation (e.g. a compute task).
|
|
237
|
+
*
|
|
238
|
+
* @async
|
|
239
|
+
* @return {Promise} A Promise that resolves when synchronization has been finished.
|
|
240
|
+
*/
|
|
180
241
|
waitForGPU(): Promise<void>;
|
|
242
|
+
/**
|
|
243
|
+
* Sets the given MRT configuration.
|
|
244
|
+
*
|
|
245
|
+
* @param {MRTNode} mrt - The MRT node to set.
|
|
246
|
+
* @return {Renderer} A reference to this renderer.
|
|
247
|
+
*/
|
|
181
248
|
setMRT(mrt: MRTNode | null): this;
|
|
249
|
+
/**
|
|
250
|
+
* Returns the MRT configuration.
|
|
251
|
+
*
|
|
252
|
+
* @return {MRTNode} The MRT configuration.
|
|
253
|
+
*/
|
|
182
254
|
getMRT(): MRTNode | null;
|
|
255
|
+
/**
|
|
256
|
+
* Default implementation of the device lost callback.
|
|
257
|
+
*
|
|
258
|
+
* @private
|
|
259
|
+
* @param {Object} info - Information about the context lost.
|
|
260
|
+
*/
|
|
183
261
|
_onDeviceLost(info: DeviceLostInfo): void;
|
|
262
|
+
/**
|
|
263
|
+
* Renders the given render bundle.
|
|
264
|
+
*
|
|
265
|
+
* @private
|
|
266
|
+
* @param {Object} bundle - Render bundle data.
|
|
267
|
+
* @param {Scene} sceneRef - The scene the render bundle belongs to.
|
|
268
|
+
* @param {LightsNode} lightsNode - The current lights node.
|
|
269
|
+
*/
|
|
184
270
|
_renderBundle(bundle: Bundle, sceneRef: Scene, lightsNode: LightsNode): void;
|
|
271
|
+
/**
|
|
272
|
+
* Renders the scene or 3D object with the given camera. This method can only be called
|
|
273
|
+
* if the renderer has been initialized.
|
|
274
|
+
*
|
|
275
|
+
* The target of the method is the default framebuffer (meaning the canvas)
|
|
276
|
+
* or alternatively a render target when specified via `setRenderTarget()`.
|
|
277
|
+
*
|
|
278
|
+
* @param {Object3D} scene - The scene or 3D object to render.
|
|
279
|
+
* @param {Camera} camera - The camera to render the scene with.
|
|
280
|
+
* @return {Promise?} A Promise that resolve when the scene has been rendered.
|
|
281
|
+
* Only returned when the renderer has not been initialized.
|
|
282
|
+
*/
|
|
185
283
|
render(scene: Scene, camera: Camera): Promise<void> | undefined;
|
|
284
|
+
/**
|
|
285
|
+
* Returns an internal render target which is used when computing the output tone mapping
|
|
286
|
+
* and color space conversion. Unlike in `WebGLRenderer`, this is done in a separate render
|
|
287
|
+
* pass and not inline to achieve more correct results.
|
|
288
|
+
*
|
|
289
|
+
* @private
|
|
290
|
+
* @return {RenderTarget?} The render target. The method returns `null` if no output conversion should be applied.
|
|
291
|
+
*/
|
|
186
292
|
_getFrameBufferTarget(): RenderTarget<Texture> | null;
|
|
293
|
+
/**
|
|
294
|
+
* Renders the scene or 3D object with the given camera.
|
|
295
|
+
*
|
|
296
|
+
* @private
|
|
297
|
+
* @param {Object3D} scene - The scene or 3D object to render.
|
|
298
|
+
* @param {Camera} camera - The camera to render the scene with.
|
|
299
|
+
* @param {Boolean} [useFrameBufferTarget=true] - Whether to use a framebuffer target or not.
|
|
300
|
+
* @return {RenderContext} The current render context.
|
|
301
|
+
*/
|
|
187
302
|
_renderScene(scene: Scene, camera: Camera, useFrameBufferTarget?: boolean): RenderContext | undefined;
|
|
303
|
+
/**
|
|
304
|
+
* Returns the maximum available anisotropy for texture filtering.
|
|
305
|
+
*
|
|
306
|
+
* @return {Number} The maximum available anisotropy.
|
|
307
|
+
*/
|
|
188
308
|
getMaxAnisotropy(): number;
|
|
309
|
+
/**
|
|
310
|
+
* Returns the active cube face.
|
|
311
|
+
*
|
|
312
|
+
* @return {Number} The active cube face.
|
|
313
|
+
*/
|
|
189
314
|
getActiveCubeFace(): number;
|
|
315
|
+
/**
|
|
316
|
+
* Returns the active mipmap level.
|
|
317
|
+
*
|
|
318
|
+
* @return {Number} The active mipmap level.
|
|
319
|
+
*/
|
|
190
320
|
getActiveMipmapLevel(): number;
|
|
321
|
+
/**
|
|
322
|
+
* Applications are advised to always define the animation loop
|
|
323
|
+
* with this method and not manually with `requestAnimationFrame()`
|
|
324
|
+
* for best compatibility.
|
|
325
|
+
*
|
|
326
|
+
* @async
|
|
327
|
+
* @param {Function} callback - The application's animation loop.
|
|
328
|
+
* @return {Promise} A Promise that resolves when the set has been exeucted.
|
|
329
|
+
*/
|
|
191
330
|
setAnimationLoop(callback: ((time: DOMHighResTimeStamp, frame?: XRFrame) => void) | null): Promise<void>;
|
|
331
|
+
/**
|
|
332
|
+
* Can be used to transfer buffer data from a storage buffer attribute
|
|
333
|
+
* from the GPU to the CPU in context of compute shaders.
|
|
334
|
+
*
|
|
335
|
+
* @async
|
|
336
|
+
* @param {StorageBufferAttribute} attribute - The storage buffer attribute.
|
|
337
|
+
* @return {Promise<ArrayBuffer>} A promise that resolves with the buffer data when the data are ready.
|
|
338
|
+
*/
|
|
192
339
|
getArrayBufferAsync(attribute: BufferAttribute): Promise<ArrayBuffer>;
|
|
340
|
+
/**
|
|
341
|
+
* Returns the rendering context.
|
|
342
|
+
*
|
|
343
|
+
* @return {GPUCanvasContext|WebGL2RenderingContext} The rendering context.
|
|
344
|
+
*/
|
|
193
345
|
getContext(): void;
|
|
346
|
+
/**
|
|
347
|
+
* Returns the pixel ratio.
|
|
348
|
+
*
|
|
349
|
+
* @return {Number} The pixel ratio.
|
|
350
|
+
*/
|
|
194
351
|
getPixelRatio(): number;
|
|
352
|
+
/**
|
|
353
|
+
* Returns the drawing buffer size in physical pixels. This method honors the pixel ratio.
|
|
354
|
+
*
|
|
355
|
+
* @param {Vector2} target - The method writes the result in this target object.
|
|
356
|
+
* @return {Vector2} The drawing buffer size.
|
|
357
|
+
*/
|
|
195
358
|
getDrawingBufferSize(target: Vector2): Vector2;
|
|
359
|
+
/**
|
|
360
|
+
* Returns the renderer's size in logical pixels. This method does not honor the pixel ratio.
|
|
361
|
+
*
|
|
362
|
+
* @param {Vector2} target - The method writes the result in this target object.
|
|
363
|
+
* @return {Vector2} The drawing buffer size.
|
|
364
|
+
*/
|
|
196
365
|
getSize(target: Vector2): Vector2;
|
|
366
|
+
/**
|
|
367
|
+
* Sets the given pixel ration and resizes the canvas if necessary.
|
|
368
|
+
*
|
|
369
|
+
* @param {Number} [value=1] - The pixel ratio.
|
|
370
|
+
*/
|
|
197
371
|
setPixelRatio(value?: number): void;
|
|
372
|
+
/**
|
|
373
|
+
* This method allows to define the drawing buffer size by specifying
|
|
374
|
+
* width, height and pixel ratio all at once. The size of the drawing
|
|
375
|
+
* buffer is computed with this formula:
|
|
376
|
+
* ````
|
|
377
|
+
* size.x = width * pixelRatio;
|
|
378
|
+
* size.y = height * pixelRatio;
|
|
379
|
+
* ```
|
|
380
|
+
*
|
|
381
|
+
* @param {Number} width - The width in logical pixels.
|
|
382
|
+
* @param {Number} height - The height in logical pixels.
|
|
383
|
+
* @param {Number} pixelRatio - The pixel ratio.
|
|
384
|
+
*/
|
|
198
385
|
setDrawingBufferSize(width: number, height: number, pixelRatio: number): void;
|
|
386
|
+
/**
|
|
387
|
+
* Sets the size of the renderer.
|
|
388
|
+
*
|
|
389
|
+
* @param {Number} width - The width in logical pixels.
|
|
390
|
+
* @param {Number} height - The height in logical pixels.
|
|
391
|
+
* @param {Boolean} [updateStyle=true] - Whether to update the `style` attribute of the canvas or not.
|
|
392
|
+
*/
|
|
199
393
|
setSize(width: number, height: number, updateStyle?: boolean): void;
|
|
394
|
+
/**
|
|
395
|
+
* Defines a manual sort function for the opaque render list.
|
|
396
|
+
* Pass `null` to use the default sort.
|
|
397
|
+
*
|
|
398
|
+
* @param {Function} method - The sort function.
|
|
399
|
+
*/
|
|
200
400
|
setOpaqueSort(method: ((a: RenderItem, b: RenderItem) => number) | null): void;
|
|
401
|
+
/**
|
|
402
|
+
* Defines a manual sort function for the transparent render list.
|
|
403
|
+
* Pass `null` to use the default sort.
|
|
404
|
+
*
|
|
405
|
+
* @param {Function} method - The sort function.
|
|
406
|
+
*/
|
|
201
407
|
setTransparentSort(method: ((a: RenderItem, b: RenderItem) => number) | null): void;
|
|
408
|
+
/**
|
|
409
|
+
* Returns the scissor rectangle.
|
|
410
|
+
*
|
|
411
|
+
* @param {Vector4} target - The method writes the result in this target object.
|
|
412
|
+
* @return {Vector4} The scissor rectangle.
|
|
413
|
+
*/
|
|
202
414
|
getScissor(target: Vector4): Vector4;
|
|
415
|
+
/**
|
|
416
|
+
* Defines the scissor rectangle.
|
|
417
|
+
*
|
|
418
|
+
* @param {Number | Vector4} x - The horizontal coordinate for the lower left corner of the box in logical pixel unit.
|
|
419
|
+
* Instead of passing four arguments, the method also works with a single four-dimensional vector.
|
|
420
|
+
* @param {Number} y - The vertical coordinate for the lower left corner of the box in logical pixel unit.
|
|
421
|
+
* @param {Number} width - The width of the scissor box in logical pixel unit.
|
|
422
|
+
* @param {Number} height - The height of the scissor box in logical pixel unit.
|
|
423
|
+
*/
|
|
203
424
|
setScissor(x: Vector4): void;
|
|
204
425
|
setScissor(x: number, y: number, width: number, height: number): void;
|
|
426
|
+
/**
|
|
427
|
+
* Returns the scissor test value.
|
|
428
|
+
*
|
|
429
|
+
* @return {Boolean} Whether the scissor test should be enabled or not.
|
|
430
|
+
*/
|
|
205
431
|
getScissorTest(): boolean;
|
|
432
|
+
/**
|
|
433
|
+
* Defines the scissor test.
|
|
434
|
+
*
|
|
435
|
+
* @param {Boolean} boolean - Whether the scissor test should be enabled or not.
|
|
436
|
+
*/
|
|
206
437
|
setScissorTest(boolean: boolean): void;
|
|
438
|
+
/**
|
|
439
|
+
* Returns the viewport definition.
|
|
440
|
+
*
|
|
441
|
+
* @param {Vector4} target - The method writes the result in this target object.
|
|
442
|
+
* @return {Vector4} The viewport definition.
|
|
443
|
+
*/
|
|
207
444
|
getViewport(target: Vector4): Vector4;
|
|
445
|
+
/**
|
|
446
|
+
* Defines the viewport.
|
|
447
|
+
*
|
|
448
|
+
* @param {Number | Vector4} x - The horizontal coordinate for the lower left corner of the viewport origin in logical pixel unit.
|
|
449
|
+
* @param {Number} y - The vertical coordinate for the lower left corner of the viewport origin in logical pixel unit.
|
|
450
|
+
* @param {Number} width - The width of the viewport in logical pixel unit.
|
|
451
|
+
* @param {Number} height - The height of the viewport in logical pixel unit.
|
|
452
|
+
* @param {Number} minDepth - The minimum depth value of the viewport. WebGPU only.
|
|
453
|
+
* @param {Number} maxDepth - The maximum depth value of the viewport. WebGPU only.
|
|
454
|
+
*/
|
|
208
455
|
setViewport(x: Vector4): void;
|
|
209
456
|
setViewport(x: number, y: number, width: number, height: number, minDepth?: number, maxDepth?: number): void;
|
|
457
|
+
/**
|
|
458
|
+
* Returns the clear color.
|
|
459
|
+
*
|
|
460
|
+
* @param {Color} target - The method writes the result in this target object.
|
|
461
|
+
* @return {Color} The clear color.
|
|
462
|
+
*/
|
|
210
463
|
getClearColor(target: Color4): Color4;
|
|
211
|
-
|
|
464
|
+
/**
|
|
465
|
+
* Defines the clear color and optionally the clear alpha.
|
|
466
|
+
*
|
|
467
|
+
* @param {Color} color - The clear color.
|
|
468
|
+
* @param {Number} [alpha=1] - The clear alpha.
|
|
469
|
+
*/
|
|
470
|
+
setClearColor(color: ColorRepresentation, alpha?: number): void;
|
|
471
|
+
/**
|
|
472
|
+
* Returns the clear alpha.
|
|
473
|
+
*
|
|
474
|
+
* @return {Number} The clear alpha.
|
|
475
|
+
*/
|
|
212
476
|
getClearAlpha(): number;
|
|
477
|
+
/**
|
|
478
|
+
* Defines the clear alpha.
|
|
479
|
+
*
|
|
480
|
+
* @param {Number} alpha - The clear alpha.
|
|
481
|
+
*/
|
|
213
482
|
setClearAlpha(alpha: number): void;
|
|
483
|
+
/**
|
|
484
|
+
* Returns the clear depth.
|
|
485
|
+
*
|
|
486
|
+
* @return {Number} The clear depth.
|
|
487
|
+
*/
|
|
214
488
|
getClearDepth(): number;
|
|
489
|
+
/**
|
|
490
|
+
* Defines the clear depth.
|
|
491
|
+
*
|
|
492
|
+
* @param {Number} depth - The clear depth.
|
|
493
|
+
*/
|
|
215
494
|
setClearDepth(depth: number): void;
|
|
495
|
+
/**
|
|
496
|
+
* Returns the clear stencil.
|
|
497
|
+
*
|
|
498
|
+
* @return {Number} The clear stencil.
|
|
499
|
+
*/
|
|
216
500
|
getClearStencil(): number;
|
|
501
|
+
/**
|
|
502
|
+
* Defines the clear stencil.
|
|
503
|
+
*
|
|
504
|
+
* @param {Number} stencil - The clear stencil.
|
|
505
|
+
*/
|
|
217
506
|
setClearStencil(stencil: number): void;
|
|
507
|
+
/**
|
|
508
|
+
* This method performs an occlusion query for the given 3D object.
|
|
509
|
+
* It returns `true` if the given 3D object is fully occluded by other
|
|
510
|
+
* 3D objects in the scene.
|
|
511
|
+
*
|
|
512
|
+
* @param {Object3D} object - The 3D object to test.
|
|
513
|
+
* @return {Boolean} Whether the 3D object is fully occluded or not.
|
|
514
|
+
*/
|
|
218
515
|
isOccluded(object: Object3D): boolean | null;
|
|
516
|
+
/**
|
|
517
|
+
* Performs a manual clear operation. This method ignores `autoClear` properties.
|
|
518
|
+
*
|
|
519
|
+
* @param {Boolean} [color=true] - Whether the color buffer should be cleared or not.
|
|
520
|
+
* @param {Boolean} [depth=true] - Whether the depth buffer should be cleared or not.
|
|
521
|
+
* @param {Boolean} [stencil=true] - Whether the stencil buffer should be cleared or not.
|
|
522
|
+
* @return {Promise} A Promise that resolves when the clear operation has been executed.
|
|
523
|
+
* Only returned when the renderer has not been initialized.
|
|
524
|
+
*/
|
|
219
525
|
clear(color?: boolean, depth?: boolean, stencil?: boolean): Promise<void> | undefined;
|
|
526
|
+
/**
|
|
527
|
+
* Performs a manual clear operation of the color buffer. This method ignores `autoClear` properties.
|
|
528
|
+
*
|
|
529
|
+
* @return {Promise} A Promise that resolves when the clear operation has been executed.
|
|
530
|
+
* Only returned when the renderer has not been initialized.
|
|
531
|
+
*/
|
|
220
532
|
clearColor(): Promise<void> | undefined;
|
|
533
|
+
/**
|
|
534
|
+
* Performs a manual clear operation of the depth buffer. This method ignores `autoClear` properties.
|
|
535
|
+
*
|
|
536
|
+
* @return {Promise} A Promise that resolves when the clear operation has been executed.
|
|
537
|
+
* Only returned when the renderer has not been initialized.
|
|
538
|
+
*/
|
|
221
539
|
clearDepth(): Promise<void> | undefined;
|
|
540
|
+
/**
|
|
541
|
+
* Performs a manual clear operation of the stencil buffer. This method ignores `autoClear` properties.
|
|
542
|
+
*
|
|
543
|
+
* @return {Promise} A Promise that resolves when the clear operation has been executed.
|
|
544
|
+
* Only returned when the renderer has not been initialized.
|
|
545
|
+
*/
|
|
222
546
|
clearStencil(): Promise<void> | undefined;
|
|
547
|
+
/**
|
|
548
|
+
* Async version of {@link module:Renderer~Renderer#clear}.
|
|
549
|
+
*
|
|
550
|
+
* @async
|
|
551
|
+
* @param {Boolean} [color=true] - Whether the color buffer should be cleared or not.
|
|
552
|
+
* @param {Boolean} [depth=true] - Whether the depth buffer should be cleared or not.
|
|
553
|
+
* @param {Boolean} [stencil=true] - Whether the stencil buffer should be cleared or not.
|
|
554
|
+
* @return {Promise} A Promise that resolves when the clear operation has been executed.
|
|
555
|
+
*/
|
|
223
556
|
clearAsync(color?: boolean, depth?: boolean, stencil?: boolean): Promise<void>;
|
|
557
|
+
/**
|
|
558
|
+
* Async version of {@link module:Renderer~Renderer#clearColor}.
|
|
559
|
+
*
|
|
560
|
+
* @async
|
|
561
|
+
* @return {Promise} A Promise that resolves when the clear operation has been executed.
|
|
562
|
+
*/
|
|
224
563
|
clearColorAsync(): Promise<void>;
|
|
564
|
+
/**
|
|
565
|
+
* Async version of {@link module:Renderer~Renderer#clearDepth}.
|
|
566
|
+
*
|
|
567
|
+
* @async
|
|
568
|
+
* @return {Promise} A Promise that resolves when the clear operation has been executed.
|
|
569
|
+
*/
|
|
225
570
|
clearDepthAsync(): Promise<void>;
|
|
571
|
+
/**
|
|
572
|
+
* Async version of {@link module:Renderer~Renderer#clearStencil}.
|
|
573
|
+
*
|
|
574
|
+
* @async
|
|
575
|
+
* @return {Promise} A Promise that resolves when the clear operation has been executed.
|
|
576
|
+
*/
|
|
226
577
|
clearStencilAsync(): Promise<void>;
|
|
578
|
+
/**
|
|
579
|
+
* The current output tone mapping of the renderer. When a render target is set,
|
|
580
|
+
* the output tone mapping is always `NoToneMapping`.
|
|
581
|
+
*
|
|
582
|
+
* @type {Number}
|
|
583
|
+
*/
|
|
227
584
|
get currentToneMapping(): ToneMapping;
|
|
585
|
+
/**
|
|
586
|
+
* The current output color space of the renderer. When a render target is set,
|
|
587
|
+
* the output color space is always `LinearSRGBColorSpace`.
|
|
588
|
+
*
|
|
589
|
+
* @type {String}
|
|
590
|
+
*/
|
|
228
591
|
get currentColorSpace(): string;
|
|
592
|
+
/**
|
|
593
|
+
* Frees all internal resources of the renderer. Call this method if the renderer
|
|
594
|
+
* is no longer in use by your app.
|
|
595
|
+
*/
|
|
229
596
|
dispose(): void;
|
|
597
|
+
/**
|
|
598
|
+
* Sets the given render target. Calling this method means the renderer does not
|
|
599
|
+
* target the default framebuffer (meaning the canvas) anymore but a custom framebuffer.
|
|
600
|
+
* Use `null` as the first argument to reset the state.
|
|
601
|
+
*
|
|
602
|
+
* @param {RenderTarget?} renderTarget - The render target to set.
|
|
603
|
+
* @param {Number} [activeCubeFace=0] - The active cube face.
|
|
604
|
+
* @param {Number} [activeMipmapLevel=0] - The active mipmap level.
|
|
605
|
+
*/
|
|
230
606
|
setRenderTarget(renderTarget: RenderTarget | null, activeCubeFace?: number, activeMipmapLevel?: number): void;
|
|
607
|
+
/**
|
|
608
|
+
* Returns the current render target.
|
|
609
|
+
*
|
|
610
|
+
* @return {RenderTarget?} The render target. Returns `null` if no render target is set.
|
|
611
|
+
*/
|
|
231
612
|
getRenderTarget(): RenderTarget<Texture> | null;
|
|
613
|
+
/**
|
|
614
|
+
* Callback for {@link module:Renderer~Renderer#setRenderObjectFunction}.
|
|
615
|
+
*
|
|
616
|
+
* @callback renderObjectFunction
|
|
617
|
+
* @param {Object3D} object - The 3D object.
|
|
618
|
+
* @param {Scene} scene - The scene the 3D object belongs to.
|
|
619
|
+
* @param {Camera} camera - The camera the object should be rendered with.
|
|
620
|
+
* @param {BufferGeometry} geometry - The object's geometry.
|
|
621
|
+
* @param {Material} material - The object's material.
|
|
622
|
+
* @param {Object?} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`.
|
|
623
|
+
* @param {LightsNode} lightsNode - The current lights node.
|
|
624
|
+
* @param {ClippingContext} clippingContext - The clipping context.
|
|
625
|
+
* @param {String?} [passId=null] - An optional ID for identifying the pass.
|
|
626
|
+
*/
|
|
627
|
+
/**
|
|
628
|
+
* Sets the given render object function. Calling this method overwrites the default implementation
|
|
629
|
+
* which is {@link module:Renderer~Renderer#renderObject}. Defining a custom function can be useful
|
|
630
|
+
* if you want to modify the way objects are rendered. For example you can define things like "every
|
|
631
|
+
* object that has material of a certain type should perform a pre-pass with a special overwrite material".
|
|
632
|
+
* The custom function must always call `renderObject()` in its implementation.
|
|
633
|
+
*
|
|
634
|
+
* Use `null` as the first argument to reset the state.
|
|
635
|
+
*
|
|
636
|
+
* @param {module:Renderer~renderObjectFunction?} renderObjectFunction - The render object function.
|
|
637
|
+
*/
|
|
232
638
|
setRenderObjectFunction(
|
|
233
639
|
renderObjectFunction:
|
|
234
640
|
| ((
|
|
@@ -242,6 +648,11 @@ declare class Renderer {
|
|
|
242
648
|
) => void)
|
|
243
649
|
| null,
|
|
244
650
|
): void;
|
|
651
|
+
/**
|
|
652
|
+
* Returns the current render object function.
|
|
653
|
+
*
|
|
654
|
+
* @return {Function?} The current render object function. Returns `null` if no function is set.
|
|
655
|
+
*/
|
|
245
656
|
getRenderObjectFunction():
|
|
246
657
|
| ((
|
|
247
658
|
object: Object3D,
|
|
@@ -253,11 +664,78 @@ declare class Renderer {
|
|
|
253
664
|
lightsNode: LightsNode,
|
|
254
665
|
) => void)
|
|
255
666
|
| null;
|
|
667
|
+
/**
|
|
668
|
+
* Execute a single or an array of compute nodes. This method can only be called
|
|
669
|
+
* if the renderer has been initialized.
|
|
670
|
+
*
|
|
671
|
+
* @param {Node|Array<Node>} computeNodes - The compute node(s).
|
|
672
|
+
* @return {Promise?} A Promise that resolve when the compute has finished. Only returned when the renderer has not been initialized.
|
|
673
|
+
*/
|
|
256
674
|
compute(computeNodes: ComputeNode | ComputeNode[]): Promise<void> | undefined;
|
|
675
|
+
/**
|
|
676
|
+
* Execute a single or an array of compute nodes.
|
|
677
|
+
*
|
|
678
|
+
* @async
|
|
679
|
+
* @param {Node|Array<Node>} computeNodes - The compute node(s).
|
|
680
|
+
* @return {Promise?} A Promise that resolve when the compute has finished.
|
|
681
|
+
*/
|
|
257
682
|
computeAsync(computeNodes: ComputeNode | ComputeNode[]): Promise<void>;
|
|
683
|
+
/**
|
|
684
|
+
* Checks if the given feature is supported by the selected backend.
|
|
685
|
+
*
|
|
686
|
+
* @async
|
|
687
|
+
* @param {String} name - The feature's name.
|
|
688
|
+
* @return {Promise<Boolean>} A Promise that resolves with a bool that indicates whether the feature is supported or not.
|
|
689
|
+
*/
|
|
258
690
|
hasFeatureAsync(name: string): Promise<void>;
|
|
691
|
+
/**
|
|
692
|
+
* Checks if the given feature is supported by the selected backend. If the
|
|
693
|
+
* renderer has not been initialized, this method always returns `false`.
|
|
694
|
+
*
|
|
695
|
+
* @param {String} name - The feature's name.
|
|
696
|
+
* @return {Boolean} Whether the feature is supported or not.
|
|
697
|
+
*/
|
|
259
698
|
hasFeature(name: string): false | void;
|
|
699
|
+
/**
|
|
700
|
+
* Returns `true` when the renderer has been initialized.
|
|
701
|
+
*
|
|
702
|
+
* @return {Boolean} Whether the renderer has been initialized or not.
|
|
703
|
+
*/
|
|
704
|
+
hasInitialized(): boolean;
|
|
705
|
+
/**
|
|
706
|
+
* Initializes the given textures. Useful for preloading a texture rather than waiting until first render
|
|
707
|
+
* (which can cause noticeable lags due to decode and GPU upload overhead).
|
|
708
|
+
*
|
|
709
|
+
* @async
|
|
710
|
+
* @param {Texture} texture - The texture.
|
|
711
|
+
* @return {Promise} A Promise that resolves when the texture has been initialized.
|
|
712
|
+
*/
|
|
713
|
+
initTextureAsync(texture: Texture): Promise<void>;
|
|
714
|
+
/**
|
|
715
|
+
* Initializes the given textures. Useful for preloading a texture rather than waiting until first render
|
|
716
|
+
* (which can cause noticeable lags due to decode and GPU upload overhead).
|
|
717
|
+
*
|
|
718
|
+
* This method can only be used if the renderer has been initialized.
|
|
719
|
+
*
|
|
720
|
+
* @param {Texture} texture - The texture.
|
|
721
|
+
*/
|
|
722
|
+
initTexture(texture: Texture): void;
|
|
723
|
+
/**
|
|
724
|
+
* Copies the current bound framebuffer into the given texture.
|
|
725
|
+
*
|
|
726
|
+
* @param {FramebufferTexture} framebufferTexture - The texture.
|
|
727
|
+
* @param {Vector2|Vector4} rectangle - A two or four dimensional vector that defines the rectangular portion of the framebuffer that should be copied.
|
|
728
|
+
*/
|
|
260
729
|
copyFramebufferToTexture(framebufferTexture: FramebufferTexture, rectangle?: Rectangle | null): void;
|
|
730
|
+
/**
|
|
731
|
+
* Copies data of source texture into a destination texture.
|
|
732
|
+
*
|
|
733
|
+
* @param {Texture} srcTexture - The source texture.
|
|
734
|
+
* @param {Texture} dstTexture - The destination texture.
|
|
735
|
+
* @param {Box2|Box3} [srcRegion=null] - A bounding box which describes the source region. Can be two or three-dimensional.
|
|
736
|
+
* @param {Vector2|Vector3} [dstPosition=null] - A vector that represents the origin of the destination region. Can be two or three-dimensional.
|
|
737
|
+
* @param {Number} level - The mipmap level to copy.
|
|
738
|
+
*/
|
|
261
739
|
copyTextureToTexture(
|
|
262
740
|
srcTexture: Texture,
|
|
263
741
|
dstTexture: Texture,
|
|
@@ -265,17 +743,64 @@ declare class Renderer {
|
|
|
265
743
|
dstPosition?: Vector2 | null,
|
|
266
744
|
level?: number,
|
|
267
745
|
): void;
|
|
746
|
+
/**
|
|
747
|
+
* Reads pixel data from the given render target.
|
|
748
|
+
*
|
|
749
|
+
* @async
|
|
750
|
+
* @param {RenderTarget} renderTarget - The render target to read from.
|
|
751
|
+
* @param {Number} x - The `x` coordinate of the copy region's origin.
|
|
752
|
+
* @param {Number} y - The `y` coordinate of the copy region's origin.
|
|
753
|
+
* @param {Number} width - The width of the copy region.
|
|
754
|
+
* @param {Number} height - The height of the copy region.
|
|
755
|
+
* @param {Number} [textureIndex=0] - The texture index of a MRT render target.
|
|
756
|
+
* @param {Number} [faceIndex=0] - The active cube face index.
|
|
757
|
+
* @return {Promise<TypedArray>} A Promise that resolves when the read has been finished. The resolve provides the read data as a typed array.
|
|
758
|
+
*/
|
|
268
759
|
readRenderTargetPixelsAsync(
|
|
269
760
|
renderTarget: RenderTarget,
|
|
270
761
|
x: number,
|
|
271
762
|
y: number,
|
|
272
763
|
width: number,
|
|
273
764
|
height: number,
|
|
274
|
-
|
|
765
|
+
textureIndex?: number,
|
|
275
766
|
faceIndex?: number,
|
|
276
767
|
): Promise<import("../../core/BufferAttribute.js").TypedArray>;
|
|
277
|
-
|
|
768
|
+
/**
|
|
769
|
+
* Analyzes the given 3D object's hierarchy and builds render lists from the
|
|
770
|
+
* processed hierarchy.
|
|
771
|
+
*
|
|
772
|
+
* @param {Object3D} object - The 3D object to process (usually a scene).
|
|
773
|
+
* @param {Camera} camera - The camera the object is rendered with.
|
|
774
|
+
* @param {Number} groupOrder - The group order is derived from the `renderOrder` of groups and is used to group 3D objects within groups.
|
|
775
|
+
* @param {RenderList} renderList - The current render list.
|
|
776
|
+
* @param {ClippingContext} clippingContext - The current clipping context.
|
|
777
|
+
*/
|
|
778
|
+
_projectObject(
|
|
779
|
+
object: Object3D,
|
|
780
|
+
camera: Camera,
|
|
781
|
+
groupOrder: number,
|
|
782
|
+
renderList: RenderList,
|
|
783
|
+
clippingContext: ClippingContext | null,
|
|
784
|
+
): void;
|
|
785
|
+
/**
|
|
786
|
+
* Renders the given render bundles.
|
|
787
|
+
*
|
|
788
|
+
* @private
|
|
789
|
+
* @param {Array<Object>} bundles - Array with render bundle data.
|
|
790
|
+
* @param {Scene} sceneRef - The scene the render bundles belong to.
|
|
791
|
+
* @param {LightsNode} lightsNode - The current lights node.
|
|
792
|
+
*/
|
|
278
793
|
_renderBundles(bundles: Bundle[], sceneRef: Scene, lightsNode: LightsNode): void;
|
|
794
|
+
/**
|
|
795
|
+
* Renders the transparent objects from the given render lists.
|
|
796
|
+
*
|
|
797
|
+
* @private
|
|
798
|
+
* @param {Array<Object>} renderList - The transparent render list.
|
|
799
|
+
* @param {Array<Object>} doublePassList - The list of transparent objects which require a double pass (e.g. because of transmission).
|
|
800
|
+
* @param {Camera} camera - The camera the render list should be rendered with.
|
|
801
|
+
* @param {Scene} scene - The scene the render list belongs to.
|
|
802
|
+
* @param {LightsNode} lightsNode - The current lights node.
|
|
803
|
+
*/
|
|
279
804
|
_renderTransparents(
|
|
280
805
|
renderList: RenderItem[],
|
|
281
806
|
doublePassList: RenderItem[],
|
|
@@ -283,6 +808,16 @@ declare class Renderer {
|
|
|
283
808
|
scene: Scene,
|
|
284
809
|
lightsNode: LightsNode,
|
|
285
810
|
): void;
|
|
811
|
+
/**
|
|
812
|
+
* Renders the objects from the given render list.
|
|
813
|
+
*
|
|
814
|
+
* @private
|
|
815
|
+
* @param {Array<Object>} renderList - The render list.
|
|
816
|
+
* @param {Camera} camera - The camera the render list should be rendered with.
|
|
817
|
+
* @param {Scene} scene - The scene the render list belongs to.
|
|
818
|
+
* @param {LightsNode} lightsNode - The current lights node.
|
|
819
|
+
* @param {String?} [passId=null] - An optional ID for identifying the pass.
|
|
820
|
+
*/
|
|
286
821
|
_renderObjects(
|
|
287
822
|
renderList: RenderItem[],
|
|
288
823
|
camera: Camera,
|
|
@@ -290,6 +825,20 @@ declare class Renderer {
|
|
|
290
825
|
lightsNode: LightsNode,
|
|
291
826
|
passId?: string | null,
|
|
292
827
|
): void;
|
|
828
|
+
/**
|
|
829
|
+
* This method represents the default render object function that manages the render lifecycle
|
|
830
|
+
* of the object.
|
|
831
|
+
*
|
|
832
|
+
* @param {Object3D} object - The 3D object.
|
|
833
|
+
* @param {Scene} scene - The scene the 3D object belongs to.
|
|
834
|
+
* @param {Camera} camera - The camera the object should be rendered with.
|
|
835
|
+
* @param {BufferGeometry} geometry - The object's geometry.
|
|
836
|
+
* @param {Material} material - The object's material.
|
|
837
|
+
* @param {Object?} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`.
|
|
838
|
+
* @param {LightsNode} lightsNode - The current lights node.
|
|
839
|
+
* @param {ClippingContext} clippingContext - The clipping context.
|
|
840
|
+
* @param {String?} [passId=null] - An optional ID for identifying the pass.
|
|
841
|
+
*/
|
|
293
842
|
renderObject(
|
|
294
843
|
object: Object3D,
|
|
295
844
|
scene: Scene,
|
|
@@ -298,8 +847,23 @@ declare class Renderer {
|
|
|
298
847
|
material: Material,
|
|
299
848
|
group: GeometryGroup,
|
|
300
849
|
lightsNode: LightsNode,
|
|
850
|
+
clippingContext?: ClippingContext | null,
|
|
301
851
|
passId?: string | null,
|
|
302
852
|
): void;
|
|
853
|
+
/**
|
|
854
|
+
* This method represents the default `_handleObjectFunction` implementation which creates
|
|
855
|
+
* a render object from the given data and performs the draw command with the selected backend.
|
|
856
|
+
*
|
|
857
|
+
* @private
|
|
858
|
+
* @param {Object3D} object - The 3D object.
|
|
859
|
+
* @param {Material} material - The object's material.
|
|
860
|
+
* @param {Scene} scene - The scene the 3D object belongs to.
|
|
861
|
+
* @param {Camera} camera - The camera the object should be rendered with.
|
|
862
|
+
* @param {LightsNode} lightsNode - The current lights node.
|
|
863
|
+
* @param {Object?} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`.
|
|
864
|
+
* @param {ClippingContext} clippingContext - The clipping context.
|
|
865
|
+
* @param {String?} [passId=null] - An optional ID for identifying the pass.
|
|
866
|
+
*/
|
|
303
867
|
_renderObjectDirect(
|
|
304
868
|
object: Object3D,
|
|
305
869
|
material: Material,
|
|
@@ -307,16 +871,42 @@ declare class Renderer {
|
|
|
307
871
|
camera: Camera,
|
|
308
872
|
lightsNode: LightsNode,
|
|
309
873
|
group: GeometryGroup,
|
|
874
|
+
clippingContext: ClippingContext | null,
|
|
310
875
|
passId?: string,
|
|
311
876
|
): void;
|
|
877
|
+
/**
|
|
878
|
+
* A different implementation for `_handleObjectFunction` which only makes sure the object is ready for rendering.
|
|
879
|
+
* Used in `compileAsync()`.
|
|
880
|
+
*
|
|
881
|
+
* @private
|
|
882
|
+
* @param {Object3D} object - The 3D object.
|
|
883
|
+
* @param {Material} material - The object's material.
|
|
884
|
+
* @param {Scene} scene - The scene the 3D object belongs to.
|
|
885
|
+
* @param {Camera} camera - The camera the object should be rendered with.
|
|
886
|
+
* @param {LightsNode} lightsNode - The current lights node.
|
|
887
|
+
* @param {Object?} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`.
|
|
888
|
+
* @param {ClippingContext} clippingContext - The clipping context.
|
|
889
|
+
* @param {String?} [passId=null] - An optional ID for identifying the pass.
|
|
890
|
+
*/
|
|
312
891
|
_createObjectPipeline(
|
|
313
892
|
object: Object3D,
|
|
314
893
|
material: Material,
|
|
315
894
|
scene: Scene,
|
|
316
895
|
camera: Camera,
|
|
317
896
|
lightsNode: LightsNode,
|
|
897
|
+
group: Group,
|
|
898
|
+
clippingContext: ClippingContext | null,
|
|
318
899
|
passId?: string,
|
|
319
900
|
): void;
|
|
901
|
+
/**
|
|
902
|
+
* Alias for `compileAsync()`.
|
|
903
|
+
*
|
|
904
|
+
* @method
|
|
905
|
+
* @param {Object3D} scene - The scene or 3D object to precompile.
|
|
906
|
+
* @param {Camera} camera - The camera that is used to render the scene.
|
|
907
|
+
* @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.
|
|
908
|
+
* @return {Promise} A Promise that resolves when the compile has been finished.
|
|
909
|
+
*/
|
|
320
910
|
get compile(): (scene: Object3D, camera: Camera, targetScene?: Object3D | null) => Promise<void>;
|
|
321
911
|
}
|
|
322
912
|
export default Renderer;
|