@types/three 0.162.0 → 0.163.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/controls/OrbitControls.d.ts +1 -1
- three/examples/jsm/geometries/TextGeometry.d.ts +8 -0
- three/examples/jsm/loaders/FontLoader.d.ts +18 -4
- three/examples/jsm/loaders/LUT3dlLoader.d.ts +1 -2
- three/examples/jsm/loaders/LUTCubeLoader.d.ts +1 -2
- three/examples/jsm/loaders/RGBMLoader.d.ts +5 -0
- three/examples/jsm/loaders/TTFLoader.d.ts +5 -3
- three/examples/jsm/nodes/Nodes.d.ts +5 -1
- three/examples/jsm/nodes/accessors/BatchNode.d.ts +14 -0
- three/examples/jsm/nodes/accessors/InstanceNode.d.ts +2 -1
- three/examples/jsm/nodes/accessors/RendererReferenceNode.d.ts +16 -0
- three/examples/jsm/nodes/accessors/TextureNode.d.ts +8 -1
- three/examples/jsm/nodes/core/Node.d.ts +7 -3
- three/examples/jsm/nodes/core/NodeUtils.d.ts +1 -1
- three/examples/jsm/nodes/display/PassNode.d.ts +2 -0
- three/examples/jsm/nodes/display/ToneMappingNode.d.ts +12 -0
- three/examples/jsm/nodes/fog/FogNode.d.ts +10 -5
- three/examples/jsm/nodes/fog/FogRangeNode.d.ts +9 -5
- three/examples/jsm/nodes/materials/Materials.d.ts +1 -0
- three/examples/jsm/nodes/materials/MeshNormalNodeMaterial.d.ts +23 -0
- three/examples/jsm/nodes/materials/NodeMaterial.d.ts +3 -0
- three/examples/jsm/nodes/pmrem/PMREMNode.d.ts +20 -0
- three/examples/jsm/objects/QuadMesh.d.ts +5 -8
- three/examples/jsm/renderers/common/Info.d.ts +3 -7
- three/examples/jsm/renderers/common/PostProcessing.d.ts +3 -1
- three/examples/jsm/renderers/common/Renderer.d.ts +4 -1
- three/examples/jsm/renderers/common/extras/PMREMGenerator.d.ts +8 -0
- three/examples/jsm/renderers/webgl/WebGLBackend.d.ts +4 -0
- three/index.d.ts +1 -1
- three/package.json +4 -4
- three/src/Three.d.ts +0 -1
- three/src/cameras/Camera.d.ts +3 -0
- three/src/constants.d.ts +10 -40
- three/src/materials/Material.d.ts +46 -23
- three/src/materials/ShaderMaterial.d.ts +2 -17
- three/src/objects/BatchedMesh.d.ts +0 -3
- three/src/objects/InstancedMesh.d.ts +1 -1
- three/src/objects/SkinnedMesh.d.ts +0 -2
- three/src/renderers/WebGLRenderer.d.ts +2 -2
- three/src/renderers/webgl/WebGLAttributes.d.ts +1 -2
- three/src/renderers/webgl/WebGLBindingStates.d.ts +1 -8
- three/src/renderers/webgl/WebGLBufferRenderer.d.ts +0 -3
- three/src/renderers/webgl/WebGLCapabilities.d.ts +8 -6
- three/src/renderers/webgl/WebGLExtensions.d.ts +1 -3
- three/src/renderers/webgl/WebGLIndexedBufferRenderer.d.ts +1 -1
- three/src/renderers/webgl/WebGLLights.d.ts +1 -2
- three/src/renderers/webgl/WebGLPrograms.d.ts +0 -9
- three/src/renderers/webgl/WebGLState.d.ts +1 -3
- three/src/renderers/webgl/WebGLUtils.d.ts +0 -2
- three/src/scenes/Scene.d.ts +6 -0
- three/src/textures/Data3DTexture.d.ts +0 -1
- three/src/textures/DataArrayTexture.d.ts +0 -1
- three/src/textures/DepthTexture.d.ts +0 -3
- three/src/textures/Texture.d.ts +13 -7
- three/examples/jsm/nodes/utils/SpecularMIPLevelNode.d.ts +0 -12
- three/src/renderers/WebGL1Renderer.d.ts +0 -6
three/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for three (https://threejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Fri, 29 Mar 2024 19:35:33 GMT
|
|
12
12
|
* Dependencies: [@tweenjs/tween.js](https://npmjs.com/package/@tweenjs/tween.js), [@types/stats.js](https://npmjs.com/package/@types/stats.js), [@types/webxr](https://npmjs.com/package/@types/webxr), [fflate](https://npmjs.com/package/fflate), [meshoptimizer](https://npmjs.com/package/meshoptimizer)
|
|
13
13
|
|
|
14
14
|
# Credits
|
|
@@ -14,7 +14,7 @@ export interface OrbitControlsEventMap {
|
|
|
14
14
|
* event listeners.
|
|
15
15
|
*/
|
|
16
16
|
export class OrbitControls extends EventDispatcher<OrbitControlsEventMap> {
|
|
17
|
-
constructor(object: Camera, domElement
|
|
17
|
+
constructor(object: Camera, domElement: HTMLElement);
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* The camera being controlled.
|
|
@@ -16,9 +16,17 @@ export interface TextGeometryParameters extends ExtrudeGeometryOptions {
|
|
|
16
16
|
* Thickness to extrude text.
|
|
17
17
|
* Expects a `Float`.
|
|
18
18
|
* @defaultValue `50`
|
|
19
|
+
* @deprecated THREE.TextGeometry: .height is now depreciated. Please use .depth instead
|
|
19
20
|
*/
|
|
20
21
|
height?: number | undefined;
|
|
21
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Thickness to extrude text.
|
|
25
|
+
* Expects a `Float`.
|
|
26
|
+
* @defaultValue `50`
|
|
27
|
+
*/
|
|
28
|
+
depth?: number | undefined;
|
|
29
|
+
|
|
22
30
|
/**
|
|
23
31
|
* @override
|
|
24
32
|
* @defaultValue `12`
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import { Loader, LoadingManager, Shape } from "three";
|
|
2
2
|
|
|
3
|
+
export interface FontData {
|
|
4
|
+
glyphs: Record<string, { ha: number; x_min: number; x_max: number; o: string }>;
|
|
5
|
+
familyName: string;
|
|
6
|
+
ascender: number;
|
|
7
|
+
descender: number;
|
|
8
|
+
underlinePosition: number;
|
|
9
|
+
underlineThickness: number;
|
|
10
|
+
boundingBox: { yMin: number; xMin: number; yMax: number; xMax: number };
|
|
11
|
+
resolution: number;
|
|
12
|
+
original_font_information: Record<string, string>;
|
|
13
|
+
}
|
|
14
|
+
|
|
3
15
|
export class FontLoader extends Loader<Font> {
|
|
4
16
|
constructor(manager?: LoadingManager);
|
|
5
17
|
|
|
@@ -10,18 +22,20 @@ export class FontLoader extends Loader<Font> {
|
|
|
10
22
|
onError?: (err: unknown) => void,
|
|
11
23
|
): void;
|
|
12
24
|
|
|
13
|
-
parse(json:
|
|
25
|
+
parse(json: FontData): Font;
|
|
14
26
|
}
|
|
15
27
|
|
|
16
28
|
export class Font {
|
|
17
|
-
|
|
29
|
+
readonly isFont: true;
|
|
18
30
|
|
|
19
31
|
/**
|
|
20
32
|
* @default 'Font'
|
|
21
33
|
*/
|
|
22
34
|
type: string;
|
|
23
35
|
|
|
24
|
-
data:
|
|
36
|
+
data: FontData;
|
|
37
|
+
|
|
38
|
+
constructor(data: FontData);
|
|
25
39
|
|
|
26
|
-
generateShapes(text: string, size
|
|
40
|
+
generateShapes(text: string, size?: number): Shape[];
|
|
27
41
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { Data3DTexture,
|
|
1
|
+
import { Data3DTexture, FloatType, Loader, LoadingManager, UnsignedByteType } from "three";
|
|
2
2
|
|
|
3
3
|
export interface LUT3dlResult {
|
|
4
4
|
size: number;
|
|
5
|
-
texture: DataTexture;
|
|
6
5
|
texture3D: Data3DTexture;
|
|
7
6
|
}
|
|
8
7
|
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { Data3DTexture,
|
|
1
|
+
import { Data3DTexture, FloatType, Loader, LoadingManager, UnsignedByteType, Vector3 } from "three";
|
|
2
2
|
|
|
3
3
|
export interface LUTCubeResult {
|
|
4
4
|
title: string;
|
|
5
5
|
size: number;
|
|
6
6
|
domainMin: Vector3;
|
|
7
7
|
domainMax: Vector3;
|
|
8
|
-
texture: DataTexture;
|
|
9
8
|
texture3D: Data3DTexture;
|
|
10
9
|
}
|
|
11
10
|
|
|
@@ -24,6 +24,11 @@ export class RGBMLoader extends DataTextureLoader {
|
|
|
24
24
|
onError?: (event: ErrorEvent) => void,
|
|
25
25
|
): CubeTexture;
|
|
26
26
|
|
|
27
|
+
loadCubemapAsync(
|
|
28
|
+
urls: string[],
|
|
29
|
+
onProgress?: (event: ProgressEvent) => void,
|
|
30
|
+
): Promise<CubeTexture>;
|
|
31
|
+
|
|
27
32
|
parse(buffer: ArrayBuffer): RGBM;
|
|
28
33
|
|
|
29
34
|
setDataType(dataType: TextureDataType): this;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Loader, LoadingManager } from "three";
|
|
2
|
+
import { FontData } from "./FontLoader.js";
|
|
2
3
|
|
|
3
|
-
export class TTFLoader extends Loader<
|
|
4
|
-
constructor(manager?: LoadingManager);
|
|
4
|
+
export class TTFLoader extends Loader<FontData> {
|
|
5
5
|
reversed: boolean;
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
constructor(manager?: LoadingManager);
|
|
8
|
+
|
|
9
|
+
parse(arraybuffer: ArrayBuffer): FontData;
|
|
8
10
|
}
|
|
@@ -169,7 +169,6 @@ export { default as ReflectorNode, reflector, ReflectorNodeParameters } from "./
|
|
|
169
169
|
export { default as RemapNode, remap, remapClamp } from "./utils/RemapNode.js";
|
|
170
170
|
export { default as RotateNode, rotate } from "./utils/RotateNode.js";
|
|
171
171
|
export { default as RotateUVNode, rotateUV } from "./utils/RotateUVNode.js";
|
|
172
|
-
export { default as SpecularMIPLevelNode, specularMIPLevel } from "./utils/SpecularMIPLevelNode.js";
|
|
173
172
|
export { default as SplitNode } from "./utils/SplitNode.js";
|
|
174
173
|
export { default as SpriteSheetUVNode, spritesheetUV } from "./utils/SpriteSheetUVNode.js";
|
|
175
174
|
export { default as StorageArrayElementNode } from "./utils/SpriteSheetUVNode.js";
|
|
@@ -192,6 +191,7 @@ export * from "./shadernode/ShaderNode.js";
|
|
|
192
191
|
|
|
193
192
|
// accessors
|
|
194
193
|
export { parallaxDirection, parallaxUV, TBNViewMatrix } from "./accessors/AccessorsUtils.js";
|
|
194
|
+
export { batch, default as BatchNode } from "./accessors/BatchNode.js";
|
|
195
195
|
export {
|
|
196
196
|
bitangentGeometry,
|
|
197
197
|
bitangentLocal,
|
|
@@ -275,6 +275,7 @@ export {
|
|
|
275
275
|
} from "./accessors/PositionNode.js";
|
|
276
276
|
export { default as ReferenceNode, reference, referenceBuffer } from "./accessors/ReferenceNode.js";
|
|
277
277
|
export { default as ReflectVectorNode, reflectVector } from "./accessors/ReflectVectorNode.js";
|
|
278
|
+
export { default as RendererReferenceNode, rendererReference } from "./accessors/RendererReferenceNode.js";
|
|
278
279
|
export { default as SkinningNode, skinning } from "./accessors/SkinningNode.js";
|
|
279
280
|
export { default as StorageBufferNode, storage, storageObject } from "./accessors/StorageBufferNode.js";
|
|
280
281
|
export {
|
|
@@ -375,6 +376,9 @@ export { default as LightsNode, lights } from "./lighting/LightsNode.js";
|
|
|
375
376
|
export { default as PointLightNode } from "./lighting/PointLightNode.js";
|
|
376
377
|
export { default as SpotLightNode } from "./lighting/SpotLightNode.js";
|
|
377
378
|
|
|
379
|
+
// pmrem
|
|
380
|
+
export { default as PMREMNode, pmremTexture } from "./pmrem/PMREMNode.js";
|
|
381
|
+
|
|
378
382
|
// procedural
|
|
379
383
|
export { checker, default as CheckerNode } from "./procedural/CheckerNode.js";
|
|
380
384
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BatchedMesh } from "three";
|
|
2
|
+
import Node from "../core/Node.js";
|
|
3
|
+
import { ShaderNodeObject } from "../shadernode/ShaderNode.js";
|
|
4
|
+
|
|
5
|
+
export default class BatchNode extends Node {
|
|
6
|
+
batchMesh: BatchedMesh;
|
|
7
|
+
|
|
8
|
+
instanceColorNode: Node | null;
|
|
9
|
+
batchingIdNode: Node | null;
|
|
10
|
+
|
|
11
|
+
constructor(batchMesh: BatchedMesh);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const batch: (batchMesh: BatchedMesh) => ShaderNodeObject<BatchNode>;
|
|
@@ -4,7 +4,8 @@ import { ShaderNodeObject } from "../shadernode/ShaderNode.js";
|
|
|
4
4
|
|
|
5
5
|
export default class InstanceNode extends Node {
|
|
6
6
|
instanceMesh: InstancedMesh;
|
|
7
|
-
instanceMatrixNode: Node;
|
|
7
|
+
instanceMatrixNode: Node | null;
|
|
8
|
+
instanceColorNode: Node | null;
|
|
8
9
|
|
|
9
10
|
constructor(instanceMesh: InstancedMesh);
|
|
10
11
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import Renderer from "../../renderers/common/Renderer.js";
|
|
2
|
+
import { NodeTypeOption } from "../core/constants.js";
|
|
3
|
+
import { ShaderNodeObject } from "../shadernode/ShaderNode.js";
|
|
4
|
+
import ReferenceNode from "./ReferenceNode.js";
|
|
5
|
+
|
|
6
|
+
export default class RendererReferenceNode extends ReferenceNode<Renderer> {
|
|
7
|
+
renderer: Renderer | null;
|
|
8
|
+
|
|
9
|
+
constructor(property: string, inputType: NodeTypeOption, renderer?: Renderer | null);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const rendererReference: (
|
|
13
|
+
name: string,
|
|
14
|
+
type: NodeTypeOption,
|
|
15
|
+
renderer?: Renderer | null,
|
|
16
|
+
) => ShaderNodeObject<RendererReferenceNode>;
|
|
@@ -4,10 +4,17 @@ import UniformNode from "../core/UniformNode.js";
|
|
|
4
4
|
import { NodeRepresentation, ShaderNodeObject } from "../shadernode/ShaderNode.js";
|
|
5
5
|
|
|
6
6
|
export default class TextureNode extends UniformNode<Texture> {
|
|
7
|
-
isTextureNode: true;
|
|
7
|
+
readonly isTextureNode: true;
|
|
8
8
|
|
|
9
9
|
uvNode: ShaderNodeObject<Node> | null;
|
|
10
10
|
levelNode: ShaderNodeObject<Node> | null;
|
|
11
|
+
compareNode: Node | null;
|
|
12
|
+
depthNode: Node | null;
|
|
13
|
+
|
|
14
|
+
sampler: boolean;
|
|
15
|
+
updateMatrix: boolean;
|
|
16
|
+
|
|
17
|
+
referenceNode: Node | null;
|
|
11
18
|
|
|
12
19
|
constructor(value: Texture, uvNode?: ShaderNodeObject<Node>, levelNode?: ShaderNodeObject<Node> | null);
|
|
13
20
|
|
|
@@ -3,8 +3,6 @@ import NodeBuilder from "./NodeBuilder.js";
|
|
|
3
3
|
import NodeFrame from "./NodeFrame.js";
|
|
4
4
|
|
|
5
5
|
export default abstract class Node {
|
|
6
|
-
readonly isNode: true;
|
|
7
|
-
|
|
8
6
|
nodeType: NodeTypeOption | null;
|
|
9
7
|
|
|
10
8
|
updateType: NodeUpdateType;
|
|
@@ -12,17 +10,23 @@ export default abstract class Node {
|
|
|
12
10
|
|
|
13
11
|
uuid: string;
|
|
14
12
|
|
|
13
|
+
version: number;
|
|
14
|
+
|
|
15
|
+
readonly isNode: true;
|
|
16
|
+
|
|
15
17
|
readonly id: number;
|
|
16
18
|
|
|
17
19
|
constructor(nodeType?: NodeTypeOption | null);
|
|
18
20
|
|
|
21
|
+
set needsUpdate(value: boolean);
|
|
22
|
+
|
|
19
23
|
get type(): number;
|
|
20
24
|
|
|
21
25
|
isGlobal(builder: NodeBuilder): boolean;
|
|
22
26
|
|
|
23
27
|
getChildren(): Node[];
|
|
24
28
|
|
|
25
|
-
getCacheKey(): string;
|
|
29
|
+
getCacheKey(force?: boolean): string;
|
|
26
30
|
|
|
27
31
|
getHash(builder: NodeBuilder): string;
|
|
28
32
|
|
|
@@ -7,7 +7,7 @@ export interface NodeChild {
|
|
|
7
7
|
childNode: Node;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export function getCacheKey(object: Node): string;
|
|
10
|
+
export function getCacheKey(object: Node, force?: boolean): string;
|
|
11
11
|
export function getNodeChildren(object: Node): Generator<NodeChild, void>;
|
|
12
12
|
export function getValueType(value: unknown): string | null;
|
|
13
13
|
export function getValueFromType(
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ToneMapping } from "three";
|
|
2
|
+
import RendererReferenceNode from "../accessors/RendererReferenceNode.js";
|
|
2
3
|
import Node from "../core/Node.js";
|
|
3
4
|
import TempNode from "../core/TempNode.js";
|
|
4
5
|
import { NodeRepresentation, ShaderNodeObject } from "../shadernode/ShaderNode.js";
|
|
@@ -19,3 +20,14 @@ export const toneMapping: (
|
|
|
19
20
|
exposure: NodeRepresentation,
|
|
20
21
|
color?: NodeRepresentation,
|
|
21
22
|
) => ShaderNodeObject<ToneMappingNode>;
|
|
23
|
+
export const toneMappingExposure: ShaderNodeObject<RendererReferenceNode>;
|
|
24
|
+
|
|
25
|
+
declare module "../shadernode/ShaderNode.js" {
|
|
26
|
+
interface NodeElements {
|
|
27
|
+
toneMapping: (
|
|
28
|
+
color: NodeRepresentation,
|
|
29
|
+
mapping?: NodeRepresentation,
|
|
30
|
+
exposure?: NodeRepresentation,
|
|
31
|
+
) => ShaderNodeObject<ToneMappingNode>;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import Node from "../core/Node.js";
|
|
2
|
+
import NodeBuilder from "../core/NodeBuilder.js";
|
|
2
3
|
import { NodeRepresentation, ShaderNodeObject } from "../shadernode/ShaderNode.js";
|
|
3
4
|
|
|
4
5
|
export default class FogNode extends Node {
|
|
5
6
|
isFogNode: true;
|
|
6
|
-
colorNode: Node;
|
|
7
|
-
factorNode: Node;
|
|
7
|
+
colorNode: Node | null;
|
|
8
|
+
factorNode: Node | null;
|
|
8
9
|
|
|
9
|
-
constructor(colorNode: Node, factorNode: Node);
|
|
10
|
-
|
|
10
|
+
constructor(colorNode: Node | null, factorNode: Node | null);
|
|
11
|
+
|
|
12
|
+
getViewZNode(builder: NodeBuilder): Node;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
|
-
export const fog: (
|
|
15
|
+
export const fog: (
|
|
16
|
+
colorNode: NodeRepresentation | null,
|
|
17
|
+
factorNode: NodeRepresentation | null,
|
|
18
|
+
) => ShaderNodeObject<FogNode>;
|
|
14
19
|
|
|
15
20
|
declare module "../shadernode/ShaderNode.js" {
|
|
16
21
|
interface NodeElements {
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import Node from "../core/Node.js";
|
|
2
|
-
import { ShaderNodeObject } from "../shadernode/ShaderNode.js";
|
|
2
|
+
import { NodeRepresentation, ShaderNodeObject } from "../shadernode/ShaderNode.js";
|
|
3
3
|
import FogNode from "./FogNode.js";
|
|
4
4
|
|
|
5
5
|
export default class FogRangeNode extends FogNode {
|
|
6
6
|
isFogRangeNode: true;
|
|
7
|
-
nearNode: Node;
|
|
8
|
-
farNode: Node;
|
|
7
|
+
nearNode: Node | null;
|
|
8
|
+
farNode: Node | null;
|
|
9
9
|
|
|
10
|
-
constructor(colorNode: Node, nearNode: Node, farNode: Node);
|
|
10
|
+
constructor(colorNode: Node | null, nearNode: Node | null, farNode: Node | null);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export const rangeFog: (
|
|
13
|
+
export const rangeFog: (
|
|
14
|
+
colorNode: NodeRepresentation | null,
|
|
15
|
+
nearNode: NodeRepresentation | null,
|
|
16
|
+
farNode: NodeRepresentation | null,
|
|
17
|
+
) => ShaderNodeObject<FogRangeNode>;
|
|
14
18
|
|
|
15
19
|
declare module "../shadernode/ShaderNode.js" {
|
|
16
20
|
interface NodeElements {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as LineBasicNodeMaterial } from "./LineBasicNodeMaterial.js";
|
|
2
2
|
export { default as MeshBasicNodeMaterial } from "./MeshBasicNodeMaterial.js";
|
|
3
|
+
export { default as MeshNormalNodeMaterial } from "./MeshNormalNodeMaterial.js";
|
|
3
4
|
export { default as MeshPhongNodeMaterial } from "./MeshPhongNodeMaterial.js";
|
|
4
5
|
export { default as MeshPhysicalNodeMaterial } from "./MeshPhysicalNodeMaterial.js";
|
|
5
6
|
export { default as MeshSSSPhysicalNodeMaterial } from "./MeshSSSNodeMaterial.js";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { MeshNormalMaterialParameters, NormalMapTypes, Texture, Vector2 } from "three";
|
|
2
|
+
import NodeMaterial, { NodeMaterialParameters } from "./NodeMaterial.js";
|
|
3
|
+
|
|
4
|
+
export interface MeshBasicNodeMaterialParameters extends NodeMaterialParameters, MeshNormalMaterialParameters {
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export default class MeshNormalNodeMaterial extends NodeMaterial {
|
|
8
|
+
readonly isMeshNormalNodeMaterial: true;
|
|
9
|
+
|
|
10
|
+
// Properties from MeshNormalMaterial
|
|
11
|
+
readonly isMeshNormalMaterial: true;
|
|
12
|
+
bumpMap: Texture | null;
|
|
13
|
+
bumpScale: number;
|
|
14
|
+
normalMap: Texture | null;
|
|
15
|
+
normalMapType: NormalMapTypes;
|
|
16
|
+
normalScale: Vector2;
|
|
17
|
+
displacementMap: Texture | null;
|
|
18
|
+
displacementScale: number;
|
|
19
|
+
displacementBias: number;
|
|
20
|
+
flatShading: boolean;
|
|
21
|
+
|
|
22
|
+
constructor(parameters?: MeshBasicNodeMaterialParameters);
|
|
23
|
+
}
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
LineBasicMaterial,
|
|
3
3
|
Material,
|
|
4
4
|
MeshBasicMaterial,
|
|
5
|
+
MeshNormalMaterial,
|
|
5
6
|
MeshPhongMaterial,
|
|
6
7
|
MeshPhysicalMaterial,
|
|
7
8
|
MeshStandardMaterial,
|
|
@@ -18,6 +19,7 @@ import LightsNode from "../lighting/LightsNode.js";
|
|
|
18
19
|
import { ShaderNodeObject } from "../shadernode/ShaderNode.js";
|
|
19
20
|
import LineBasicNodeMaterial from "./LineBasicNodeMaterial.js";
|
|
20
21
|
import MeshBasicNodeMaterial from "./MeshBasicNodeMaterial.js";
|
|
22
|
+
import MeshNormalNodeMaterial from "./MeshNormalNodeMaterial.js";
|
|
21
23
|
import MeshPhongNodeMaterial from "./MeshPhongNodeMaterial.js";
|
|
22
24
|
import MeshPhysicalNodeMaterial from "./MeshPhysicalNodeMaterial.js";
|
|
23
25
|
import MeshStandardNodeMaterial from "./MeshStandardNodeMaterial.js";
|
|
@@ -97,6 +99,7 @@ export default class NodeMaterial extends ShaderMaterial {
|
|
|
97
99
|
|
|
98
100
|
static fromMaterial(material: LineBasicMaterial): LineBasicNodeMaterial;
|
|
99
101
|
static fromMaterial(material: MeshBasicMaterial): MeshBasicNodeMaterial;
|
|
102
|
+
static fromMaterial(material: MeshNormalMaterial): MeshNormalNodeMaterial;
|
|
100
103
|
static fromMaterial(material: MeshPhongMaterial): MeshPhongNodeMaterial;
|
|
101
104
|
static fromMaterial(material: MeshPhysicalMaterial): MeshPhysicalNodeMaterial;
|
|
102
105
|
static fromMaterial(material: MeshStandardMaterial): MeshStandardNodeMaterial;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Texture } from "three";
|
|
2
|
+
import Node from "../core/Node.js";
|
|
3
|
+
import TempNode from "../core/TempNode.js";
|
|
4
|
+
import { NodeRepresentation, ShaderNodeObject } from "../shadernode/ShaderNode.js";
|
|
5
|
+
|
|
6
|
+
export default class PMREMNode extends TempNode {
|
|
7
|
+
uvNode: Node | null;
|
|
8
|
+
levelNode: Node | null;
|
|
9
|
+
|
|
10
|
+
constructor(value: Texture, uvNode?: Node | null, levelNode?: Node | null);
|
|
11
|
+
|
|
12
|
+
set value(value: Texture);
|
|
13
|
+
get value(): Texture;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const pmremTexture: (
|
|
17
|
+
value: Texture,
|
|
18
|
+
uvNode?: NodeRepresentation,
|
|
19
|
+
levelNode?: NodeRepresentation,
|
|
20
|
+
) => ShaderNodeObject<PMREMNode>;
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { Material } from "three";
|
|
1
|
+
import { Material, Mesh, OrthographicCamera } from "three";
|
|
2
2
|
import Renderer from "../renderers/common/Renderer.js";
|
|
3
3
|
|
|
4
|
-
export default class QuadMesh {
|
|
5
|
-
|
|
4
|
+
export default class QuadMesh extends Mesh {
|
|
5
|
+
camera: OrthographicCamera;
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
constructor(material?: Material | null);
|
|
8
8
|
|
|
9
9
|
renderAsync(renderer: Renderer): Promise<void>;
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
set material(value: Material);
|
|
13
|
-
|
|
14
|
-
get render(): (renderer: Renderer) => Promise<void>;
|
|
11
|
+
render(renderer: Renderer): void;
|
|
15
12
|
}
|
|
@@ -6,19 +6,15 @@ export default class Info {
|
|
|
6
6
|
frame: number;
|
|
7
7
|
calls: number;
|
|
8
8
|
|
|
9
|
-
render: { calls: number; drawCalls: number; triangles: number; points: number; lines: number };
|
|
9
|
+
render: { calls: number; drawCalls: number; triangles: number; points: number; lines: number; timestamp: number };
|
|
10
10
|
|
|
11
|
-
compute: { calls: number; computeCalls: number };
|
|
11
|
+
compute: { calls: number; computeCalls: number; timestamp: number };
|
|
12
12
|
|
|
13
13
|
memory: { geometries: number; textures: number };
|
|
14
14
|
|
|
15
|
-
timestamp: { compute: number; render: number };
|
|
16
|
-
|
|
17
15
|
update(object: Object3D, count: number, instanceCount: number): void;
|
|
18
16
|
|
|
19
|
-
updateTimestamp(type:
|
|
20
|
-
|
|
21
|
-
resetCompute(): void;
|
|
17
|
+
updateTimestamp(type: "render" | "compute", time: number): void;
|
|
22
18
|
|
|
23
19
|
reset(): void;
|
|
24
20
|
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
RenderTarget,
|
|
13
13
|
Scene,
|
|
14
14
|
ShadowMapType,
|
|
15
|
+
Texture,
|
|
15
16
|
ToneMapping,
|
|
16
17
|
Vector2,
|
|
17
18
|
Vector4,
|
|
@@ -90,7 +91,7 @@ export default class Renderer {
|
|
|
90
91
|
depth: boolean;
|
|
91
92
|
|
|
92
93
|
/**
|
|
93
|
-
* @default
|
|
94
|
+
* @default false
|
|
94
95
|
*/
|
|
95
96
|
stencil: boolean;
|
|
96
97
|
|
|
@@ -268,6 +269,8 @@ export default class Renderer {
|
|
|
268
269
|
|
|
269
270
|
copyFramebufferToTexture(framebufferTexture: FramebufferTexture): void;
|
|
270
271
|
|
|
272
|
+
copyTextureToTexture(position: Vector2, srcTexture: Texture, dstTexture: Texture, level?: number): void;
|
|
273
|
+
|
|
271
274
|
readRenderTargetPixelsAsync(
|
|
272
275
|
renderTarget: RenderTarget,
|
|
273
276
|
x: number,
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { CoordinateSystem } from "three";
|
|
2
2
|
import Backend, { BackendParameters } from "../common/Backend.js";
|
|
3
3
|
|
|
4
|
+
export interface WebGLBackendParameters extends BackendParameters {
|
|
5
|
+
trackTimestamp?: boolean | undefined;
|
|
6
|
+
}
|
|
7
|
+
|
|
4
8
|
export default class WebGLBackend extends Backend {
|
|
5
9
|
constructor(parameters?: BackendParameters);
|
|
6
10
|
|
three/index.d.ts
CHANGED
three/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/three",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.163.0",
|
|
4
4
|
"description": "TypeScript definitions for three",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three",
|
|
6
6
|
"license": "MIT",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"@tweenjs/tween.js": "~23.1.1",
|
|
43
43
|
"@types/stats.js": "*",
|
|
44
44
|
"@types/webxr": "*",
|
|
45
|
-
"fflate": "~0.
|
|
45
|
+
"fflate": "~0.8.2",
|
|
46
46
|
"meshoptimizer": "~0.18.1"
|
|
47
47
|
},
|
|
48
|
-
"typesPublisherContentHash": "
|
|
49
|
-
"typeScriptVersion": "4.
|
|
48
|
+
"typesPublisherContentHash": "9f0e97bd23c86f0c0c2d025de530532214c74995254c55868863ffb17e00963a",
|
|
49
|
+
"typeScriptVersion": "4.7"
|
|
50
50
|
}
|
three/src/Three.d.ts
CHANGED
|
@@ -203,7 +203,6 @@ export * from "./renderers/webgl/WebGLTextures.js";
|
|
|
203
203
|
export * from "./renderers/webgl/WebGLUniforms.js";
|
|
204
204
|
export * from "./renderers/webgl/WebGLUniformsGroups.js";
|
|
205
205
|
export { WebGLUtils } from "./renderers/webgl/WebGLUtils.js";
|
|
206
|
-
export * from "./renderers/WebGL1Renderer.js";
|
|
207
206
|
export * from "./renderers/WebGL3DRenderTarget.js";
|
|
208
207
|
export * from "./renderers/WebGLArrayRenderTarget.js";
|
|
209
208
|
export * from "./renderers/WebGLCubeRenderTarget.js";
|
three/src/cameras/Camera.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { Layers } from "../core/Layers.js";
|
|
|
3
3
|
import { Object3D } from "../core/Object3D.js";
|
|
4
4
|
import { Matrix4 } from "../math/Matrix4.js";
|
|
5
5
|
import { Vector3 } from "../math/Vector3.js";
|
|
6
|
+
import { Vector4 } from "../math/Vector4.js";
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Abstract base class for cameras
|
|
@@ -62,6 +63,8 @@ export class Camera extends Object3D {
|
|
|
62
63
|
|
|
63
64
|
coordinateSystem: CoordinateSystem;
|
|
64
65
|
|
|
66
|
+
viewport?: Vector4;
|
|
67
|
+
|
|
65
68
|
/**
|
|
66
69
|
* Returns a {@link THREE.Vector3 | Vector3} representing the world space direction in which the {@link Camera} is looking.
|
|
67
70
|
* @remarks Note: A {@link Camera} looks down its local, negative z-axis.
|
three/src/constants.d.ts
CHANGED
|
@@ -336,6 +336,7 @@ export const HalfFloatType: 1016;
|
|
|
336
336
|
export const UnsignedShort4444Type: 1017;
|
|
337
337
|
export const UnsignedShort5551Type: 1018;
|
|
338
338
|
export const UnsignedInt248Type: 1020;
|
|
339
|
+
export const UnsignedInt5999Type: 35902;
|
|
339
340
|
|
|
340
341
|
export type AttributeGPUType = typeof FloatType | typeof IntType;
|
|
341
342
|
|
|
@@ -356,7 +357,8 @@ export type TextureDataType =
|
|
|
356
357
|
| typeof HalfFloatType
|
|
357
358
|
| typeof UnsignedShort4444Type
|
|
358
359
|
| typeof UnsignedShort5551Type
|
|
359
|
-
| typeof UnsignedInt248Type
|
|
360
|
+
| typeof UnsignedInt248Type
|
|
361
|
+
| typeof UnsignedInt5999Type;
|
|
360
362
|
|
|
361
363
|
///////////////////////////////////////////////////////////////////////////////
|
|
362
364
|
// Pixel formats
|
|
@@ -364,7 +366,9 @@ export type TextureDataType =
|
|
|
364
366
|
/** {@link AlphaFormat} discards the red, green and blue components and reads just the alpha component. */
|
|
365
367
|
export const AlphaFormat: 1021;
|
|
366
368
|
|
|
367
|
-
|
|
369
|
+
export const RGBFormat: 1022;
|
|
370
|
+
|
|
371
|
+
/** {@link RGBAFormat} is the default and reads the red, green, blue and alpha components. */
|
|
368
372
|
export const RGBAFormat: 1023;
|
|
369
373
|
|
|
370
374
|
/**
|
|
@@ -395,27 +399,23 @@ export const DepthStencilFormat: 1027;
|
|
|
395
399
|
|
|
396
400
|
/**
|
|
397
401
|
* {@link RedFormat} discards the green and blue components and reads just the red component.
|
|
398
|
-
* @remarks Can only be used with a WebGL 2 rendering context.
|
|
399
402
|
*/
|
|
400
403
|
export const RedFormat: 1028;
|
|
401
404
|
|
|
402
405
|
/**
|
|
403
406
|
* {@link RedIntegerFormat} discards the green and blue components and reads just the red component.
|
|
404
407
|
* The texels are read as integers instead of floating point.
|
|
405
|
-
* @remarks Can only be used with a WebGL 2 rendering context.
|
|
406
408
|
*/
|
|
407
409
|
export const RedIntegerFormat: 1029;
|
|
408
410
|
|
|
409
411
|
/**
|
|
410
412
|
* {@link RGFormat} discards the alpha, and blue components and reads the red, and green components.
|
|
411
|
-
* @remarks Can only be used with a WebGL 2 rendering context.
|
|
412
413
|
*/
|
|
413
414
|
export const RGFormat: 1030;
|
|
414
415
|
|
|
415
416
|
/**
|
|
416
417
|
* {@link RGIntegerFormat} discards the alpha, and blue components and reads the red, and green components.
|
|
417
418
|
* The texels are read as integers instead of floating point.
|
|
418
|
-
* @remarks Can only be used with a WebGL 2 rendering context.
|
|
419
419
|
*/
|
|
420
420
|
export const RGIntegerFormat: 1031;
|
|
421
421
|
|
|
@@ -425,35 +425,15 @@ export const RGIntegerFormat: 1031;
|
|
|
425
425
|
*/
|
|
426
426
|
export const RGBAIntegerFormat: 1033;
|
|
427
427
|
|
|
428
|
-
export const _SRGBAFormat: 1035; // fallback for WebGL 1
|
|
429
|
-
|
|
430
|
-
/**
|
|
431
|
-
* Texture Pixel Formats Modes. Compatible only with {@link WebGLRenderingContext | WebGL 1 Rendering Context}.
|
|
432
|
-
* @remarks Note that the texture must have the correct {@link THREE.Texture.type} set, as described in {@link TextureDataType}.
|
|
433
|
-
* @see {@link WebGLRenderingContext.texImage2D} for details.
|
|
434
|
-
* @see {@link WebGL2PixelFormat} and {@link PixelFormat}
|
|
435
|
-
* @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
|
|
436
|
-
*/
|
|
437
|
-
export type WebGL1PixelFormat =
|
|
438
|
-
| typeof AlphaFormat
|
|
439
|
-
| typeof LuminanceFormat
|
|
440
|
-
| typeof LuminanceAlphaFormat
|
|
441
|
-
| typeof DepthFormat
|
|
442
|
-
| typeof DepthStencilFormat
|
|
443
|
-
| typeof RedFormat
|
|
444
|
-
| typeof RedIntegerFormat
|
|
445
|
-
| typeof RGFormat
|
|
446
|
-
| typeof _SRGBAFormat;
|
|
447
|
-
|
|
448
428
|
/**
|
|
449
|
-
* Texture Pixel Formats Modes.
|
|
429
|
+
* All Texture Pixel Formats Modes.
|
|
450
430
|
* @remarks Note that the texture must have the correct {@link THREE.Texture.type} set, as described in {@link TextureDataType}.
|
|
451
431
|
* @see {@link WebGLRenderingContext.texImage2D} for details.
|
|
452
|
-
* @see {@link WebGL2PixelFormat} and {@link PixelFormat}
|
|
453
432
|
* @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
|
|
454
433
|
*/
|
|
455
|
-
export type
|
|
434
|
+
export type PixelFormat =
|
|
456
435
|
| typeof AlphaFormat
|
|
436
|
+
| typeof RGBFormat
|
|
457
437
|
| typeof RGBAFormat
|
|
458
438
|
| typeof LuminanceFormat
|
|
459
439
|
| typeof LuminanceAlphaFormat
|
|
@@ -463,17 +443,7 @@ export type WebGL2PixelFormat =
|
|
|
463
443
|
| typeof RedIntegerFormat
|
|
464
444
|
| typeof RGFormat
|
|
465
445
|
| typeof RGIntegerFormat
|
|
466
|
-
| typeof RGBAIntegerFormat
|
|
467
|
-
| typeof _SRGBAFormat;
|
|
468
|
-
|
|
469
|
-
/**
|
|
470
|
-
* All Texture Pixel Formats Modes.
|
|
471
|
-
* @remarks Note that the texture must have the correct {@link THREE.Texture.type} set, as described in {@link TextureDataType}.
|
|
472
|
-
* @see {@link WebGLRenderingContext.texImage2D} for details.
|
|
473
|
-
* @see {@link WebGL1PixelFormat} and {@link WebGL2PixelFormat}
|
|
474
|
-
* @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
|
|
475
|
-
*/
|
|
476
|
-
export type PixelFormat = WebGL1PixelFormat | WebGL2PixelFormat;
|
|
446
|
+
| typeof RGBAIntegerFormat;
|
|
477
447
|
|
|
478
448
|
/**
|
|
479
449
|
* All Texture Pixel Formats Modes for {@link THREE.DepthTexture}.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Camera } from "../cameras/Camera.js";
|
|
1
2
|
import {
|
|
2
3
|
Blending,
|
|
3
4
|
BlendingDstFactor,
|
|
@@ -9,11 +10,15 @@ import {
|
|
|
9
10
|
StencilFunc,
|
|
10
11
|
StencilOp,
|
|
11
12
|
} from "../constants.js";
|
|
13
|
+
import { BufferGeometry } from "../core/BufferGeometry.js";
|
|
12
14
|
import { EventDispatcher } from "../core/EventDispatcher.js";
|
|
15
|
+
import { Object3D } from "../core/Object3D.js";
|
|
13
16
|
import { Color, ColorRepresentation } from "../math/Color.js";
|
|
14
17
|
import { Plane } from "../math/Plane.js";
|
|
18
|
+
import { Group } from "../objects/Group.js";
|
|
15
19
|
import { WebGLProgramParametersWithUniforms } from "../renderers/webgl/WebGLPrograms.js";
|
|
16
20
|
import { WebGLRenderer } from "../renderers/WebGLRenderer.js";
|
|
21
|
+
import { Scene } from "../scenes/Scene.js";
|
|
17
22
|
|
|
18
23
|
export interface MaterialParameters {
|
|
19
24
|
alphaHash?: boolean | undefined;
|
|
@@ -84,12 +89,6 @@ export class Material extends EventDispatcher<{ dispose: {} }> {
|
|
|
84
89
|
*/
|
|
85
90
|
alphaHash: boolean;
|
|
86
91
|
|
|
87
|
-
/**
|
|
88
|
-
* Sets the alpha value to be used when running an alpha test. Default is 0.
|
|
89
|
-
* @default 0
|
|
90
|
-
*/
|
|
91
|
-
alphaTest: number;
|
|
92
|
-
|
|
93
92
|
/**
|
|
94
93
|
* Enables alpha to coverage. Can only be used with MSAA-enabled rendering contexts (meaning when the renderer was
|
|
95
94
|
* created with *antialias* parameter set to `true`). Enabling this will smooth aliasing on clip plane edges and
|
|
@@ -271,13 +270,6 @@ export class Material extends EventDispatcher<{ dispose: {} }> {
|
|
|
271
270
|
*/
|
|
272
271
|
name: string;
|
|
273
272
|
|
|
274
|
-
/**
|
|
275
|
-
* Specifies that the material needs to be updated, WebGL wise. Set it to true if you made changes that need to be reflected in WebGL.
|
|
276
|
-
* This property is automatically set to true when instancing a new material.
|
|
277
|
-
* @default false
|
|
278
|
-
*/
|
|
279
|
-
needsUpdate: boolean;
|
|
280
|
-
|
|
281
273
|
/**
|
|
282
274
|
* Opacity. Default is 1.
|
|
283
275
|
* @default 1
|
|
@@ -342,7 +334,8 @@ export class Material extends EventDispatcher<{ dispose: {} }> {
|
|
|
342
334
|
|
|
343
335
|
/**
|
|
344
336
|
* Defines whether this material is tone mapped according to the renderer's
|
|
345
|
-
* {@link WebGLRenderer.toneMapping toneMapping} setting. It is ignored when rendering to a render target
|
|
337
|
+
* {@link WebGLRenderer.toneMapping toneMapping} setting. It is ignored when rendering to a render target or using
|
|
338
|
+
* post processing.
|
|
346
339
|
* @default true
|
|
347
340
|
*/
|
|
348
341
|
toneMapped: boolean;
|
|
@@ -390,20 +383,27 @@ export class Material extends EventDispatcher<{ dispose: {} }> {
|
|
|
390
383
|
version: number;
|
|
391
384
|
|
|
392
385
|
/**
|
|
393
|
-
*
|
|
386
|
+
* Gets the alpha value to be used when running an alpha test. Default is 0.
|
|
387
|
+
* @default 0
|
|
394
388
|
*/
|
|
395
|
-
|
|
389
|
+
get alphaTest(): number;
|
|
396
390
|
|
|
397
391
|
/**
|
|
398
|
-
*
|
|
399
|
-
* @
|
|
392
|
+
* Sets the alpha value to be used when running an alpha test. Default is 0.
|
|
393
|
+
* @default 0
|
|
400
394
|
*/
|
|
401
|
-
|
|
395
|
+
set alphaTest(value: number);
|
|
402
396
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
397
|
+
onBuild(object: Object3D, parameters: WebGLProgramParametersWithUniforms, renderer: WebGLRenderer): void;
|
|
398
|
+
|
|
399
|
+
onBeforeRender(
|
|
400
|
+
renderer: WebGLRenderer,
|
|
401
|
+
scene: Scene,
|
|
402
|
+
camera: Camera,
|
|
403
|
+
geometry: BufferGeometry,
|
|
404
|
+
object: Object3D,
|
|
405
|
+
group: Group,
|
|
406
|
+
): void;
|
|
407
407
|
|
|
408
408
|
/**
|
|
409
409
|
* An optional callback that is executed immediately before the shader program is compiled.
|
|
@@ -430,4 +430,27 @@ export class Material extends EventDispatcher<{ dispose: {} }> {
|
|
|
430
430
|
* @param meta Object containing metadata such as textures or images for the material.
|
|
431
431
|
*/
|
|
432
432
|
toJSON(meta?: any): any;
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* Return a new material with the same parameters as this material.
|
|
436
|
+
*/
|
|
437
|
+
clone(): this;
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* Copy the parameters from the passed material into this material.
|
|
441
|
+
* @param material
|
|
442
|
+
*/
|
|
443
|
+
copy(material: Material): this;
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* This disposes the material. Textures of a material don't get disposed. These needs to be disposed by {@link Texture}.
|
|
447
|
+
*/
|
|
448
|
+
dispose(): void;
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* Specifies that the material needs to be updated, WebGL wise. Set it to true if you made changes that need to be reflected in WebGL.
|
|
452
|
+
* This property is automatically set to true when instancing a new material.
|
|
453
|
+
* @default false
|
|
454
|
+
*/
|
|
455
|
+
set needsUpdate(value: boolean);
|
|
433
456
|
}
|
|
@@ -16,10 +16,8 @@ export interface ShaderMaterialParameters extends MaterialParameters {
|
|
|
16
16
|
fog?: boolean | undefined;
|
|
17
17
|
extensions?:
|
|
18
18
|
| {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
drawBuffers?: boolean | undefined;
|
|
22
|
-
shaderTextureLOD?: boolean | undefined;
|
|
19
|
+
clipCullDistance?: boolean | undefined;
|
|
20
|
+
multiDraw?: boolean | undefined;
|
|
23
21
|
}
|
|
24
22
|
| undefined;
|
|
25
23
|
glslVersion?: GLSLVersion | undefined;
|
|
@@ -86,26 +84,13 @@ export class ShaderMaterial extends Material {
|
|
|
86
84
|
*/
|
|
87
85
|
clipping: boolean;
|
|
88
86
|
|
|
89
|
-
/**
|
|
90
|
-
* @deprecated Use {@link ShaderMaterial#extensions.derivatives extensions.derivatives} instead.
|
|
91
|
-
*/
|
|
92
|
-
derivatives: any;
|
|
93
|
-
|
|
94
87
|
/**
|
|
95
88
|
* @default {
|
|
96
|
-
* derivatives: false,
|
|
97
|
-
* fragDepth: false,
|
|
98
|
-
* drawBuffers: false,
|
|
99
|
-
* shaderTextureLOD: false,
|
|
100
89
|
* clipCullDistance: false,
|
|
101
90
|
* multiDraw: false
|
|
102
91
|
* }
|
|
103
92
|
*/
|
|
104
93
|
extensions: {
|
|
105
|
-
derivatives: boolean;
|
|
106
|
-
fragDepth: boolean;
|
|
107
|
-
drawBuffers: boolean;
|
|
108
|
-
shaderTextureLOD: boolean;
|
|
109
94
|
clipCullDistance: boolean;
|
|
110
95
|
multiDraw: boolean;
|
|
111
96
|
};
|
|
@@ -156,9 +156,6 @@ declare class BatchedMesh extends Mesh<BufferGeometry, Material> {
|
|
|
156
156
|
*/
|
|
157
157
|
setGeometryAt(index: number, geometry: BufferGeometry): number;
|
|
158
158
|
|
|
159
|
-
/**
|
|
160
|
-
* Marks the geometry at the given index as deleted and to not be rendered anymore.
|
|
161
|
-
*/
|
|
162
159
|
deleteGeometry(index: number): this;
|
|
163
160
|
|
|
164
161
|
getBoundingBoxAt(index: number, target: Box3): Box3 | null;
|
|
@@ -11,8 +11,6 @@ import { Skeleton } from "./Skeleton.js";
|
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* A mesh that has a {@link THREE.Skeleton | Skeleton} with {@link Bone | bones} that can then be used to animate the vertices of the geometry.
|
|
14
|
-
* @remarks
|
|
15
|
-
* {@link SkinnedMesh} can only be used with WebGL 2.
|
|
16
14
|
* @example
|
|
17
15
|
* ```typescript
|
|
18
16
|
* const geometry = new THREE.CylinderGeometry(5, 5, 5, 5, 15, 5, 30);
|
|
@@ -65,7 +65,7 @@ export interface WebGLRendererParameters {
|
|
|
65
65
|
antialias?: boolean | undefined;
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
|
-
* default is
|
|
68
|
+
* default is false.
|
|
69
69
|
*/
|
|
70
70
|
stencil?: boolean | undefined;
|
|
71
71
|
|
|
@@ -177,7 +177,7 @@ export class WebGLRenderer implements Renderer {
|
|
|
177
177
|
/**
|
|
178
178
|
* @default []
|
|
179
179
|
*/
|
|
180
|
-
clippingPlanes:
|
|
180
|
+
clippingPlanes: Plane[];
|
|
181
181
|
|
|
182
182
|
/**
|
|
183
183
|
* @default false
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { BufferAttribute } from "../../core/BufferAttribute.js";
|
|
2
2
|
import { GLBufferAttribute } from "../../core/GLBufferAttribute.js";
|
|
3
3
|
import { InterleavedBufferAttribute } from "../../core/InterleavedBufferAttribute.js";
|
|
4
|
-
import { WebGLCapabilities } from "./WebGLCapabilities.js";
|
|
5
4
|
|
|
6
5
|
export class WebGLAttributes {
|
|
7
|
-
constructor(gl: WebGLRenderingContext | WebGL2RenderingContext
|
|
6
|
+
constructor(gl: WebGLRenderingContext | WebGL2RenderingContext);
|
|
8
7
|
|
|
9
8
|
get(attribute: BufferAttribute | InterleavedBufferAttribute | GLBufferAttribute):
|
|
10
9
|
| {
|
|
@@ -3,17 +3,10 @@ import { BufferGeometry } from "../../core/BufferGeometry.js";
|
|
|
3
3
|
import { Object3D } from "../../core/Object3D.js";
|
|
4
4
|
import { Material } from "../../materials/Material.js";
|
|
5
5
|
import { WebGLAttributes } from "./WebGLAttributes.js";
|
|
6
|
-
import { WebGLCapabilities } from "./WebGLCapabilities.js";
|
|
7
|
-
import { WebGLExtensions } from "./WebGLExtensions.js";
|
|
8
6
|
import { WebGLProgram } from "./WebGLProgram.js";
|
|
9
7
|
|
|
10
8
|
export class WebGLBindingStates {
|
|
11
|
-
constructor(
|
|
12
|
-
gl: WebGLRenderingContext,
|
|
13
|
-
extensions: WebGLExtensions,
|
|
14
|
-
attributes: WebGLAttributes,
|
|
15
|
-
capabilities: WebGLCapabilities,
|
|
16
|
-
);
|
|
9
|
+
constructor(gl: WebGLRenderingContext, attributes: WebGLAttributes);
|
|
17
10
|
|
|
18
11
|
setup(
|
|
19
12
|
object: Object3D,
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Renderers / WebGL /////////////////////////////////////////////////////////////////////
|
|
2
|
-
import { WebGLCapabilities } from "./WebGLCapabilities.js";
|
|
3
1
|
import { WebGLExtensions } from "./WebGLExtensions.js";
|
|
4
2
|
import { WebGLInfo } from "./WebGLInfo.js";
|
|
5
3
|
|
|
@@ -8,7 +6,6 @@ export class WebGLBufferRenderer {
|
|
|
8
6
|
gl: WebGLRenderingContext,
|
|
9
7
|
extensions: WebGLExtensions,
|
|
10
8
|
info: WebGLInfo,
|
|
11
|
-
capabilities: WebGLCapabilities,
|
|
12
9
|
);
|
|
13
10
|
|
|
14
11
|
setMode: (value: any) => void;
|
|
@@ -7,22 +7,24 @@ export class WebGLCapabilities {
|
|
|
7
7
|
constructor(gl: WebGLRenderingContext, extensions: any, parameters: WebGLCapabilitiesParameters);
|
|
8
8
|
|
|
9
9
|
readonly isWebGL2: boolean;
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
getMaxAnisotropy: () => number;
|
|
12
|
+
getMaxPrecision: (precision: string) => string;
|
|
13
|
+
|
|
11
14
|
precision: string;
|
|
12
15
|
logarithmicDepthBuffer: boolean;
|
|
16
|
+
|
|
13
17
|
maxTextures: number;
|
|
14
18
|
maxVertexTextures: number;
|
|
15
19
|
maxTextureSize: number;
|
|
16
20
|
maxCubemapSize: number;
|
|
21
|
+
|
|
17
22
|
maxAttributes: number;
|
|
18
23
|
maxVertexUniforms: number;
|
|
19
24
|
maxVaryings: number;
|
|
20
25
|
maxFragmentUniforms: number;
|
|
26
|
+
|
|
21
27
|
vertexTextures: boolean;
|
|
22
|
-
floatFragmentTextures: boolean;
|
|
23
|
-
floatVertexTextures: boolean;
|
|
24
|
-
maxSamples: number;
|
|
25
28
|
|
|
26
|
-
|
|
27
|
-
getMaxPrecision(precision: string): string;
|
|
29
|
+
maxSamples: number;
|
|
28
30
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { WebGLCapabilities } from "./WebGLCapabilities.js";
|
|
2
1
|
import { WebGLExtensions } from "./WebGLExtensions.js";
|
|
3
2
|
|
|
4
3
|
export interface WebGLLightsState {
|
|
@@ -40,7 +39,7 @@ export interface WebGLLightsState {
|
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
export class WebGLLights {
|
|
43
|
-
constructor(extensions: WebGLExtensions
|
|
42
|
+
constructor(extensions: WebGLExtensions);
|
|
44
43
|
|
|
45
44
|
state: WebGLLightsState;
|
|
46
45
|
|
|
@@ -22,8 +22,6 @@ import { WebGLLightsState } from "./WebGLLights.js";
|
|
|
22
22
|
import { WebGLProgram } from "./WebGLProgram.js";
|
|
23
23
|
|
|
24
24
|
export interface WebGLProgramParameters {
|
|
25
|
-
isWebGL2: boolean;
|
|
26
|
-
|
|
27
25
|
shaderID: string;
|
|
28
26
|
shaderType: string;
|
|
29
27
|
shaderName: string;
|
|
@@ -200,16 +198,9 @@ export interface WebGLProgramParameters {
|
|
|
200
198
|
|
|
201
199
|
index0AttributeName: string | undefined;
|
|
202
200
|
|
|
203
|
-
extensionDerivatives: boolean;
|
|
204
|
-
extensionFragDepth: boolean;
|
|
205
|
-
extensionDrawBuffers: boolean;
|
|
206
|
-
extensionShaderTextureLOD: boolean;
|
|
207
201
|
extensionClipCullDistance: boolean;
|
|
208
202
|
extensionMultiDraw: boolean;
|
|
209
203
|
|
|
210
|
-
rendererExtensionFragDepth: boolean;
|
|
211
|
-
rendererExtensionDrawBuffers: boolean;
|
|
212
|
-
rendererExtensionShaderTextureLod: boolean;
|
|
213
204
|
rendererExtensionParallelShaderCompile: boolean;
|
|
214
205
|
|
|
215
206
|
customProgramCacheKey: string;
|
|
@@ -9,8 +9,6 @@ import {
|
|
|
9
9
|
import { Material } from "../../materials/Material.js";
|
|
10
10
|
import { Vector4 } from "../../math/Vector4.js";
|
|
11
11
|
import { WebGLRenderTarget } from "../WebGLRenderTarget.js";
|
|
12
|
-
import { WebGLCapabilities } from "./WebGLCapabilities.js";
|
|
13
|
-
import { WebGLExtensions } from "./WebGLExtensions.js";
|
|
14
12
|
|
|
15
13
|
export class WebGLColorBuffer {
|
|
16
14
|
constructor();
|
|
@@ -45,7 +43,7 @@ export class WebGLStencilBuffer {
|
|
|
45
43
|
}
|
|
46
44
|
|
|
47
45
|
export class WebGLState {
|
|
48
|
-
constructor(gl: WebGLRenderingContext
|
|
46
|
+
constructor(gl: WebGLRenderingContext);
|
|
49
47
|
|
|
50
48
|
buffers: {
|
|
51
49
|
color: WebGLColorBuffer;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { ColorSpace, CompressedPixelFormat, PixelFormat, TextureDataType } from "../../constants.js";
|
|
2
|
-
import { WebGLCapabilities } from "./WebGLCapabilities.js";
|
|
3
2
|
import { WebGLExtensions } from "./WebGLExtensions.js";
|
|
4
3
|
|
|
5
4
|
export class WebGLUtils {
|
|
6
5
|
constructor(
|
|
7
6
|
gl: WebGLRenderingContext | WebGL2RenderingContext,
|
|
8
7
|
extensions: WebGLExtensions,
|
|
9
|
-
capabilities: WebGLCapabilities,
|
|
10
8
|
);
|
|
11
9
|
|
|
12
10
|
convert(p: PixelFormat | CompressedPixelFormat | TextureDataType, colorSpace?: ColorSpace): number | null;
|
three/src/scenes/Scene.d.ts
CHANGED
|
@@ -82,6 +82,12 @@ export class Scene extends Object3D {
|
|
|
82
82
|
*/
|
|
83
83
|
environment: Texture | null;
|
|
84
84
|
|
|
85
|
+
/**
|
|
86
|
+
* Attenuates the color of the environment. Only influences environment maps assigned to {@link Scene.environment}.
|
|
87
|
+
* @default 1
|
|
88
|
+
*/
|
|
89
|
+
environmentIntensity: number;
|
|
90
|
+
|
|
85
91
|
/**
|
|
86
92
|
* The rotation of the environment map in radians. Only influences physical materials in the scene when
|
|
87
93
|
* {@link .environment} is used. Default is `(0,0,0)`.
|
|
@@ -4,7 +4,6 @@ import { Texture3DImageData } from "./types.js";
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Creates a three-dimensional texture from raw data, with parameters to divide it into width, height, and depth
|
|
7
|
-
* @remarks Compatible only with {@link WebGL2RenderingContext | WebGL 2 Rendering Context}.
|
|
8
7
|
* @example
|
|
9
8
|
* ```typescript
|
|
10
9
|
* This creates a[name] with repeating data, 0 to 255
|
|
@@ -4,7 +4,6 @@ import { Texture3DImageData } from "./types.js";
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Creates an array of textures directly from raw data, width and height and depth
|
|
7
|
-
* @remarks Compatible only with {@link WebGL2RenderingContext | WebGL 2 Rendering Context}.
|
|
8
7
|
* @example
|
|
9
8
|
* ```typescript
|
|
10
9
|
* This creates a[name] where each texture has a different color.
|
|
@@ -11,9 +11,6 @@ import { Texture } from "./Texture.js";
|
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* This class can be used to automatically save the depth information of a rendering into a texture
|
|
14
|
-
* @remarks
|
|
15
|
-
* When using a **WebGL1** rendering context, {@link DepthTexture} requires support for the
|
|
16
|
-
* {@link https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/ | WEBGL_depth_texture} extension.
|
|
17
14
|
* @see Example: {@link https://threejs.org/examples/#webgl_depth_texture | depth / texture}
|
|
18
15
|
* @see {@link https://threejs.org/docs/index.html#api/en/textures/DepthTexture | Official Documentation}
|
|
19
16
|
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/textures/DepthTexture.js | Source}
|
three/src/textures/Texture.d.ts
CHANGED
|
@@ -339,13 +339,6 @@ export class Texture extends EventDispatcher<{ dispose: {} }> {
|
|
|
339
339
|
*/
|
|
340
340
|
isRenderTargetTexture: boolean;
|
|
341
341
|
|
|
342
|
-
/**
|
|
343
|
-
* Indicates whether this texture should be processed by {@link THREE.PMREMGenerator} or not.
|
|
344
|
-
* @remarks Only relevant for render target textures.
|
|
345
|
-
* @defaultValue `false`
|
|
346
|
-
*/
|
|
347
|
-
needsPMREMUpdate: boolean;
|
|
348
|
-
|
|
349
342
|
/**
|
|
350
343
|
* An object that can be used to store custom data about the texture.
|
|
351
344
|
* @remarks It should not hold references to functions as these will not be cloned.
|
|
@@ -360,11 +353,24 @@ export class Texture extends EventDispatcher<{ dispose: {} }> {
|
|
|
360
353
|
*/
|
|
361
354
|
version: number;
|
|
362
355
|
|
|
356
|
+
/**
|
|
357
|
+
* Indicates whether this texture should be processed by PMREMGenerator or not (only relevant for render target
|
|
358
|
+
* textures)
|
|
359
|
+
*/
|
|
360
|
+
pmremVersion: number;
|
|
361
|
+
|
|
363
362
|
/**
|
|
364
363
|
* Set this to `true` to trigger an update next time the texture is used. Particularly important for setting the wrap mode.
|
|
365
364
|
*/
|
|
366
365
|
set needsUpdate(value: boolean);
|
|
367
366
|
|
|
367
|
+
/**
|
|
368
|
+
* Indicates whether this texture should be processed by {@link THREE.PMREMGenerator} or not.
|
|
369
|
+
* @remarks Only relevant for render target textures.
|
|
370
|
+
* @defaultValue `false`
|
|
371
|
+
*/
|
|
372
|
+
set needsPMREMUpdate(value: boolean);
|
|
373
|
+
|
|
368
374
|
/**
|
|
369
375
|
* The Global default value for {@link anisotropy | .anisotropy}.
|
|
370
376
|
* @defaultValue `1`.
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import TextureNode from "../accessors/TextureNode.js";
|
|
2
|
-
import Node from "../core/Node.js";
|
|
3
|
-
import { ShaderNodeObject } from "../shadernode/ShaderNode.js";
|
|
4
|
-
|
|
5
|
-
export default class SpecularMIPLevelNode extends Node {
|
|
6
|
-
textureNode: TextureNode;
|
|
7
|
-
roughnessNode: Node | null;
|
|
8
|
-
|
|
9
|
-
constructor(textureNode: TextureNode, roughnessNode?: Node | null);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const specularMIPLevel: () => ShaderNodeObject<SpecularMIPLevelNode>;
|