From 5d6d0f82b9e733c86bdb0bca7721734fcf6471fa Mon Sep 17 00:00:00 2001 From: Tleety Date: Tue, 19 Jan 2016 16:48:59 +0100 Subject: [PATCH] Removed some debug code --- resources/Shaders/ForwardPlus.frag.glsl | 18 +++++++++++------- src/Engine/Rendering/LightCullingPass.cpp | 2 -- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/resources/Shaders/ForwardPlus.frag.glsl b/resources/Shaders/ForwardPlus.frag.glsl index e67a4d5d..78a2125e 100644 --- a/resources/Shaders/ForwardPlus.frag.glsl +++ b/resources/Shaders/ForwardPlus.frag.glsl @@ -114,12 +114,13 @@ void main() int start = int(LightGrids.Data[currentTile].Start); int amount = int(LightGrids.Data[currentTile].Amount); - //for(int i = 0; i < 3; i++) + for(int i = start; i < start + amount; i++) { + int l = int(LightIndex[i]); LightSource light = LightSources.List[l]; - LightResult result; + LightResult result; if(light.Type == 1) { // point result = CalcPointLightSource(V * light.Position, light.Radius, light.Color, light.Intensity, viewVec, position, normal, light.Falloff); } else if (light.Type == 2) { //Directional @@ -136,12 +137,15 @@ void main() //fragmentColor += Input.DiffuseColor + vec4(0.0, LightGrids.Data[currentTile].Amount/3, 0, 1); //fragmentColor = texel * Input.DiffuseColor * Color; //fragmentColor += vec4(currentTile/3600.f, 0, 0, 1); - if(int(gl_FragCoord.x)%16 == 0 || int(gl_FragCoord.y)%16 == 0 ) { - //fragmentColor += vec4(0.5, 0, 0, 0); - } else { - //fragmentColor += vec4(LightGrids.Data[int(tilePos.x + tilePos.y*80)].Amount/3.0, 0, 0, 1); - } + //Tiled Debug Code + /* + if(int(gl_FragCoord.x)%16 == 0 || int(gl_FragCoord.y)%16 == 0 ) { + fragmentColor += vec4(0.5, 0, 0, 0); + } else { + fragmentColor += vec4(LightGrids.Data[int(tilePos.x + tilePos.y*80)].Amount/LightSources.List.length(), 0, 0, 1); + } + */ } diff --git a/src/Engine/Rendering/LightCullingPass.cpp b/src/Engine/Rendering/LightCullingPass.cpp index 2a2e2383..a68fe4d1 100644 --- a/src/Engine/Rendering/LightCullingPass.cpp +++ b/src/Engine/Rendering/LightCullingPass.cpp @@ -95,7 +95,6 @@ void LightCullingPass::FillLightList(RenderScene& scene) //p.Padding = 123.f; p.Type = LightSource::Point; m_LightSources.push_back(p); - } } for(auto &job : scene.DirectionalLightJobs) { @@ -107,7 +106,6 @@ void LightCullingPass::FillLightList(RenderScene& scene) p.Intensity = directionalLightJob->Intensity; p.Type = LightSource::Directional; m_LightSources.push_back(p); - } } }