From 793c2b5611002552488dad8b84deaeb9ebe984b5 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Thu, 12 Mar 2026 21:52:00 -0700 Subject: [PATCH] fix: remove incorrect Y-flip in postprocess vertex shader postprocess.vert.glsl had `TexCoord.y = 1.0 - TexCoord.y` which inverted the vertical sampling of the scene texture. Vulkan textures use v=0 at the top, matching framebuffer row 0, so no flip is needed. The camera already flips the projection matrix (mat[1][1] *= -1) so the scene is rendered correctly oriented; the extra inversion in the postprocess pass flipped FXAA output upside down. Fixes: FXAA shows camera upside down Also fixes: FSR1 upscale and FSR3 sharpen passes (same vertex shader) --- assets/shaders/postprocess.vert.glsl | 4 +++- assets/shaders/postprocess.vert.spv | Bin 1340 -> 932 bytes 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/assets/shaders/postprocess.vert.glsl b/assets/shaders/postprocess.vert.glsl index aa78b1b5..2ed8f784 100644 --- a/assets/shaders/postprocess.vert.glsl +++ b/assets/shaders/postprocess.vert.glsl @@ -6,5 +6,7 @@ void main() { // Fullscreen triangle trick: 3 vertices, no vertex buffer TexCoord = vec2((gl_VertexIndex << 1) & 2, gl_VertexIndex & 2); gl_Position = vec4(TexCoord * 2.0 - 1.0, 0.0, 1.0); - TexCoord.y = 1.0 - TexCoord.y; // flip Y for Vulkan + // No Y-flip: scene textures use Vulkan convention (v=0 at top), + // and NDC y=-1 already maps to framebuffer top, so the triangle + // naturally samples the correct row without any inversion. } diff --git a/assets/shaders/postprocess.vert.spv b/assets/shaders/postprocess.vert.spv index afc10472a717a27b5271a74a49ea7de1c07bbc28..89065a80956cae9eb53207486ec177dc883898cb 100644 GIT binary patch delta 85 zcmdnPwS=9QnMs+Qfq{{Mn}L@>XCiO#<_5+mjDk80tPDV525lf#0^!Mp%;~(xfudYM eo(K^0PX5XqJvoI%fKhvLDN8!XU!WNlKnwsnG!6Cu delta 490 zcmYjO%SyvQ6un8BRHIo)-G~$)S^C@*+$czuAQW1tx)F&b8N$FgDM>2TO&5NF^N)FFtUJP_3rrHK!|4JMw^)K3Bo7~~;_S^6_vCR$&b~@#inKX~VxTqQcwxCap z&GjmC<(GN0(gTB+CLh>llv`HA@XMB!+?_(>e!Bp_%NoEP9h`dr^Uv^by$^7n`C0A& R_gU@)Q*q6{AN<%O;1}3?P~iXo