@types/three 0.184.1 → 0.185.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 +2 -0
- three/examples/jsm/controls/FirstPersonControls.d.ts +9 -0
- three/examples/jsm/controls/OrbitControls.d.ts +2 -2
- three/examples/jsm/controls/TransformControls.d.ts +32 -1
- three/examples/jsm/csm/CSMFrustum.d.ts +73 -13
- three/examples/jsm/exporters/DRACOExporter.d.ts +1 -1
- three/examples/jsm/exporters/GLTFExporter.d.ts +2 -2
- three/examples/jsm/exporters/PLYExporter.d.ts +5 -4
- three/examples/jsm/exporters/USDZExporter.d.ts +5 -1
- three/examples/jsm/generators/CityGenerator.d.ts +75 -0
- three/examples/jsm/generators/ForestGenerator.d.ts +79 -0
- three/examples/jsm/generators/TerrainGenerator.d.ts +67 -0
- three/examples/jsm/generators/TreeGenerator.d.ts +97 -0
- three/examples/jsm/generators/city/SidewalkGenerator.d.ts +40 -0
- three/examples/jsm/generators/city/SkyscraperGenerator.d.ts +83 -0
- three/examples/jsm/geometries/LoftGeometry.d.ts +83 -0
- three/examples/jsm/inspector/tabs/Parameters.d.ts +5 -2
- three/examples/jsm/lighting/ClusteredLighting.d.ts +45 -0
- three/examples/jsm/lighting/LightProbeGrid.d.ts +131 -13
- three/examples/jsm/loaders/DRACOLoader.d.ts +20 -6
- three/examples/jsm/loaders/EXRLoader.d.ts +2 -12
- three/examples/jsm/loaders/GLTFLoader.d.ts +1 -1
- three/examples/jsm/loaders/HDRLoader.d.ts +2 -12
- three/examples/jsm/loaders/KTX2Loader.d.ts +1 -1
- three/examples/jsm/loaders/LWOLoader.d.ts +6 -0
- three/examples/jsm/loaders/RGBELoader.d.ts +1 -7
- three/examples/jsm/loaders/SVGLoader.d.ts +9 -6
- three/examples/jsm/loaders/TGALoader.d.ts +2 -2
- three/examples/jsm/loaders/TIFFLoader.d.ts +2 -11
- three/examples/jsm/loaders/USDLoader.d.ts +6 -1
- three/examples/jsm/misc/TileCreasedNormalsPlugin.d.ts +49 -0
- three/examples/jsm/objects/MarchingCubes.d.ts +2 -2
- three/examples/jsm/objects/Reflector.d.ts +38 -5
- three/examples/jsm/objects/SkyMesh.d.ts +1 -1
- three/examples/jsm/physics/RapierPhysics.d.ts +1 -0
- three/examples/jsm/tsl/display/BloomNode.d.ts +23 -6
- three/examples/jsm/tsl/display/ImportanceSampledEnvironment.d.ts +84 -0
- three/examples/jsm/tsl/display/RecurrentDenoiseNode.d.ts +89 -0
- three/examples/jsm/tsl/display/SSAAPassNode.d.ts +0 -2
- three/examples/jsm/tsl/display/SSGINode.d.ts +4 -1
- three/examples/jsm/tsl/display/SSRNode.d.ts +303 -30
- three/examples/jsm/tsl/display/TRAANode.d.ts +1 -1
- three/examples/jsm/tsl/display/TemporalReprojectNode.d.ts +64 -0
- three/examples/jsm/tsl/lighting/ClusteredLightsNode.d.ts +54 -0
- three/examples/jsm/tsl/math/curlNoise.d.ts +38 -0
- three/examples/jsm/tsl/utils/GroundedSkybox.d.ts +17 -0
- three/examples/jsm/tsl/utils/RNoise.d.ts +12 -0
- three/examples/jsm/tsl/utils/SpecularHelpers.d.ts +20 -0
- three/examples/jsm/webxr/WebGLXRFallback.d.ts +14 -0
- three/package.json +3 -3
- three/src/Three.TSL.d.ts +10 -3
- three/src/Three.WebGPU.Nodes.d.ts +2 -2
- three/src/Three.WebGPU.d.ts +5 -3
- three/src/animation/AnimationClip.d.ts +0 -10
- three/src/cameras/Camera.d.ts +1 -1
- three/src/core/InterleavedBuffer.d.ts +1 -1
- three/src/core/Object3D.d.ts +8 -4
- three/src/core/RenderTarget.d.ts +11 -0
- three/src/core/Timer.d.ts +1 -1
- three/src/core/UniformsGroup.d.ts +1 -1
- three/src/extras/Controls.d.ts +6 -5
- three/src/extras/core/ShapePath.d.ts +61 -65
- three/src/loaders/DataTextureLoader.d.ts +37 -3
- three/src/loaders/MaterialLoader.d.ts +8 -0
- three/src/materials/LineBasicMaterial.d.ts +5 -0
- three/src/materials/Material.d.ts +9 -1
- three/src/materials/MeshBasicMaterial.d.ts +30 -0
- three/src/materials/MeshDepthMaterial.d.ts +13 -0
- three/src/materials/MeshDistanceMaterial.d.ts +13 -0
- three/src/materials/MeshLambertMaterial.d.ts +50 -1
- three/src/materials/MeshMatcapMaterial.d.ts +31 -1
- three/src/materials/MeshNormalMaterial.d.ts +11 -1
- three/src/materials/MeshPhongMaterial.d.ts +50 -1
- three/src/materials/MeshPhysicalMaterial.d.ts +50 -0
- three/src/materials/MeshStandardMaterial.d.ts +53 -1
- three/src/materials/MeshToonMaterial.d.ts +43 -1
- three/src/materials/PointsMaterial.d.ts +9 -0
- three/src/materials/ShaderMaterial.d.ts +2 -0
- three/src/materials/SpriteMaterial.d.ts +9 -0
- three/src/materials/nodes/Line2NodeMaterial.d.ts +18 -13
- three/src/materials/nodes/NodeMaterial.d.ts +33 -13
- three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +0 -84
- three/src/math/Box2.d.ts +3 -3
- three/src/math/Box3.d.ts +255 -19
- three/src/math/Color.d.ts +10 -10
- three/src/math/FrustumArray.d.ts +75 -16
- three/src/math/Interpolant.d.ts +111 -8
- three/src/math/Matrix3.d.ts +9 -0
- three/src/math/Matrix4.d.ts +329 -105
- three/src/math/Vector3.d.ts +2 -2
- three/src/math/interpolants/BezierInterpolant.d.ts +19 -3
- three/src/math/interpolants/CubicInterpolant.d.ts +18 -3
- three/src/math/interpolants/DiscreteInterpolant.d.ts +8 -3
- three/src/math/interpolants/LinearInterpolant.d.ts +7 -3
- three/src/math/interpolants/QuaternionLinearInterpolant.d.ts +7 -3
- three/src/nodes/Nodes.d.ts +4 -13
- three/src/nodes/TSL.d.ts +7 -5
- three/src/nodes/accessors/Batch.d.ts +19 -0
- three/src/nodes/accessors/Instance.d.ts +34 -0
- three/src/nodes/accessors/MaterialNode.d.ts +86 -79
- three/src/nodes/accessors/Morph.d.ts +11 -0
- three/src/nodes/accessors/Skinning.d.ts +23 -0
- three/src/nodes/accessors/StorageBufferNode.d.ts +22 -23
- three/src/nodes/accessors/StorageTexture3DNode.d.ts +17 -0
- three/src/nodes/accessors/StorageTextureNode.d.ts +6 -4
- three/src/nodes/accessors/TextureNode.d.ts +15 -10
- three/src/nodes/core/ArrayNode.d.ts +16 -8
- three/src/nodes/core/ContextNode.d.ts +5 -6
- three/src/nodes/core/LightingModel.d.ts +2 -0
- three/src/nodes/core/Node.d.ts +50 -51
- three/src/nodes/core/NodeBuilder.d.ts +1 -133
- three/src/nodes/core/OverrideContextNode.d.ts +92 -0
- three/src/nodes/core/PropertyNode.d.ts +13 -2
- three/src/nodes/core/StructNode.d.ts +0 -2
- three/src/nodes/core/StructTypeNode.d.ts +5 -4
- three/src/nodes/core/UniformNode.d.ts +48 -9
- three/src/nodes/display/BlendModes.d.ts +72 -11
- three/src/nodes/display/FrontFacingNode.d.ts +62 -3
- three/src/nodes/display/PassNode.d.ts +0 -2
- three/src/nodes/display/PremultiplyAlphaFunctions.d.ts +37 -0
- three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +53 -45
- three/src/nodes/lighting/LightingContextNode.d.ts +9 -2
- three/src/nodes/lighting/LightsNode.d.ts +4 -4
- three/src/nodes/math/MathNode.d.ts +358 -304
- three/src/nodes/math/OperatorNode.d.ts +253 -82
- three/src/nodes/tsl/TSLCore.d.ts +16 -9
- three/src/nodes/utils/ArrayElementNode.d.ts +5 -4
- three/src/nodes/utils/EquirectUV.d.ts +31 -1
- three/src/nodes/utils/Packing.d.ts +50 -3
- three/src/nodes/utils/RTTNode.d.ts +7 -12
- three/src/nodes/utils/Remap.d.ts +216 -29
- three/src/nodes/utils/SampleNode.d.ts +18 -8
- three/src/objects/BatchedMesh.d.ts +1 -1
- three/src/objects/InstancedMesh.d.ts +0 -8
- three/src/objects/Skeleton.d.ts +0 -2
- three/src/renderers/common/Backend.d.ts +0 -3
- three/src/renderers/common/CanvasTarget.d.ts +0 -49
- three/src/renderers/common/ClippingContext.d.ts +6 -1
- three/src/renderers/common/CubeRenderTarget.d.ts +2 -1
- three/src/renderers/common/Info.d.ts +26 -66
- three/src/renderers/common/InspectorBase.d.ts +0 -7
- three/src/renderers/common/Lighting.d.ts +49 -5
- three/src/renderers/common/Renderer.d.ts +34 -458
- three/src/renderers/common/RendererUtils.d.ts +1 -2
- three/src/renderers/common/TimestampQueryPool.d.ts +1 -1
- three/src/renderers/common/XRManager.d.ts +32 -299
- three/src/renderers/common/nodes/NodeLibrary.d.ts +0 -117
- three/src/renderers/webgl/WebGLPrograms.d.ts +2 -0
- three/src/renderers/webgl/WebGLRenderLists.d.ts +5 -1
- three/src/renderers/webgl/WebGLState.d.ts +2 -0
- three/src/renderers/webgl-fallback/WebGLBackend.d.ts +1 -1
- three/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.d.ts +0 -10
- three/src/renderers/webgpu/nodes/StandardNodeLibrary.d.ts +0 -1
- three/src/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts +5 -121
- three/src/textures/CubeDepthTexture.d.ts +2 -3
- three/src/textures/DataTexture.d.ts +2 -1
- three/src/textures/DepthTexture.d.ts +5 -5
- three/examples/jsm/lighting/TiledLighting.d.ts +0 -9
- three/examples/jsm/tsl/display/AnamorphicNode.d.ts +0 -31
- three/examples/jsm/tsl/lighting/TiledLightsNode.d.ts +0 -22
- three/src/nodes/accessors/BatchNode.d.ts +0 -12
- three/src/nodes/accessors/InstanceNode.d.ts +0 -30
- three/src/nodes/accessors/InstancedMeshNode.d.ts +0 -10
- three/src/nodes/accessors/MorphNode.d.ts +0 -14
- three/src/nodes/accessors/SkinningNode.d.ts +0 -32
- three/src/renderers/common/Animation.d.ts +0 -102
- three/src/renderers/common/Attributes.d.ts +0 -59
- three/src/renderers/common/Background.d.ts +0 -47
- three/src/renderers/common/BindGroup.d.ts +0 -39
- three/src/renderers/common/Binding.d.ts +0 -50
- three/src/renderers/common/Bindings.d.ts +0 -132
- three/src/renderers/common/Buffer.d.ts +0 -90
- three/src/renderers/common/ChainMap.d.ts +0 -49
- three/src/renderers/common/Color4.d.ts +0 -55
- three/src/renderers/common/ComputePipeline.d.ts +0 -34
- three/src/renderers/common/DataMap.d.ts +0 -42
- three/src/renderers/common/Geometries.d.ts +0 -111
- three/src/renderers/common/Pipeline.d.ts +0 -29
- three/src/renderers/common/Pipelines.d.ts +0 -186
- three/src/renderers/common/ProgrammableStage.d.ts +0 -73
- three/src/renderers/common/RenderBundle.d.ts +0 -25
- three/src/renderers/common/RenderBundles.d.ts +0 -34
- three/src/renderers/common/RenderContext.d.ts +0 -235
- three/src/renderers/common/RenderContexts.d.ts +0 -47
- three/src/renderers/common/RenderList.d.ts +0 -226
- three/src/renderers/common/RenderLists.d.ts +0 -46
- three/src/renderers/common/RenderObject.d.ts +0 -448
- three/src/renderers/common/RenderObjectPipeline.d.ts +0 -33
- three/src/renderers/common/RenderObjects.d.ts +0 -151
- three/src/renderers/common/SampledTexture.d.ts +0 -28
- three/src/renderers/common/Sampler.d.ts +0 -19
- three/src/renderers/common/Textures.d.ts +0 -125
- three/src/renderers/common/Uniform.d.ts +0 -262
- three/src/renderers/common/UniformBuffer.d.ts +0 -20
- three/src/renderers/common/UniformsGroup.d.ts +0 -152
- three/src/renderers/common/XRRenderTarget.d.ts +0 -67
- three/src/renderers/common/nodes/NodeBuilderState.d.ts +0 -121
- three/src/renderers/common/nodes/NodeManager.d.ts +0 -309
- three/src/renderers/common/nodes/NodeSampledTexture.d.ts +0 -29
- three/src/renderers/common/nodes/NodeSampler.d.ts +0 -12
- three/src/renderers/common/nodes/NodeUniform.d.ts +0 -250
- three/src/renderers/common/nodes/NodeUniformsGroup.d.ts +0 -41
- three/src/renderers/webgpu/nodes/WGSLNodeFunction.d.ts +0 -6
- three/src/renderers/webgpu/nodes/WGSLNodeParser.d.ts +0 -6
|
@@ -19,13 +19,6 @@ export interface InspectorBaseEventMap {
|
|
|
19
19
|
declare class InspectorBase<TEventMap extends InspectorBaseEventMap = InspectorBaseEventMap>
|
|
20
20
|
extends EventDispatcher<TEventMap>
|
|
21
21
|
{
|
|
22
|
-
/**
|
|
23
|
-
* The renderer associated with this inspector.
|
|
24
|
-
*
|
|
25
|
-
* @type {WebGLRenderer}
|
|
26
|
-
* @private
|
|
27
|
-
*/
|
|
28
|
-
private _renderer;
|
|
29
22
|
/**
|
|
30
23
|
* The current frame being processed.
|
|
31
24
|
*
|
|
@@ -1,11 +1,55 @@
|
|
|
1
|
-
import { Object3D } from "../../core/Object3D.js";
|
|
2
1
|
import { Light } from "../../lights/Light.js";
|
|
3
|
-
import LightsNode from "../../nodes/
|
|
2
|
+
import { LightsNode } from "../../nodes/Nodes.js";
|
|
3
|
+
import { Scene } from "../../scenes/Scene.js";
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* This renderer module manages the lights nodes which are unique
|
|
7
|
+
* per scene and camera combination.
|
|
8
|
+
*
|
|
9
|
+
* The lights node itself is later configured in the render list
|
|
10
|
+
* with the actual lights from the scene.
|
|
11
|
+
*
|
|
12
|
+
* @private
|
|
13
|
+
*/
|
|
5
14
|
declare class Lighting {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Whether this lighting manager is enabled or not.
|
|
17
|
+
*
|
|
18
|
+
* @type {boolean}
|
|
19
|
+
* @default true
|
|
20
|
+
*/
|
|
21
|
+
enabled: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Creates a new lights node for the given array of lights.
|
|
24
|
+
*
|
|
25
|
+
* @param {Array<Light>} lights - The render object.
|
|
26
|
+
* @return {LightsNode} The lights node.
|
|
27
|
+
*/
|
|
28
|
+
createNode(lights?: Array<Light>): LightsNode;
|
|
29
|
+
/**
|
|
30
|
+
* Returns a lights node for the given scene.
|
|
31
|
+
*
|
|
32
|
+
* @param {Scene} scene - The scene.
|
|
33
|
+
* @return {LightsNode} The lights node.
|
|
34
|
+
*/
|
|
35
|
+
getNode(scene: Scene): LightsNode;
|
|
36
|
+
/**
|
|
37
|
+
* Saves the current lights of the scene's lights node so they can be restored
|
|
38
|
+
* in {@link Lighting#finishRender}. Must be paired with a `finishRender()` call
|
|
39
|
+
* to avoid memory leaks.
|
|
40
|
+
*
|
|
41
|
+
* Nested render calls might mutate the lights array so a save/restore is required
|
|
42
|
+
* for each render call.
|
|
43
|
+
*
|
|
44
|
+
* @param {Scene} scene - The scene.
|
|
45
|
+
*/
|
|
46
|
+
beginRender(scene: Scene): void;
|
|
47
|
+
/**
|
|
48
|
+
* Restores the lights saved by the matching {@link Lighting#beginRender} call.
|
|
49
|
+
*
|
|
50
|
+
* @param {Scene} scene - The scene.
|
|
51
|
+
*/
|
|
52
|
+
finishRender(scene: Scene): void;
|
|
9
53
|
}
|
|
10
54
|
|
|
11
55
|
export default Lighting;
|
|
@@ -7,12 +7,13 @@ import { RenderTarget } from "../../core/RenderTarget.js";
|
|
|
7
7
|
import { Material } from "../../materials/Material.js";
|
|
8
8
|
import { Box2 } from "../../math/Box2.js";
|
|
9
9
|
import { Box3 } from "../../math/Box3.js";
|
|
10
|
-
import { ColorRepresentation } from "../../math/Color.js";
|
|
10
|
+
import { Color, 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
14
|
import ContextNode from "../../nodes/core/ContextNode.js";
|
|
15
15
|
import MRTNode from "../../nodes/core/MRTNode.js";
|
|
16
|
+
import Node from "../../nodes/core/Node.js";
|
|
16
17
|
import ComputeNode from "../../nodes/gpgpu/ComputeNode.js";
|
|
17
18
|
import LightsNode from "../../nodes/lighting/LightsNode.js";
|
|
18
19
|
import { Scene } from "../../scenes/Scene.js";
|
|
@@ -21,16 +22,22 @@ import { Texture } from "../../textures/Texture.js";
|
|
|
21
22
|
import Backend from "./Backend.js";
|
|
22
23
|
import CanvasTarget from "./CanvasTarget.js";
|
|
23
24
|
import ClippingContext from "./ClippingContext.js";
|
|
24
|
-
import Color4 from "./Color4.js";
|
|
25
25
|
import IndirectStorageBufferAttribute from "./IndirectStorageBufferAttribute.js";
|
|
26
26
|
import Info from "./Info.js";
|
|
27
27
|
import InspectorBase from "./InspectorBase.js";
|
|
28
28
|
import Lighting from "./Lighting.js";
|
|
29
29
|
import NodeLibrary from "./nodes/NodeLibrary.js";
|
|
30
30
|
import ReadbackBuffer from "./ReadbackBuffer.js";
|
|
31
|
-
import { RenderItem } from "./RenderList.js";
|
|
32
31
|
import XRManager from "./XRManager.js";
|
|
33
32
|
|
|
33
|
+
declare module "../../scenes/Scene.js" {
|
|
34
|
+
interface Scene {
|
|
35
|
+
environmentNode?: Node<"vec3"> | null | undefined;
|
|
36
|
+
backgroundNode?: Node | null | undefined;
|
|
37
|
+
fogNode?: Node | null | undefined;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
34
41
|
interface DeviceLostInfo {
|
|
35
42
|
api: "WebGL" | "WebGPU";
|
|
36
43
|
message: string;
|
|
@@ -51,6 +58,18 @@ export interface RendererParameters {
|
|
|
51
58
|
multiview?: boolean | undefined;
|
|
52
59
|
}
|
|
53
60
|
|
|
61
|
+
export interface RenderItem {
|
|
62
|
+
id: number | null;
|
|
63
|
+
object: Object3D | null;
|
|
64
|
+
geometry: BufferGeometry | null;
|
|
65
|
+
material: Material | null;
|
|
66
|
+
groupOrder: number | null;
|
|
67
|
+
renderOrder: number | null;
|
|
68
|
+
z: number | null;
|
|
69
|
+
group: GeometryGroup | null;
|
|
70
|
+
clippingContext: ClippingContext | null;
|
|
71
|
+
}
|
|
72
|
+
|
|
54
73
|
/**
|
|
55
74
|
* Base class for renderers.
|
|
56
75
|
*/
|
|
@@ -227,287 +246,6 @@ declare class Renderer {
|
|
|
227
246
|
* @type {Lighting}
|
|
228
247
|
*/
|
|
229
248
|
lighting: Lighting;
|
|
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
|
-
* Cache for the fullscreen quad.
|
|
363
|
-
* This fullscreen quad is used for internal render passes
|
|
364
|
-
* like the tone mapping and color space output pass.
|
|
365
|
-
*
|
|
366
|
-
* @private
|
|
367
|
-
* @type {Map<Texture,QuadMesh>}
|
|
368
|
-
*/
|
|
369
|
-
private _quadCache;
|
|
370
|
-
/**
|
|
371
|
-
* A reference to the current render context.
|
|
372
|
-
*
|
|
373
|
-
* @private
|
|
374
|
-
* @type {?RenderContext}
|
|
375
|
-
* @default null
|
|
376
|
-
*/
|
|
377
|
-
private _currentRenderContext;
|
|
378
|
-
/**
|
|
379
|
-
* A custom sort function for the opaque render list.
|
|
380
|
-
*
|
|
381
|
-
* @private
|
|
382
|
-
* @type {?Function}
|
|
383
|
-
* @default null
|
|
384
|
-
*/
|
|
385
|
-
private _opaqueSort;
|
|
386
|
-
/**
|
|
387
|
-
* A custom sort function for the transparent render list.
|
|
388
|
-
*
|
|
389
|
-
* @private
|
|
390
|
-
* @type {?Function}
|
|
391
|
-
* @default null
|
|
392
|
-
*/
|
|
393
|
-
private _transparentSort;
|
|
394
|
-
/**
|
|
395
|
-
* Cache of framebuffer targets per canvas target.
|
|
396
|
-
*
|
|
397
|
-
* @private
|
|
398
|
-
* @type {Map<CanvasTarget, RenderTarget>}
|
|
399
|
-
*/
|
|
400
|
-
private _frameBufferTargets;
|
|
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
249
|
/**
|
|
512
250
|
* A callback function that defines what should happen when a device/context lost occurs.
|
|
513
251
|
*
|
|
@@ -515,55 +253,24 @@ declare class Renderer {
|
|
|
515
253
|
*/
|
|
516
254
|
onDeviceLost: (info: DeviceLostInfo) => void;
|
|
517
255
|
/**
|
|
518
|
-
*
|
|
519
|
-
*
|
|
520
|
-
*
|
|
521
|
-
*
|
|
522
|
-
*
|
|
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.
|
|
256
|
+
* A callback function that defines what should happen when an uncaptured
|
|
257
|
+
* backend error is reported (e.g. a WebGPU validation/out-of-memory/internal
|
|
258
|
+
* error raised outside an error scope). Applications can override this to
|
|
259
|
+
* surface errors in their own UI without letting them escalate to a device
|
|
260
|
+
* loss. The default implementation logs to the console.
|
|
536
261
|
*
|
|
537
|
-
* @
|
|
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
|
|
262
|
+
* @type {Function}
|
|
557
263
|
*/
|
|
558
|
-
|
|
264
|
+
onError: (errorMessage: string) => void;
|
|
559
265
|
/**
|
|
560
|
-
*
|
|
266
|
+
* When an override material is in use, this property points to the current
|
|
267
|
+
* source material during the rendering of a render object.
|
|
561
268
|
*
|
|
562
269
|
* @private
|
|
563
|
-
* @type {?
|
|
270
|
+
* @type {?Material}
|
|
564
271
|
* @default null
|
|
565
272
|
*/
|
|
566
|
-
private
|
|
273
|
+
private _currentSourceMaterial;
|
|
567
274
|
/**
|
|
568
275
|
* Whether the renderer should render transparent render objects or not.
|
|
569
276
|
*
|
|
@@ -760,22 +467,6 @@ declare class Renderer {
|
|
|
760
467
|
* @return {number} The output buffer type.
|
|
761
468
|
*/
|
|
762
469
|
getColorBufferType(): TextureDataType;
|
|
763
|
-
/**
|
|
764
|
-
* Default implementation of the device lost callback.
|
|
765
|
-
*
|
|
766
|
-
* @private
|
|
767
|
-
* @param {Object} info - Information about the context lost.
|
|
768
|
-
*/
|
|
769
|
-
private _onDeviceLost;
|
|
770
|
-
/**
|
|
771
|
-
* Renders the given render bundle.
|
|
772
|
-
*
|
|
773
|
-
* @private
|
|
774
|
-
* @param {Object} bundle - Render bundle data.
|
|
775
|
-
* @param {Scene} sceneRef - The scene the render bundle belongs to.
|
|
776
|
-
* @param {LightsNode} lightsNode - The lights node.
|
|
777
|
-
*/
|
|
778
|
-
private _renderBundle;
|
|
779
470
|
/**
|
|
780
471
|
* Renders the scene or 3D object with the given camera. This method can only be called
|
|
781
472
|
* if the renderer has been initialized. When using `render()` inside an animation loop,
|
|
@@ -799,33 +490,6 @@ declare class Renderer {
|
|
|
799
490
|
* @return {boolean} Whether the renderer has been initialized or not.
|
|
800
491
|
*/
|
|
801
492
|
get initialized(): boolean;
|
|
802
|
-
/**
|
|
803
|
-
* Returns an internal render target which is used when computing the output tone mapping
|
|
804
|
-
* and color space conversion. Unlike in `WebGLRenderer`, this is done in a separate render
|
|
805
|
-
* pass and not inline to achieve more correct results.
|
|
806
|
-
*
|
|
807
|
-
* @private
|
|
808
|
-
* @return {?RenderTarget} The render target. The method returns `null` if no output conversion should be applied.
|
|
809
|
-
*/
|
|
810
|
-
private _getFrameBufferTarget;
|
|
811
|
-
/**
|
|
812
|
-
* Renders the scene or 3D object with the given camera.
|
|
813
|
-
*
|
|
814
|
-
* @private
|
|
815
|
-
* @param {Object3D} scene - The scene or 3D object to render.
|
|
816
|
-
* @param {Camera} camera - The camera to render the scene with.
|
|
817
|
-
* @param {boolean} [useFrameBufferTarget=true] - Whether to use a framebuffer target or not.
|
|
818
|
-
* @return {RenderContext} The current render context.
|
|
819
|
-
*/
|
|
820
|
-
private _renderScene;
|
|
821
|
-
_setXRLayerSize(width: number, height: number): void;
|
|
822
|
-
/**
|
|
823
|
-
* The output pass performs tone mapping and color space conversion.
|
|
824
|
-
*
|
|
825
|
-
* @private
|
|
826
|
-
* @param {RenderTarget} renderTarget - The current render target.
|
|
827
|
-
*/
|
|
828
|
-
private _renderOutput;
|
|
829
493
|
/**
|
|
830
494
|
* Returns the maximum available anisotropy for texture filtering.
|
|
831
495
|
*
|
|
@@ -1011,7 +675,7 @@ declare class Renderer {
|
|
|
1011
675
|
* @param {Color} target - The method writes the result in this target object.
|
|
1012
676
|
* @return {Color} The clear color.
|
|
1013
677
|
*/
|
|
1014
|
-
getClearColor(target:
|
|
678
|
+
getClearColor(target: Color): Color;
|
|
1015
679
|
/**
|
|
1016
680
|
* Defines the clear color and optionally the clear alpha.
|
|
1017
681
|
*
|
|
@@ -1207,12 +871,6 @@ declare class Renderer {
|
|
|
1207
871
|
* @return {CanvasTarget} The current canvas target.
|
|
1208
872
|
*/
|
|
1209
873
|
getCanvasTarget(): CanvasTarget;
|
|
1210
|
-
/**
|
|
1211
|
-
* Resets the renderer to the initial state before WebXR started.
|
|
1212
|
-
*
|
|
1213
|
-
* @private
|
|
1214
|
-
*/
|
|
1215
|
-
private _resetXRState;
|
|
1216
874
|
/**
|
|
1217
875
|
* Callback for {@link Renderer#setRenderObjectFunction}.
|
|
1218
876
|
*
|
|
@@ -1397,58 +1055,6 @@ declare class Renderer {
|
|
|
1397
1055
|
textureIndex?: number,
|
|
1398
1056
|
faceIndex?: number,
|
|
1399
1057
|
): Promise<TypedArray>;
|
|
1400
|
-
/**
|
|
1401
|
-
* Analyzes the given 3D object's hierarchy and builds render lists from the
|
|
1402
|
-
* processed hierarchy.
|
|
1403
|
-
*
|
|
1404
|
-
* @private
|
|
1405
|
-
* @param {Object3D} object - The 3D object to process (usually a scene).
|
|
1406
|
-
* @param {Camera} camera - The camera the object is rendered with.
|
|
1407
|
-
* @param {number} groupOrder - The group order is derived from the `renderOrder` of groups and is used to group 3D objects within groups.
|
|
1408
|
-
* @param {RenderList} renderList - The current render list.
|
|
1409
|
-
* @param {ClippingContext} clippingContext - The current clipping context.
|
|
1410
|
-
*/
|
|
1411
|
-
private _projectObject;
|
|
1412
|
-
/**
|
|
1413
|
-
* Renders the given render bundles.
|
|
1414
|
-
*
|
|
1415
|
-
* @private
|
|
1416
|
-
* @param {Array<Object>} bundles - Array with render bundle data.
|
|
1417
|
-
* @param {Scene} sceneRef - The scene the render bundles belong to.
|
|
1418
|
-
* @param {LightsNode} lightsNode - The current lights node.
|
|
1419
|
-
*/
|
|
1420
|
-
private _renderBundles;
|
|
1421
|
-
/**
|
|
1422
|
-
* Renders the transparent objects from the given render lists.
|
|
1423
|
-
*
|
|
1424
|
-
* @private
|
|
1425
|
-
* @param {Array<Object>} renderList - The transparent render list.
|
|
1426
|
-
* @param {Array<Object>} doublePassList - The list of transparent objects which require a double pass (e.g. because of transmission).
|
|
1427
|
-
* @param {Camera} camera - The camera the render list should be rendered with.
|
|
1428
|
-
* @param {Scene} scene - The scene the render list belongs to.
|
|
1429
|
-
* @param {LightsNode} lightsNode - The current lights node.
|
|
1430
|
-
*/
|
|
1431
|
-
private _renderTransparents;
|
|
1432
|
-
/**
|
|
1433
|
-
* Renders the objects from the given render list.
|
|
1434
|
-
*
|
|
1435
|
-
* @private
|
|
1436
|
-
* @param {Array<Object>} renderList - The render list.
|
|
1437
|
-
* @param {Camera} camera - The camera the render list should be rendered with.
|
|
1438
|
-
* @param {Scene} scene - The scene the render list belongs to.
|
|
1439
|
-
* @param {LightsNode} lightsNode - The current lights node.
|
|
1440
|
-
* @param {?string} [passId=null] - An optional ID for identifying the pass.
|
|
1441
|
-
*/
|
|
1442
|
-
private _renderObjects;
|
|
1443
|
-
/**
|
|
1444
|
-
* Retrieves shadow nodes for the given material. This is used to setup shadow passes.
|
|
1445
|
-
* The result is cached per material and updated when the material's version changes.
|
|
1446
|
-
*
|
|
1447
|
-
* @private
|
|
1448
|
-
* @param {Material} material
|
|
1449
|
-
* @returns {Object} - The shadow nodes for the material.
|
|
1450
|
-
*/
|
|
1451
|
-
private _getShadowNodes;
|
|
1452
1058
|
/**
|
|
1453
1059
|
* This method represents the default render object function that manages the render lifecycle
|
|
1454
1060
|
* of the object.
|
|
@@ -1481,36 +1087,6 @@ declare class Renderer {
|
|
|
1481
1087
|
* @return {boolean} Whether the compatibility is supported or not.
|
|
1482
1088
|
*/
|
|
1483
1089
|
hasCompatibility(name: string): boolean;
|
|
1484
|
-
/**
|
|
1485
|
-
* This method represents the default `_handleObjectFunction` implementation which creates
|
|
1486
|
-
* a render object from the given data and performs the draw command with the selected backend.
|
|
1487
|
-
*
|
|
1488
|
-
* @private
|
|
1489
|
-
* @param {Object3D} object - The 3D object.
|
|
1490
|
-
* @param {Material} material - The object's material.
|
|
1491
|
-
* @param {Scene} scene - The scene the 3D object belongs to.
|
|
1492
|
-
* @param {Camera} camera - The camera the object should be rendered with.
|
|
1493
|
-
* @param {LightsNode} lightsNode - The current lights node.
|
|
1494
|
-
* @param {?{start: number, count: number}} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`.
|
|
1495
|
-
* @param {ClippingContext} clippingContext - The clipping context.
|
|
1496
|
-
* @param {string} [passId] - An optional ID for identifying the pass.
|
|
1497
|
-
*/
|
|
1498
|
-
private _renderObjectDirect;
|
|
1499
|
-
/**
|
|
1500
|
-
* A different implementation for `_handleObjectFunction` which only makes sure the object is ready for rendering.
|
|
1501
|
-
* Used in `compileAsync()`.
|
|
1502
|
-
*
|
|
1503
|
-
* @private
|
|
1504
|
-
* @param {Object3D} object - The 3D object.
|
|
1505
|
-
* @param {Material} material - The object's material.
|
|
1506
|
-
* @param {Scene} scene - The scene the 3D object belongs to.
|
|
1507
|
-
* @param {Camera} camera - The camera the object should be rendered with.
|
|
1508
|
-
* @param {LightsNode} lightsNode - The current lights node.
|
|
1509
|
-
* @param {?{start: number, count: number}} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`.
|
|
1510
|
-
* @param {ClippingContext} clippingContext - The clipping context.
|
|
1511
|
-
* @param {string} [passId] - An optional ID for identifying the pass.
|
|
1512
|
-
*/
|
|
1513
|
-
private _createObjectPipeline;
|
|
1514
1090
|
/**
|
|
1515
1091
|
* Alias for `compileAsync()`.
|
|
1516
1092
|
*
|
|
@@ -11,7 +11,6 @@ import LightsNode from "../../nodes/lighting/LightsNode.js";
|
|
|
11
11
|
import { Scene } from "../../scenes/Scene.js";
|
|
12
12
|
import { CubeTexture } from "../../textures/CubeTexture.js";
|
|
13
13
|
import { Texture } from "../../textures/Texture.js";
|
|
14
|
-
import Color4 from "./Color4.js";
|
|
15
14
|
import Renderer from "./Renderer.js";
|
|
16
15
|
|
|
17
16
|
// renderer state
|
|
@@ -36,7 +35,7 @@ export interface RendererState {
|
|
|
36
35
|
| null;
|
|
37
36
|
pixelRatio: number;
|
|
38
37
|
mrt: MRTNode | null;
|
|
39
|
-
clearColor:
|
|
38
|
+
clearColor: Color;
|
|
40
39
|
clearAlpha: number;
|
|
41
40
|
autoClear: boolean;
|
|
42
41
|
scissorTest: boolean;
|
|
@@ -91,7 +91,7 @@ declare abstract class TimestampQueryPool {
|
|
|
91
91
|
* @param {string} uid - A unique identifier for the render context.
|
|
92
92
|
* @return {boolean} True if a timestamp is available, false otherwise.
|
|
93
93
|
*/
|
|
94
|
-
|
|
94
|
+
hasTimestampQuery(uid: string): boolean;
|
|
95
95
|
/**
|
|
96
96
|
* Allocate queries for a specific uid.
|
|
97
97
|
*
|