Update res-independent-scanlines.slang

This commit is contained in:
metallic77 2023-04-26 09:18:55 +03:00 committed by GitHub
parent aaca9c96aa
commit bd3cbebeee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;