-
Notifications
You must be signed in to change notification settings - Fork 0
/
Material.cs
272 lines (244 loc) · 6.91 KB
/
Material.cs
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
using System.Numerics;
internal struct Material
{
public string Name;
public Vector3 Ambient;
public Vector3 Diffuse;
public Vector3 Specular;
public float Shininess;
public Material(Vector3 ambient, Vector3 diffuse, Vector3 specular, float shininess)
: this("", ambient, diffuse, specular, shininess) { }
public Material(
string name,
Vector3 ambient,
Vector3 diffuse,
Vector3 specular,
float shininess
)
{
Name = name;
Ambient = ambient;
Diffuse = diffuse;
Specular = specular;
Shininess = shininess;
}
public static readonly Material Emerald =
new(
"Emerald",
new(0.0215f, 0.1745f, 0.0215f),
new(0.07568f, 0.61424f, 0.07568f),
new(0.633f, 0.727811f, 0.633f),
0.6f * 128f
);
public static readonly Material Jade =
new(
"Jade",
new(0.135f, 0.2225f, 0.1575f),
new(0.54f, 0.89f, 0.63f),
new(0.316228f, 0.316228f, 0.316228f),
0.1f * 128f
);
public static readonly Material Obsidian =
new(
"Obsidian",
new(0.05375f, 0.05f, 0.06625f),
new(0.18275f, 0.17f, 0.22525f),
new(0.332741f, 0.328634f, 0.346435f),
0.3f * 128f
);
public static readonly Material Pearl =
new(
"Pearl",
new(0.25f, 0.20725f, 0.20725f),
new(1f, 0.829f, 0.829f),
new(0.296648f, 0.296648f, 0.296648f),
0.088f * 128f
);
public static readonly Material Ruby =
new(
"Ruby",
new(0.1745f, 0.01175f, 0.01175f),
new(0.61424f, 0.04136f, 0.04136f),
new(0.727811f, 0.626959f, 0.626959f),
0.6f * 128f
);
public static readonly Material Turquoise =
new(
"Turquoise",
new(0.1f, 0.18725f, 0.1745f),
new(0.396f, 0.74151f, 0.69102f),
new(0.297254f, 0.30829f, 0.306678f),
0.1f * 128f
);
public static readonly Material Brass =
new(
"Brass",
new(0.329412f, 0.223529f, 0.027451f),
new(0.780392f, 0.568627f, 0.113725f),
new(0.992157f, 0.941176f, 0.807843f),
0.21794872f * 128f
);
public static readonly Material Bronze =
new(
"Bronze",
new(0.2125f, 0.1275f, 0.054f),
new(0.714f, 0.4284f, 0.18144f),
new(0.393548f, 0.271906f, 0.166721f),
0.2f * 128f
);
public static readonly Material Chrome =
new(
"Chrome",
new(0.25f, 0.25f, 0.25f),
new(0.4f, 0.4f, 0.4f),
new(0.774597f, 0.774597f, 0.774597f),
0.6f * 128f
);
public static readonly Material Copper =
new(
"Copper",
new(0.19125f, 0.0735f, 0.0225f),
new(0.7038f, 0.27048f, 0.0828f),
new(0.256777f, 0.137622f, 0.086014f),
0.1f * 128f
);
public static readonly Material Gold =
new(
"Gold",
new(0.24725f, 0.1995f, 0.0745f),
new(0.75164f, 0.60648f, 0.22648f),
new(0.628281f, 0.555802f, 0.366065f),
0.4f * 128f
);
public static readonly Material Silver =
new(
"Silver",
new(0.19225f, 0.19225f, 0.19225f),
new(0.50754f, 0.50754f, 0.50754f),
new(0.508273f, 0.508273f, 0.508273f),
0.4f * 128f
);
public static readonly Material BlackPlastic =
new(
"BlackPlastic",
new(0.0f, 0.0f, 0.0f),
new(0.01f, 0.01f, 0.01f),
new(0.50f, 0.50f, 0.50f),
0.25f * 128f
);
public static readonly Material CyanPlastic =
new(
"CyanPlastic",
new(0.0f, 0.1f, 0.06f),
new(0.0f, 0.50980392f, 0.50980392f),
new(0.50196078f, 0.50196078f, 0.50196078f),
0.25f * 128f
);
public static readonly Material GreenPlastic =
new(
"GreenPlastic",
new(0.0f, 0.0f, 0.0f),
new(0.1f, 0.35f, 0.1f),
new(0.45f, 0.55f, 0.45f),
0.25f * 128f
);
public static readonly Material RedPlastic =
new(
"RedPlastic",
new(0.0f, 0.0f, 0.0f),
new(0.5f, 0.0f, 0.0f),
new(0.7f, 0.6f, 0.6f),
0.25f * 128f
);
public static readonly Material WhitePlastic =
new(
"WhitePlastic",
new(0.0f, 0.0f, 0.0f),
new(0.55f, 0.55f, 0.55f),
new(0.70f, 0.70f, 0.70f),
0.25f * 128f
);
public static readonly Material YellowPlastic =
new(
"YellowPlastic",
new(0.0f, 0.0f, 0.0f),
new(0.5f, 0.5f, 0.0f),
new(0.60f, 0.60f, 0.50f),
0.25f * 128f
);
public static readonly Material BlackRubber =
new(
"BlackRubber",
new(0.02f, 0.02f, 0.02f),
new(0.01f, 0.01f, 0.01f),
new(0.4f, 0.4f, 0.4f),
0.078125f * 128f
);
public static readonly Material CyanRubber =
new(
"CyanRubber",
new(0.0f, 0.05f, 0.05f),
new(0.4f, 0.5f, 0.5f),
new(0.04f, 0.7f, 0.7f),
0.078125f * 128f
);
public static readonly Material GreenRubber =
new(
"GreenRubber",
new(0.0f, 0.05f, 0.0f),
new(0.4f, 0.5f, 0.4f),
new(0.04f, 0.7f, 0.04f),
0.078125f * 128f
);
public static readonly Material RedRubber =
new(
"RedRubber",
new(0.05f, 0.0f, 0.0f),
new(0.5f, 0.4f, 0.4f),
new(0.7f, 0.04f, 0.04f),
0.078125f * 128f
);
public static readonly Material WhiteRubber =
new(
"WhiteRubber",
new(0.05f, 0.05f, 0.05f),
new(0.5f, 0.5f, 0.5f),
new(0.7f, 0.7f, 0.7f),
0.078125f * 128f
);
public static readonly Material YellowRubber =
new(
"YellowRubber",
new(0.05f, 0.05f, 0.0f),
new(0.5f, 0.5f, 0.4f),
new(0.7f, 0.7f, 0.04f),
0.078125f * 128f
);
public static readonly Material[] All =
{
Emerald,
Jade,
Obsidian,
Pearl,
Ruby,
Turquoise,
Brass,
Bronze,
Chrome,
Copper,
Gold,
Silver,
BlackPlastic,
CyanPlastic,
GreenPlastic,
RedPlastic,
WhitePlastic,
YellowPlastic,
BlackRubber,
CyanRubber,
GreenRubber,
RedRubber,
WhiteRubber,
YellowRubber
};
}