Compare commits

...

3 commits

Author SHA1 Message Date
b103d0ca99 fixed scanlines for real this time :/ 2024-05-03 22:24:04 -04:00
fc1c7c7b1a fixes to scanline function 2024-05-03 22:18:22 -04:00
40111d5e90 added 'hard' scanline option 2024-05-03 22:08:09 -04:00
5 changed files with 31 additions and 8 deletions

View file

@ -4,7 +4,6 @@
//#define aberration //#define aberration
//#define hBlur //#define hBlur
//#define scanlines
varying vec2 texcoord; varying vec2 texcoord;
@ -13,6 +12,7 @@ uniform float viewWidth;
#include "/module/aberration.frag" #include "/module/aberration.frag"
#include "/module/horizontal_blur.frag" #include "/module/horizontal_blur.frag"
#include "/module/scanline.frag"
void main() { void main() {
vec3 color; vec3 color;
@ -26,11 +26,8 @@ void main() {
color.rb = aberrate().rb; color.rb = aberrate().rb;
#endif #endif
#ifdef scanlines #if scanline > 0
if(mod(int(gl_FragCoord.y / (pixelSize * 2)), 2) == 0) color = scanlines(color);
color.rgb *= 0.95;
else
color.rgb /= 0.95;
#endif #endif
gl_FragData[0] = vec4(color, 1); gl_FragData[0] = vec4(color, 1);

View file

@ -54,7 +54,10 @@ screen.SCREEN=Screen
option.interlacing=Interlacing option.interlacing=Interlacing
option.scanlines=Scanlines option.scanline=Scanlines
value.scanline.0=Off
value.scanline.1=Soft
value.scanline.2=Hard
option.aberration=Chromatic Aberration option.aberration=Chromatic Aberration

View file

@ -0,0 +1,18 @@
#include "/var/scanline.glsl"
#define scanline 0 // [0 1 2]
vec3 scanlines(vec3 color) {
#if scanline == SCANLINE_SOFT
if(mod(int(gl_FragCoord.y / pixelSize * 2), 2) == 0)
color.rgb *= 0.95;
else
color.rgb /= 0.95;
#elif scanline == SCANLINE_HARD
if(mod(int(gl_FragCoord.y / pixelSize), 2) == 0)
color.rgb *= 0.5;
#endif
return color;
}

View file

@ -20,7 +20,7 @@ screen.COLOR.columns=3
screen.COLOR=colorMode dithering <empty> colorDepth <empty> monoPalette hueBits satBits valBits screen.COLOR=colorMode dithering <empty> colorDepth <empty> monoPalette hueBits satBits valBits
# screen effects # screen effects
screen.SCREEN=interlacing scanlines aberration screen.SCREEN=interlacing scanline aberration
# console effects # console effects
screen.CONSOLE.columns=1 screen.CONSOLE.columns=1

View file

@ -0,0 +1,5 @@
#define SCANLINE_SOFT 1
#define SCANLINE_HARD 2
#define SCANLINE_STRETCH 3