forked from apurvsinghdark/GraphicProgramming
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Material.h
57 lines (48 loc) · 1013 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
52
53
54
55
56
57
#pragma once
#include<glew.h>
#include<glfw3.h>
#include"Shader.h"
class Material
{
private:
glm::vec3 ambident;
glm::vec3 diffuse;
glm::vec3 specular;
GLint diffuseTex;
GLint specularTex;
public:
Material(
glm::vec3 ambident,
glm::vec3 diffuse,
glm::vec3 specular,
GLint diffuseTex,
GLint specularTex
);
~Material();
void SendToShader(Shader& program);
};
Material::Material(
glm::vec3 ambident,
glm::vec3 diffuse,
glm::vec3 specular,
GLint diffuseTex,
GLint specularTex
)
{
this->ambident = ambident;
this->diffuse = diffuse;
this->specular = specular;
this->diffuseTex = diffuseTex;
this->specularTex = specularTex;
}
Material::~Material()
{
}
void Material::SendToShader(Shader& program)
{
program.SetVec3("material.ambident", this->ambident);
program.SetVec3("material.diffuse", this->diffuse);
program.SetVec3("material.specular", this->specular);
program.SetVec1i("material.diffuseTex", this->diffuseTex);
program.SetVec1i("material.specularTex", this->specularTex);
}