Deck.scene({ id:'lamp',title:'How far you can see',enterWith:'fade', post:{bloom:.68,threshold:.95,exposure:1,vignette:.19,grain:.024,tone:'aces'}, beats:[{dur:2.2,hold:5},{dur:5.5,hold:5},{dur:5,hold:6}], notes:[ 'Forget test scores. Intelligence is how far you can see. This is one person, with one lantern, in the dark. Everything inside the pool you can think about. Everything outside it is not there.', 'Now light the brightest lantern anyone ever carried. Einstein. Look at how much more of the field he lights. Almost nothing. Now everyone alive, all eight billion of us, together. It is beautiful. It is also still night.', 'So what does it look like when the sun comes up? All of this was always here. What we called the world was one small fold in it.' ], setup(d){return {land:d.pass(` uniform float pull,bright,dawn,warm; uniform vec2 mousePos; float fillS(float v){return 1.-smoothstep(-.8,.8,v);} float seg(vec2 p, vec2 a,vec2 b){vec2 v=b-a;return length(p-a-v*clamp(dot(p-a,v)/dot(v,v),0.,1.));} vec3 camp(vec2 q){ vec2 ctr=vec2(1340.,538.); float z=exp(-pull*5.); vec2 p=(q-ctr-mousePos*4.)/z; float g=exp(-dot((p-vec2(-15.,240.))/vec2(405.,125.),(p-vec2(-15.,240.))/vec2(405.,125.))); float flick=(.98+.02*sin(uTime*5.1))*(.85+.15*warm+.7*bright); vec3 amber=vec3(1.,.405,.078); vec3 c=vec3(.003,.004,.006)+amber*.028*exp(-length(p)*.009)*flick; if(p.y>90.){ float tex=vnoise(p*vec2(.1,.3))*.6+.4*vnoise(p*.023); c+=vec3(.21,.104,.031)*g*(.38+.95*tex)*flick; vec2 paper=rot2(-.17)*(p-vec2(-153.,248.));paper.x+=paper.y*.55; float page=fillS(sdBox(paper,vec2(55.,16.))); c=mix(c,vec3(.54,.37,.19)*(.72+.22*step(4.,paper.x))*g,page); for(int i=0;i<5;i++){ float j=float(i);vec2 rr=p-vec2(-285.+j*133.,208.+24.*sin(j*4.)); float v=length(rr/vec2(23.+10.*sin(j),13.))+rr.x*.007+.11*sin(rr.x*.13)-1.; c=mix(c,g*vec3(.15,.092,.057)*(.32+.9*smoothstep(2.,-10.,rr.y+rr.x*.25)),1.-smoothstep(-.06,.06,v)); } } // Field iron: the long upright bends back on itself to carry the bail. vec3 iron=vec3(.097,.065,.037); float pole=min(seg(p,vec2(88.,242.),vec2(88.,-167.)),abs(length(p-vec2(44.,-167.))-44.)+max(0.,p.y+167.)); pole=min(pole,seg(p,vec2(0.,-167.),vec2(0.,-148.))); c=mix(c,iron*(.4+.65*exp(-abs(p.x-84.)*.4)),fillS(pole-4.)); vec2 bail=(p-vec2(0.,-101.))/vec2(49.,49.); c=mix(c,iron*1.4,fillS(abs(length(bail)-1.)*49.-1.8)*step(p.y,-76.)); vec2 bulb=(p-vec2(0.,-6.))/vec2(39.,59.); float shell=length(bulb),light=length((p-vec2(0.,12.))*vec2(1.,.78)); c+=amber*.23*exp(-light/48.)*flick; c=mix(c,c+amber*(.068+.63*pow(shell,9.)*(.5+.5*sin(bulb.x*5.))) ,fillS((shell-1.)*39.)); float ax=abs(p.x); float tank=max(abs(p.y-61.)-20.,ax-(44.-.016*pow(p.y-64.,2.))); float cap=max(abs(p.y+71.)-21.,ax-(27.+(p.y+71.)*.65)); vec3 enamel=vec3(.195,.12,.049)*(.24+.74*exp(-abs(p.x+16.)*.084)+.22*cos(p.y*.53)); c=mix(c,enamel,fillS(min(tank,cap))); c=mix(c,iron*2.,fillS(sdBox(p-vec2(0.,-94.),vec2(17.,5.)))); float rail=abs(ax-(47.+5.*cos(p.y*.039))); c=mix(c,enamel*1.5,fillS(max(rail-4.,abs(p.y+2.)-65.))); float guard=min(seg(p,vec2(-40.,-47.),vec2(36.,39.)),seg(p,vec2(40.,-47.),vec2(-36.,39.))); c=mix(c,iron*1.6,fillS(guard-1.3)); vec2 flame=p-vec2(0.,16.); flame.x-=3.*sin(uTime*3.)*smoothstep(6.,-23.,flame.y); float wick=length(flame/vec2(8.+.13*clamp(flame.y,-21.,12.),23.)); c+=amber*4.*(1.-smoothstep(.75,1.,wick))*flick+vec3(2.,1.7,.7)*exp(-light*.13); for(int i=0;i<6;i++){ float j=float(i),a=uTime*(.49+.05*j)+j*5.; vec2 m=p-vec2(cos(a)*(83.+6.*j),-27.+sin(a*1.7)*62.); c+=vec3(.64,.45,.22)*exp(-length(m*vec2(.55,1.3))*.58); } // Dry stems in offset depth rows, each bearing a narrow seed head. for(int i=0;i<8;i++){ float j=float(i),base=168.+j*19.,xx=p.x+j*157.,id=floor(xx/26.); float rn=hash12(vec2(id,j)),h=(22.+74.*rn)*(.8+j*.045); float yf=(base-p.y)/h; float stem=xx-26.*(id+.5)-(rn-.5)*15.*yf*yf-2.*sin(uTime*.6+rn*8.)*yf; float blade=1.-smoothstep(.4,1.6,abs(stem)); blade=max(blade,(1.-smoothstep(.8,2.4,abs(stem)))*step(.78,yf)); float mask=blade*step(0.,yf)*step(yf,1.)*step(.2,rn)*smoothstep(48.,180.,abs(p.x+55.)); c=mix(c,vec3(.36,.193,.065)*exp(-abs(p.x)*.0035)*(.25+rn)*flick,mask); } return c; } vec3 embers(vec2 q){ vec2 p=(q-vec2(1110.,600.))/1080.;p+=mousePos*.005; float y=p.y; p.y*=1.8; p*=1.65+.32*pull; float ridge=abs(p.y+.24*sin(p.x*3.3)+.15*sin(p.x*7.5)+.25*p.x); float density=exp(-ridge*5.)+.6*exp(-abs(ridge-.4)*13.); vec3 c=vec3(.004,.006,.009)+vec3(.041,.014,.003)*density; for(int i=0;i<3;i++){ vec2 cell=p*(60.+float(i)*87.);vec2 id=floor(cell); float n=hash12(id+29.);vec2 off=vec2(n,hash12(id+3.))*.66+.17; float lamp=exp(-length(fract(cell)-off)*(9.+float(i)*2.)); c+=vec3(1.6,.49,.085)*lamp*step(hash12(id-11.),density*.77)*(.25+2.5*n); } return c*(.27+.73*smoothstep(-.37,.05,y)); } vec3 morning(vec2 q){ vec2 p=q/1080.+mousePos*.005; vec2 sun=vec2(1.25,.33); float dist=length(p-sun); vec3 c=mix(vec3(.13,.32,.48),vec3(.85,.63,.39),smoothstep(.03,.71,p.y)); c+=vec3(1.,.78,.47)*(.24*exp(-dist*8.)+4.*(1.-smoothstep(.031,.033,dist))); float hz=.64; if(p.y>hz){ float dep=p.y-hz; float w=vnoise(vec2(p.x*15./(.09+dep),dep*220.+uTime*.3)); c=mix(vec3(.41,.52,.54),vec3(.035,.145,.21),smoothstep(0.,.31,dep)); c+=vec3(.55,.43,.23)*exp(-abs(p.x-sun.x)/(.05+dep*.52))*smoothstep(.46,.82,w); } for(int i=0;i<4;i++){ float j=float(i),sc=.17+j*j*.049; vec2 a=(p-vec2(1.24-.043*j,.657+.014*j*j))/sc; float n=vnoise(a*3.3+7.); float roof=-.93+.17*a.x+.16*sin(2.4*a.x)+.08*n; float hole=length(vec2((a.x-.08)*1.27,(a.y-.06)*1.55))-.99+.085*n+.058*sin(a.y*8.); float rock=max(max(roof-a.y,-hole),a.y-.06-.03*sin(a.x*7.)); rock=max(rock,-a.x-1.23+.17*sin(2.*a.y)); float band=.5+.5*sin((a.y+.12*a.x+.052*sin(a.x*3.))*70.+n*2.); vec3 stone=mix(vec3(.205,.065,.035),vec3(.58,.224,.091),.37+.42*band+.19*n); stone*=.62+.45*n+.65*exp(-abs(a.y-roof)*22.); stone*=.62+.38*smoothstep(.0,.21,hole); c=mix(c,mix(vec3(.48,.47,.42),stone,.36+.21*j),1.-smoothstep(-.002,.002,rock)); } c+=vec3(.13,.095,.056)*exp(-abs(p.x-1.25+(p.y-.33)*.55)*17.)*smoothstep(.35,.62,p.y); for(int i=0;i<7;i++){ float j=float(i);vec2 b=(p-vec2(.5+j*.052+.006*sin(uTime*.24),.32+.048*sin(j*1.6)))*1080.; float wing=abs(b.y+.48*abs(b.x)-.044*b.x*b.x); c=mix(c,vec3(.068,.093,.099),fillS(wing-.9)*step(abs(b.x),6.+mod(j,3.))); } return c*(.61+.39*smoothstep(.1,1.,p.x)); } void main(){ vec2 q=design(vUv);vec3 c=vec3(0.); if(dawn<1.){ if(pull<.99)c=camp(q); if(pull>.01)c=mix(c,embers(q),smoothstep(.01,.99,pull)); } if(dawn>0.)c=mix(c,morning(q),dawn); o=vec4(c,1.); }`,'wick, embers and sandstone')} }, draw(s,d,r){ const L=d.E.lin,p=s.k(1,1.05,5.5),sun=s.k(2,.1,5),b=s.k(1,0,.95); r.land.draw({pull:p,bright:b,dawn:sun,warm:s.k(0,0,2.2),mousePos:[s.mouse.x,s.mouse.y]}); const t={x:142,y:175,size:86,font:'display',color:'#f6e9cf',by:'line'}; d.text('Intelligence is\nhow far you can see.',{...t,show:s.k(0,.18,1.55,L),hide:s.k(1,0,.58,L)}); d.text('You',{x:1482,y:523,size:31,font:'mono',color:'#e4c89b',show:s.k(0,.9,1.8,L),hide:s.k(1,0,.6,L)}); d.text('Everyone alive',{...t,size:105,show:s.k(1,.95,2.2,L),hide:s.k(2,0,.6,L)}); d.text('Superintelligence',{...t,x:135,y:795+90*(1-s.k(2,.9,3.5)),size:121,show:s.k(2,.9,2.4,L)}); const read={x:d.view.x1-102,y:954,size:42,font:'mono',align:'right',color:'#f3d7a8',style:'fade'}; d.text('1.6 × 10^19',{...read,show:s.k(0,.8,2.2,L),hide:s.k(1,.45,1.05,L)}); d.text('1.3 × 10^29',{...read,size:48,show:s.k(1,1.2,2.55,L),hide:s.k(2,0,.65,L)}); d.text('> 10^29',{...read,size:53,color:'#fff1d7',show:s.k(2,2.9,4.4,L)}); } });