UNPKG

4.43 kBTypeScriptView Raw
1import { NormalMapTypes } from "../constants.js";
2import { Color, ColorRepresentation } from "../math/Color.js";
3import { Euler } from "../math/Euler.js";
4import { Vector2 } from "../math/Vector2.js";
5import { Texture } from "../textures/Texture.js";
6import { Material, MaterialParameters } from "./Material.js";
7
8export interface MeshStandardMaterialParameters extends MaterialParameters {
9 color?: ColorRepresentation | undefined;
10 roughness?: number | undefined;
11 metalness?: number | undefined;
12 map?: Texture | null | undefined;
13 lightMap?: Texture | null | undefined;
14 lightMapIntensity?: number | undefined;
15 aoMap?: Texture | null | undefined;
16 aoMapIntensity?: number | undefined;
17 emissive?: ColorRepresentation | undefined;
18 emissiveIntensity?: number | undefined;
19 emissiveMap?: Texture | null | undefined;
20 bumpMap?: Texture | null | undefined;
21 bumpScale?: number | undefined;
22 normalMap?: Texture | null | undefined;
23 normalMapType?: NormalMapTypes | undefined;
24 normalScale?: Vector2 | undefined;
25 displacementMap?: Texture | null | undefined;
26 displacementScale?: number | undefined;
27 displacementBias?: number | undefined;
28 roughnessMap?: Texture | null | undefined;
29 metalnessMap?: Texture | null | undefined;
30 alphaMap?: Texture | null | undefined;
31 envMap?: Texture | null | undefined;
32 envMapRotation?: Euler | undefined;
33 envMapIntensity?: number | undefined;
34 wireframe?: boolean | undefined;
35 wireframeLinewidth?: number | undefined;
36 fog?: boolean | undefined;
37 flatShading?: boolean | undefined;
38}
39
40export class MeshStandardMaterial extends Material {
41 constructor(parameters?: MeshStandardMaterialParameters);
42
43 /**
44 * Read-only flag to check if a given object is of type {@link MeshStandardMaterial}.
45 * @remarks This is a _constant_ value
46 * @defaultValue `true`
47 */
48 readonly isMeshStandardMaterial: true;
49
50 /**
51 * @default { 'STANDARD': '' }
52 */
53 defines: { [key: string]: any };
54
55 /**
56 * @default new THREE.Color( 0xffffff )
57 */
58 color: Color;
59
60 /**
61 * @default 1
62 */
63 roughness: number;
64
65 /**
66 * @default 0
67 */
68 metalness: number;
69
70 /**
71 * @default null
72 */
73 map: Texture | null;
74
75 /**
76 * @default null
77 */
78 lightMap: Texture | null;
79
80 /**
81 * @default 1
82 */
83 lightMapIntensity: number;
84
85 /**
86 * @default null
87 */
88 aoMap: Texture | null;
89
90 /**
91 * @default 1
92 */
93 aoMapIntensity: number;
94
95 /**
96 * @default new THREE.Color( 0x000000 )
97 */
98 emissive: Color;
99
100 /**
101 * @default 1
102 */
103 emissiveIntensity: number;
104
105 /**
106 * @default null
107 */
108 emissiveMap: Texture | null;
109
110 /**
111 * @default null
112 */
113 bumpMap: Texture | null;
114
115 /**
116 * @default 1
117 */
118 bumpScale: number;
119
120 /**
121 * @default null
122 */
123 normalMap: Texture | null;
124
125 /**
126 * @default THREE.TangentSpaceNormalMap
127 */
128 normalMapType: NormalMapTypes;
129
130 /**
131 * @default new THREE.Vector2( 1, 1 )
132 */
133 normalScale: Vector2;
134
135 /**
136 * @default null
137 */
138 displacementMap: Texture | null;
139
140 /**
141 * @default 1
142 */
143 displacementScale: number;
144
145 /**
146 * @default 0
147 */
148 displacementBias: number;
149
150 /**
151 * @default null
152 */
153 roughnessMap: Texture | null;
154
155 /**
156 * @default null
157 */
158 metalnessMap: Texture | null;
159
160 /**
161 * @default null
162 */
163 alphaMap: Texture | null;
164
165 /**
166 * @default null
167 */
168 envMap: Texture | null;
169
170 /**
171 * The rotation of the environment map in radians. Default is `(0,0,0)`.
172 */
173 envMapRotation: Euler;
174
175 /**
176 * @default 1
177 */
178 envMapIntensity: number;
179
180 /**
181 * @default false
182 */
183 wireframe: boolean;
184
185 /**
186 * @default 1
187 */
188 wireframeLinewidth: number;
189
190 /**
191 * @default 'round'
192 */
193 wireframeLinecap: string;
194
195 /**
196 * @default 'round'
197 */
198 wireframeLinejoin: string;
199
200 /**
201 * Define whether the material is rendered with flat shading. Default is false.
202 * @default false
203 */
204 flatShading: boolean;
205
206 /**
207 * Whether the material is affected by fog. Default is true.
208 * @default fog
209 */
210 fog: boolean;
211
212 setValues(parameters: MeshStandardMaterialParameters): void;
213}