UNPKG

4.84 kBTypeScriptView Raw
1import { Color, ColorRepresentation } from "../math/Color.js";
2import { Vector2 } from "../math/Vector2.js";
3import { Texture } from "../textures/Texture.js";
4import { MeshStandardMaterial, MeshStandardMaterialParameters } from "./MeshStandardMaterial.js";
5
6export interface MeshPhysicalMaterialParameters extends MeshStandardMaterialParameters {
7 anisotropyRotation?: number | undefined;
8 anisotropyMap?: Texture | null | undefined;
9
10 clearcoatMap?: Texture | null | undefined;
11 clearcoatRoughness?: number | undefined;
12 clearcoatRoughnessMap?: Texture | null | undefined;
13 clearcoatNormalScale?: Vector2 | undefined;
14 clearcoatNormalMap?: Texture | null | undefined;
15
16 ior?: number | undefined;
17
18 reflectivity?: number | undefined;
19
20 iridescenceMap?: Texture | null | undefined;
21 iridescenceIOR?: number | undefined;
22 iridescenceThicknessRange?: [number, number] | undefined;
23 iridescenceThicknessMap?: Texture | null | undefined;
24
25 sheenColor?: ColorRepresentation | undefined;
26 sheenColorMap?: Texture | null | undefined;
27 sheenRoughness?: number | undefined;
28 sheenRoughnessMap?: Texture | null | undefined;
29
30 transmissionMap?: Texture | null | undefined;
31
32 thickness?: number | undefined;
33 thicknessMap?: Texture | null | undefined;
34 attenuationDistance?: number | undefined;
35 attenuationColor?: ColorRepresentation | undefined;
36
37 specularIntensity?: number | undefined;
38 specularIntensityMap?: Texture | null | undefined;
39 specularColor?: ColorRepresentation | undefined;
40 specularColorMap?: Texture | null | undefined;
41
42 anisotropy?: number | undefined;
43 clearcoat?: number | undefined;
44 iridescence?: number | undefined;
45 dispersion?: number | undefined;
46 sheen?: number | undefined;
47 transmission?: number | undefined;
48}
49
50export class MeshPhysicalMaterial extends MeshStandardMaterial {
51 constructor(parameters?: MeshPhysicalMaterialParameters);
52
53 /**
54 * Read-only flag to check if a given object is of type {@link MeshPhysicalMaterial}.
55 * @remarks This is a _constant_ value
56 * @defaultValue `true`
57 */
58 readonly isMeshPhysicalMaterial: true;
59
60 /**
61 * @default { 'STANDARD': '', 'PHYSICAL': '' }
62 */
63 defines: { [key: string]: any };
64
65 /**
66 * @default 0
67 */
68 anisotropyRotation?: number;
69
70 /**
71 * @default null
72 */
73 anisotropyMap?: Texture | null;
74
75 /**
76 * @default null
77 */
78 clearcoatMap: Texture | null;
79
80 /**
81 * @default 0
82 */
83 clearcoatRoughness: number;
84
85 /**
86 * @default null
87 */
88 clearcoatRoughnessMap: Texture | null;
89
90 /**
91 * @default new THREE.Vector2( 1, 1 )
92 */
93 clearcoatNormalScale: Vector2;
94
95 /**
96 * @default null
97 */
98 clearcoatNormalMap: Texture | null;
99
100 /**
101 * @default 1.5
102 */
103 ior: number;
104
105 /**
106 * @default 0.5
107 */
108 get reflectivity(): number;
109 set reflectivity(reflectivity: number);
110
111 /**
112 * @default null
113 */
114 iridescenceMap: Texture | null;
115
116 /**
117 * @default 1.3
118 */
119 iridescenceIOR: number;
120
121 /**
122 * @default [100, 400]
123 */
124 iridescenceThicknessRange: [number, number];
125
126 /**
127 * @default null
128 */
129 iridescenceThicknessMap: Texture | null;
130
131 /**
132 * @default Color( 0x000000 )
133 */
134 sheenColor: Color;
135
136 /**
137 * @default null
138 */
139 sheenColorMap: Texture | null;
140
141 /**
142 * @default 1.0
143 */
144 sheenRoughness: number;
145
146 /**
147 * @default null
148 */
149 sheenRoughnessMap: Texture | null;
150
151 /**
152 * @default null
153 */
154 transmissionMap: Texture | null;
155
156 /**
157 * @default 0.01
158 */
159 thickness: number;
160
161 /**
162 * @default null
163 */
164 thicknessMap: Texture | null;
165
166 /**
167 * @default 0.0
168 */
169 attenuationDistance: number;
170
171 /**
172 * @default Color( 1, 1, 1 )
173 */
174 attenuationColor: Color;
175
176 /**
177 * @default 1.0
178 */
179 specularIntensity: number;
180
181 /**
182 * @default null
183 */
184 specularIntensityMap: Texture | null;
185
186 /**
187 * @default Color(1, 1, 1)
188 */
189 specularColor: Color;
190
191 /**
192 * @default null
193 */
194 specularColorMap: Texture | null;
195
196 /**
197 * @default 0
198 */
199 get anisotropy(): number;
200 set anisotropy(value: number);
201
202 /**
203 * @default 0
204 */
205 get clearcoat(): number;
206 set clearcoat(value: number);
207
208 /**
209 * @default 0
210 */
211 get iridescence(): number;
212 set iridescence(value: number);
213
214 /**
215 * @default 0
216 */
217 get dispersion(): number;
218 set dispersion(value: number);
219
220 /**
221 * @default 0.0
222 */
223 get sheen(): number;
224 set sheen(value: number);
225
226 /**
227 * @default 0
228 */
229 get transmission(): number;
230 set transmission(value: number);
231}