2024-04-14 18:52:46 -04:00
|
|
|
#version 120
|
|
|
|
|
2024-04-18 00:22:26 -04:00
|
|
|
#include "/module/common.glsl"
|
|
|
|
|
|
|
|
//#define aberration
|
2024-04-14 18:52:46 -04:00
|
|
|
//#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"
|
2024-05-04 00:33:08 -04:00
|
|
|
#include "/module/signal.frag"
|
2024-04-14 18:52:46 -04:00
|
|
|
|
|
|
|
void main() {
|
2024-04-18 00:22:26 -04:00
|
|
|
vec3 color;
|
2024-05-04 00:33:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
// 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
|
|
|
|
|
2024-05-04 00:33:08 -04:00
|
|
|
// 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);
|
2024-05-04 00:33:08 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// physical post-processing effects
|
|
|
|
#ifdef aberration
|
2024-05-05 14:48:27 -04:00
|
|
|
color.rb = aberrate().rb;
|
2024-05-04 00:33:08 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2024-04-18 00:22:26 -04:00
|
|
|
gl_FragData[0] = vec4(color, 1);
|
2024-04-14 18:52:46 -04:00
|
|
|
}
|
|
|
|
|