From 3b2507d072c080ec8ea49b8775f4cebfc15acfe5 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Thu, 6 Apr 2023 21:03:05 +0200 Subject: [PATCH] Fix the clear screen shader bug Fix texture set layout not matching the c++ code's version (vulkan validation error) --- wadsrc/static/shaders/scene/frag_main.glsl | 2 ++ wadsrc/static/shaders/scene/layout_shared.glsl | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/wadsrc/static/shaders/scene/frag_main.glsl b/wadsrc/static/shaders/scene/frag_main.glsl index 03c04261d..edaef7a9f 100644 --- a/wadsrc/static/shaders/scene/frag_main.glsl +++ b/wadsrc/static/shaders/scene/frag_main.glsl @@ -17,8 +17,10 @@ void main() float gray = grayscale(frag); vec4 cm = (uObjectColor + gray * (uAddColor - uObjectColor)) * 2; frag = vec4(clamp(cm.rgb, 0.0, 1.0), frag.a); + frag *= vColor; frag.rgb = frag.rgb + uFogColor.rgb; #else + frag *= vColor; frag.rgb = frag.rgb + uFogColor.rgb; #endif #else diff --git a/wadsrc/static/shaders/scene/layout_shared.glsl b/wadsrc/static/shaders/scene/layout_shared.glsl index a51340a50..714a2aa13 100644 --- a/wadsrc/static/shaders/scene/layout_shared.glsl +++ b/wadsrc/static/shaders/scene/layout_shared.glsl @@ -95,7 +95,6 @@ layout(set = 2, binding = 7) uniform sampler2D texture8; layout(set = 2, binding = 8) uniform sampler2D texture9; layout(set = 2, binding = 9) uniform sampler2D texture10; layout(set = 2, binding = 10) uniform sampler2D texture11; -layout(set = 2, binding = 11) uniform sampler2D texture12; // This must match the PushConstants struct layout(push_constant) uniform PushConstants