retuned chromatic aberration
This commit is contained in:
parent
981ebea8c8
commit
f89d8ac3c9
2 changed files with 5 additions and 5 deletions
|
@ -39,7 +39,7 @@ void main() {
|
||||||
|
|
||||||
// physical post-processing effects
|
// physical post-processing effects
|
||||||
#ifdef aberration
|
#ifdef aberration
|
||||||
color.rb = aberrate(color).rb;
|
color.rb = aberrate().rb;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
|
|
||||||
vec2 caOffset = vec2(2 * pixelSize / viewWidth, 0);
|
vec2 caOffset = vec2(2 * pixelSize / viewWidth, 0);
|
||||||
|
|
||||||
vec3 aberrate(vec3 color) {
|
vec3 aberrate() {
|
||||||
vec2 offset = caOffset * abs(cos(texcoord * 3.14));
|
vec2 offset = caOffset * cos(texcoord * 3.14);
|
||||||
float red = color.r;
|
float red = texture2D(gcolor, texcoord - offset).r;
|
||||||
float blue = color.b;
|
float blue = texture2D(gcolor, texcoord + offset).b;
|
||||||
|
|
||||||
return vec3(red, 0, blue);
|
return vec3(red, 0, blue);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue