-
Notifications
You must be signed in to change notification settings - Fork 1
/
material.h
40 lines (30 loc) · 1.03 KB
/
material.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
#pragma once
#include "light.h"
class Material {
public:
Material() : specular(0.f), diffuse(0.f), color(Color(1.f, 0.f, 0.f)), reflectiveIndex(0.f) {
}
Material(float specular, float diffuse, Color color, float reflectiveIndex, float transparency) :
specular(specular), diffuse(diffuse), color(color), reflectiveIndex(reflectiveIndex), transparency(transparency) {
}
float specular;
float diffuse;
Color color;
float reflectiveIndex;
float transparency;
static Material glass() {
return Material(0.9f, 0.1f, Color(1.f, 1.f, 1.f), 1.5f, 0.3f);
};
static Material redGlass() {
return Material(0.9f, 0.3f, Color(1.f, 0.f, 0.f), 1.5f, 0.3f);
};
static Material RedPlastic() {
return Material(0.8f, 1.f, Color(1.f, 0.2f, 0.2f), 0.f, 0.f);
};
static Material silver() {
return Material(0.8f, 1.f, Color(0.8f, 0.8f, 0.8f), 0.f, 0.f);
};
static Material concrete() {
return Material(1.f, 0.5f, Color(0.3f, 0.3f, 0.3f), 0.f, 0.f);
};
};