-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
standard-material-options.js
112 lines (95 loc) · 2.46 KB
/
standard-material-options.js
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
import { LitShaderOptions } from "../shader-lib/programs/lit-shader-options.js";
/**
* The standard material options define a set of options used to control the shader frontend shader
* generation, such as textures, tints and multipliers.
*
* @category Graphics
*/
class StandardMaterialOptions {
/**
* If UV1 (second set of texture coordinates) is required in the shader. Will be declared as
* "vUv1" and passed to the fragment shader.
*
* @type {boolean}
*/
forceUv1 = false;
/**
* The value of {@link StandardMaterial#ambientTint}.
*
* @type {boolean}
*/
ambientTint = false;
/**
* Defines if {@link StandardMaterial#diffuse} constant should affect diffuse color.
*
* @type {boolean}
*/
diffuseTint = false;
/**
* Defines if {@link StandardMaterial#specular} constant should affect specular color.
*
* @type {boolean}
*/
specularTint = false;
/**
* Defines if {@link StandardMaterial#metalness} constant should affect metalness value.
*
* @type {boolean}
*/
metalnessTint = false;
/**
* Defines if {@link StandardMaterial#gloss} constant should affect glossiness value.
*
* @type {boolean}
*/
glossTint = false;
/**
* Defines if {@link StandardMaterial#emissive} constant should affect emissive color.
*
* @type {boolean}
*/
emissiveTint = false;
/**
* Defines if {@link StandardMaterial#opacity} constant should affect opacity value.
*
* @type {boolean}
*/
opacityTint = false;
emissiveEncoding = 'linear';
lightMapEncoding = 'linear';
/**
* If normal map contains X in RGB, Y in Alpha, and Z must be reconstructed.
*
* @type {boolean}
*/
packedNormal = false;
/**
* Invert the gloss channel.
*
* @type {boolean}
*/
glossInvert = false;
/**
* Invert the sheen gloss channel.
*
* @type {boolean}
*/
sheenGlossInvert = false;
/**
* Invert the clearcoat gloss channel.
*
* @type {boolean}
*/
clearCoatGlossInvert = false;
/**
* Storage for the options for lit the shader and material.
*
* @type {LitShaderOptions}
*/
litOptions = new LitShaderOptions();
// program-library assumes material options has a pass property
get pass() {
return this.litOptions.pass;
}
}
export { StandardMaterialOptions };