Skip to content

Commit

Permalink
MODERN: Apply alpha after fog.
Browse files Browse the repository at this point in the history
  • Loading branch information
dsvensson committed Jan 19, 2025
1 parent 96b8d61 commit a6cd1de
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/glsl/draw_world.fragment.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -255,5 +255,7 @@ void main()
#ifdef DRAW_FOG
frag_colour = applyFog(frag_colour, gl_FragCoord.z / gl_FragCoord.w);
#endif

frag_colour *= alpha;
}
}

0 comments on commit a6cd1de

Please sign in to comment.