mirror of
https://github.com/italicsjenga/slang-shaders.git
synced 2024-11-22 15:51:30 +11:00
add img-flip param to metaCRT
for use with hardware-rendered cores
This commit is contained in:
parent
5cc1d51b8e
commit
0b33b2cf9c
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue