forked from BabylonJS/Babylon.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaterialFlags.ts
408 lines (358 loc) · 13.7 KB
/
materialFlags.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
import { AbstractEngine } from "../Engines/abstractEngine";
import { Constants } from "../Engines/constants";
/**
* This groups all the flags used to control the materials channel.
*/
export class MaterialFlags {
// Flags used to enable or disable a type of texture for all Standard Materials
private static _DiffuseTextureEnabled = true;
/**
* Are diffuse textures enabled in the application.
*/
public static get DiffuseTextureEnabled(): boolean {
return this._DiffuseTextureEnabled;
}
public static set DiffuseTextureEnabled(value: boolean) {
if (this._DiffuseTextureEnabled === value) {
return;
}
this._DiffuseTextureEnabled = value;
AbstractEngine.MarkAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);
}
private static _BaseWeightTextureEnabled = true;
/**
* Is the OpenPBR Base Weight texture enabled in the application.
*/
public static get BaseWeightTextureEnabled(): boolean {
return this._BaseWeightTextureEnabled;
}
public static set BaseWeightTextureEnabled(value: boolean) {
if (this._BaseWeightTextureEnabled === value) {
return;
}
this._BaseWeightTextureEnabled = value;
AbstractEngine.MarkAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);
}
private static _BaseDiffuseRoughnessTextureEnabled = true;
/**
* Is the OpenPBR Base Diffuse Roughness texture enabled in the application.
*/
public static get BaseDiffuseRoughnessTextureEnabled(): boolean {
return this._BaseDiffuseRoughnessTextureEnabled;
}
public static set BaseDiffuseRoughnessTextureEnabled(value: boolean) {
if (this._BaseDiffuseRoughnessTextureEnabled === value) {
return;
}
this._BaseDiffuseRoughnessTextureEnabled = value;
AbstractEngine.MarkAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);
}
private static _DetailTextureEnabled = true;
/**
* Are detail textures enabled in the application.
*/
public static get DetailTextureEnabled(): boolean {
return this._DetailTextureEnabled;
}
public static set DetailTextureEnabled(value: boolean) {
if (this._DetailTextureEnabled === value) {
return;
}
this._DetailTextureEnabled = value;
AbstractEngine.MarkAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);
}
private static _DecalMapEnabled = true;
/**
* Are decal maps enabled in the application.
*/
public static get DecalMapEnabled(): boolean {
return this._DecalMapEnabled;
}
public static set DecalMapEnabled(value: boolean) {
if (this._DecalMapEnabled === value) {
return;
}
this._DecalMapEnabled = value;
AbstractEngine.MarkAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);
}
private static _AmbientTextureEnabled = true;
/**
* Are ambient textures enabled in the application.
*/
public static get AmbientTextureEnabled(): boolean {
return this._AmbientTextureEnabled;
}
public static set AmbientTextureEnabled(value: boolean) {
if (this._AmbientTextureEnabled === value) {
return;
}
this._AmbientTextureEnabled = value;
AbstractEngine.MarkAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);
}
private static _OpacityTextureEnabled = true;
/**
* Are opacity textures enabled in the application.
*/
public static get OpacityTextureEnabled(): boolean {
return this._OpacityTextureEnabled;
}
public static set OpacityTextureEnabled(value: boolean) {
if (this._OpacityTextureEnabled === value) {
return;
}
this._OpacityTextureEnabled = value;
AbstractEngine.MarkAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);
}
private static _ReflectionTextureEnabled = true;
/**
* Are reflection textures enabled in the application.
*/
public static get ReflectionTextureEnabled(): boolean {
return this._ReflectionTextureEnabled;
}
public static set ReflectionTextureEnabled(value: boolean) {
if (this._ReflectionTextureEnabled === value) {
return;
}
this._ReflectionTextureEnabled = value;
AbstractEngine.MarkAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);
}
private static _EmissiveTextureEnabled = true;
/**
* Are emissive textures enabled in the application.
*/
public static get EmissiveTextureEnabled(): boolean {
return this._EmissiveTextureEnabled;
}
public static set EmissiveTextureEnabled(value: boolean) {
if (this._EmissiveTextureEnabled === value) {
return;
}
this._EmissiveTextureEnabled = value;
AbstractEngine.MarkAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);
}
private static _SpecularTextureEnabled = true;
/**
* Are specular textures enabled in the application.
*/
public static get SpecularTextureEnabled(): boolean {
return this._SpecularTextureEnabled;
}
public static set SpecularTextureEnabled(value: boolean) {
if (this._SpecularTextureEnabled === value) {
return;
}
this._SpecularTextureEnabled = value;
AbstractEngine.MarkAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);
}
private static _BumpTextureEnabled = true;
/**
* Are bump textures enabled in the application.
*/
public static get BumpTextureEnabled(): boolean {
return this._BumpTextureEnabled;
}
public static set BumpTextureEnabled(value: boolean) {
if (this._BumpTextureEnabled === value) {
return;
}
this._BumpTextureEnabled = value;
AbstractEngine.MarkAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);
}
private static _LightmapTextureEnabled = true;
/**
* Are lightmap textures enabled in the application.
*/
public static get LightmapTextureEnabled(): boolean {
return this._LightmapTextureEnabled;
}
public static set LightmapTextureEnabled(value: boolean) {
if (this._LightmapTextureEnabled === value) {
return;
}
this._LightmapTextureEnabled = value;
AbstractEngine.MarkAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);
}
private static _RefractionTextureEnabled = true;
/**
* Are refraction textures enabled in the application.
*/
public static get RefractionTextureEnabled(): boolean {
return this._RefractionTextureEnabled;
}
public static set RefractionTextureEnabled(value: boolean) {
if (this._RefractionTextureEnabled === value) {
return;
}
this._RefractionTextureEnabled = value;
AbstractEngine.MarkAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);
}
private static _ColorGradingTextureEnabled = true;
/**
* Are color grading textures enabled in the application.
*/
public static get ColorGradingTextureEnabled(): boolean {
return this._ColorGradingTextureEnabled;
}
public static set ColorGradingTextureEnabled(value: boolean) {
if (this._ColorGradingTextureEnabled === value) {
return;
}
this._ColorGradingTextureEnabled = value;
AbstractEngine.MarkAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);
}
private static _FresnelEnabled = true;
/**
* Are fresnels enabled in the application.
*/
public static get FresnelEnabled(): boolean {
return this._FresnelEnabled;
}
public static set FresnelEnabled(value: boolean) {
if (this._FresnelEnabled === value) {
return;
}
this._FresnelEnabled = value;
AbstractEngine.MarkAllMaterialsAsDirty(Constants.MATERIAL_FresnelDirtyFlag);
}
private static _ClearCoatTextureEnabled = true;
/**
* Are clear coat textures enabled in the application.
*/
public static get ClearCoatTextureEnabled(): boolean {
return this._ClearCoatTextureEnabled;
}
public static set ClearCoatTextureEnabled(value: boolean) {
if (this._ClearCoatTextureEnabled === value) {
return;
}
this._ClearCoatTextureEnabled = value;
AbstractEngine.MarkAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);
}
private static _ClearCoatBumpTextureEnabled = true;
/**
* Are clear coat bump textures enabled in the application.
*/
public static get ClearCoatBumpTextureEnabled(): boolean {
return this._ClearCoatBumpTextureEnabled;
}
public static set ClearCoatBumpTextureEnabled(value: boolean) {
if (this._ClearCoatBumpTextureEnabled === value) {
return;
}
this._ClearCoatBumpTextureEnabled = value;
AbstractEngine.MarkAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);
}
private static _ClearCoatTintTextureEnabled = true;
/**
* Are clear coat tint textures enabled in the application.
*/
public static get ClearCoatTintTextureEnabled(): boolean {
return this._ClearCoatTintTextureEnabled;
}
public static set ClearCoatTintTextureEnabled(value: boolean) {
if (this._ClearCoatTintTextureEnabled === value) {
return;
}
this._ClearCoatTintTextureEnabled = value;
AbstractEngine.MarkAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);
}
private static _SheenTextureEnabled = true;
/**
* Are sheen textures enabled in the application.
*/
public static get SheenTextureEnabled(): boolean {
return this._SheenTextureEnabled;
}
public static set SheenTextureEnabled(value: boolean) {
if (this._SheenTextureEnabled === value) {
return;
}
this._SheenTextureEnabled = value;
AbstractEngine.MarkAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);
}
private static _AnisotropicTextureEnabled = true;
/**
* Are anisotropic textures enabled in the application.
*/
public static get AnisotropicTextureEnabled(): boolean {
return this._AnisotropicTextureEnabled;
}
public static set AnisotropicTextureEnabled(value: boolean) {
if (this._AnisotropicTextureEnabled === value) {
return;
}
this._AnisotropicTextureEnabled = value;
AbstractEngine.MarkAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);
}
private static _ThicknessTextureEnabled = true;
/**
* Are thickness textures enabled in the application.
*/
public static get ThicknessTextureEnabled(): boolean {
return this._ThicknessTextureEnabled;
}
public static set ThicknessTextureEnabled(value: boolean) {
if (this._ThicknessTextureEnabled === value) {
return;
}
this._ThicknessTextureEnabled = value;
AbstractEngine.MarkAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);
}
private static _RefractionIntensityTextureEnabled = true;
/**
* Are refraction intensity textures enabled in the application.
*/
public static get RefractionIntensityTextureEnabled(): boolean {
return this._ThicknessTextureEnabled;
}
public static set RefractionIntensityTextureEnabled(value: boolean) {
if (this._RefractionIntensityTextureEnabled === value) {
return;
}
this._RefractionIntensityTextureEnabled = value;
AbstractEngine.MarkAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);
}
private static _TranslucencyIntensityTextureEnabled = true;
/**
* Are translucency intensity textures enabled in the application.
*/
public static get TranslucencyIntensityTextureEnabled(): boolean {
return this._TranslucencyIntensityTextureEnabled;
}
public static set TranslucencyIntensityTextureEnabled(value: boolean) {
if (this._TranslucencyIntensityTextureEnabled === value) {
return;
}
this._TranslucencyIntensityTextureEnabled = value;
AbstractEngine.MarkAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);
}
private static _TranslucencyColorTextureEnabled = true;
/**
* Are translucency tint textures enabled in the application.
*/
public static get TranslucencyColorTextureEnabled(): boolean {
return this._TranslucencyColorTextureEnabled;
}
public static set TranslucencyColorTextureEnabled(value: boolean) {
if (this._TranslucencyColorTextureEnabled === value) {
return;
}
this._TranslucencyColorTextureEnabled = value;
AbstractEngine.MarkAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);
}
private static _IridescenceTextureEnabled = true;
/**
* Are translucency intensity textures enabled in the application.
*/
public static get IridescenceTextureEnabled(): boolean {
return this._IridescenceTextureEnabled;
}
public static set IridescenceTextureEnabled(value: boolean) {
if (this._IridescenceTextureEnabled === value) {
return;
}
this._IridescenceTextureEnabled = value;
AbstractEngine.MarkAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);
}
}