53 lines
913 B
C++
53 lines
913 B
C++
#ifndef LIGHTING_H
|
|
#define LIGHTING_H
|
|
|
|
namespace djalim {
|
|
class ShaderProgram;
|
|
}
|
|
|
|
#include "Camera.h"
|
|
#include <glm/glm.hpp>
|
|
|
|
struct DirectionalLight {
|
|
glm::vec3 direction;
|
|
glm::vec3 ambient;
|
|
glm::vec3 diffuse;
|
|
glm::vec3 specular;
|
|
};
|
|
|
|
struct PointLight {
|
|
glm::vec3 position;
|
|
glm::vec3 ambient;
|
|
glm::vec3 diffuse;
|
|
glm::vec3 specular;
|
|
float constant;
|
|
float linear;
|
|
float exponent;
|
|
};
|
|
|
|
struct SpotLight {
|
|
glm::vec3 position;
|
|
glm::vec3 direction;
|
|
glm::vec3 ambient;
|
|
glm::vec3 diffuse;
|
|
glm::vec3 specular;
|
|
float cosInnerCone;
|
|
float cosOuterCone;
|
|
float constant;
|
|
float linear;
|
|
float exponent;
|
|
bool on;
|
|
};
|
|
|
|
class Lighting {
|
|
public:
|
|
Lighting();
|
|
void update(djalim::ShaderProgram& shader, FPSCamera& camera);
|
|
|
|
DirectionalLight sunLight;
|
|
PointLight pointLights[3];
|
|
SpotLight spotLight;
|
|
};
|
|
|
|
#endif // LIGHTING_H
|