From 73a64112ce24e0ac629d5600e66d1b456183ab3a Mon Sep 17 00:00:00 2001 From: Xonk Date: Wed, 22 May 2024 00:30:35 -0400 Subject: [PATCH] fix minimum light not working when SSGI/RTAO is enabled --- shaders/lib/indirect_lighting_effects.glsl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/shaders/lib/indirect_lighting_effects.glsl b/shaders/lib/indirect_lighting_effects.glsl index b5cb3df..db8d207 100644 --- a/shaders/lib/indirect_lighting_effects.glsl +++ b/shaders/lib/indirect_lighting_effects.glsl @@ -320,7 +320,8 @@ void ApplySSRT( // rgb = torch color * lightmap. a = sky lightmap. vec4 Lighting = RT_AmbientLight(playerPos, lpvPos, Exposure, lightmaps, torchcolor); - skylightcolor = skylightcolor * ambient_brightness * Lighting.a; + // skylightcolor = skylightcolor * ambient_brightness * Lighting.a; + skylightcolor = max(skylightcolor * ambient_brightness * Lighting.a, vec3(1.0) * (MIN_LIGHT_AMOUNT*0.01 + nightVision)); for (int i = 0; i < nrays; i++){ int seed = (frameCounter%40000)*nrays+i; @@ -339,9 +340,9 @@ void ApplySSRT( // rayDir.y = mix(-1.0, rayDir.y, lightmaps.y*lightmaps.y); - skycontribution = ((skyCloudsFromTexLOD(rayDir, colortex4, 0).rgb / 30.0) * 2.5 * ambient_brightness) * Lighting.a + Lighting.rgb; + skycontribution = ((skyCloudsFromTexLOD(rayDir, colortex4, 0).rgb / 30.0) * 2.5 * ambient_brightness) * Lighting.a + skylightcolor*(1-Lighting.a) + Lighting.rgb; #else - skycontribution = ((skyCloudsFromTexLOD2(rayDir, colortex4, 6).rgb / 30.0) * 2.5 * ambient_brightness) * Lighting.a + Lighting.rgb; + skycontribution = ((skyCloudsFromTexLOD2(rayDir, colortex4, 6).rgb / 30.0) * 2.5 * ambient_brightness) * Lighting.a + skylightcolor*(1-Lighting.a) + Lighting.rgb; #endif #else