-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMaterials.h
50 lines (46 loc) · 1.35 KB
/
Materials.h
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
#pragma once
enum Material {
red = 0,
mirror = 1,
magenta = 2,
cyan = 3,
white = 4,
glass = 5,
red_glass = 6,
reflective_blue = 7,
white_light = 8,
emerald = 9,
yellow = 10,
green_light = 11,
};
struct MaterialData
{
float3 color; //it either is a static color or gets calculated with the location and normal
float specularity; //1.0 = 100% reflective
float transparent; // 1 if not transparent at all, 0 if completely transparent, this has to do with beers law
float refractive_index;
bool isLight;
MaterialData(
float3 color,
float specularity,
float transparent=1,
float refractive_index=0,
bool isLight=false
);
};
const uint MATERIALCOUNT = 12;
const MaterialData materials[MATERIALCOUNT] = {
MaterialData(float3(1.f,0.f,0.f), 0.0f),
MaterialData(float3(1.f,1.f,1.f), 1.0f),
MaterialData(float3(0.212f,0.263f,0.f), 0.0f),
MaterialData(float3(0.1f,1.f,1.f), 0.1f),
MaterialData(float3(1.f,1.f,1.f), 0.0f),
MaterialData(float3(1.f,1.f,1.f), 0.0f, 0.f, 1.5f), //glass
MaterialData(float3(0.878f,0.066f,0.373f), 0.0f, 0.7f, 1.2f),
MaterialData(float3(0.1f,0.6f,0.9f), 0.9f),
MaterialData(float3(10.f,10.f,10.f), 0.0f, 1.f,0.f, true),
MaterialData(float3(0.314f,0.784f,0.471f), 0.0f, 0.3f, 1.57f),
MaterialData(float3(0.878, 0.906, 0.133), 0.f),
MaterialData(float3(6.6, 8.59, 1.18), 0.f, 1, 0, true),
};
Material get_random_material();