-
Notifications
You must be signed in to change notification settings - Fork 0
/
Lighting.h
63 lines (45 loc) · 1.25 KB
/
Lighting.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
51
52
53
54
55
56
57
58
59
60
61
62
63
#pragma once
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
class Lighting {
struct Direction_Light {
bool status;
glm::vec3 direction;
glm::vec4 ambient;
glm::vec4 diffuse;
glm::vec4 specular;
};
struct Point_Light {
bool status;
glm::vec3 position;
float constant;
float linear;
float quadratic;
glm::vec4 ambient;
glm::vec4 diffuse;
glm::vec4 specular;
};
public:
Direction_Light direction_light;
Point_Light point_light;
Lighting() {
}
~Lighting() {}
void init()
{
direction_light.status = true;
direction_light.direction = glm::vec3(-1.0f, -1.0f, -1.0f);
direction_light.ambient = glm::vec4(0.5f, 0.5f, 0.5f, 1.0f);
direction_light.diffuse = glm::vec4(0.6f, 0.6f, 0.6f, 1.0f);
direction_light.specular = glm::vec4(0.0f, 0.0f, 0.0f, 1.0f);
point_light.status = true;
point_light.position = glm::vec3(1.2f, 1.0f, 2.0f);
point_light.ambient = glm::vec4(0.1f, 0.1f, 0.1f, 1.0f);
point_light.diffuse = glm::vec4(1.0f, 1.0f, 1.0f, 1.0f);
point_light.specular = glm::vec4(1.0f, 1.0f, 1.0f, 1.0f);
point_light.constant = 1.0f;
point_light.linear = 0.09f;
point_light.quadratic = 0.032f;
};
};