From 0b33b2cf9ceadb30da6f9eea7ba196f3f4b9e37a Mon Sep 17 00:00:00 2001 From: hizzlekizzle Date: Tue, 18 Apr 2023 08:27:18 -0500 Subject: [PATCH] add img-flip param to metaCRT for use with hardware-rendered cores --- crt/shaders/metacrt/Image.slang | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crt/shaders/metacrt/Image.slang b/crt/shaders/metacrt/Image.slang index fed304d..1e6a031 100644 --- a/crt/shaders/metacrt/Image.slang +++ b/crt/shaders/metacrt/Image.slang @@ -6,6 +6,7 @@ layout(push_constant) uniform Push vec4 OriginalSize; vec4 OutputSize; uint FrameCount; + float flip_image; } params; #define vFragCoord vTexCoord.xy * params.OutputSize.xy @@ -18,6 +19,8 @@ layout(push_constant) uniform Push #define vFragColor FragColor #define fragColor FragColor +#pragma parameter flip_image "Flip Image (for hardware-rendered cores)" 0.0 0.0 1.0 1.0 + layout(std140, set = 0, binding = 0) uniform UBO { mat4 MVP; @@ -31,7 +34,7 @@ layout(location = 0) out vec2 vTexCoord; void main() { gl_Position = global.MVP * Position; - vTexCoord = TexCoord; + vTexCoord = (bool(params.flip_image)) ? vec2(TexCoord.x, 1.0 - TexCoord.y) : TexCoord.xy; } #pragma stage fragment @@ -385,4 +388,4 @@ void main() fragColor.rgb = Tonemap( fragColor.rgb ); fragColor.a = 1.0; -} \ No newline at end of file +}