glsl-chromatic-aberration
glslify module for fast approximation of chromatic aberration as a post processing (fullscreen) effect.
The function shifts each RGB channel separately in the given direction.
Combine with a directional blur pass for more convincing results.
Installation
glslify is required for importing.
yarn add glsl-chromatic-aberration
npm i glsl-chromatic-aberration --save
Usage
vec4
The function shifts each RGB channel of image
separately in the given direction
and returns the color for the pixel at uv
.
Example
# ca = require('glsl-chromatic-aberration') uniform vec2 iResolution;uniform sampler2D iChannel0; void