From bd3cbebeeec91b56107387baab14164c4b4ccca2 Mon Sep 17 00:00:00 2001 From: metallic77 <43163462+metallic77@users.noreply.github.com> Date: Wed, 26 Apr 2023 09:18:55 +0300 Subject: [PATCH] Update res-independent-scanlines.slang --- scanlines/shaders/res-independent-scanlines.slang | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scanlines/shaders/res-independent-scanlines.slang b/scanlines/shaders/res-independent-scanlines.slang index 53992b7..51c10d4 100644 --- a/scanlines/shaders/res-independent-scanlines.slang +++ b/scanlines/shaders/res-independent-scanlines.slang @@ -19,7 +19,7 @@ layout(push_constant) uniform Push float phase; float lines_black; float lines_white; - float mask, mask_weight, imageSize; + float mask, mask_weight, imageSize, autoscale; } params; #pragma parameter amp "Amplitude" 1.2500 0.000 2.000 0.05 @@ -29,7 +29,8 @@ layout(push_constant) uniform Push #pragma parameter mask "Mask Layout" 0.0 0.0 19.0 1.0 #pragma parameter mask_weight "Mask Weight" 0.5 0.0 1.0 0.01 -#pragma parameter imageSize "Simulated Image Height" 224.0 144.0 260.0 1.0 +#pragma parameter imageSize "Simulated Image Height" 224.0 144.0 288.0 1.0 +#pragma parameter autoscale "Automatic Scale" 0.0 0.0 1.0 1.0 #define freq 0.500000 #define offset 0.000000 @@ -65,7 +66,8 @@ layout(set = 0, binding = 2) uniform sampler2D Source; void main() { - float angle = (gl_FragCoord.y * params.OutputSize.w) * omega * params.imageSize + params.phase; + float scale = params.imageSize; if (params.autoscale == 1.0) scale = params.OriginalSize.y; + float angle = (gl_FragCoord.y * params.OutputSize.w) * omega * scale + params.phase; vec3 color = texture(Source, vTexCoord).xyz; float grid;