From 3f3f48eb6d07ea0a153dcf53d4679ca8aab4f589 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Sat, 12 Jul 2025 22:53:33 +0300 Subject: [PATCH] fix --- res/shaders/effects/deferred_lighting.glsl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/res/shaders/effects/deferred_lighting.glsl b/res/shaders/effects/deferred_lighting.glsl index 27488911..f8f10401 100644 --- a/res/shaders/effects/deferred_lighting.glsl +++ b/res/shaders/effects/deferred_lighting.glsl @@ -21,10 +21,14 @@ vec4 effect() { vec3 normal = transpose(mat3(u_view)) * texture(u_normal, v_uv).xyz; vec3 dir = modelpos.xyz - u_cameraPos; + float emission = texture(u_emission, v_uv).r; + #ifdef ENABLE_SHADOWS - light *= max(calc_shadow(modelpos, normal, length(pos)), texture(u_emission, v_uv).r); + light *= calc_shadow(modelpos, normal, length(pos)); #endif + light = max(light, emission); + vec3 fogColor = texture(u_skybox, dir).rgb; float fog = calc_fog(length(u_view * vec4((modelpos.xyz - u_cameraPos) * FOG_POS_SCALE, 0.0)) / 256.0); return vec4(mix(texture(u_screen, v_uv).rgb * mix(1.0, light, 1.0), fogColor, fog), 1.0);