-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathShaderData.h
53 lines (46 loc) · 1.11 KB
/
ShaderData.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
/*
* File: ShaderData.h
* Author: swl
*
* Created on February 6, 2016, 10:02 AM
*/
#ifndef SHADERDATA_H
#define SHADERDATA_H
#include "ShaderUtils.h"
#include <glm/glm.hpp>
#include "tiny_obj_loader.h"
class ShaderData
{
public:
virtual void loadData(const tinyobj::material_t& mat,
const std::string& mtl_base_path){}
virtual void send2shader(GLuint shaderProgID) const {}
virtual bool transparent() const { return false; }
};
class ShaderDataPhong : public ShaderData
{
protected:
unsigned outputID;
glm::vec3 ka;
glm::vec3 kd;
glm::vec3 ks;
float d;
float s;
GLuint diffTexID;
public:
void send2shader(GLuint shaderProgID) const;
void loadData(const tinyobj::material_t& mat,
const std::string& mtl_base_path);
virtual bool transparent() const { return d < 1; }
};
class ShaderDataBRDF : public ShaderData
{
protected:
unsigned outputID;
GLuint brdfTexID;
public:
void send2shader(GLuint shaderProgID) const;
void loadData(const tinyobj::material_t& mat,
const std::string& mtl_base_path);
};
#endif /* SHADERDATA_H */