Last active
May 2, 2021 16:44
-
-
Save marioecg/d3962602232005e5370aea18750ec34a to your computer and use it in GitHub Desktop.
This file contains 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
const int AMOUNT = 25; | |
void main () { | |
float TIME = uTime * 1.0; | |
vec2 uv = scale * (gl_FragCoord.xy - .5 * uResolution.xy) / uResolution.y; | |
// uv *= rotate(uv, angle1); | |
uv.x *= 0.85; | |
uv.y += 10.; | |
// Distort uvs | |
for(int n = 1; n < AMOUNT; n++){ | |
float i = float(n); | |
uv += vec2( | |
0.7 / i * sin(i * uv.y * freq1 + TIME + 0.6 * i) + 0.9, | |
0.4 / i + sin((uv.x) + TIME + 0.3 * i) + 1.6 | |
); | |
} | |
// Colors | |
vec3 c1 = vec3(0.111, 0.005, 0.115); | |
vec3 c2 = vec3(0.770, 0.005, 0.742); | |
vec3 c3 = vec3(0.185, 0.849, 1.000); | |
vec3 c4 = vec3(0.813, 0.895, 0.981); | |
vec3 c5 = vec3(0.019, 0.000, 0.026); | |
vec3 color = vec3( | |
0.5 * sin(uv.x * freq1 + uTime) * amp1, | |
0.5 * sin(uv.y * 1.) + 0.5, | |
0.5 * sin((uv.x + uv.y) * 4.) | |
); | |
float x0 = clamp(color.r * 0.8 + color.g * color.b, 0., 1.); | |
float p1 = smoothstep(0., 0.5, x0); | |
float p2 = smoothstep(0.0, 1.0, x0); | |
float p3 = smoothstep(0.5, 0.75, x0); | |
float p4 = smoothstep(0.75, 1., x0); | |
vec3 mix1 = mix(c1, c2, p1); | |
vec3 mix2 = mix(mix1, c3, p2); | |
vec3 mix3 = mix(mix2, c4, p3); | |
vec3 mix4 = mix(mix3, c5, p4); | |
float shadow = clamp(color.b, 0., 1.); | |
vec3 final = mix2; | |
final += shadow; | |
final += random(vUv * 4.) * 0.1; | |
gl_FragColor = vec4(final, 1.0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment