mirror of
https://github.com/italicsjenga/slang-shaders.git
synced 2024-11-26 17:31:31 +11:00
add an option to freeze the newpixie scanlines and fix the bezel image
This commit is contained in:
parent
547e9671bd
commit
83485c6983
|
@ -54,12 +54,14 @@ layout(push_constant) uniform Push
|
||||||
float use_frame;
|
float use_frame;
|
||||||
float curvature;
|
float curvature;
|
||||||
float wiggle_toggle;
|
float wiggle_toggle;
|
||||||
|
float scanroll;
|
||||||
} params;
|
} params;
|
||||||
|
|
||||||
#pragma parameter use_frame "Use Frame Image" 0.0 0.0 1.0 1.0
|
#pragma parameter use_frame "Use Frame Image" 0.0 0.0 1.0 1.0
|
||||||
#define use_frame params.use_frame
|
#define use_frame params.use_frame
|
||||||
#pragma parameter curvature "Curvature" 2.0 0.0001 4.0 0.25
|
#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 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 gl_FragCoord (vTexCoord.xy * params.OutputSize.xy)
|
||||||
#define backbuffer accum1
|
#define backbuffer accum1
|
||||||
|
@ -176,6 +178,8 @@ void main()
|
||||||
vig = 1.3*pow(vig,0.5);
|
vig = 1.3*pow(vig,0.5);
|
||||||
col *= vig;
|
col *= vig;
|
||||||
|
|
||||||
|
time *= params.scanroll;
|
||||||
|
|
||||||
/* Scanlines */
|
/* Scanlines */
|
||||||
float scans = clamp( 0.35+0.18*sin(6.0*time-curved_uv.y*resolution.y*1.5), 0.0, 1.0);
|
float scans = clamp( 0.35+0.18*sin(6.0*time-curved_uv.y*resolution.y*1.5), 0.0, 1.0);
|
||||||
float s = pow(scans,0.9);
|
float s = pow(scans,0.9);
|
||||||
|
@ -206,7 +210,7 @@ void main()
|
||||||
/* Frame */
|
/* Frame */
|
||||||
vec2 fscale = vec2( 0.026, -0.018);//vec2( -0.018, -0.013 );
|
vec2 fscale = vec2( 0.026, -0.018);//vec2( -0.018, -0.013 );
|
||||||
uv = vec2(uv.x, 1.-uv.y);
|
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 );
|
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 );
|
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 ) );
|
col = mix( col, mix( max( col, 0.0), pow( abs( f.xyz ), vec3( 1.4 ) ) * fvig, f.w * f.w), vec3( use_frame ) );
|
||||||
|
|
Loading…
Reference in a new issue