From 1351b17f224f85396ec7a86f653282a69be168f9 Mon Sep 17 00:00:00 2001 From: Valerie Date: Sat, 20 Apr 2024 22:13:24 -0400 Subject: [PATCH] initial implementation for scanlines --- README.md | 2 ++ shaders/final.fsh | 8 ++++++++ shaders/lang/en_US.lang | 1 + shaders/shaders.properties | 2 +- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ca39ecd..a91b1da 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ aimed at providing a variety of effects in the vein of its parent project. - Dithering - Downscaling - Horizontal Blur +- Interlacing +- Scanlines - Screen-Space Vertex Warping - Affine Texture Warping - World Curvature diff --git a/shaders/final.fsh b/shaders/final.fsh index 1ad9801..d2c3624 100644 --- a/shaders/final.fsh +++ b/shaders/final.fsh @@ -4,6 +4,7 @@ //#define aberration //#define hBlur +//#define scanlines varying vec2 texcoord; @@ -25,6 +26,13 @@ void main() { color.rb = aberrate().rb; #endif + #ifdef scanlines + if(mod(int(gl_FragCoord.y / (pixelSize * 2)), 2) == 0) + color.rgb *= 0.95; + else + color.rgb /= 0.95; + #endif + gl_FragData[0] = vec4(color, 1); } diff --git a/shaders/lang/en_US.lang b/shaders/lang/en_US.lang index 150b3d9..4da6505 100644 --- a/shaders/lang/en_US.lang +++ b/shaders/lang/en_US.lang @@ -25,6 +25,7 @@ option.valSteps=Value Depth screen.SCREEN=Screen option.interlacing=Interlacing +option.scanlines=Scanlines option.aberration=Chromatic Aberration screen.CONSOLE=Consoles diff --git a/shaders/shaders.properties b/shaders/shaders.properties index 33c9ba8..af5624c 100644 --- a/shaders/shaders.properties +++ b/shaders/shaders.properties @@ -17,7 +17,7 @@ screen.COLOR.columns=3 screen.COLOR=colorMode dithering rgbSteps hueSteps satSteps valSteps # screen effects -screen.SCREEN=interlacing aberration +screen.SCREEN=interlacing scanlines aberration # console effects screen.CONSOLE.columns=1