Saturday Aisles, Drifting Slow
This one didn't compile in your browser.
Sourceparallax-scrolling rows of hashed rounded-box SDFs with soft drop shadows and diffuse overcast wash
precision mediump float;
uniform vec2 u_resolution;
uniform float u_time;
float h1(float n){return fract(sin(n*127.1)*43758.5453);}
float sdBox(vec2 p, vec2 b, float r){
vec2 q=abs(p)-b+r;
return length(max(q,0.0))+min(max(q.x,q.y),0.0)-r;
}
vec3 pal(float t){
if(t<0.2) return vec3(0.86,0.55,0.33);
if(t<0.4) return vec3(0.62,0.70,0.56);
if(t<0.6) return vec3(0.90,0.76,0.42);
if(t<0.8) return vec3(0.55,0.64,0.74);
return vec3(0.93,0.86,0.74);
}
void main(){
vec2 uv=(gl_FragCoord.xy-0.5*u_resolution)/u_resolution.y;
float t=u_time;
vec3 col=mix(vec3(0.76,0.74,0.71),vec3(0.86,0.84,0.80),uv.y+0.5);
col+=0.035*sin(uv.x*2.2+t*0.08+sin(uv.y*3.0+t*0.05));
for(int i=0;i<3;i++){
float fi=float(i);
float dir=mod(fi,2.0)*2.0-1.0;
float sp=0.022*(1.0+fi*0.35)*dir;
float base=-0.40+fi*0.29;
float x=uv.x+t*sp+fi*0.37;
float w=0.22;
float id=floor(x/w);
float lx=mod(x,w)-w*0.5;
float r1=h1(id+fi*17.0);
float r2=h1(id*1.7+fi*5.3+3.1);
float r3=h1(id*2.3+fi*9.1+7.7);
vec2 hb=vec2(0.05+0.04*r1,0.04+0.06*r2);
float bob=0.006*sin(t*0.5+id*1.3+fi*2.0);
vec2 p=vec2(lx,uv.y-base-hb.y-bob-0.012);
float sh=sdBox(p-vec2(0.018,-0.014),hb,0.03);
col*=1.0-0.16*(1.0-smoothstep(-0.02,0.05,sh));
float d=sdBox(p,hb,0.018);
vec3 bc=pal(r3);
float shade=0.92+0.10*clamp((p.y/hb.y)*0.7-(p.x/hb.x)*0.3,-1.0,1.0);
if(r1>0.5){
bc=mix(bc,bc*0.84,1.0-smoothstep(0.014,0.02,abs(p.y-hb.y*0.15)));
}
bc*=shade;
bc*=0.9+0.1*smoothstep(-0.035,-0.005,-d);
col=mix(col,bc,1.0-smoothstep(-0.004,0.004,d));
float pl=abs(uv.y-base+0.008)-0.011;
float below=step(uv.y,base-0.019);
col*=1.0-0.14*below*smoothstep(0.07,0.0,base-0.019-uv.y);
col=mix(col,vec3(0.62,0.50,0.40),1.0-smoothstep(-0.003,0.003,pl));
}
col=mix(col,vec3(0.92,0.89,0.84),0.12*smoothstep(-0.2,0.55,uv.y));
float glow=0.04*sin(t*0.12)*smoothstep(0.9,0.0,length(uv-vec2(-0.4,0.4)));
col+=glow;
float vig=1.0-0.28*dot(uv*vec2(0.8,1.0),uv*vec2(0.8,1.0));
col*=vig;
col=clamp(col,0.05,0.95);
gl_FragColor=vec4(col,1.0);
}