Fixed lights and added a bad gamma correction
This commit is contained in:
+19
-10
@@ -24,13 +24,7 @@ public:
|
||||
int HEIGHT, WIDTH;
|
||||
|
||||
std::list<std::tuple<Model*, glm::mat4, bool, bool>> ModelsToRender;
|
||||
int Lights;
|
||||
std::vector<glm::vec3> Light_position;
|
||||
std::vector<glm::vec3> Light_specular;
|
||||
std::vector<glm::vec3> Light_diffuse;
|
||||
std::vector<float> Light_specularExponent;
|
||||
|
||||
|
||||
|
||||
std::vector<float> Light_constantAttenuation;
|
||||
std::vector<float> Light_linearAttenuation;
|
||||
std::vector<float> Light_quadraticAttenuation;
|
||||
@@ -50,7 +44,8 @@ public:
|
||||
glm::vec3 _position,
|
||||
glm::vec3 _specular,
|
||||
glm::vec3 _diffuse,
|
||||
float _specularExponent
|
||||
float _specularExponent,
|
||||
float _scale
|
||||
);
|
||||
void AddAABBToDraw(glm::vec3 origin, glm::vec3 volumeVector, bool colliding);
|
||||
|
||||
@@ -72,6 +67,21 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
struct Light
|
||||
{
|
||||
glm::vec3 Position;
|
||||
glm::vec3 Specular;
|
||||
glm::vec3 Diffuse;
|
||||
float SpecularExponent;
|
||||
float Scale;
|
||||
glm::mat4 SphereModelMatrix;
|
||||
};
|
||||
|
||||
float Gamma;
|
||||
|
||||
std::list<Light> Lights;
|
||||
|
||||
GLFWwindow* m_Window;
|
||||
GLint m_glVersion[2];
|
||||
GLchar* m_glVendor;
|
||||
@@ -101,7 +111,6 @@ private:
|
||||
|
||||
GLuint m_fDepthBuffer;
|
||||
GLenum draw_bufs[2];
|
||||
glm::mat4 lM[5];
|
||||
GLuint m_ScreenQuad;
|
||||
Model* m_sphereModel;
|
||||
|
||||
@@ -133,7 +142,7 @@ private:
|
||||
void DrawFBOScene();
|
||||
void DrawLightScene();
|
||||
void BindFragDataLocation();
|
||||
void CreateLightMatrix();
|
||||
glm::mat4 CreateLightMatrix(Light &_light);
|
||||
|
||||
GLuint CreateQuad();
|
||||
void DrawDebugShadowMap();
|
||||
|
||||
Reference in New Issue
Block a user