-->
uniform float uRefractPower;
uniform float uChromaticAberration;
// ...
vec3 color = vec3(0.0);
for ( int i = 0; i < LOOP; i ++ ) {
float slide = float(i) / float(LOOP) * 0.1;
vec3 refractVecR = refract(eyeVector, normal, iorRatioRed);
vec3 refractVecG = refract(eyeVector, normal, iorRatioGreen);
vec3 refractVecB = refract(eyeVector, normal, iorRatioBlue);
color.r += texture2D(uTexture, uv + refractVecR.xy * (uRefractPower + slide * 1.0) * uChromaticAberration).r;
color.g += texture2D(uTexture, uv + refractVecG.xy * (uRefractPower + slide * 2.0) * uChromaticAberration).g;
color.b += texture2D(uTexture, uv + refractVecB.xy * (uRefractPower + slide * 3.0) * uChromaticAberration).b;
}
// Divide by the number of layers to normalize colors (rgb values can be worth up to the value of LOOP)
color /= float( LOOP );
//...