-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLight.h
More file actions
33 lines (29 loc) · 952 Bytes
/
Light.h
File metadata and controls
33 lines (29 loc) · 952 Bytes
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
#pragma once
#include <iostream>
#include "GL/glew.h"
#include "glm/glm.hpp"
#include "glm\gtc\matrix_transform.hpp"
#include "ShadowMap.h"
class Light
{
public:
//Constructors
Light();
Light(glm::vec4 AmbientLightParams, GLfloat DiffuseIntensity,GLuint SMapWidth,GLuint SMapHeight);
//Enables light during rendering and passes lighting information to shaders
//The proper way to implement this would probably be to create a virtual function here and make the children call it from the parent
virtual void UseLight(GLuint AmbientColorLocation, GLuint AmbientIntensityLocation,GLuint DiffuseIntensityUniformLocation);
virtual void CreateShadowMap();
virtual ShadowMap* GetShadowMap();
protected:
//Colour vector
glm::vec3 AmbientColour;
//Color Intensity
GLfloat AmbientIntensity;
//Directional light intensity
GLfloat DiffuseIntensity;
GLuint ShadowMapWidth;
GLuint ShadowMapHeight;
ShadowMap* sMap;
glm::mat4 LightProjection;
};