UNPKG

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