Deck.transition('slam',{dur:1.2,frag:`void main(){ float e=p*p*(3.-2.*p); float yb=1.25-1.55*e; float m=smoothstep(yb-.006,yb+.006,vUv.y); vec3 a=texture(tA,vUv).rgb, b=texture(tB,vUv).rgb; vec3 c=mix(a,b,m); float sh=exp(-abs(vUv.y-yb)*22.)*.55*step(vUv.y,yb)*step(.02,p); c*=1.-sh; float d=vnoise(vec2(vUv.x*26.,vUv.y*26.-p*3.))*(1.-abs(p-.5)*2.); c+=vec3(.85,.78,.66)*d*.22; o=vec4(c,1.); }`}); Deck.scene({ id:'dominoes', title:'Thirty steps', enterWith:'slam', post:{tone:'none', bloom:.35, threshold:1.05, vignette:.22, grain:.045}, beats:[{dur:4,hold:5},{dur:7,hold:4},{dur:4,hold:6}], notes:['Here is why people who study this expect it to be sudden. Suppose each AI can build the next one, and the next one is only one and a half times better. That does not sound like much.', 'A real domino can knock over one that is one and a half times its size. The first is a centimetre tall. Ten steps later it is thirty-eight centimetres. Twenty steps, twenty-two metres. Step thirty is 1.28 kilometres, taller than any building on Earth.', 'Nothing changed between the steps. Same push, same ratio, thirty times.'], setup(d){ const X=[0]; for(let i=1;i<32;i++) X.push(X[i-1]+0.95*Math.pow(1.5,i-1)); const city=[]; let sd=7, px=-80; const rnd=()=>{ sd=(sd*16807)%2147483647; return sd/2147483647; }; while(px<2100){ const w=22+rnd()*46; city.push({x:px,w,h:22+rnd()*74,roof:rnd()>.4}); px+=w+5+rnd()*12; } return { X, city, bg:d.pass(`uniform float uGrain,uSky; void main(){ vec2 q=design(vUv); float hz=mix(1180.,690.,uSky); vec2 w=q*uGrain; float g1=fbm(vec2(w.x*.006,w.y*.022)); float g2=fbm(vec2(w.x*.028+g1*2.2,w.y*.075)); vec3 wood=mix(vec3(.33,.185,.095),vec3(.52,.31,.165),g1); wood=mix(wood,vec3(.60,.39,.22),smoothstep(.45,.95,g2)); wood*=.88+.26*vnoise(vec2(w.x*.01,w.y*.5)); float far=smoothstep(.35,.015,uGrain); wood=mix(wood,vec3(.44,.30,.19),far*.85); float lp=exp(-length((q-vec2(380.,380.))*vec2(.62,1.))*0.0013); wood=mix(wood,vec3(.94,.87,.75),lp*.68); wood+=vec3(.55,.38,.2)*pow(vnoise(q*vec2(.9,.9)+vec2(0.,-uTime*.03)),9.)*.9; vec3 skyc=mix(vec3(.55,.66,.80),vec3(.97,.90,.77),smoothstep(hz-560.,hz,q.y)); float mh=hz-60.-170.*fbm(vec2(q.x*.0016+2.,1.3))-55.*fbm(vec2(q.x*.006,5.)); float mm=smoothstep(mh-2.,mh+2.,q.y)*smoothstep(hz+4.,hz-4.,q.y); vec3 mcol=mix(vec3(.40,.42,.50),vec3(.62,.55,.52),fbm(vec2(q.x*.003,9.))); mcol=mix(mcol,vec3(.95,.87,.76),.35); skyc=mix(skyc,mcol,mm); skyc=mix(skyc,vec3(.97,.89,.76),smoothstep(hz-180.,hz,q.y)*.8); float above=smoothstep(hz+1.5,hz-1.5,q.y); vec3 c=mix(wood,skyc,above*uSky); c*=1.-.30*smoothstep(780.,1080.,q.y)*smoothstep(.02,.5,uGrain); c*=.94+.12*fbm(q*.6); o=vec4(c,1.); }`,'dominoes desk') }; }, draw(s,d,r){ const E=d.E, c=d.ctx2d, groundY=800, cx=1400; const F=29.2*s.k(1,1.0,6.6,E.io3); const Lf=Math.max(2.5,F); const Z=260*Math.pow(1.5,-Lf); const i0=Math.min(29,Math.floor(Lf)), fr=Lf-i0; const camX=r.X[i0]*(1-fr)+r.X[i0+1]*fr; const uSky=Math.min(1,Math.max(0,(Lf-6)/8)); r.bg.draw({uGrain:Math.max(.0008,Z/141.5), uSky}); // toy city along the horizon if(uSky>0.02){ const hz=1180+(690-1180)*uSky, sh=-(Lf-2.5)*3; c.save(); c.globalAlpha=Math.min(1,uSky*.95); for(const b of r.city){ c.fillStyle='#efe6d6'; c.fillRect(b.x+sh,hz+20-b.h,b.w,b.h); if(b.roof){ c.fillStyle='#c2543c'; c.beginPath(); c.moveTo(b.x+sh-3,hz+20-b.h); c.lineTo(b.x+sh+b.w/2,hz+20-b.h-13); c.lineTo(b.x+sh+b.w+3,hz+20-b.h); c.fill(); } } c.strokeStyle='#8d8578'; c.lineWidth=3; const cr=(x,h)=>{ c.beginPath(); c.moveTo(x,hz+20); c.lineTo(x,hz+20-h); c.moveTo(x-38,hz+20-h*.72); c.lineTo(x+64,hz+20-h*.72); c.stroke(); }; cr(250,124); cr(1660,96); c.restore(); } // dominoes const domAlpha=1-s.k(2,0,1.0,E.lin); if(domAlpha>0.02){ c.save(); c.globalAlpha=domAlpha; for(let i=0;i<=29;i++){ if(i>Lf+1.3) break; if(i3400) continue; const bx=cx+(r.X[i]-camX)*Z; if(bx-ws>2300||bx+ws<-300) continue; const a=Math.min(1,Math.max(0,F-i)); const ang=1.24*(a*a*(3-2*a)); c.save(); c.translate(bx+ws*0.5,groundY); if(hs>26){ c.fillStyle='rgba(60,32,12,0.20)'; c.beginPath(); c.ellipse(0,0,ws*0.85,Math.max(3,ws*0.20),0,0,6.2832); c.fill(); } c.rotate(ang); c.fillStyle='#fbf5e7'; c.fillRect(-ws,-hs,ws,hs); c.fillStyle='rgba(150,124,92,0.30)'; c.fillRect(-ws*0.16,-hs,ws*0.16,hs); c.strokeStyle='rgba(150,124,92,0.55)'; c.lineWidth=Math.max(1,ws*0.018); c.strokeRect(-ws,-hs,ws,hs); if(ws>54&&ws<430){ const fs=ws*0.56; d.text(String(i+1),{x:-ws*0.5,y:-hs*0.70-fs*0.55,size:fs,font:'display',color:'#3d2a18',align:'center'}); } c.restore(); } c.restore(); } // pencil and shavings on the desk const pa=1-s.k(1,0,.9,E.lin); if(pa>0.02){ c.save(); c.globalAlpha=pa; c.translate(430,940); c.rotate(-.10); c.fillStyle='#e0a93b'; c.fillRect(-210,-9,360,18); c.fillStyle='#c98f2a'; c.fillRect(-210,2,360,7); c.beginPath(); c.moveTo(150,-9); c.lineTo(214,0); c.lineTo(150,9); c.closePath(); c.fillStyle='#efd9b0'; c.fill(); c.beginPath(); c.moveTo(194,-2.4); c.lineTo(214,0); c.lineTo(194,2.4); c.closePath(); c.fillStyle='#3a3229'; c.fill(); c.fillStyle='#b8b6ae'; c.fillRect(-222,-9,14,18); c.restore(); c.save(); c.globalAlpha=pa; c.strokeStyle='#d9bb8d'; c.lineWidth=4; c.lineCap='round'; c.beginPath(); c.arc(720,975,16,.4,3.6); c.stroke(); c.beginPath(); c.arc(772,1000,12,1.0,4.0); c.stroke(); c.beginPath(); c.arc(676,1012,10,2.0,5.2); c.stroke(); c.restore(); } // the last slab above the mountains const slabE=s.k(2,0,1.6,E.out3); if(slabE>0.001){ const sb=-500+1245*slabE; const gr=c.createLinearGradient(0,sb,0,sb+90); gr.addColorStop(0,'rgba(45,24,10,0.40)'); gr.addColorStop(1,'rgba(45,24,10,0)'); c.fillStyle=gr; c.fillRect(340,sb,1240,90); c.fillStyle='#fbf5e9'; c.fillRect(400,-700,1120,sb+700); const g2=c.createLinearGradient(400,0,1520,sb); g2.addColorStop(0,'rgba(255,250,238,0.85)'); g2.addColorStop(.55,'rgba(240,229,210,0.20)'); g2.addColorStop(1,'rgba(196,176,146,0.38)'); c.fillStyle=g2; c.fillRect(400,-700,1120,sb+700); c.fillStyle='rgba(150,124,92,0.55)'; c.fillRect(398,sb-2,1124,3); d.text('30',{x:960,y:70,size:380,font:'display',color:'#3b2415',align:'center',style:'fade',show:s.k(2,.9,2.2,E.lin)}); } // selection box on domino one const b1s=Z, b1x=cx+(r.X[0]-camX)*Z; d.select(b1x-b1s*0.25-16, groundY-b1s-16, b1s*0.5+32, b1s+32, {a:s.k(0,.7,1.5,E.lin)*(1-s.k(1,0,.5,E.lin))}); // copy const n=Math.min(30,Math.round(F)+1); const hm=0.01*Math.pow(1.5,n-1); const hsTxt=n<=3?(hm*100).toFixed(1)+' cm':hm<1000?hm.toFixed(hm<10?1:0)+' m':(hm/1000).toFixed(1)+' km'; const ctr=s.k(0,.7,1.7,E.lin); d.text(String(n),{x:140,y:96,size:150,font:'800 SIZEpx system-ui,sans-serif',color:'#33200f',style:'fade',show:ctr}); d.text(hsTxt,{x:140,y:300,size:44,font:'mono',color:'#63432a',style:'fade',show:ctr}); d.text('Say each AI builds\na successor\n1.5 times better.',{x:140,y:400,size:66,font:'display',color:'#3b2415',style:'fade',show:s.k(0,.5,1.9,E.lin)}); } });