mirror of
https://github.com/italicsjenga/slang-shaders.git
synced 2024-11-22 07:41:31 +11:00
make res-independent scanlines a little thinner and adjustable brightness
This commit is contained in:
parent
492951eb55
commit
b778a6b7cb
|
@ -1,5 +1,11 @@
|
|||
#version 450
|
||||
|
||||
/*
|
||||
based on scanline shader by:
|
||||
Author: Themaister
|
||||
License: Public domain
|
||||
*/
|
||||
|
||||
layout(push_constant) uniform Push
|
||||
{
|
||||
vec4 SourceSize;
|
||||
|
@ -48,8 +54,7 @@ void main()
|
|||
{
|
||||
vec2 sine_comp = vec2(0.0, SCANLINE_SINE_COMP_B);
|
||||
vec3 res = texture(Source, vTexCoord).xyz;
|
||||
vec2 fragcoord = vTexCoord.xy * params.FinalViewportSize.xy;
|
||||
// picked 224 here as a magic number because it's a common 240p res and therefore a good starting point
|
||||
vec3 scanline = res * ((1. - 0.75 * SCANLINE_SINE_COMP_B) + dot(sine_comp * sin((fragcoord / (224. * scanline_size)) * omega), vec2(1.0, 1.0)));
|
||||
vec2 fragcoord = fract(floor(vTexCoord.xy * params.OutputSize.xy * 1.0001) / scanline_size);
|
||||
vec3 scanline = (fragcoord.y > 0.3333)? res : vec3(SCANLINE_SINE_COMP_B * res);//res * ((1. - 0.75 * SCANLINE_SINE_COMP_B) + dot(sine_comp * sin((fragcoord / scanline_size) * omega), vec2(1.0, 1.0)));
|
||||
FragColor = vec4(scanline.x, scanline.y, scanline.z, 1.0);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue