Improve multi-bounce irradiance lighting by limiting the diffuse color intensity

This commit is contained in:
Wojciech Figat
2022-05-26 15:09:37 +02:00
parent e6a06832bf
commit c2082925c7

View File

@@ -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