Working directional light

This commit is contained in:
Tleety
2016-01-19 12:32:34 +01:00
parent 4b29d48f27
commit 46e17b7e0d
6 changed files with 27 additions and 29 deletions
@@ -15,7 +15,9 @@ struct DirectionalLightJob : RenderJob
DirectionalLightJob(ComponentWrapper transformComponent, ComponentWrapper directionalLightComponent, World* m_World)
: RenderJob()
{
Direction = glm::vec4((glm::vec3)directionalLightComponent["Direction"], 0.f);
Direction = glm::vec4(0,0,-1,0) * Transform::AbsoluteOrientation(m_World, transformComponent.EntityID);
//Direction = glm::vec4((glm::vec3)directionalLightComponent["Direction"], 0.f);
Color = (glm::vec4)directionalLightComponent["Color"];
Intensity = (double)directionalLightComponent["Intensity"];
};
+5 -5
View File
@@ -46,8 +46,8 @@ private:
int m_NumberOfTiles = 0;
struct Plane {
glm::vec3 Normal;
float d;
glm::vec3 Normal = glm::vec3(0.f);
float d = 0;
};
struct Frustum {
@@ -68,9 +68,9 @@ private:
std::vector<LightSource> m_LightSources;
struct LightGrid {
float Start;
float Amount;
glm::vec2 Padding;
float Start = 0;
float Amount = 0;
glm::vec2 Padding = glm::vec2(1.f, 2.f);
};
LightGrid* m_LightGrid;