Advertisement
KoctrX

Untitled

Nov 29th, 2021
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. "#version 100\n\nprecision mediump float;\nuniform sampler2D u_image;\nuniform float time;\nvarying vec2 texCoords;\n\nfloat timeFn() {\n float x = time / 1.8 - 0.2;\n\n float a = .6;\n float y = 0.;\n y += 1.2 * smoothstep(0., a, x) / (1. / a);\n y += 3. * pow(max(x, 0.8) - 0.8, 2.);\n y += x / 10.;\n\n return y;\n}\n\nfloat mask(vec2 st) {\n return clamp(-abs(350. * (st.x - 1.38 * timeFn() + .20 + .18 * st.y)) + 50., 0., 1.);\n}\n\nfloat shadowMask(vec2 st) {\n return clamp(-abs(10. * (st.x - 1.38 * timeFn() + .14 + .18 * st.y)) + 1.9, 0., 1.);\n}\n\nvec4 shadow(vec2 st) {\n return vec4(vec3(0.), smoothstep(0., 1., shadowMask(st) * 0.5));\n}\n\nvoid main() {\n vec4 color = texture2D(u_image, texCoords * 0.7 + 0.15);\n vec2 uv = texCoords;\n\n color = vec4(color.rgb, mask(uv) * color.a);\n\n color = mix(shadow(uv), vec4(color.rgb, 1.), color.a);\n\n gl_FragColor = color;\n}\n\n"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement