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 +}