Skip to content

Instantly share code, notes, and snippets.

@adrian-afl
Created March 19, 2015 17:56
Show Gist options
  • Save adrian-afl/4dbc13da13ff1e19a9d7 to your computer and use it in GitHub Desktop.
Save adrian-afl/4dbc13da13ff1e19a9d7 to your computer and use it in GitHub Desktop.
vec3 blurWhitening(){
vec3 outc = vec3(0);
for(float g = 0; g < mPI2; g+=0.6){
for(float g2 = 0; g2 < 14.0; g2+=2.0){
vec2 gauss = vec2(sin(g)*ratio, cos(g)) * (g2 * 0.001);
vec3 color = fetchColor(UV + gauss);
float luminance = length(color); // luminance from 1.4 to 1.7320
if(luminance > 1.0){
luminance = (luminance - 1.0) / 0.320;
outc += 0.042857142 * luminance;
}
}
}
return outc;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment