mirror of
https://github.com/italicsjenga/slang-shaders.git
synced 2024-11-25 08:51:32 +11:00
update fake-crt-geom-potato (#429)
fix small mistakes in crt-geom-potato
This commit is contained in:
parent
233cc7dcec
commit
fe459ce01c
|
@ -1,5 +1,5 @@
|
|||
shaders = 1
|
||||
|
||||
shader0 = shaders/fake-crt-geom-potato.slang
|
||||
filter_linear0 = true
|
||||
filter_linear0 = false
|
||||
scale_type0 = viewport
|
||||
|
|
|
@ -155,7 +155,6 @@ void main()
|
|||
vec3 lumweight=vec3(0.213,0.715,0.072);
|
||||
float lum = dot(color,lumweight);
|
||||
|
||||
color = pow(color,vec3(INGAMMA));
|
||||
|
||||
//APPLY MASK
|
||||
float MSK = mix(MSK1,MSK2,lum);
|
||||
|
@ -165,9 +164,10 @@ void main()
|
|||
float SCANLINE = mix(SCANLINE1,SCANLINE2,lum);
|
||||
//INTERLACING MODE FIX SCANLINES
|
||||
if (INTERLACE > 0.0 && global.OriginalSize.y > 400.0 ) scan; else
|
||||
scan= SCANLINE * sin(fract(vTexCoord.y*SourceSize.y/SCALE)*3.141529) +(1.0-SCANLINE);
|
||||
color *= SCANLINE * sin(fract(vTexCoord.y*SourceSize.y/SCALE)*3.141529) +(1.0-SCANLINE);
|
||||
color = pow(color,vec3(INGAMMA));
|
||||
|
||||
color *=mix(scan*mask, scan, dot(color, vec3(FADE)));
|
||||
color =mix(color, color*mask, dot(color, vec3(FADE)));
|
||||
|
||||
color *= mix(1.0,BOOST,lum);
|
||||
color *= vec3(1.0+WPR, 1.0-WPR/2.0, 1.0-WPR/2.0);
|
||||
|
|
|
@ -16,13 +16,13 @@ layout(push_constant) uniform Push
|
|||
|
||||
// Parameter lines go here:
|
||||
|
||||
#pragma parameter boost "Bright boost " 1.00 1.00 2.00 0.02
|
||||
#pragma parameter boost "Bright boost " 1.20 1.00 2.00 0.02
|
||||
#define boost params.boost
|
||||
|
||||
#pragma parameter SCANLINE "Scanline Intensity" 0.70 0.0 1.0 0.05
|
||||
#pragma parameter SCANLINE "Scanline Intensity" 0.50 0.0 1.0 0.05
|
||||
#define SCANLINE params.SCANLINE
|
||||
|
||||
#pragma parameter cgwg "Mask Intensity " 0.8 0.0 1.0 0.05
|
||||
#pragma parameter cgwg "Mask Intensity " 0.3 0.0 1.0 0.05
|
||||
#define cgwg params.cgwg
|
||||
|
||||
|
||||
|
@ -63,12 +63,15 @@ void main()
|
|||
|
||||
vec3 res = texture(Source, pos).rgb;
|
||||
|
||||
res *=res;
|
||||
res *= SCANLINE * sin(fract(p.y)*pi) +(1.0-SCANLINE);
|
||||
|
||||
// apply the mask
|
||||
res *= cgwg * sin(fract(pos.x*0.5*params.OutputSize.x)*pi) +(1.0-cgwg);
|
||||
res = sqrt(res);
|
||||
|
||||
//scanlines will misalign if res*res is run before scanlines applied.
|
||||
res *= res;
|
||||
|
||||
// apply the mask
|
||||
res *= cgwg*(sin(pos.x*params.OutputSize.x*pi))+1.0-cgwg ;
|
||||
|
||||
res = sqrt(res);
|
||||
res *= boost;
|
||||
|
||||
FragColor = vec4(res,1.0);
|
||||
|
|
Loading…
Reference in a new issue