diff --git a/Nuake/src/Rendering/SceneRenderer.cpp b/Nuake/src/Rendering/SceneRenderer.cpp index a74e2dcb..b6bcc725 100644 --- a/Nuake/src/Rendering/SceneRenderer.cpp +++ b/Nuake/src/Rendering/SceneRenderer.cpp @@ -1001,13 +1001,16 @@ namespace Nuake { auto [transform, light, parent] = view.get(l); - if (light.Type == Directional && light.SyncDirectionWithSky) + if (light.Type == Directional) { - light.Direction = env->ProceduralSkybox->GetSunDirection(); - } - else - { - light.Direction = transform.GetGlobalRotation() * Vector3(0, 0, 1); + if (light.SyncDirectionWithSky) + { + light.Direction = env->ProceduralSkybox->GetSunDirection(); + } + else + { + light.Direction = transform.GetGlobalRotation() * Vector3(0, 0, 1); + } } Vector3 lightPosition = transform.GetGlobalPosition(); diff --git a/Resources/Shaders/deferred.shader b/Resources/Shaders/deferred.shader index ad673035..3ae1f981 100644 --- a/Resources/Shaders/deferred.shader +++ b/Resources/Shaders/deferred.shader @@ -309,7 +309,7 @@ void main() if(u_DirectionalLight.Shadow > 0.1f) { - shadow = ShadowCalculation(worldPos, N); + shadow += ShadowCalculation(worldPos, N); } vec3 radiance = u_DirectionalLight.Color * attenuation * shadow;