Back to shaders

Shader test bench

Aurora Veil

stronghold-curated generative glsl runnable fragment MIT
Source
runnable fragment

Complete GLSL fragment shader. Stronghold runs it directly when the browser can compile it.

Code

precision mediump float;
uniform vec2 resolution;
uniform float time;
float hash(vec2 p){ return fract(sin(dot(p, vec2(127.1,311.7))) * 43758.5453123); }
float noise(vec2 p){ vec2 i=floor(p), f=fract(p); f=f*f*(3.0-2.0*f); return mix(mix(hash(i),hash(i+vec2(1.0,0.0)),f.x),mix(hash(i+vec2(0.0,1.0)),hash(i+vec2(1.0,1.0)),f.x),f.y); }
float fbm(vec2 p){ float v=0.0,a=0.5; for(int i=0;i<5;i++){ v+=a*noise(p); p*=2.0; a*=0.5; } return v; }
void main(){
  vec2 uv=gl_FragCoord.xy/resolution.xy;
  float band=0.0;
  for(int i=0;i<4;i++){
    float fi=float(i);
    float y=0.34+0.12*sin(uv.x*5.0+time*(0.35+fi*0.08)+fi);
    float n=fbm(vec2(uv.x*3.0+time*0.06, uv.y*2.0+fi));
    band += smoothstep(0.25,0.0,abs(uv.y-y-n*0.18))*0.35;
  }
  vec3 sky=mix(vec3(0.005,0.01,0.05), vec3(0.02,0.04,0.12), uv.y);
  vec3 aur=band*mix(vec3(0.1,1.0,0.55), vec3(0.65,0.25,1.0), uv.x);
  gl_FragColor=vec4(sky+aur,1.0);
}