47 lines
799 B
C++
47 lines
799 B
C++
#ifndef PHONGMATERIAL_H
|
|
#define PHONGMATERIAL_H
|
|
|
|
#include "material.h"
|
|
#include "glm/vec3.hpp"
|
|
|
|
class Texture;
|
|
|
|
class PhongMaterial : public Material
|
|
{
|
|
public:
|
|
glm::vec3 emission;
|
|
glm::vec3 diffuse;
|
|
glm::vec3 specular;
|
|
float shininess;
|
|
Texture* diffuse_texture;
|
|
Texture* normal_map;
|
|
|
|
PhongMaterial() :
|
|
emission(0),
|
|
diffuse(0.5f),
|
|
specular(0.5f),
|
|
shininess(10),
|
|
diffuse_texture(NULL),
|
|
normal_map(NULL)
|
|
{
|
|
updateShader();
|
|
}
|
|
PhongMaterial(glm::vec3 myKd, glm::vec3 myKs, float myNs) :
|
|
emission(0),
|
|
diffuse(myKd),
|
|
specular(myKs),
|
|
shininess(myNs),
|
|
diffuse_texture(NULL),
|
|
normal_map(NULL)
|
|
{
|
|
updateShader();
|
|
}
|
|
virtual void bindAttributes();
|
|
|
|
void setTexture(Texture* myTexture);
|
|
|
|
void updateShader();
|
|
};
|
|
|
|
#endif // PHONGMATERIAL_H
|