From 9de74f4d61f1a27b9dd32be278cb7e404ed7e4a6 Mon Sep 17 00:00:00 2001 From: hunterk Date: Tue, 25 Oct 2022 21:50:03 -0500 Subject: [PATCH] fix weird coord behavior on vulkan (#324) --- vhs/shaders/vhs_font.slang | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/vhs/shaders/vhs_font.slang b/vhs/shaders/vhs_font.slang index c436afa..d2c9f05 100644 --- a/vhs/shaders/vhs_font.slang +++ b/vhs/shaders/vhs_font.slang @@ -259,19 +259,15 @@ int[] font = int[]( layout(location = 0) in vec4 Position; layout(location = 1) in vec2 TexCoord; layout(location = 0) out vec2 vTexCoord; -layout(location = 1) out vec2 flipcoord; void main() { - vec4 pos = vec4(Position.x, 1.0 - Position.y, Position.z, Position.w); - gl_Position = global.MVP * pos; + gl_Position = global.MVP * Position; vTexCoord = TexCoord; - flipcoord = vec2(vTexCoord.x, 1.0 - vTexCoord.y); } #pragma stage fragment layout(location = 0) in vec2 vTexCoord; -layout(location = 1) in vec2 flipcoord; layout(location = 0) out vec4 FragColor; layout(set = 0, binding = 2) uniform sampler2D Source; @@ -337,10 +333,10 @@ vec2 warp(vec2 uv){ void main() { - vec2 uv = warp(flipcoord); + vec2 uv = warp(vTexCoord); vec2 p = uv.xy * vec2(300.,225.);//vec2(fragCoord.x, iResolution.y - fragCoord.y) / 2.; - vec4 t = texture(iChannel0, flipcoord); + vec4 t = texture(iChannel0, vTexCoord); float timer = (params.FrameDirection > 0.5) ? float(params.FrameCount) : 0.0; int acc = 0;