Created
December 18, 2018 13:41
-
-
Save fand/800cb00d6b93bfb44dbf324b6dc4635d to your computer and use it in GitHub Desktop.
SHIT key effect on VEDA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*{ | |
IMPORTED: { | |
img: { PATH: 'shit.jpg' }, | |
}, | |
}*/ | |
precision highp float; | |
uniform float time; | |
uniform vec2 resolution; | |
uniform sampler2D img; | |
void main() { | |
vec2 fragCoord = gl_FragCoord.xy; | |
fragCoord += vec2(sin(time * 71.), cos(time * 57.)) * 1.4; | |
fragCoord = (fragCoord - resolution * .5) * (1. + sin(time * 37.3) * sin(time * 23.3) * .02) + resolution * .5; | |
vec2 uv = fragCoord.xy / resolution; | |
vec2 p = (fragCoord.xy *2.- resolution) / min(resolution.x, resolution.y); | |
// offset | |
p += vec2(.1, .2); | |
float l = length(p); | |
l = l * l * 4.; | |
float a = atan(p.y, p.x); | |
float wave = sin(a * 37.+ time * 39.) * sin(a * 171. + time * 97.) *l; | |
l += wave * .1; | |
vec4 c = texture2D(img, uv); | |
// blur | |
for (int i = 0; i < 30; i++) { | |
float fi = float(i); | |
vec2 uv2 = (uv - .5) * (1. - l * fi *.001) + .5; | |
c += texture2D(img, uv2); | |
} | |
c /= 30.; | |
c *= 1. + wave * .03; | |
// color grading | |
c = smoothstep(.05, .9, c); | |
c.r = pow(c.r, .8 + l * .1); | |
c *= 1. - l * l * .008; | |
gl_FragColor = c; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment