Deck.transition('line',{dur:1.2,frag:`void main(){ float a=sat(p*2.), b=sat(p*2.-1.); float e=a*a*(3.-2.*a); float sc=1.-e*.995; vec2 uv=vec2(vUv.x,.5+(vUv.y-.5)/sc); float inside=step(abs(uv.y-.5),.5); vec3 old=texture(tA,uv).rgb*inside; float hh=.51*b*b*(3.-2.*b); vec3 nw=texture(tB,vUv).rgb*step(abs(vUv.y-.5),hh); vec3 base=p<.5?old:nw; float amp=smoothstep(.2,.5,p)*(1.-smoothstep(.5,.95,p)); float g=exp(-abs(vUv.y-.5)*420.)*(.55+.45*(1.-abs(vUv.x-.5)*1.4)); o=vec4(base+vec3(1.,.9,.7)*g*amp*2.2,1.); }`}); Deck.scene({ id:'aim', title:'Aim', enterWith:'line', post:{bloom:.7,threshold:1,vignette:.3,grain:.03,exposure:1,tone:'aces'}, beats:[{dur:2,hold:4},{dur:4.6,hold:5},{dur:4.4,hold:5},{dur:3.6,hold:4}], 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.', 'And that is where the lines end up, far apart, still going. Nothing about the angle changed. Only the distance did. (Pause. Let the stars sit there for a moment.)' ], setup(d){ const glow=(c,x0,y0,x1,y1,rgb,a,dash)=>{ if(a<=.002) return; c.save(); c.globalCompositeOperation='lighter'; c.lineCap='round'; if(dash) c.setLineDash([16,12]); const W=[16,6,2.5],A=[.07,.2,.95]; for(let i=0;i<3;i++){ c.strokeStyle='rgba('+rgb+','+(A[i]*a)+')'; c.lineWidth=W[i]; c.beginPath(); c.moveTo(x0,y0); c.lineTo(x1,y1); c.stroke(); } c.restore(); }; const ring=(c,x,y,r,a)=>{ if(a<=.002) return; c.save(); c.globalAlpha=a; c.strokeStyle='#d6e8ff'; c.lineWidth=2.5; c.beginPath(); c.arc(x,y,r,0,6.2832); c.stroke(); c.beginPath(); c.moveTo(x-r-26,y); c.lineTo(x-r+16,y); c.moveTo(x+r-16,y); c.lineTo(x+r+26,y); c.moveTo(x,y-r-26); c.lineTo(x,y-r+16); c.moveTo(x,y+r-16); c.lineTo(x,y+r+26); c.stroke(); c.restore(); }; const bracketV=(c,x,y0,y1,a)=>{ if(a<=.002) return; c.save(); c.globalAlpha=a; c.strokeStyle='#f6ead2'; c.lineWidth=3; c.beginPath(); c.moveTo(x,y0); c.lineTo(x,y1); c.moveTo(x-14,y0); c.lineTo(x+14,y0); c.moveTo(x-14,y1); c.lineTo(x+14,y1); c.stroke(); c.restore(); }; return { glow, ring, bracketV, scene:d.pass(`uniform float uZ,uSp,uMoon,uStar,uScr; uniform vec2 uM; const vec2 TC=vec2(.3,.02); vec3 hall(vec2 q,float aa){ float hz=-.05; vec3 c; if(q.y.42) c*=.5; } float shaft=pow(.5+.5*cos((q.x+.55*(q.y-.12))*12.566),4.)*(.5+.5*fbm(vec2(q.x*4.+uTime*.03,q.y*6.)))*smoothstep(.5,-.3,q.y); c+=vec3(1.,.7,.35)*shaft*.2; vec2 tq=q-TC; float st=min(sdBox(tq-vec2(0.,-.11),vec2(.0035,.11)),sdBox(tq-vec2(0.,-.052),vec2(.095,.0035))); c=mix(c,vec3(.18,.09,.04),smoothstep(aa,-aa,st)); float dt=length(tq); float band=floor(dt/.0132); vec3 pc=vec3(.8,.74,.62)*(.9+.2*vnoise(q*400.)); if(band<.5) pc=vec3(1.1,.72,.14); else if(mod(band,2.)<.5) pc=vec3(.03,.03,.04); c=mix(c,pc,smoothstep(.066+aa,.066-aa,dt)); return c; } vec3 space(vec2 p){ vec3 c=vec3(.004,.006,.014)+vec3(.01,.015,.03)*fbm(p*2.+3.); vec2 s=p*90.; float h=hash12(floor(s)); c+=vec3(.7,.8,1.)*step(.985,h)*smoothstep(.3,0.,length(fract(s)-.5))*(.5+.5*sin(uTime+h*60.)); vec2 mc=vec2(.2685,-.2037), sc=vec2(.7315,-.2037); vec2 mq=p-mc; float md=length(mq); float r=.12*max(uMoon,.001); if(md.01){ c.save(); c.globalAlpha=ba; c.lineCap='round'; c.strokeStyle='#0e0804'; c.lineWidth=16; c.beginPath(); c.moveTo(470,450); c.quadraticCurveTo(740,770,470,1090); c.stroke(); c.strokeStyle='#7a5530'; c.lineWidth=3; c.beginPath(); c.moveTo(476,450); c.quadraticCurveTo(748,770,476,1090); c.stroke(); c.strokeStyle='#e9dfc8'; c.lineWidth=2; c.beginPath(); c.moveTo(470,450); c.lineTo(OX,OY); c.lineTo(470,1090); c.stroke(); c.strokeStyle='#e8dcc0'; c.lineWidth=4; c.beginPath(); c.moveTo(OX-12,OY+3); c.lineTo(1000,590); c.stroke(); c.fillStyle='#b83a2a'; c.beginPath(); c.moveTo(OX+30,OY-8); c.lineTo(OX+90,OY-24); c.lineTo(OX+90,OY-8); c.closePath(); c.fill(); c.restore(); } // hall lines const hx=1284+27.4*Z, hy=518.4, a1=s.k(1,1.8,3.4,E.out3), ha=1-sp; if(a1>0&&ha>.01){ r.glow(c,OX,OY,OX+(1284-OX)*a1,OY+(hy-OY)*a1,'140,200,255',ha*.8,true); const ex=OX+(hx-OX)*a1, ey=OY+(hy-OY)*a1; r.glow(c,OX,OY,ex,ey,'255,190,90',ha); if(a1>.98){ c.save(); c.globalAlpha=ha; c.fillStyle='#fff3d0'; c.beginPath(); c.arc(hx,hy,7,0,6.2832); c.fill(); c.restore(); } const ba2=s.k(1,3.2,4,E.lin)*ha, by=900; if(ba2>.01){ c.save(); c.globalAlpha=ba2; c.strokeStyle=cream; c.lineWidth=3; c.beginPath(); c.moveTo(1284,by); c.lineTo(hx,by); c.moveTo(1284,by-14); c.lineTo(1284,by+14); c.moveTo(hx,by-14); c.lineTo(hx,by+14); c.stroke(); c.restore(); } d.text('10 metres: 17 cm',{x:(1284+hx)/2,y:by+24,size:34,font:'mono',color:cream,align:'center',style:'fade',show:ba2}); } // space lines const a2=s.k(2,1,3.4,E.out3), sl=.543+(.268-.543)*kk; const xe=OX+1170*a2+290*s.k(3,0,3,E.io3); if(sp>.01&&a2>0){ const yAt=x=>OY-sl*(x-OX); r.glow(c,OX,OY,xe,OY,'140,200,255',sp); r.glow(c,OX,OY,xe,yAt(xe),'255,170,70',sp); r.ring(c,1250,OY,165,s.k(2,2.2,3,E.lin)*(1-kk)); r.ring(c,1750,OY,70,s.k(3,1.2,2.2,E.lin)); const mb=(xe>=1250?s.k(2,3,3.8,E.lin):0)*(1-Math.min(1,kk*2.5)); r.bracketV(c,1250,yAt(1250),OY,mb); d.text('6,700 km',{x:1276,y:(yAt(1250)+OY)/2-56,size:40,font:'mono',color:cream,style:'fade',show:mb}); const sb=s.k(3,2.2,3.4,E.lin); r.bracketV(c,1750,yAt(1750),OY,sb); d.text('4,700 AU',{x:1722,y:(yAt(1750)+OY)/2-20,size:36,font:'mono',color:cream,align:'right',style:'fade',show:sb}); d.text('nearest star',{x:1750,y:OY+90,size:28,font:'mono',color:'#cfd3da',align:'center',style:'fade',show:sb}); } d.text('illustration, angle exaggerated',{x:150,y:d.view.y1-90,size:28,font:'mono',color:'#cfd3da',style:'fade',show:s.k(2,.8,1.6,E.lin)}); // headlines d.text('What does\nit want?',{x:150,y:130,size:112,color:cream,show:s.k(0,.3,1.5,E.lin),hide:s.k(1,0,.6,E.lin)}); d.text('Miss by\none degree.',{x:150,y:130,size:112,color:cream,show:s.k(1,.8,2,E.lin),hide:s.k(2,0,.6,E.lin)}); } });