VIGNETTES //natural vignette //modified from https://www.shadertoy.com/view/4lSXDm float Falloff = 0.95; // float radius = 0.75; // vec2 pos = vec2(0.5,0.5); //center of vignette void mainImage( out vec4 fragColor, in vec2 fragCoord ) { vec2 uv = fragCoord.xy / iResolution.xy; vec4 color = texture(iChannel0, uv); //vec4 color = vec4(1.,1.,1.,1.); vec2 coord = (uv - pos) * vec2(iResolution.x/iResolution.y,1.) / radius; float rf = 1.0 + dot(coord, coord) * Falloff*Falloff; float e = 1.0 / (rf*rf); fragColor = vec4(color.rgb * e, 1.0); } // // modified https://www.shadertoy.com/view/MsySzy #define FROSTYNESS 2.0 #define COLORIZE 1.0 #define COLOR_RGB 0.7,1.0,1.0 float rand(vec2 uv) { float a = dot(uv, vec2(92., 80.)); float b = dot(uv, vec2(41., 62.)); float x = sin(a) + cos(b) * 51.; return fract(x); } void mainImage( out vec4 fragColor, in vec2 fragCoord ) { vec2 uv = fragCoord.xy / iResolution.xy; vec4 d = texture(iChannel1, uv); vec2 rnd = vec2(rand(uv+d.r*.05), rand(uv+d.b*.05)); //vignette const vec2 lensRadius = vec2(0.35*1.42, 0.25); //float dist = distance(uv.xy, vec2(0.5,0.5)); float dist = distance(uv.xy, iMouse.xy/ iResolution.xy ); float vigfin = pow(1.-smoothstep(lensRadius.x, lensRadius.y, dist),2.); rnd *= .035*vigfin; uv += rnd; //uv += rnd + vigfin; //give lens distorsion around circle fragColor = mix(texture(iChannel0, uv),vec4(COLOR_RGB,1.0),0.); }