@types/three 0.150.2 → 0.152.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 +2 -2
- three/build/three.min.d.ts +2 -0
- three/build/three.module.min.d.ts +2 -0
- three/examples/jsm/controls/MapControls.d.ts +21 -0
- three/examples/jsm/controls/OrbitControls.d.ts +1 -5
- three/examples/jsm/controls/PointerLockControls.d.ts +3 -0
- three/examples/jsm/controls/TrackballControls.d.ts +2 -0
- three/examples/jsm/helpers/ViewHelper.d.ts +3 -4
- three/examples/jsm/libs/tween.module.d.ts +2 -0
- three/examples/jsm/loaders/GLTFLoader.d.ts +2 -4
- three/examples/jsm/loaders/SVGLoader.d.ts +15 -3
- three/examples/jsm/nodes/Nodes.d.ts +131 -226
- three/examples/jsm/nodes/{core → code}/CodeNode.d.ts +2 -3
- three/examples/jsm/nodes/{core → code}/ExpressionNode.d.ts +2 -2
- three/examples/jsm/nodes/{core → code}/FunctionCallNode.d.ts +2 -2
- three/examples/jsm/nodes/{core → code}/FunctionNode.d.ts +4 -4
- three/examples/jsm/nodes/core/InputNode.d.ts +4 -0
- three/examples/jsm/nodes/core/NodeBuilder.d.ts +1 -11
- three/examples/jsm/nodes/core/NodeUtils.d.ts +8 -2
- three/examples/jsm/nodes/core/{VaryNode.d.ts → VaryingNode.d.ts} +1 -1
- three/examples/jsm/nodes/core/constants.d.ts +1 -0
- three/examples/jsm/nodes/fog/FogNode.d.ts +1 -1
- three/examples/jsm/nodes/geometry/RangeNode.d.ts +2 -1
- three/examples/jsm/nodes/lighting/LightUtils.d.ts +4 -0
- three/examples/jsm/nodes/lighting/PointLightNode.d.ts +10 -0
- three/examples/jsm/nodes/lighting/SpotLightNode.d.ts +15 -0
- three/examples/jsm/nodes/materials/LineBasicNodeMaterial.d.ts +0 -7
- three/examples/jsm/nodes/materials/MeshBasicNodeMaterial.d.ts +0 -9
- three/examples/jsm/nodes/materials/MeshStandardNodeMaterial.d.ts +0 -9
- three/examples/jsm/nodes/materials/NodeMaterial.d.ts +17 -1
- three/examples/jsm/nodes/math/MathNode.d.ts +2 -2
- three/examples/jsm/nodes/shadernode/ShaderNodeBaseElements.d.ts +2 -2
- three/examples/jsm/nodes/shadernode/ShaderNodeElements.d.ts +0 -2
- three/examples/jsm/objects/{GroundProjectedEnv.d.ts → GroundProjectedSkybox.d.ts} +1 -1
- three/examples/jsm/postprocessing/Pass.d.ts +2 -0
- three/examples/jsm/renderers/CSS2DRenderer.d.ts +2 -1
- three/examples/jsm/renderers/CSS3DRenderer.d.ts +2 -2
- three/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.d.ts +1 -21
- three/examples/jsm/utils/BufferGeometryUtils.d.ts +12 -2
- three/examples/jsm/utils/SkeletonUtils.d.ts +3 -19
- three/index.d.ts +1 -1
- three/package.json +3 -2
- three/src/Three.d.ts +1 -0
- three/src/constants.d.ts +3 -23
- three/src/core/BufferGeometry.d.ts +60 -33
- three/src/core/Raycaster.d.ts +2 -1
- three/src/extras/DataUtils.d.ts +13 -0
- three/src/extras/Earcut.d.ts +12 -0
- three/src/extras/ImageUtils.d.ts +20 -20
- three/src/extras/PMREMGenerator.d.ts +66 -0
- three/src/extras/ShapeUtils.d.ts +19 -1
- three/src/extras/core/Curve.d.ts +86 -31
- three/src/extras/core/CurvePath.d.ts +46 -4
- three/src/extras/core/Interpolations.d.ts +36 -0
- three/src/extras/core/Path.d.ts +122 -15
- three/src/extras/core/Shape.d.ts +56 -6
- three/src/extras/core/ShapePath.d.ts +73 -8
- three/src/extras/curves/ArcCurve.d.ts +35 -3
- three/src/extras/curves/CatmullRomCurve3.d.ts +62 -15
- three/src/extras/curves/CubicBezierCurve.d.ts +48 -7
- three/src/extras/curves/CubicBezierCurve3.d.ts +48 -7
- three/src/extras/curves/EllipseCurve.d.ts +73 -18
- three/src/extras/curves/LineCurve.d.ts +26 -5
- three/src/extras/curves/LineCurve3.d.ts +26 -5
- three/src/extras/curves/QuadraticBezierCurve.d.ts +44 -6
- three/src/extras/curves/QuadraticBezierCurve3.d.ts +44 -6
- three/src/extras/curves/SplineCurve.d.ts +39 -3
- three/src/helpers/ArrowHelper.d.ts +47 -16
- three/src/helpers/AxesHelper.d.ts +35 -3
- three/src/helpers/Box3Helper.d.ts +28 -4
- three/src/helpers/BoxHelper.d.ts +44 -4
- three/src/helpers/CameraHelper.d.ts +38 -19
- three/src/helpers/DirectionalLightHelper.d.ts +57 -10
- three/src/helpers/GridHelper.d.ts +32 -6
- three/src/helpers/HemisphereLightHelper.d.ts +56 -3
- three/src/helpers/PlaneHelper.d.ts +31 -8
- three/src/helpers/PointLightHelper.d.ts +54 -6
- three/src/helpers/PolarGridHelper.d.ts +35 -8
- three/src/helpers/SkeletonHelper.d.ts +56 -8
- three/src/helpers/SpotLightHelper.d.ts +59 -4
- three/src/lights/AmbientLight.d.ts +23 -10
- three/src/lights/AmbientLightProbe.d.ts +18 -0
- three/src/lights/DirectionalLight.d.ts +75 -20
- three/src/lights/DirectionalLightShadow.d.ts +68 -2
- three/src/lights/HemisphereLight.d.ts +45 -12
- three/src/lights/HemisphereLightProbe.d.ts +19 -0
- three/src/lights/Light.d.ts +40 -43
- three/src/lights/LightProbe.d.ts +32 -5
- three/src/lights/LightShadow.d.ts +100 -18
- three/src/lights/PointLight.d.ts +57 -12
- three/src/lights/PointLightShadow.d.ts +18 -2
- three/src/lights/RectAreaLight.d.ts +60 -8
- three/src/lights/SpotLight.d.ts +105 -20
- three/src/lights/SpotLightShadow.d.ts +63 -3
- three/src/materials/LineBasicMaterial.d.ts +7 -1
- three/src/materials/MeshDistanceMaterial.d.ts +0 -15
- three/src/materials/ShaderMaterial.d.ts +1 -1
- three/src/math/Color.d.ts +23 -2
- three/src/math/Quaternion.d.ts +6 -0
- three/src/math/Triangle.d.ts +40 -0
- three/src/math/Vector2.d.ts +5 -0
- three/src/math/Vector3.d.ts +10 -3
- three/src/objects/InstancedMesh.d.ts +22 -30
- three/src/objects/LineSegments.d.ts +2 -0
- three/src/objects/Points.d.ts +7 -6
- three/src/objects/Skeleton.d.ts +5 -1
- three/src/objects/SkinnedMesh.d.ts +37 -25
- three/src/renderers/WebGLRenderTarget.d.ts +3 -0
- three/src/renderers/WebGLRenderer.d.ts +25 -1
- three/src/renderers/shaders/ShaderChunk.d.ts +58 -37
- three/src/renderers/shaders/UniformsLib.d.ts +88 -57
- three/src/textures/CanvasTexture.d.ts +0 -1
- three/src/textures/CompressedTexture.d.ts +3 -2
- three/src/textures/CubeTexture.d.ts +3 -4
- three/src/textures/DataTexture.d.ts +3 -3
- three/src/textures/Texture.d.ts +37 -24
- three/examples/jsm/nodes/functions/light/getDistanceAttenuation.d.ts +0 -5
- three/examples/jsm/nodes/lighting/PunctualLightNode.d.ts +0 -12
three/src/math/Vector3.d.ts
CHANGED
|
@@ -2,12 +2,13 @@ import { Euler } from './Euler';
|
|
|
2
2
|
import { Matrix3 } from './Matrix3';
|
|
3
3
|
import { Matrix4 } from './Matrix4';
|
|
4
4
|
import { Quaternion } from './Quaternion';
|
|
5
|
-
import { Camera } from '
|
|
5
|
+
import { Camera } from '../cameras/Camera';
|
|
6
6
|
import { Spherical } from './Spherical';
|
|
7
7
|
import { Cylindrical } from './Cylindrical';
|
|
8
|
-
import { BufferAttribute } from '
|
|
9
|
-
import { InterleavedBufferAttribute } from '
|
|
8
|
+
import { BufferAttribute } from '../core/BufferAttribute';
|
|
9
|
+
import { InterleavedBufferAttribute } from '../core/InterleavedBufferAttribute';
|
|
10
10
|
import { Vector } from './Vector2';
|
|
11
|
+
import { Color } from './Color';
|
|
11
12
|
|
|
12
13
|
export type Vector3Tuple = [number, number, number];
|
|
13
14
|
|
|
@@ -68,6 +69,12 @@ export class Vector3 implements Vector {
|
|
|
68
69
|
|
|
69
70
|
setComponent(index: number, value: number): this;
|
|
70
71
|
|
|
72
|
+
/**
|
|
73
|
+
* Sets this vector's {@link x}, {@link y} and {@link z} components from the r, g, and b components of the specified
|
|
74
|
+
* {@link Color | color}.
|
|
75
|
+
*/
|
|
76
|
+
setFromColor(color: Color): this;
|
|
77
|
+
|
|
71
78
|
getComponent(index: number): number;
|
|
72
79
|
|
|
73
80
|
/**
|
|
@@ -39,23 +39,19 @@ export class InstancedMesh<
|
|
|
39
39
|
*/
|
|
40
40
|
readonly isInstancedMesh: true;
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
// * @defaultValue `null`
|
|
49
|
-
// */
|
|
50
|
-
// boundingBox: Box3 | null;
|
|
42
|
+
/**
|
|
43
|
+
* This bounding box encloses all instances of the {@link InstancedMesh},, which can be calculated with {@link computeBoundingBox | .computeBoundingBox()}.
|
|
44
|
+
* @remarks Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are `null`.
|
|
45
|
+
* @defaultValue `null`
|
|
46
|
+
*/
|
|
47
|
+
boundingBox: Box3 | null;
|
|
51
48
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
/////////////////////////////////////////////////
|
|
49
|
+
/**
|
|
50
|
+
* This bounding sphere encloses all instances of the {@link InstancedMesh}, which can be calculated with {@link computeBoundingSphere | .computeBoundingSphere()}.
|
|
51
|
+
* @remarks bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are `null`.
|
|
52
|
+
* @defaultValue `null`
|
|
53
|
+
*/
|
|
54
|
+
boundingSphere: Sphere | null;
|
|
59
55
|
|
|
60
56
|
/**
|
|
61
57
|
* The number of instances.
|
|
@@ -80,21 +76,17 @@ export class InstancedMesh<
|
|
|
80
76
|
*/
|
|
81
77
|
instanceMatrix: InstancedBufferAttribute;
|
|
82
78
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
// * @remarks Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are `null`.
|
|
89
|
-
// */
|
|
90
|
-
// computeBoundingBox(): void;
|
|
79
|
+
/**
|
|
80
|
+
* Computes bounding box of the all instances, updating {@link boundingBox | .boundingBox} attribute.
|
|
81
|
+
* @remarks Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are `null`.
|
|
82
|
+
*/
|
|
83
|
+
computeBoundingBox(): void;
|
|
91
84
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
/////////////////////////////////////////////////
|
|
85
|
+
/**
|
|
86
|
+
* Computes bounding sphere of the all instances, updating {@link boundingSphere | .boundingSphere} attribute.
|
|
87
|
+
* @remarks bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are `null`.
|
|
88
|
+
*/
|
|
89
|
+
computeBoundingSphere(): void;
|
|
98
90
|
|
|
99
91
|
/**
|
|
100
92
|
* Get the color of the defined instance.
|
three/src/objects/Points.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Material } from '
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { Material } from '../materials/Material';
|
|
2
|
+
import { Object3D } from '../core/Object3D';
|
|
3
|
+
import { BufferGeometry, NormalOrGLBufferAttributes } from '../core/BufferGeometry';
|
|
4
|
+
import { BufferAttribute } from '../core/BufferAttribute';
|
|
5
|
+
import { InterleavedBufferAttribute } from '../core/InterleavedBufferAttribute';
|
|
6
|
+
import { GLBufferAttribute } from '../core/GLBufferAttribute';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* A class for displaying {@link Points}
|
|
@@ -12,7 +13,7 @@ import { Intersection } from '../core/Raycaster';
|
|
|
12
13
|
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/objects/Points.js | Source}
|
|
13
14
|
*/
|
|
14
15
|
export class Points<
|
|
15
|
-
TGeometry extends BufferGeometry = BufferGeometry,
|
|
16
|
+
TGeometry extends BufferGeometry<NormalOrGLBufferAttributes> = BufferGeometry,
|
|
16
17
|
TMaterial extends Material | Material[] = Material | Material[],
|
|
17
18
|
> extends Object3D {
|
|
18
19
|
/**
|
three/src/objects/Skeleton.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export class Skeleton {
|
|
|
32
32
|
* @param bones The array of {@link THREE.Bone | bones}. Default `[]`.
|
|
33
33
|
* @param boneInverses An array of {@link THREE.Matrix4 | Matrix4s}. Default `[]`.
|
|
34
34
|
*/
|
|
35
|
-
constructor(bones
|
|
35
|
+
constructor(bones?: Bone[], boneInverses?: Matrix4[]);
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* {@link http://en.wikipedia.org/wiki/Universally_unique_identifier | UUID} of this object instance.
|
|
@@ -112,4 +112,8 @@ export class Skeleton {
|
|
|
112
112
|
* Call this method whenever this instance is no longer used in your app.
|
|
113
113
|
*/
|
|
114
114
|
dispose(): void;
|
|
115
|
+
|
|
116
|
+
toJSON(): unknown;
|
|
117
|
+
|
|
118
|
+
fromJSON(json: unknown, bones: Record<string, Bone>): void;
|
|
115
119
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Material } from './../materials/Material';
|
|
2
|
+
import { Box3 } from '../math/Box3';
|
|
2
3
|
import { Matrix4 } from './../math/Matrix4';
|
|
3
4
|
import { Vector3 } from './../math/Vector3';
|
|
4
5
|
import { Skeleton } from './Skeleton';
|
|
5
6
|
import { Mesh } from './Mesh';
|
|
6
7
|
import { BufferGeometry } from '../core/BufferGeometry';
|
|
8
|
+
import { Sphere } from '../math/Sphere';
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
* 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.
|
|
@@ -86,6 +88,18 @@ export class SkinnedMesh<
|
|
|
86
88
|
*/
|
|
87
89
|
bindMatrixInverse: Matrix4;
|
|
88
90
|
|
|
91
|
+
/**
|
|
92
|
+
* The bounding box of the SkinnedMesh. Can be calculated with {@link computeBoundingBox | .computeBoundingBox()}.
|
|
93
|
+
* @default `null`
|
|
94
|
+
*/
|
|
95
|
+
boundingBox: Box3;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* The bounding box of the SkinnedMesh. Can be calculated with {@link computeBoundingSphere | .computeBoundingSphere()}.
|
|
99
|
+
* @default `null`
|
|
100
|
+
*/
|
|
101
|
+
boundingSphere: Sphere;
|
|
102
|
+
|
|
89
103
|
/**
|
|
90
104
|
* {@link THREE.Skeleton | Skeleton} representing the bone hierarchy of the skinned mesh.
|
|
91
105
|
*/
|
|
@@ -100,6 +114,23 @@ export class SkinnedMesh<
|
|
|
100
114
|
*/
|
|
101
115
|
bind(skeleton: Skeleton, bindMatrix?: Matrix4): void;
|
|
102
116
|
|
|
117
|
+
/**
|
|
118
|
+
* Computes the bounding box, updating {@link boundingBox | .boundingBox} attribute.
|
|
119
|
+
* @remarks
|
|
120
|
+
* Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are `null`. If an
|
|
121
|
+
* instance of SkinnedMesh is animated, this method should be called per frame to compute a correct bounding box.
|
|
122
|
+
*/
|
|
123
|
+
computeBoundingBox(): void;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Computes the bounding sphere, updating {@link boundingSphere | .boundingSphere} attribute.
|
|
127
|
+
* @remarks
|
|
128
|
+
* Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are `null`. If
|
|
129
|
+
* an instance of SkinnedMesh is animated, this method should be called per frame to compute a correct bounding
|
|
130
|
+
* sphere.
|
|
131
|
+
*/
|
|
132
|
+
computeBoundingSphere(): void;
|
|
133
|
+
|
|
103
134
|
/**
|
|
104
135
|
* This method sets the skinned mesh in the rest pose (resets the pose).
|
|
105
136
|
*/
|
|
@@ -110,35 +141,16 @@ export class SkinnedMesh<
|
|
|
110
141
|
*/
|
|
111
142
|
normalizeSkinWeights(): void;
|
|
112
143
|
|
|
113
|
-
/////////////////////////////////////////////////
|
|
114
|
-
// FUTURE - r151
|
|
115
|
-
/////////////////////////////////////////////////
|
|
116
|
-
// /**
|
|
117
|
-
// * Applies the bone transform associated with the given index to the given position vector
|
|
118
|
-
// * @remarks Returns the updated vector.
|
|
119
|
-
// * @param index Expects a `Integer`
|
|
120
|
-
// * @param vector
|
|
121
|
-
// */
|
|
122
|
-
// applyBoneTransform(index: number, vector: Vector3): Vector3;
|
|
123
|
-
|
|
124
|
-
// /**
|
|
125
|
-
// * @deprecated {@link THREE.SkinnedMesh}: {@link boneTransform | .boneTransform()} was renamed to {@link applyBoneTransform | .applyBoneTransform()} in **r151**.
|
|
126
|
-
// */
|
|
127
|
-
// boneTransform(index: number, target: Vector3): Vector3;
|
|
128
|
-
/////////////////////////////////////////////////
|
|
129
|
-
|
|
130
144
|
/**
|
|
131
|
-
* Applies the bone transform associated with the given index to the given position vector
|
|
132
|
-
* Calculates the position of the vertex at the given index relative to the current bone transformations.
|
|
133
|
-
* Target vector must be initialized with the vertex coordinates prior to the transformation:
|
|
134
|
-
* ```typescript
|
|
135
|
-
* const target = new THREE.Vector3();
|
|
136
|
-
* target.fromBufferAttribute( mesh.geometry.attributes.position, index );
|
|
137
|
-
* mesh.boneTransform( index, target );
|
|
138
|
-
* ```
|
|
145
|
+
* Applies the bone transform associated with the given index to the given position vector
|
|
139
146
|
* @remarks Returns the updated vector.
|
|
140
147
|
* @param index Expects a `Integer`
|
|
141
148
|
* @param vector
|
|
142
149
|
*/
|
|
150
|
+
applyBoneTransform(index: number, vector: Vector3): Vector3;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* @deprecated {@link THREE.SkinnedMesh}: {@link boneTransform | .boneTransform()} was renamed to {@link applyBoneTransform | .applyBoneTransform()} in **r151**.
|
|
154
|
+
*/
|
|
143
155
|
boneTransform(index: number, target: Vector3): Vector3;
|
|
144
156
|
}
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
TextureEncoding,
|
|
9
9
|
MinificationTextureFilter,
|
|
10
10
|
MagnificationTextureFilter,
|
|
11
|
+
ColorSpace,
|
|
11
12
|
} from '../constants';
|
|
12
13
|
|
|
13
14
|
export interface WebGLRenderTargetOptions {
|
|
@@ -22,7 +23,9 @@ export interface WebGLRenderTargetOptions {
|
|
|
22
23
|
stencilBuffer?: boolean | undefined; // false;
|
|
23
24
|
generateMipmaps?: boolean | undefined; // true;
|
|
24
25
|
depthTexture?: DepthTexture | undefined;
|
|
26
|
+
/** @deprecated Use 'colorSpace' in three.js r152+. */
|
|
25
27
|
encoding?: TextureEncoding | undefined;
|
|
28
|
+
colorSpace?: ColorSpace | undefined;
|
|
26
29
|
|
|
27
30
|
/**
|
|
28
31
|
* Defines the count of MSAA samples. Can only be used with WebGL 2. Default is **0**.
|
|
@@ -14,7 +14,7 @@ import { WebGLRenderTarget } from './WebGLRenderTarget';
|
|
|
14
14
|
import { WebGLMultipleRenderTargets } from './WebGLMultipleRenderTargets';
|
|
15
15
|
import { Object3D } from './../core/Object3D';
|
|
16
16
|
import { Material } from './../materials/Material';
|
|
17
|
-
import { ToneMapping, ShadowMapType, CullFace, TextureEncoding } from '../constants';
|
|
17
|
+
import { ToneMapping, ShadowMapType, CullFace, TextureEncoding, ColorSpace } from '../constants';
|
|
18
18
|
import { WebXRManager } from '../renderers/webxr/WebXRManager';
|
|
19
19
|
import { BufferGeometry } from './../core/BufferGeometry';
|
|
20
20
|
import { OffscreenCanvas, Texture } from '../textures/Texture';
|
|
@@ -22,6 +22,7 @@ import { Data3DTexture } from '../textures/Data3DTexture';
|
|
|
22
22
|
import { Vector3 } from '../math/Vector3';
|
|
23
23
|
import { Box3 } from '../math/Box3';
|
|
24
24
|
import { DataArrayTexture } from '../textures/DataArrayTexture';
|
|
25
|
+
import { WebGLProgram } from './webgl/WebGLProgram';
|
|
25
26
|
|
|
26
27
|
export interface Renderer {
|
|
27
28
|
domElement: HTMLCanvasElement;
|
|
@@ -99,6 +100,21 @@ export interface WebGLDebug {
|
|
|
99
100
|
* Enables error checking and reporting when shader programs are being compiled.
|
|
100
101
|
*/
|
|
101
102
|
checkShaderErrors: boolean;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* A callback function that can be used for custom error reporting. The callback receives the WebGL context, an
|
|
106
|
+
* instance of WebGLProgram as well two instances of WebGLShader representing the vertex and fragment shader.
|
|
107
|
+
* Assigning a custom function disables the default error reporting.
|
|
108
|
+
* @default `null`
|
|
109
|
+
*/
|
|
110
|
+
onShaderError:
|
|
111
|
+
| ((
|
|
112
|
+
gl: WebGLRenderingContext,
|
|
113
|
+
program: WebGLProgram,
|
|
114
|
+
glVertexShader: WebGLShader,
|
|
115
|
+
glFragmentShader: WebGLShader,
|
|
116
|
+
) => void)
|
|
117
|
+
| null;
|
|
102
118
|
}
|
|
103
119
|
|
|
104
120
|
/**
|
|
@@ -173,9 +189,17 @@ export class WebGLRenderer implements Renderer {
|
|
|
173
189
|
/**
|
|
174
190
|
* Default is LinearEncoding.
|
|
175
191
|
* @default THREE.LinearEncoding
|
|
192
|
+
* @deprecated Use {@link WebGLRenderer.outputColorSpace .outputColorSpace} in three.js r152+.
|
|
176
193
|
*/
|
|
177
194
|
outputEncoding: TextureEncoding;
|
|
178
195
|
|
|
196
|
+
/**
|
|
197
|
+
* Color space used for output to HTMLCanvasElement. Supported values are
|
|
198
|
+
* {@link SRGBColorSpace} and {@link LinearSRGBColorSpace}.
|
|
199
|
+
* @default THREE.SRGBColorSpace.
|
|
200
|
+
*/
|
|
201
|
+
outputColorSpace: ColorSpace;
|
|
202
|
+
|
|
179
203
|
/**
|
|
180
204
|
* @default true
|
|
181
205
|
*/
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// Renderers / Shaders /////////////////////////////////////////////////////////////////////
|
|
2
|
-
export
|
|
3
|
-
[name: string]: string;
|
|
4
|
-
|
|
2
|
+
export const ShaderChunk: {
|
|
5
3
|
alphamap_fragment: string;
|
|
6
4
|
alphamap_pars_fragment: string;
|
|
7
5
|
alphatest_fragment: string;
|
|
6
|
+
alphatest_pars_fragment: string;
|
|
8
7
|
aomap_fragment: string;
|
|
9
8
|
aomap_pars_fragment: string;
|
|
10
9
|
begin_vertex: string;
|
|
11
10
|
beginnormal_vertex: string;
|
|
12
11
|
bsdfs: string;
|
|
12
|
+
iridescence_fragment: string;
|
|
13
13
|
bumpmap_pars_fragment: string;
|
|
14
14
|
clipping_planes_fragment: string;
|
|
15
15
|
clipping_planes_pars_fragment: string;
|
|
@@ -20,37 +20,32 @@ export let ShaderChunk: {
|
|
|
20
20
|
color_pars_vertex: string;
|
|
21
21
|
color_vertex: string;
|
|
22
22
|
common: string;
|
|
23
|
-
cube_frag: string;
|
|
24
|
-
cube_vert: string;
|
|
25
23
|
cube_uv_reflection_fragment: string;
|
|
26
24
|
defaultnormal_vertex: string;
|
|
27
|
-
depth_frag: string;
|
|
28
|
-
depth_vert: string;
|
|
29
|
-
distanceRGBA_frag: string;
|
|
30
|
-
distanceRGBA_vert: string;
|
|
31
|
-
displacementmap_vertex: string;
|
|
32
25
|
displacementmap_pars_vertex: string;
|
|
26
|
+
displacementmap_vertex: string;
|
|
33
27
|
emissivemap_fragment: string;
|
|
34
28
|
emissivemap_pars_fragment: string;
|
|
35
|
-
encodings_pars_fragment: string;
|
|
36
29
|
encodings_fragment: string;
|
|
30
|
+
encodings_pars_fragment: string;
|
|
37
31
|
envmap_fragment: string;
|
|
38
32
|
envmap_common_pars_fragment: string;
|
|
39
33
|
envmap_pars_fragment: string;
|
|
40
34
|
envmap_pars_vertex: string;
|
|
35
|
+
envmap_physical_pars_fragment: string;
|
|
41
36
|
envmap_vertex: string;
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
fog_vertex: string;
|
|
38
|
+
fog_pars_vertex: string;
|
|
44
39
|
fog_fragment: string;
|
|
45
40
|
fog_pars_fragment: string;
|
|
46
|
-
|
|
47
|
-
linedashed_vert: string;
|
|
41
|
+
gradientmap_pars_fragment: string;
|
|
48
42
|
lightmap_fragment: string;
|
|
49
43
|
lightmap_pars_fragment: string;
|
|
50
|
-
|
|
44
|
+
lights_lambert_fragment: string;
|
|
45
|
+
lights_lambert_pars_fragment: string;
|
|
51
46
|
lights_pars_begin: string;
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
lights_toon_fragment: string;
|
|
48
|
+
lights_toon_pars_fragment: string;
|
|
54
49
|
lights_phong_fragment: string;
|
|
55
50
|
lights_phong_pars_fragment: string;
|
|
56
51
|
lights_physical_fragment: string;
|
|
@@ -66,36 +61,28 @@ export let ShaderChunk: {
|
|
|
66
61
|
map_pars_fragment: string;
|
|
67
62
|
map_particle_fragment: string;
|
|
68
63
|
map_particle_pars_fragment: string;
|
|
69
|
-
meshbasic_frag: string;
|
|
70
|
-
meshbasic_vert: string;
|
|
71
|
-
meshlambert_frag: string;
|
|
72
|
-
meshlambert_vert: string;
|
|
73
|
-
meshphong_frag: string;
|
|
74
|
-
meshphong_vert: string;
|
|
75
|
-
meshphysical_frag: string;
|
|
76
|
-
meshphysical_vert: string;
|
|
77
64
|
metalnessmap_fragment: string;
|
|
78
65
|
metalnessmap_pars_fragment: string;
|
|
66
|
+
morphcolor_vertex: string;
|
|
79
67
|
morphnormal_vertex: string;
|
|
80
68
|
morphtarget_pars_vertex: string;
|
|
81
69
|
morphtarget_vertex: string;
|
|
82
|
-
normal_flip: string;
|
|
83
|
-
normal_frag: string;
|
|
84
70
|
normal_fragment_begin: string;
|
|
85
71
|
normal_fragment_maps: string;
|
|
86
|
-
|
|
72
|
+
normal_pars_fragment: string;
|
|
73
|
+
normal_pars_vertex: string;
|
|
74
|
+
normal_vertex: string;
|
|
87
75
|
normalmap_pars_fragment: string;
|
|
88
76
|
clearcoat_normal_fragment_begin: string;
|
|
89
77
|
clearcoat_normal_fragment_maps: string;
|
|
90
78
|
clearcoat_pars_fragment: string;
|
|
79
|
+
iridescence_pars_fragment: string;
|
|
80
|
+
output_fragment: string;
|
|
91
81
|
packing: string;
|
|
92
|
-
points_frag: string;
|
|
93
|
-
points_vert: string;
|
|
94
|
-
shadow_frag: string;
|
|
95
|
-
shadow_vert: string;
|
|
96
|
-
|
|
97
82
|
premultiplied_alpha_fragment: string;
|
|
98
83
|
project_vertex: string;
|
|
84
|
+
dithering_fragment: string;
|
|
85
|
+
dithering_pars_fragment: string;
|
|
99
86
|
roughnessmap_fragment: string;
|
|
100
87
|
roughnessmap_pars_fragment: string;
|
|
101
88
|
shadowmap_pars_fragment: string;
|
|
@@ -110,11 +97,45 @@ export let ShaderChunk: {
|
|
|
110
97
|
specularmap_pars_fragment: string;
|
|
111
98
|
tonemapping_fragment: string;
|
|
112
99
|
tonemapping_pars_fragment: string;
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
uv2_vertex: string;
|
|
100
|
+
transmission_fragment: string;
|
|
101
|
+
transmission_pars_fragment: string;
|
|
116
102
|
uv_pars_fragment: string;
|
|
117
103
|
uv_pars_vertex: string;
|
|
118
104
|
uv_vertex: string;
|
|
119
105
|
worldpos_vertex: string;
|
|
106
|
+
|
|
107
|
+
background_vert: string;
|
|
108
|
+
background_frag: string;
|
|
109
|
+
backgroundCube_vert: string;
|
|
110
|
+
backgroundCube_frag: string;
|
|
111
|
+
cube_vert: string;
|
|
112
|
+
cube_frag: string;
|
|
113
|
+
depth_vert: string;
|
|
114
|
+
depth_frag: string;
|
|
115
|
+
distanceRGBA_vert: string;
|
|
116
|
+
distanceRGBA_frag: string;
|
|
117
|
+
equirect_vert: string;
|
|
118
|
+
equirect_frag: string;
|
|
119
|
+
linedashed_vert: string;
|
|
120
|
+
linedashed_frag: string;
|
|
121
|
+
meshbasic_vert: string;
|
|
122
|
+
meshbasic_frag: string;
|
|
123
|
+
meshlambert_vert: string;
|
|
124
|
+
meshlambert_frag: string;
|
|
125
|
+
meshmatcap_vert: string;
|
|
126
|
+
meshmatcap_frag: string;
|
|
127
|
+
meshnormal_vert: string;
|
|
128
|
+
meshnormal_frag: string;
|
|
129
|
+
meshphong_vert: string;
|
|
130
|
+
meshphong_frag: string;
|
|
131
|
+
meshphysical_vert: string;
|
|
132
|
+
meshphysical_frag: string;
|
|
133
|
+
meshtoon_vert: string;
|
|
134
|
+
meshtoon_frag: string;
|
|
135
|
+
points_vert: string;
|
|
136
|
+
points_frag: string;
|
|
137
|
+
shadow_vert: string;
|
|
138
|
+
shadow_frag: string;
|
|
139
|
+
sprite_vert: string;
|
|
140
|
+
sprite_frag: string;
|
|
120
141
|
};
|