chromatic aberration is now dynamic
This commit is contained in:
parent
623a7e4645
commit
844b782c40
1 changed files with 3 additions and 2 deletions
|
@ -2,8 +2,9 @@
|
||||||
vec2 caOffset = vec2(pixelSize / viewWidth, 0);
|
vec2 caOffset = vec2(pixelSize / viewWidth, 0);
|
||||||
|
|
||||||
vec3 aberrate() {
|
vec3 aberrate() {
|
||||||
float red = texture2D(gcolor, texcoord - caOffset).r;
|
vec2 offset = caOffset * abs(cos(texcoord * 3.14));
|
||||||
float blue = texture2D(gcolor, texcoord + caOffset).b;
|
float red = texture2D(gcolor, texcoord - offset).r;
|
||||||
|
float blue = texture2D(gcolor, texcoord + offset).b;
|
||||||
|
|
||||||
return vec3(red, 0, blue);
|
return vec3(red, 0, blue);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue