Deck.transition('line',{dur:1.4,frag:` void main(){ if(p<=0.){o=texture(tA,vUv);return;} if(p>=1.){o=texture(tB,vUv);return;} float h=max(.0015,smoothstep(0.,.48,abs(p-.5))); vec2 uv=vec2(vUv.x,(vUv.y-.5)/h+.5); vec3 c=(p<.5?texture(tA,clamp(uv,0.,1.)):texture(tB,clamp(uv,0.,1.))).rgb; c*=1.-smoothstep(h*.5,h*.5+.001,abs(vUv.y-.5)); c+=vec3(1.,.83,.53)*exp(-abs(vUv.y-.5)*350.)*(1.-smoothstep(.015,.28,abs(p-.5))); o=vec4(c,1.); }`}); Deck.scene({ id:'aim',title:'Aim',enterWith:'line', post:{tone:'aces',exposure:1,bloom:.45,threshold:1.1,grain:.023,vignette:.16}, beats:[{dur:3,hold:4},{dur:4,hold:5},{dur:4,hold:6},{dur:4,hold:5}], notes:[ 'Everything so far assumed one thing: that it aims where we meant it to. Alignment is the question of what it actually wants.', 'Suppose we get it almost right. One degree off. At ten metres that is seventeen centimetres. Every demo and every test happens at ten metres.', 'But the same degree keeps going. At the Moon you miss by about 6,700 kilometres, almost two whole Moons. At the nearest star you miss by 4,700 times the distance from the Earth to the Sun. It is only geometry: the tangent of one degree times the distance.', 'One degree still sounds small. The farther the shot goes, the more it matters where we aimed. (Pause.)' ], setup(d){return {bg:d.pass(` uniform float zoomIn,spaceMix,starRun,beam,drift; float pane(vec2 a){ float x=mod(a.x,3.)-1.5,y=a.y-3.65; float ds=max(max(abs(x)-1.16,1.05-a.y),length(vec2(x,max(0.,y)))-1.16); return 1.-smoothstep(-.016,.016,ds); } float gridBar(float x,float pitch,float w){return 1.-smoothstep(w,w+.012,abs(fract(x/pitch+.5)-.5)*pitch);} float seg(vec2 q,vec2 a,vec2 b){vec2 v=b-a;return length(q-a-v*clamp(dot(q-a,v)/dot(v,v),0.,1.));} vec3 hall(vec2 q){ vec3 ro=vec3(mix(-2.1,.48,zoomIn)+drift,1.76,mix(-.7,9.25,zoomIn)); vec3 rd=vec3((q.x-960.)/1000.,(540.-q.y)/1000.,1.); float t=(14.-ro.z),side=0.; float tx=((rd.x>0.?5.:-7.)-ro.x)/(rd.x+.000001); if(tx>0.&&tx0.?5.5:0.)-ro.y)/(rd.y+.000001); if(ty>0.&&ty4.9){ float win=pane(a),bars=max(gridBar(a.x-.0,.375,.021),gridBar(a.y,.53,.027)); c=mix(c,mix(vec3(1.23,.93,.55)*(.75+.3*vnoise(a*.9)),vec3(.105,.069,.042),bars),win); } }else{ float row=floor(P.x/.42);float wood=vnoise(P.xz*vec2(28.,.7)); c=vec3(.19,.097,.043)*(.65+.5*wood+.17*hash12(vec2(row,2.))); c*=1.-.56*max(gridBar(P.x,.42,.005),gridBar(P.z+row*1.53,4.7,.006)); vec2 light=vec2(P.z-(5.-P.x)*.39,(5.-P.x)*.51); c*=.65+2.2*pane(light)*(1.-.72*max(gridBar(light.x,.375,.031),gridBar(light.y,.53,.038))); if(P.y>5.)c*=.38; } // A freestanding washi disc, with a tripod visible below it. float tz=13.-ro.z;vec2 hit=ro.xy+rd.xy*tz-vec2(2.,1.76); if(tz=1.)c=cosmos(q);else c=mix(hall(q),cosmos(q),spaceMix); o=vec4(c,1.);}`,'aim / cedar and paper')}}, draw(s,d,r){ const z=s.k(1,0,3.2),sp=s.k(2,0,3.1),star=s.k(3,0,4),bm=s.k(1,1.85,3.45),dr=.018*s.mouse.x+.01*Math.sin(s.t*.22); r.bg.draw({zoomIn:z,spaceMix:sp,starRun:star,beam:bm,drift:dr}); const c=d.ctx2d,L=d.E.lin; if(z<1){ c.save();c.globalAlpha=1-z;c.translate(825-590*z+s.mouse.x*5,608+5*Math.sin(s.t*.35));c.rotate(-.17); const limb=()=>{c.beginPath();c.moveTo(12,-437);c.bezierCurveTo(19,-377,133,-244,119,-73);c.bezierCurveTo(101,64,86,218,-8,355);}; limb();c.strokeStyle='#302217';c.lineWidth=18;c.stroke();limb();c.strokeStyle='#b2814d';c.lineWidth=8;c.stroke(); c.beginPath();c.moveTo(12,-437);c.lineTo(-215,1);c.lineTo(-8,355);c.strokeStyle='#dac7a7';c.lineWidth=2;c.stroke(); c.beginPath();c.moveTo(-222,1);c.lineTo(235,-11);c.lineWidth=5;c.strokeStyle='#b9a487';c.stroke(); c.beginPath();c.moveTo(244,-12);c.lineTo(221,-17);c.lineTo(222,-5);c.fillStyle='#b7b9ae';c.fill(); for(let i=0;i<8;i++){c.fillStyle=i%2?'#493328':'#694e38';c.fillRect(98-i*.85,-18+i*6,17,7);} c.restore(); } d.text('What does\nit want?',{x:145,y:168,size:113,font:'display',color:'#fff1d7',show:s.k(0,.2,2,L),hide:s.k(1,0,.6,L)}); d.text('Miss by\none degree.',{x:145,y:168,size:106,font:'display',color:'#fff1d7',show:s.k(1,.8,2,L),hide:s.k(2,0,.6,L)}); const a=s.k(1,3.18,4)*(1-sp), x=960+1000*(2-(-2.1+2.58*z+dr))/(13.7-9.95*z),w=170/(13.7-9.95*z); if(a>0){ d.rect(x,631,w,3,'#f7ecd1',a);d.rect(x,624,2,17,'#f7ecd1',a);d.rect(x+w,624,2,17,'#f7ecd1',a); d.text('10 metres: 17 cm',{x:145,y:665,size:36,font:'mono',color:'#ffda93',alpha:a}); } const b=s.k(2,2.2,4)*(1-star); if(b>0){ const y=246,xx=1310;d.rect(xx-1,y,2,194,'#eed4aa',b);d.rect(xx-9,y,18,2,'#eed4aa',b);d.rect(xx-9,440,18,2,'#eed4aa',b); d.text('6,700 km',{x:xx+30,y:323,size:40,font:'mono',color:'#ffe1ab',alpha:b}); } // Dust motes cross the late light; their visibility falls with the hall. c.save();c.fillStyle='#ffe7b6'; for(let i=0;i<36;i++){let xx=1040+(i*137.1+s.t*(2+i%3))%850,yy=76+(i*81.3+s.t*3)%840; c.globalAlpha=(1-sp)*(.12+.12*Math.sin(i+s.t*.48))*s.k(0,0,3);c.fillRect(xx,yy,2.2,2.2);} c.restore(); } });