53 lines
1.1 KiB
C++
53 lines
1.1 KiB
C++
#ifndef PHONGMATERIAL_H
|
|
#define PHONGMATERIAL_H
|
|
|
|
#include "material.h"
|
|
#include "glm/vec3.hpp"
|
|
#include <string>
|
|
|
|
class Texture;
|
|
|
|
struct PBRMaterial : public Material
|
|
{
|
|
enum TextureSlots
|
|
{
|
|
ALBEDO_SLOT,
|
|
EMISSION_SLOT,
|
|
NORMALS_SLOT,
|
|
ROUGHNESS_SLOT,
|
|
METALLIC_SLOT,
|
|
ALPHA_SLOT,
|
|
NB_PBR_SLOTS
|
|
};
|
|
|
|
glm::vec3 emission;
|
|
glm::vec3 albedo;
|
|
float roughness;
|
|
float metallic;
|
|
float opacity;
|
|
Texture* textures[NB_PBR_SLOTS];
|
|
std::string textureNames[NB_PBR_SLOTS];
|
|
|
|
PBRMaterial() :
|
|
emission(0),
|
|
albedo(0.9f),
|
|
roughness(0.8f),
|
|
metallic(0.2),
|
|
opacity(1.f)
|
|
{
|
|
for(int i=0; i<NB_PBR_SLOTS; ++i)
|
|
textures[i] = NULL;
|
|
}
|
|
|
|
void setTexture(TextureSlots slot, Texture* texture = NULL, const std::string &name = "")
|
|
{ textures[slot] = texture; textureNames[slot] = name; }
|
|
|
|
virtual ~PBRMaterial() {}
|
|
|
|
virtual void bindAttributes(Shader* myShader);
|
|
|
|
virtual unsigned int getFlags();
|
|
};
|
|
|
|
#endif // PHONGMATERIAL_H
|