aeon-199x/shaders/final.fsh

49 lines
791 B
Text
Raw Normal View History

#version 120
2024-04-18 00:22:26 -04:00
#include "/module/common.glsl"
//#define aberration
//#define hBlur
varying vec2 texcoord;
uniform sampler2D gcolor;
uniform float viewWidth;
2024-04-18 00:22:26 -04:00
#include "/module/aberration.frag"
2024-04-17 10:54:58 -04:00
#include "/module/horizontal_blur.frag"
2024-05-03 22:08:09 -04:00
#include "/module/scanline.frag"
#include "/module/signal.frag"
void main() {
2024-04-18 00:22:26 -04:00
vec3 color;
// software post-processing effects
2024-04-17 11:20:09 -04:00
#ifdef hBlur
2024-04-18 00:22:26 -04:00
color = hblur();
2024-04-17 10:54:58 -04:00
#else
2024-04-18 00:22:26 -04:00
color = texture2D(gcolor, texcoord).rgb;
#endif
2024-05-03 22:08:09 -04:00
#if scanline > 0
color = scanlines(color);
2024-04-20 22:13:24 -04:00
#endif
// hardware post-processing effects
#if signal == SIGNAL_NTSC
color = ntsc(color);
2024-05-05 13:44:23 -04:00
#elif signal == SIGNAL_PAL
color = pal(color);
#endif
// physical post-processing effects
#ifdef aberration
2024-05-05 14:48:27 -04:00
color.rb = aberrate().rb;
#endif
2024-04-18 00:22:26 -04:00
gl_FragData[0] = vec4(color, 1);
}