aeon-199x/shaders/module/aberration.frag

12 lines
264 B
GLSL
Raw Normal View History

2024-04-18 00:22:26 -04:00
2024-04-18 16:45:02 -04:00
vec2 caOffset = vec2(2 * pixelSize / viewWidth, 0);
2024-04-18 00:22:26 -04:00
vec3 aberrate() {
2024-04-18 11:41:47 -04:00
vec2 offset = caOffset * abs(cos(texcoord * 3.14));
float red = texture2D(gcolor, texcoord - offset).r;
float blue = texture2D(gcolor, texcoord + offset).b;
2024-04-18 00:22:26 -04:00
return vec3(red, 0, blue);
}