-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathShaderVariables.h
49 lines (37 loc) · 1.45 KB
/
ShaderVariables.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
//
// Created by jeff2310 on 4/25/18.
//
#ifndef VKSOFTWARERENDER_SHADERVARIABLES_H
#define VKSOFTWARERENDER_SHADERVARIABLES_H
namespace VkRenderer {
class PhongConstants {
public:
const float ambient;
const float diffuse;
const float specular;
int shiniess;
Vector lightPos;
const Color lightColor;
PhongConstants() : ambient(1.0f), diffuse(1.0f), specular(1.0f), shiniess(16), lightPos(),
lightColor() {}
PhongConstants(float _ambient, float _diffuse, float _specular, int _shiniess, const Vector &_lightPos,
const Color &_lightColor) : ambient(_ambient), diffuse(_diffuse),
specular(_specular), shiniess(_shiniess),
lightPos(_lightPos),
lightColor(_lightColor) {}
};
class PhongVariables {
public:
Vector fragPos;
PhongVariables() : fragPos(0.0f, 0.0f, 0.0f) {}
PhongVariables(Vector _pos) : fragPos(_pos) {}
static PhongVariables
variablesInterp(const PhongVariables &v1, const PhongVariables &v2, float world_t) {
PhongVariables v;
v.fragPos = interp(v1.fragPos, v2.fragPos, world_t);
return v;
}
};
extern PhongConstants normalPhongConstants;
}
#endif //VKSOFTWARERENDER_SHADERVARIABLES_H