aeon-199x/shaders/final.fsh

48 lines
808 B
GLSL

#version 120
#include "/module/common.glsl"
//#define aberration
//#define hBlur
varying vec2 texcoord;
uniform sampler2D gcolor;
uniform float viewWidth;
#include "/module/aberration.frag"
#include "/module/horizontal_blur.frag"
#include "/module/scanline.frag"
#include "/module/signal.frag"
void main() {
vec3 color;
// software post-processing effects
#ifdef hBlur
color = hblur();
#else
color = texture2D(gcolor, texcoord).rgb;
#endif
#if scanline > 0
color = scanlines(color);
#endif
// hardware post-processing effects
#if signal == SIGNAL_NTSC
color = ntsc(color);
#elif signal == SIGNAL_PAL
color = pal(color);
#endif
// physical post-processing effects
#ifdef aberration
color.rb = (color.rb + aberrate().rb) / 2;
#endif
gl_FragData[0] = vec4(color, 1);
}