mirror of
https://github.com/italicsjenga/slang-shaders.git
synced 2024-11-29 19:01:31 +11:00
add protect white on masks parameter (#397)
* integrate NTSC-colors * Integrate NTSC-colors * Integrate NTSC-colors, some fixes too * additions Added hue shift from grade, improved glow, added scanlines downscale to interlace mode. Some other touches too * Update crt-consumer.slang * fix scanlines misalignment * add protect white on masks parameter
This commit is contained in:
parent
91eb05f136
commit
b28d910c29
|
@ -28,6 +28,7 @@ layout(push_constant) uniform Push
|
||||||
#pragma parameter scanhigh "Beam high" 8.0 1.0 15.0 1.0
|
#pragma parameter scanhigh "Beam high" 8.0 1.0 15.0 1.0
|
||||||
#pragma parameter beamlow "Scanlines dark" 1.45.5 2.5 0.05
|
#pragma parameter beamlow "Scanlines dark" 1.45.5 2.5 0.05
|
||||||
#pragma parameter beamhigh "Scanlines bright" 1.05 0.5 2.5 0.05
|
#pragma parameter beamhigh "Scanlines bright" 1.05 0.5 2.5 0.05
|
||||||
|
#pragma parameter preserve " Protect White On Masks" 0.98 0.0 1.0 0.01
|
||||||
#pragma parameter brightboost1 " Bright boost dark pixels" 1.2 0.0 3.0 0.05
|
#pragma parameter brightboost1 " Bright boost dark pixels" 1.2 0.0 3.0 0.05
|
||||||
#pragma parameter brightboost2 " Bright boost bright pixels" 1.0 0.0 3.0 0.05
|
#pragma parameter brightboost2 " Bright boost bright pixels" 1.0 0.0 3.0 0.05
|
||||||
#pragma parameter glow " Glow Strength" 0.0 0.0 1.0 0.02
|
#pragma parameter glow " Glow Strength" 0.0 0.0 1.0 0.02
|
||||||
|
@ -36,7 +37,7 @@ layout(push_constant) uniform Push
|
||||||
#pragma parameter postbr " Post Brightness" 1.0 0.0 2.5 0.02
|
#pragma parameter postbr " Post Brightness" 1.0 0.0 2.5 0.02
|
||||||
#pragma parameter Shadowmask "Mask Type" 0.0 -1.0 8.0 1.0
|
#pragma parameter Shadowmask "Mask Type" 0.0 -1.0 8.0 1.0
|
||||||
#pragma parameter masksize "Mask Size" 1.0 1.0 2.0 1.0
|
#pragma parameter masksize "Mask Size" 1.0 1.0 2.0 1.0
|
||||||
#pragma parameter MaskDark "Mask dark" 0.5 0.0 2.0 0.1
|
#pragma parameter MaskDark "Mask dark" 0.2 0.0 2.0 0.1
|
||||||
#pragma parameter MaskLight "Mask light" 1.5 0.0 2.0 0.1
|
#pragma parameter MaskLight "Mask light" 1.5 0.0 2.0 0.1
|
||||||
#pragma parameter slotmask "Slot Mask Strength" 0.0 0.0 1.0 0.05
|
#pragma parameter slotmask "Slot Mask Strength" 0.0 0.0 1.0 0.05
|
||||||
#pragma parameter slotwidth "Slot Mask Width" 2.0 1.0 6.0 0.5
|
#pragma parameter slotwidth "Slot Mask Width" 2.0 1.0 6.0 0.5
|
||||||
|
@ -103,7 +104,7 @@ layout(std140, set = 0, binding = 0) uniform UBO
|
||||||
float postbr;
|
float postbr;
|
||||||
float PRE_SCALE;
|
float PRE_SCALE;
|
||||||
float intensity;
|
float intensity;
|
||||||
|
float preserve;
|
||||||
} global;
|
} global;
|
||||||
|
|
||||||
#pragma stage vertex
|
#pragma stage vertex
|
||||||
|
@ -548,7 +549,12 @@ void main()
|
||||||
else
|
else
|
||||||
{color = color * sw(f,lum) + color * sw (1.0-f,lum);}
|
{color = color * sw(f,lum) + color * sw (1.0-f,lum);}
|
||||||
|
|
||||||
color *= mask((vTexCoord * params.OutputSize.xy) * 1.0001, color,lum);
|
float lum1 = color.r * 0.3 + color.g * 0.6 + color.b * 0.1;
|
||||||
|
|
||||||
|
|
||||||
|
color *= mix(mask((vTexCoord * params.OutputSize.xy) * 1.0001, color,lum1), vec3(1.0), lum1*global.preserve);
|
||||||
|
|
||||||
|
|
||||||
if (global.slotmask != 0.0) color *= SlotMask((vTexCoord * params.OutputSize.xy) * 1.0001, color);
|
if (global.slotmask != 0.0) color *= SlotMask((vTexCoord * params.OutputSize.xy) * 1.0001, color);
|
||||||
|
|
||||||
color *= mix(global.brightboost1, global.brightboost2, max(max(color.r, color.g), color.b));
|
color *= mix(global.brightboost1, global.brightboost2, max(max(color.r, color.g), color.b));
|
||||||
|
|
Loading…
Reference in a new issue