Skip to content

Instantly share code, notes, and snippets.

@ELI7VH
Last active July 1, 2019 06:46
Show Gist options
  • Save ELI7VH/0ef038ebf00dbdc6e34b568634d14179 to your computer and use it in GitHub Desktop.
Save ELI7VH/0ef038ebf00dbdc6e34b568634d14179 to your computer and use it in GitHub Desktop.
Outrun Sun Fragment Shader
uniform float time;
varying vec2 vUv;
void main() {
vec3 color = vec3(1.0);
float sun = step(mod(vUv.y * 20. + time, 1.), -0.2 + 0.35 * vUv.y * 3.7);
color.x *= sun;
color.y *= sun * (0.6 + vUv.y - 0.7 );
color.z = 0.;
gl_FragColor = vec4(color, 1.);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment