From c2082925c703c8dafe16bf663e4b222e4902a16f Mon Sep 17 00:00:00 2001 From: Wojciech Figat Date: Thu, 26 May 2022 15:09:37 +0200 Subject: [PATCH] Improve multi-bounce irradiance lighting by limiting the diffuse color intensity --- Source/Shaders/GI/GlobalSurfaceAtlas.shader | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Shaders/GI/GlobalSurfaceAtlas.shader b/Source/Shaders/GI/GlobalSurfaceAtlas.shader index 83707ac38..c917583d7 100644 --- a/Source/Shaders/GI/GlobalSurfaceAtlas.shader +++ b/Source/Shaders/GI/GlobalSurfaceAtlas.shader @@ -120,6 +120,7 @@ float4 PS_Lighting(AtlasVertexOutput input) : SV_Target // Calculate lighting float3 diffuseColor = GetDiffuseColor(gBuffer); + diffuseColor = min(diffuseColor, 0.9f); // Nothing reflects diffuse like perfectly in the real world (ensure to have energy loss at each light bounce) float3 diffuse = Diffuse_Lambert(diffuseColor); float4 light = float4(diffuse * irradiance, 1); #else