mirror of
https://github.com/italicsjenga/slang-shaders.git
synced 2024-11-23 00:01:31 +11:00
commit
41f065993e
|
@ -12,8 +12,6 @@ layout(std140, set = 0, binding = 0) uniform UBO
|
|||
layout(location = 0) in vec4 Position;
|
||||
layout(location = 1) in vec2 TexCoord;
|
||||
layout(location = 0) out vec2 vTexCoord;
|
||||
layout(location = 2) out vec2 coords;
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
|
@ -53,7 +51,6 @@ void main()
|
|||
#pragma stage fragment
|
||||
layout(location = 0) in vec2 vTexCoord;
|
||||
layout(location = 1) in vec2 FragCoord;
|
||||
layout(location = 2) in vec2 coords;
|
||||
layout(location = 0) out vec4 FragColor;
|
||||
layout(set = 0, binding = 2) uniform sampler2D Source;
|
||||
|
||||
|
@ -128,7 +125,7 @@ void main()
|
|||
{
|
||||
vec2 dx = vec2(1.0 / global.SourceSize.x, 0.0);
|
||||
vec2 dy = vec2(0.0, 1.0 / global.SourceSize.y);
|
||||
vec2 pix_co = coords * global.SourceSize.xy - vec2(0.5, 0.5);
|
||||
vec2 pix_co = vTexCoord * global.SourceSize.xy - vec2(0.5, 0.5);
|
||||
vec2 tex_co = (floor(pix_co) + vec2(0.5, 0.5)) / global.SourceSize.xy;
|
||||
vec2 dist = fract(pix_co);
|
||||
float curve_x;
|
||||
|
@ -159,10 +156,10 @@ void main()
|
|||
float bright = (max(col.r, max(col.g, col.b)) + luma) / 2.0;
|
||||
float scan_bright = clamp(bright, SCANLINE_BRIGHT_MIN, SCANLINE_BRIGHT_MAX);
|
||||
float scan_beam = clamp(bright * SCANLINE_BEAM_WIDTH_MAX, SCANLINE_BEAM_WIDTH_MIN, SCANLINE_BEAM_WIDTH_MAX);
|
||||
float scan_weight = 1.0 - pow(cos(coords.y * 2.0 * PI * global.SourceSize.y) * 0.5 + 0.5, scan_beam) * SCANLINE_STRENGTH;
|
||||
float scan_weight = 1.0 - pow(cos(vTexCoord.y * 2.0 * PI * global.SourceSize.y) * 0.5 + 0.5, scan_beam) * SCANLINE_STRENGTH;
|
||||
|
||||
float mask = 1.0 - MASK_STRENGTH;
|
||||
vec2 mod_fac = floor(coords * global.OutputSize.xy * global.SourceSize.xy / (global.SourceSize.xy * vec2(MASK_SIZE, MASK_DOT_HEIGHT * MASK_SIZE)));
|
||||
vec2 mod_fac = floor(vTexCoord * global.OutputSize.xy * global.SourceSize.xy / (global.SourceSize.xy * vec2(MASK_SIZE, MASK_DOT_HEIGHT * MASK_SIZE)));
|
||||
int dot_no = int(mod((mod_fac.x + mod(mod_fac.y, 2.0) * MASK_STAGGER) / MASK_DOT_WIDTH, 3.0));
|
||||
vec3 mask_weight;
|
||||
|
||||
|
|
Loading…
Reference in a new issue