Pointlights are now using the pointlight component and the Light renderqueue to draw.

This commit is contained in:
Tleety
2016-01-08 14:12:09 +01:00
parent 25a99a04c5
commit dab4ba2164
5 changed files with 67 additions and 19 deletions
+2 -3
View File
@@ -17,6 +17,7 @@ public:
void GenerateNewFrustum();
void CullLights();
void FillLightList(RenderQueueCollection& rq);
GLuint FrustumSSBO() const { return m_FrustumSSBO; }
GLuint LightSSBO() const { return m_LightSSBO; }
@@ -49,8 +50,6 @@ private:
};
Frustum m_Frustums[80*45]; //TODO: Renderer: Make this change with resolution
void TEMPCreateLights();
//This should be a component
struct PointLight {
glm::vec4 Position = glm::vec4(0.f);
@@ -60,7 +59,7 @@ private:
float Falloff = 0.3f;
float Padding = 1337;
};
PointLight m_PointLights[NUM_LIGHTS];
std::vector<PointLight> m_PointLights;
struct LightGrid {
float Start;
+6 -5
View File
@@ -82,11 +82,12 @@ struct SpriteJob : RenderJob
struct PointLightJob : RenderJob
{
glm::vec3 Position;
glm::vec3 SpecularColor = glm::vec3(1, 1, 1);
glm::vec3 DiffuseColor = glm::vec3(1, 1, 1);
float Radius = 1.f;
float Intensity = 0.8f;
glm::vec4 Position;
glm::vec4 Color;
float Radius;
float Intensity;
float Falloff;
float padding = 123;
void CalculateHash() override
{