From 5d107ecc49e061a8b90fffe7af4b8bd6dacffa71 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Tue, 24 Oct 2023 17:08:17 +0200 Subject: [PATCH] Apply lightmap --- wadsrc/static/shaders/scene/frag_main.glsl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wadsrc/static/shaders/scene/frag_main.glsl b/wadsrc/static/shaders/scene/frag_main.glsl index f434f61f2..ee1592833 100644 --- a/wadsrc/static/shaders/scene/frag_main.glsl +++ b/wadsrc/static/shaders/scene/frag_main.glsl @@ -2,11 +2,12 @@ void main() { #ifdef USE_LEVELMESH - FragColor.rgb = texture(tex, vTexCoord.st).rgb * (uLightLevel / 255.0); + vec3 mat = texture(tex, vTexCoord.st).rgb; + FragColor.rgb = mat * (uLightLevel / 255.0); FragColor.a = 1.0; if (vLightmap.z >= 0.0) { - FragColor.rgb *= texture(LightMap, vLightmap).rgb; + FragColor.rgb += mat * texture(LightMap, vLightmap).rgb; } #else