From 844b782c40305e4f2a8932677a195deb0d97257b Mon Sep 17 00:00:00 2001 From: Valerie Date: Thu, 18 Apr 2024 11:41:47 -0400 Subject: [PATCH] chromatic aberration is now dynamic --- shaders/module/aberration.frag | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shaders/module/aberration.frag b/shaders/module/aberration.frag index fcb5eb4..9a68ecb 100644 --- a/shaders/module/aberration.frag +++ b/shaders/module/aberration.frag @@ -2,8 +2,9 @@ vec2 caOffset = vec2(pixelSize / viewWidth, 0); vec3 aberrate() { - float red = texture2D(gcolor, texcoord - caOffset).r; - float blue = texture2D(gcolor, texcoord + caOffset).b; + vec2 offset = caOffset * abs(cos(texcoord * 3.14)); + float red = texture2D(gcolor, texcoord - offset).r; + float blue = texture2D(gcolor, texcoord + offset).b; return vec3(red, 0, blue); }