陽だまりを駆けまわる
この一枚は、お使いのブラウザでコンパイルできませんでした。
ソースtime-sampled Lissajous metaball trail with hop offsets and detached drop shadow, landing ripple rings, skewed window-light patch with fbm cloud shadow
precision mediump float;
uniform vec2 u_resolution;
uniform float u_time;
float hash(vec2 p){return fract(sin(dot(p,vec2(127.1,311.7)))*43758.5453);}
float noise(vec2 p){
vec2 i=floor(p);vec2 f=fract(p);
vec2 u=f*f*(3.0-2.0*f);
return mix(mix(hash(i),hash(i+vec2(1.0,0.0)),u.x),mix(hash(i+vec2(0.0,1.0)),hash(i+vec2(1.0,1.0)),u.x),u.y);
}
float fbm(vec2 p){
float v=0.0;float a=0.5;
for(int i=0;i<4;i++){v+=a*noise(p);p=p*2.03+vec2(1.7,9.2);a*=0.5;}
return v;
}
vec2 path(float s){
return vec2(0.42*sin(s*1.1)+0.12*sin(s*2.7+1.3),-0.08+0.20*sin(s*1.7+0.4)+0.06*sin(s*3.3));
}
void main(){
vec2 uv=(gl_FragCoord.xy-0.5*u_resolution)/u_resolution.y;
float t=u_time;
vec3 floorA=vec3(0.80,0.66,0.50);
vec3 floorB=vec3(0.62,0.45,0.35);
vec3 col=mix(floorB,floorA,smoothstep(-0.6,0.5,uv.y));
float plank=sin((uv.x+uv.y*0.3)*18.0);
col*=0.95+0.05*smoothstep(-0.9,0.9,plank);
vec2 q=uv;q.x-=q.y*0.45;q-=vec2(0.12,-0.02);
float box=max(abs(q.x)-0.36,abs(q.y)-0.30);
float win=smoothstep(0.03,-0.03,box);
float bars=min(abs(q.x),abs(q.y));
win*=smoothstep(0.012,0.03,bars);
float cl=fbm(uv*1.6+vec2(t*0.05,t*0.01));
float shade=smoothstep(0.55,0.75,cl);
col+=win*(1.0-0.55*shade)*vec3(0.22,0.17,0.09);
float s=t*0.5;
float f=0.0;float sf=0.0;vec3 bc=vec3(0.0);
for(int i=0;i<28;i++){
float fi=float(i);
float k=fi/28.0;
float si=s-fi*0.035;
vec2 p=path(si);
float hop=abs(sin(si*6.0))*0.07*(1.0-k*0.5);
float r=mix(0.075,0.013,k);
vec2 d=uv-p-vec2(0.0,hop);
float w=r*r/(dot(d,d)+2e-4);
f+=w;
bc+=w*mix(vec3(1.0,0.74,0.40),vec3(0.96,0.48,0.42),k);
vec2 ds=uv-p-vec2(0.025,-0.045);
sf+=r*r/(dot(ds,ds)+2e-4)*(1.0-k);
}
col*=1.0-0.28*smoothstep(0.5,1.3,sf);
float ph=fract(s*6.0/3.14159);
vec2 lp=path(s-ph*3.14159/6.0)+vec2(0.0,-0.01);
vec2 rd=uv-lp;rd.y*=1.8;
float rr=length(rd);
float ringR=0.05+ph*0.17;
float ring=smoothstep(0.018,0.004,abs(rr-ringR));
col=mix(col,vec3(1.0,0.90,0.72),ring*(1.0-ph)*(1.0-ph)*0.55);
bc/=(f+1e-3);
float m=smoothstep(0.85,1.15,f);
vec3 b=bc*(0.86+0.2*smoothstep(1.0,4.0,f));
col=mix(col,b,m);
vec2 hp=path(s);hp.y+=abs(sin(s*6.0))*0.07;
float hl=smoothstep(0.03,0.0,length(uv-hp-vec2(-0.022,0.025)));
col+=hl*0.18*vec3(1.0,0.95,0.85);
col*=1.0-0.35*dot(uv*vec2(0.8,1.0),uv*vec2(0.8,1.0));
col=clamp(col,0.0,0.97);
gl_FragColor=vec4(col,1.0);
}