-
Notifications
You must be signed in to change notification settings - Fork 24
/
Material.h
51 lines (44 loc) · 957 Bytes
/
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
41
42
43
44
45
46
47
48
49
50
51
#pragma once
#include<glew.h>
#include<glfw3.h>
#include<glm.hpp>
#include<vec2.hpp>
#include<vec3.hpp>
#include<vec4.hpp>
#include<mat4x4.hpp>
#include<gtc\type_ptr.hpp>
#include"Shader.h"
class Material
{
private:
glm::vec3 ambient;
glm::vec3 diffuse;
glm::vec3 specular;
GLint diffuseTex;
GLint specularTex;
public:
Material(
glm::vec3 ambient,
glm::vec3 diffuse,
glm::vec3 specular,
GLint diffuseTex,
GLint specularTex
)
{
this->ambient = ambient;
this->diffuse = diffuse;
this->specular = specular;
this->diffuseTex = diffuseTex;
this->specularTex = specularTex;
}
~Material(){}
//Function
void sendToShader(Shader& program)
{
program.setVec3f(this->ambient, "material.ambient");
program.setVec3f(this->diffuse, "material.diffuse");
program.setVec3f(this->specular, "material.specular");
program.set1i(this->diffuseTex, "material.diffuseTex");
program.set1i(this->specularTex, "material.specularTex");
}
};