From 83485c698399034f6185416fccfb7d141256e5f8 Mon Sep 17 00:00:00 2001 From: hunterk Date: Mon, 26 Oct 2020 16:17:08 -0500 Subject: [PATCH] add an option to freeze the newpixie scanlines and fix the bezel image --- crt/shaders/newpixie/newpixie-crt.slang | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crt/shaders/newpixie/newpixie-crt.slang b/crt/shaders/newpixie/newpixie-crt.slang index fc117ce..dc70791 100644 --- a/crt/shaders/newpixie/newpixie-crt.slang +++ b/crt/shaders/newpixie/newpixie-crt.slang @@ -54,12 +54,14 @@ layout(push_constant) uniform Push float use_frame; float curvature; float wiggle_toggle; + float scanroll; } params; #pragma parameter use_frame "Use Frame Image" 0.0 0.0 1.0 1.0 #define use_frame params.use_frame #pragma parameter curvature "Curvature" 2.0 0.0001 4.0 0.25 #pragma parameter wiggle_toggle "Interference" 0.0 0.0 1.0 1.0 +#pragma parameter scanroll "Rolling Scanlines" 1.0 0.0 1.0 1.0 #define gl_FragCoord (vTexCoord.xy * params.OutputSize.xy) #define backbuffer accum1 @@ -175,6 +177,8 @@ void main() float vig = (0.1 + 1.0*16.0*curved_uv.x*curved_uv.y*(1.0-curved_uv.x)*(1.0-curved_uv.y)); vig = 1.3*pow(vig,0.5); col *= vig; + + time *= params.scanroll; /* Scanlines */ float scans = clamp( 0.35+0.18*sin(6.0*time-curved_uv.y*resolution.y*1.5), 0.0, 1.0); @@ -206,7 +210,7 @@ void main() /* Frame */ vec2 fscale = vec2( 0.026, -0.018);//vec2( -0.018, -0.013 ); uv = vec2(uv.x, 1.-uv.y); - vec4 f=texture(frametexture,uv*((1.0)+2.0*fscale)-fscale-vec2(-0.0, 0.005)); + vec4 f=texture(frametexture,vTexCoord.xy);//*((1.0)+2.0*fscale)-fscale-vec2(-0.0, 0.005)); f.xyz = mix( f.xyz, vec3(0.5,0.5,0.5), 0.5 ); float fvig = clamp( -0.00+512.0*uv.x*uv.y*(1.0-uv.x)*(1.0-uv.y), 0.2, 0.8 ); col = mix( col, mix( max( col, 0.0), pow( abs( f.xyz ), vec3( 1.4 ) ) * fvig, f.w * f.w), vec3( use_frame ) );