Compare commits
3 commits
933cb21020
...
b103d0ca99
Author | SHA1 | Date | |
---|---|---|---|
b103d0ca99 | |||
fc1c7c7b1a | |||
40111d5e90 |
5 changed files with 31 additions and 8 deletions
|
@ -4,7 +4,6 @@
|
|||
|
||||
//#define aberration
|
||||
//#define hBlur
|
||||
//#define scanlines
|
||||
|
||||
varying vec2 texcoord;
|
||||
|
||||
|
@ -13,6 +12,7 @@ uniform float viewWidth;
|
|||
|
||||
#include "/module/aberration.frag"
|
||||
#include "/module/horizontal_blur.frag"
|
||||
#include "/module/scanline.frag"
|
||||
|
||||
void main() {
|
||||
vec3 color;
|
||||
|
@ -26,11 +26,8 @@ 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;
|
||||
#if scanline > 0
|
||||
color = scanlines(color);
|
||||
#endif
|
||||
|
||||
gl_FragData[0] = vec4(color, 1);
|
||||
|
|
|
@ -54,7 +54,10 @@ screen.SCREEN=Screen
|
|||
|
||||
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
|
||||
|
||||
|
|
18
shaders/module/scanline.frag
Normal file
18
shaders/module/scanline.frag
Normal 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;
|
||||
}
|
||||
|
|
@ -20,7 +20,7 @@ screen.COLOR.columns=3
|
|||
screen.COLOR=colorMode dithering <empty> colorDepth <empty> monoPalette hueBits satBits valBits
|
||||
|
||||
# screen effects
|
||||
screen.SCREEN=interlacing scanlines aberration
|
||||
screen.SCREEN=interlacing scanline aberration
|
||||
|
||||
# console effects
|
||||
screen.CONSOLE.columns=1
|
||||
|
|
5
shaders/var/scanline.glsl
Normal file
5
shaders/var/scanline.glsl
Normal file
|
@ -0,0 +1,5 @@
|
|||
|
||||
#define SCANLINE_SOFT 1
|
||||
#define SCANLINE_HARD 2
|
||||
#define SCANLINE_STRETCH 3
|
||||
|
Loading…
Reference in a new issue