From a6cd1de5ea15a23a03c428cccf93a8a75929ad7a Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Sun, 19 Jan 2025 11:05:57 +0100 Subject: [PATCH] MODERN: Apply alpha after fog. --- src/glsl/draw_world.fragment.glsl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/glsl/draw_world.fragment.glsl b/src/glsl/draw_world.fragment.glsl index 08b15228a..4a2d4d2f1 100644 --- a/src/glsl/draw_world.fragment.glsl +++ b/src/glsl/draw_world.fragment.glsl @@ -233,11 +233,11 @@ void main() texColor = vec4(mix(texColor.rgb, texColor.rgb + lumaColor.rgb, min(1, Flags & EZQ_SURFACE_HAS_LUMA)), texColor.a); #endif texColor = applyColorTinting(texColor); - frag_colour = vec4(lmColor.rgb * alpha, alpha) * texColor; + frag_colour = vec4(lmColor.rgb, 1) * texColor; #if defined(DRAW_LUMA_TEXTURES) && defined(DRAW_LUMA_TEXTURES_FB) lumaColor = applyColorTinting(lumaColor); frag_colour = vec4(mix(frag_colour.rgb, frag_colour.rgb + lumaColor.rgb, min(1, Flags & EZQ_SURFACE_HAS_LUMA)), frag_colour.a); - frag_colour = vec4(mix(frag_colour.rgb, lumaColor.rgb * alpha, min(1, Flags & EZQ_SURFACE_HAS_FB) * lumaColor.a), frag_colour.a); + frag_colour = vec4(mix(frag_colour.rgb, lumaColor.rgb, min(1, Flags & EZQ_SURFACE_HAS_FB) * lumaColor.a), frag_colour.a); #elif !defined(DRAW_LUMA_TEXTURES) && defined(DRAW_LUMA_TEXTURES_FB) // GL_DECAL lumaColor = applyColorTinting(lumaColor); @@ -255,5 +255,7 @@ void main() #ifdef DRAW_FOG frag_colour = applyFog(frag_colour, gl_FragCoord.z / gl_FragCoord.w); #endif + + frag_colour *= alpha; } }