Guest User

Untitled

a guest
Oct 6th, 2026
64
0
Never
3
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* THE NIGHT GARDEN — a completely procedural miniature.
  2.  * Every visible mark is a triangle rasterized by the captured Favur renderer.
  3.  * Mesh construction, orthographic projection and baked lighting are JavaScript;
  4.  * actual GLSL shaders, attribute fetching, interpolation, depth and blending
  5.  * are the run's unmodified software WebGL implementation. No external assets.
  6.  */
  7. (() => {
  8.   const W=WIDTH, H=HEIGHT, aspect=W/H, TAU=Math.PI*2;
  9.   const animate=typeof ANIMATE!=='undefined' && ANIMATE;
  10.   let seed=83173;
  11.   const random=()=>((seed=Math.imul(seed,1664525)+1013904223>>>0)/4294967296);
  12.   const mix=(a,b,t)=>a.map((v,i)=>v*(1-t)+b[i]*t);
  13.   const add=(a,b)=>a.map((v,i)=>v+b[i]);
  14.   const sub=(a,b)=>a.map((v,i)=>v-b[i]);
  15.   const mul=(a,s)=>a.map(v=>v*s);
  16.   const dot=(a,b)=>a.reduce((s,v,i)=>s+v*b[i],0);
  17.   const cross=(a,b)=>[a[1]*b[2]-a[2]*b[1],a[2]*b[0]-a[0]*b[2],a[0]*b[1]-a[1]*b[0]];
  18.   const unit=a=>mul(a,1/Math.hypot(...a));
  19.   const color=h=>[parseInt(h.slice(0,2),16)/255,parseInt(h.slice(2,4),16)/255,parseInt(h.slice(4,6),16)/255];
  20.   const C={stone:color('7597a0'),edge:color('b8c9b5'),dark:color('243447'),grass:color('397b70'),copper:color('b77956'),gold:color('edb967'),water:color('46daca'),light:color('ffe1a0')};
  21.   const right=unit([.82,-.57,0]), up=unit([-.342,-.492,.8]), eye=unit([.456,.656,.598]);
  22.   const project=p=>[dot(p,right)/8.8, (dot(p,up)-.5)/6.6, -.08-dot(p,eye)/32];
  23.   const sky=[], stars=[], movers=[];
  24.   let solids=[], glows=[];
  25.   // Deterministic phase-driven meshes. The still scene is unchanged at phase 0.
  26.   function moving(build){
  27.     const initialSeed=seed, s=solids.length, g=glows.length;
  28.     build(0);
  29.     if(animate){
  30.       solids.length=s;glows.length=g;
  31.       movers.push(phase=>{const saved=seed;seed=initialSeed;build(phase);seed=saved;});
  32.     }
  33.   }
  34.   const vertex=(out,p,c)=>out.push(...p,...c.slice(0,3),c[3]??1);
  35.   const rawTri=(out,a,b,c,ca,cb=ca,cc=ca)=>{vertex(out,a,ca);vertex(out,b,cb);vertex(out,c,cc);};
  36.   const key=unit([-1,-.6,1.8]);
  37.   function lit(base,n,p){
  38.     const k=Math.max(0,dot(n,key)), rim=Math.max(0,dot(n,unit([1,1,.3])));
  39.     const lift=.43+.56*k;
  40.     let c=base.map((v,i)=>v*lift*[1.10,.98,.91][i]+rim*[.018,.09,.13][i]);
  41.     if(base[0]>base[2]*1.25 && base[0]>.4){
  42.       const spec=Math.pow(Math.max(0,dot(n,unit(add(key,eye)))),22)*.36;
  43.       c=c.map((v,i)=>v+spec*[1,.78,.48][i]);
  44.     }
  45.     // Warm bounce from observatory; blue ambient under the island.
  46.     const d=Math.hypot(p[0]+.8,p[1]+.6,p[2]-2.2);
  47.     c=c.map((v,i)=>v+[.16,.055,.012][i]*Math.exp(-d*.65));
  48.     if(p[2]<-.8)c=mix(c,color('163c59'),Math.min(.43,(-p[2]-.8)*.075));
  49.     return c.map(v=>Math.min(1,v));
  50.   }
  51.   function tri(a,b,c,base,emission=false){
  52.     let n=unit(cross(sub(b,a),sub(c,a)));
  53.     const p=mul(add(add(a,b),c),1/3);
  54.     // Meshes are two-sided; orient light toward the visible side.
  55.     if(dot(n,eye)<0)n=mul(n,-1);
  56.     const shade=emission?base:lit(base,n,p);
  57.     rawTri(solids,project(a),project(b),project(c),shade);
  58.   }
  59.   const quad=(a,b,c,d,col,em=false)=>{tri(a,b,c,col,em);tri(a,c,d,col,em);};
  60.   function screenDisc(out,x,y,r,c,alpha=1,z=.94,segments=64){
  61.     for(let i=0;i<segments;i++){
  62.       const a=TAU*i/segments,b=TAU*(i+1)/segments;
  63.       rawTri(out,[x,y,z],[x+Math.cos(a)*r/aspect,y+Math.sin(a)*r,z],[x+Math.cos(b)*r/aspect,y+Math.sin(b)*r,z],[...c,alpha]);
  64.     }
  65.   }
  66.   function halo(x,y,r,c,alpha=.2,z=.9){
  67.     const steps=animate&&r<.05?3:9, seg=animate&&r<.05?16:64;
  68.     for(let j=0;j<steps;j++)for(let i=0;i<seg;i++){
  69.       const a=TAU*i/seg,b=TAU*(i+1)/seg,r0=r*j/steps,r1=r*(j+1)/steps;
  70.       const opacity=t=>alpha*Math.pow(1-t,3);
  71.       const p=(rr,t)=>[x+Math.cos(t)*rr/aspect,y+Math.sin(t)*rr,z];
  72.       const c0=[...c,opacity(j/steps)],c1=[...c,opacity((j+1)/steps)];
  73.       rawTri(glows,p(r0,a),p(r1,a),p(r1,b),c0,c1,c1);
  74.       rawTri(glows,p(r0,a),p(r1,b),p(r0,b),c0,c1,c0);
  75.     }
  76.   }
  77.   function line2(out,a,b,width,col,z=.89){
  78.     const d=[b[0]-a[0],b[1]-a[1]], len=Math.hypot(d[0]*aspect,d[1]);
  79.     const n=[-d[1]/len*width/aspect,d[0]*aspect/len*width];
  80.     const p=[a[0]+n[0],a[1]+n[1],z],q=[a[0]-n[0],a[1]-n[1],z],r=[b[0]-n[0],b[1]-n[1],z],s=[b[0]+n[0],b[1]+n[1],z];
  81.     rawTri(out,p,q,r,col);rawTri(out,p,r,s,col);
  82.   }
  83.   function beam(a,b,r,col,sides=8){
  84.     const dir=unit(sub(b,a)), u=unit(cross(dir,Math.abs(dir[2])>.9?[1,0,0]:[0,0,1])),v=cross(dir,u);
  85.     const at=(p,i)=>add(p,add(mul(u,r*Math.cos(TAU*i/sides)),mul(v,r*Math.sin(TAU*i/sides))));
  86.     for(let i=0;i<sides;i++){
  87.       quad(at(a,i),at(a,i+1),at(b,i+1),at(b,i),col);
  88.       tri(b,at(b,i),at(b,i+1),col);
  89.     }
  90.   }
  91.   function cylinder(x,y,z,r,h,col,n=24,topR=r){
  92.     for(let i=0;i<n;i++){
  93.       const a=TAU*i/n,b=TAU*(i+1)/n;
  94.       const p=[x+Math.cos(a)*r,y+Math.sin(a)*r,z],q=[x+Math.cos(b)*r,y+Math.sin(b)*r,z];
  95.       const s=[x+Math.cos(a)*topR,y+Math.sin(a)*topR,z+h],t=[x+Math.cos(b)*topR,y+Math.sin(b)*topR,z+h];
  96.       quad(p,q,t,s,col);tri([x,y,z+h],s,t,col);
  97.     }
  98.   }
  99.   function box(x,y,z,sx,sy,sz,col){
  100.     const p=[[x-sx/2,y-sy/2,z],[x+sx/2,y-sy/2,z],[x+sx/2,y+sy/2,z],[x-sx/2,y+sy/2,z]];
  101.     for(let i=0;i<4;i++)quad(p[i],p[(i+1)%4],add(p[(i+1)%4],[0,0,sz]),add(p[i],[0,0,sz]),col);
  102.     quad(...p.map(a=>add(a,[0,0,sz])),col);
  103.   }
  104.   function sphere(center,r,col,lat=12,lon=32){
  105.     const p=(j,i)=>add(center,[r*Math.sin(Math.PI*j/lat)*Math.cos(TAU*i/lon),r*Math.sin(Math.PI*j/lat)*Math.sin(TAU*i/lon),r*Math.cos(Math.PI*j/lat)]);
  106.     for(let j=0;j<lat;j++)for(let i=0;i<lon;i++)quad(p(j,i),p(j+1,i),p(j+1,i+1),p(j,i+1),col);
  107.   }
  108.   function ring(center,r,t,col,normal=[0,0,1],segments=96){
  109.     const u=unit(cross(normal,Math.abs(normal[2])>.9?[1,0,0]:[0,0,1])),v=unit(cross(normal,u));
  110.     const p=a=>add(center,add(mul(u,r*Math.cos(a)),mul(v,r*Math.sin(a))));
  111.     for(let i=0;i<segments;i++)beam(p(TAU*i/segments),p(TAU*(i+1)/segments),t,col,5);
  112.   }
  113.   function island(cx,cy,z,r,depth,n=17){
  114.     const rings=[];
  115.     for(let j=0;j<4;j++){
  116.       rings[j]=[];
  117.       for(let i=0;i<n;i++){
  118.         const a=TAU*i/n, irregular=1+(random()-.5)*.22;
  119.         const radius=r*[1,.99,.72,.12][j]*irregular;
  120.         rings[j].push([cx+Math.cos(a)*radius,cy+Math.sin(a)*radius*.81,z-[0,.4,depth*.53,depth][j]+(j===0?0:(random()-.5)*.45)]);
  121.       }
  122.     }
  123.     const groundColor=p=>{
  124.       let c=lit(mix(C.grass,color('78a58a'),.23),[0,0,1],p);
  125.       if(r>2){
  126.         let shade=0;
  127.         for(const height of [.4,1,1.7,2.4,3.1]){
  128.           const xx=p[0]+key[0]*height/key[2]+.9,yy=p[1]+key[1]*height/key[2]+.55;
  129.           shade=Math.max(shade,Math.min(1,Math.max(0,(1.35-Math.hypot(xx,yy))/.45))*.5);
  130.         }
  131.         for(const [tx,ty] of [[-2.25,-.85],[-2.45,.12],[-2,.7],[-.6,-2],[.2,-1.98],[1.4,-1.4],[1.95,-.95]]){
  132.           shade=Math.max(shade,Math.max(0,1-Math.hypot((p[0]-tx-.20)/.50,(p[1]-ty-.15)/.40))*.55);
  133.         }
  134.         c=mix(c,color('193b45'),shade);
  135.       }
  136.       return c;
  137.     };
  138.     for(let i=0;i<n;i++){
  139.       const k=(i+1)%n;
  140.       const center=[cx,cy,z+.05];
  141.       for(let j=0;j<12;j++){
  142.         const a=mix(center,rings[0][i],j/12),b=mix(center,rings[0][i],(j+1)/12),c=mix(center,rings[0][k],(j+1)/12),d=mix(center,rings[0][k],j/12);
  143.         rawTri(solids,project(a),project(b),project(c),groundColor(a),groundColor(b),groundColor(c));
  144.         if(j)rawTri(solids,project(a),project(c),project(d),groundColor(a),groundColor(c),groundColor(d));
  145.       }
  146.       for(let j=0;j<3;j++){
  147.         const palette=j===0?mix(C.edge,C.grass,.45):mix(color('294f64'),color('69939b'),random()*.6);
  148.         tri(rings[j][i],rings[j+1][i],rings[j][k],palette);
  149.         tri(rings[j][k],rings[j+1][i],rings[j+1][k],mix(palette,C.dark,random()*.3));
  150.       }
  151.     }
  152.   }
  153.   function pine(x,y,z,h){
  154.     cylinder(x,y,z,.065*h,h*.73,color('785c57'),6);
  155.     for(let j=0;j<4;j++)cylinder(x,y,z+h*(.2+j*.17),h*(.30-j*.05),h*.47,mix(color('1a5d61'),color('70b8a0'),j*.17),7,.01);
  156.   }
  157.   function crystal(x,y,z,h,r){
  158.     const shades=['60ded5','358fba','1b5b9c','b0f6dc','54bacd','246987'];
  159.     for(let i=0;i<6;i++){
  160.       const a=TAU*i/6,b=TAU*(i+1)/6;
  161.       const p=[x+Math.cos(a)*r,y+Math.sin(a)*r,z],q=[x+Math.cos(b)*r,y+Math.sin(b)*r,z];
  162.       tri(p,q,[x+.05,y,z+h],color(shades[i]),true);
  163.       tri(q,p,[x,y,z-h*.35],color(shades[(i+2)%6]),true);
  164.     }
  165.   }
  166.  
  167.   // Gradient sky, many real triangle stars, and a restrained celestial diagram.
  168.   const lower=color('163b50'), upper=color('080f26');
  169.   rawTri(sky,[-1,-1,.99],[1,-1,.99],[1,1,.99],lower,lower,upper);
  170.   rawTri(sky,[-1,-1,.99],[1,1,.99],[-1,1,.99],lower,upper,upper);
  171.   for(let i=0;i<520;i++){
  172.     const x=random()*2-1,y=random()*2-1,r=(.0007+random()**5*.0024),c=mix(color('688eac'),color('fff1c9'),random());
  173.     stars.push({x,y,r,c});
  174.     screenDisc(sky,x,y,r,c,1,.95,5);
  175.     if(r>.0027){line2(sky,[x-.004,y],[x+.004,y],.00045,c);line2(sky,[x,y-.005],[x,y+.005],.00045,c);}
  176.   }
  177.   if(animate)moving(phase=>{
  178.     stars.forEach(({x,y,r,c},i)=>{
  179.       if(i%7!==0)return;
  180.       const brightness=(.5+.5*Math.sin(phase*TAU*(1+i%3)+i*2.399))**4;
  181.       screenDisc(glows,x,y,r*(1+brightness*.7),c,brightness*.85,.91,6);
  182.       if(r>.0015)halo(x,y,.015,c,brightness*.20,.91);
  183.     });
  184.   });
  185.   // Stylized ringed moon, drawn in the same software pipeline.
  186.   const mx=-.57,my=.55,mr=.16;
  187.   const moonLight=unit([-.75,.5,.66]);
  188.   const moonPoint=(r,a)=>[mx+r*Math.cos(a)*mr/aspect,my+r*Math.sin(a)*mr,.86];
  189.   function moonColor(r,a){
  190.     const n=[r*Math.cos(a),r*Math.sin(a),Math.sqrt(Math.max(0,1-r*r))];
  191.     const light=Math.max(0,dot(n,moonLight));
  192.     const bands=.025*Math.sin(n[1]*58+n[0]*3)+.018*Math.sin(n[1]*121);
  193.     return mix(color('284459'),color('f2d6a3'),Math.min(1,.09+light*.90+bands));
  194.   }
  195.   for(let j=0;j<28;j++)for(let i=0;i<128;i++){
  196.     const r=j/28,s=(j+1)/28,a=i*TAU/128,b=(i+1)*TAU/128;
  197.     rawTri(sky,moonPoint(r,a),moonPoint(s,a),moonPoint(s,b),moonColor(r,a),moonColor(s,a),moonColor(s,b));
  198.     rawTri(sky,moonPoint(r,a),moonPoint(s,b),moonPoint(r,b),moonColor(r,a),moonColor(s,b),moonColor(r,b));
  199.   }
  200.   for(let j=0;j<3;j++)for(let i=0;i<180;i++){
  201.     const t=TAU*i/180,u=TAU*(i+1)/180;
  202.     const p=a=>[mx+Math.cos(a)*(.175+j*.007),my+Math.sin(a)*.038+Math.cos(a)*.06];
  203.     if(Math.sin(t)<0 || Math.abs(Math.cos(t))>.68)line2(sky,p(t),p(u),j===1?.0021:.0008,color(j===1?'bdc9ad':'486879'),.84);
  204.   }
  205.   for(let i=0;i<70;i++){
  206.     const a=i/69*Math.PI*1.65;
  207.     if(i%3!==0)line2(sky,[.1+Math.cos(a)*.71,.02+Math.sin(a)*.75],[.1+Math.cos(a+.013)*.71,.02+Math.sin(a+.013)*.75],.00045,color('29485d'));
  208.   }
  209.   // Main island and its smaller bridge landing.
  210.   island(-.35,0,0,3.25,3.85,23);
  211.   island(5.0,.25,-.25,1.12,1.9,13);
  212.   island(-4.9,-.9,-.5,.72,1.65,10);
  213.   island(-3.8,2.3,-2.2,.42,.9,8);
  214.   crystal(-4.9,-.9,-.43,1.0,.22);
  215.   crystal(-3.8,2.3,-2.12,.58,.14);
  216.   // Fragmented rock and glowing mineral seams below the garden.
  217.   for(let i=0;i<16;i++){
  218.     const a=random()*TAU,r=1.3+random()*1.2;
  219.     crystal(-.35+Math.cos(a)*r,Math.sin(a)*r*.75,-1.0-random()*1.45,.32+random()*.55,.07+random()*.09);
  220.   }
  221.   for(let i=0;i<7;i++){
  222.     const a=random()*TAU;
  223.     island(Math.cos(a)*(3.1+random()),Math.sin(a)*2.4,-3.1-random(),.12+random()*.19,.4+random()*.45,5);
  224.   }
  225.   // Circular terrace and stairs; alternating tiles introduce human scale.
  226.   cylinder(-.9,-.55,.03,1.68,.2,C.dark,40);
  227.   cylinder(-.9,-.55,.23,1.62,.12,C.edge,40);
  228.   cylinder(-.9,-.55,.35,1.52,.07,color('536f78'),40);
  229.   for(let i=0;i<48;i++){
  230.     const a=i*TAU/48,b=(i+.72)*TAU/48;
  231.     quad([-.9+Math.cos(a)*1.34,-.55+Math.sin(a)*1.34,.427],[-.9+Math.cos(a)*1.49,-.55+Math.sin(a)*1.49,.427],[-.9+Math.cos(b)*1.49,-.55+Math.sin(b)*1.49,.427],[-.9+Math.cos(b)*1.34,-.55+Math.sin(b)*1.34,.427],C.edge);
  232.   }
  233.   for(let j=0;j<5;j++)box(.25+j*.25,.53,.025,.36,.75,.4-j*.075,C.edge);
  234.   // Observatory drum, stone bands, luminous arched windows and columns.
  235.   const ox=-.9,oy=-.55,base=.42,radius=1.06;
  236.   cylinder(ox,oy,base,1.14,.19,C.edge,32);
  237.   cylinder(ox,oy,base+.19,radius,1.83,color('93b1ad'),32);
  238.   for(let z of [.7,1.25,1.8,2.25])cylinder(ox,oy,z,1.075,.038,color('657f84'),32);
  239.   cylinder(ox,oy,2.38,1.19,.18,C.edge,32);
  240.   cylinder(ox,oy,2.56,1.25,.09,C.copper,40);
  241.   for(let i=0;i<10;i++){
  242.     const a=i*TAU/10,radial=[Math.cos(a),Math.sin(a),0],tangent=[-Math.sin(a),Math.cos(a),0];
  243.     const p=(u,z,r=1.079)=>add([ox,oy,z],add(mul(radial,r),mul(tangent,u)));
  244.     quad(p(-.205,.98),p(.205,.98),p(.205,1.85),p(-.205,1.85),C.dark);
  245.     quad(p(-.14,1.02,1.083),p(.14,1.02,1.083),p(.14,1.79,1.083),p(-.14,1.79,1.083),color(i%3===0?'f8ae61':'ffdc90'),true);
  246.     for(let j=0;j<10;j++){
  247.       const a0=j*Math.PI/10,a1=(j+1)*Math.PI/10;
  248.       tri(p(0,1.79,1.084),p(Math.cos(a0)*.14,1.79+Math.sin(a0)*.14,1.084),p(Math.cos(a1)*.14,1.79+Math.sin(a1)*.14,1.084),C.light,true);
  249.     }
  250.     beam(p(0,1.0,1.094),p(0,1.91,1.094),.017,C.copper,5);
  251.     beam(p(-.15,1.40,1.094),p(.15,1.40,1.094),.018,C.copper,5);
  252.     beam(p(-.265,.69),p(-.265,2.35),.055,C.edge,6);
  253.   }
  254.   // Copper dome with patinated facets, raised metal ribs and little rivets.
  255.   const domeZ=2.65, domeR=1.22, levels=10, sectors=40;
  256.   const dp=(j,i)=>[ox+domeR*Math.cos(j/levels*Math.PI/2)*Math.cos(i/sectors*TAU),oy+domeR*Math.cos(j/levels*Math.PI/2)*Math.sin(i/sectors*TAU),domeZ+Math.sin(j/levels*Math.PI/2)*1.15];
  257.   for(let j=0;j<levels;j++)for(let i=0;i<sectors;i++){
  258.     const col=mix(C.copper,color('3c9791'),Math.max(0,Math.sin(i*2.3+j*.8))*.42);
  259.     quad(dp(j,i),dp(j,i+1),dp(j+1,i+1),dp(j+1,i),col);
  260.   }
  261.   for(let i=0;i<sectors;i+=5)for(let j=0;j<levels;j++)beam(dp(j,i),dp(j+1,i),.022,C.gold,5);
  262.   cylinder(ox,oy,3.78,.12,.24,C.gold,12);
  263.   sphere([ox,oy,4.04],.09,C.gold,6,12);
  264.   beam([ox,oy,4.08],[ox,oy,4.5],.018,C.gold,5);
  265.   // Roof telescope: black aperture, brass bands, finder and support.
  266.   const ta=[ox+.54,oy+.25,3.35],tb=[ox+1.49,oy+.22,4.09],td=unit(sub(tb,ta));
  267.   beam(ta,tb,.20,color('335b69'),20);
  268.   for(let t of [0,.12,.80,1])beam(add(ta,mul(sub(tb,ta),t-.025)),add(ta,mul(sub(tb,ta),t+.025)),.223,C.gold,20);
  269.   beam(add(tb,mul(td,.040)),add(tb,mul(td,.043)),.176,color('081e31'),24);
  270.   beam(add(tb,mul(td,.044)),add(tb,mul(td,.046)),.13,color('32778c'),24);
  271.   sphere(add(add(tb,mul(td,.052)),[-.035,0,.045]),.025,color('9ae1db'),4,8);
  272.   beam(add(ta,[0,0,.26]),add(tb,[-.35,0,.10]),.045,C.gold,10);
  273.   // Curving stepping stones through the garden.
  274.   for(let i=0;i<10;i++){
  275.     const t=i/9;
  276.     cylinder(.9+t*1.85,.6-Math.sin(t*Math.PI)*.35,.025,.19,.075,mix(C.edge,C.stone,random()*.5),6);
  277.   }
  278.   // Arched bridge, with actual open space beneath and individual coping stones.
  279.   const start=2.3,end=4.62,segments=24;
  280.   const bz=t=>.16+Math.sin(t*Math.PI)*.39;
  281.   for(let i=0;i<segments;i++){
  282.     const t=i/segments,u=(i+1)/segments,x=start+(end-start)*t,xx=start+(end-start)*u;
  283.     for(let side of [-1,1]){
  284.       const y=.25+side*.34;
  285.       quad([x,y,bz(t)],[xx,y,bz(u)],[xx,y,bz(u)-.19],[x,y,bz(t)-.19],i%2?C.stone:C.edge);
  286.       beam([x,y,bz(t)+.32],[xx,y,bz(u)+.32],.045,C.gold,6);
  287.       if(i%3===0)beam([x,y,bz(t)],[x,y,bz(t)+.35],.035,C.gold,6);
  288.     }
  289.     quad([x,-.09,bz(t)],[xx,-.09,bz(u)],[xx,.59,bz(u)],[x,.59,bz(t)],i%3?C.edge:C.stone);
  290.   }
  291.   // Landing pavilion: an armillary sphere above a glowing miniature planet.
  292.   cylinder(5,.25,-.22,.60,.18,C.edge,20);
  293.   cylinder(5,.25,-.04,.19,.61,C.stone,12);
  294.   cylinder(5,.25,.53,.35,.08,C.gold,20);
  295.   sphere([5,.25,1.05],.24,color('75daca'),8,16);
  296.   moving(phase=>{
  297.     const a=phase*TAU;
  298.     ring([5,.25,1.05],.52,.022,C.gold,unit([Math.cos(a)-.3*Math.sin(a),Math.sin(a)+.3*Math.cos(a),.45]),48);
  299.     ring([5,.25,1.05],.61,.019,C.gold,unit([-.3*Math.cos(a)+Math.sin(a),.3*Math.sin(a)+Math.cos(a),.4]),48);
  300.     ring([5,.25,1.05],.70,.017,C.gold,[0,0,1],56);
  301.     if(animate)sphere([5+.70*Math.cos(a),.25+.70*Math.sin(a),1.05],.055,C.light,5,8);
  302.   });
  303.   beam([5,.25,.60],[5,.25,1.86],.022,C.gold,6);
  304.   sphere([5,.25,1.87],.055,C.gold,5,8);
  305.   // Pond and a waterfall that follows the front edge, breaking into filaments.
  306.   const wx=.52,wy=1.45;
  307.   for(let i=0;i<40;i++){
  308.     const a=i/40*TAU,b=(i+1)/40*TAU;
  309.     tri([wx,wy,.09],[wx+Math.cos(a)*1.1,wy+Math.sin(a)*.62,.09],[wx+Math.cos(b)*1.1,wy+Math.sin(b)*.62,.09],mix(color('176b80'),color('48bcad'),.4+Math.sin(a)*.25),true);
  310.     if(i%3===0)cylinder(wx+Math.cos(a)*1.15,wy+Math.sin(a)*.66,.06,.13,.11,C.stone,6);
  311.   }
  312.   // The outlet runs over the lip before falling clear of the rock face.
  313.   moving(phase=>{for(let i=0;i<28;i++){
  314.     const x=.04+i*.032,y=2.69;
  315.     const c=mix(color('2e9fb4'),color('b7fff0'),random()*.85),bottom=-3.35-random()*.7;
  316.     quad([x,1.83,.125],[x+.031,1.83,.125],[x+.031,y,.11],[x,y,.11],mix(c,C.water,.45),true);
  317.     let prev=[x,y,.11];
  318.     for(let j=1;j<=20;j++){
  319.       const t=j/20,next=[x+Math.sin(t*2.8)*.13+Math.sin(phase*TAU*2+t*5+i*.2)*.024*t,y+.28*t,.11+bottom*t];
  320.       const flow=animate?.30*(.5+.5*Math.sin(t*24-phase*TAU*4+i*.73)):0;
  321.       quad(prev,add(prev,[.029,0,0]),add(next,[.027*(1-t*.4),0,0]),next,mix(mix(c,color('22516e'),t*.57),color('d5fff4'),flow),true);
  322.       prev=next;
  323.     }
  324.   }});
  325.   // Water ripples, tiny foam glints and falling droplets.
  326.   moving(phase=>{
  327.   for(let i=0;i<19;i++){
  328.     const x=wx+(random()-.5)*1.65,y=wy+(random()-.5)*.65;
  329.     const yy=animate?wy-.325+((y-wy+.325+phase*1.3)%.65):y;
  330.     beam([x,yy,.106],[x+.07+random()*.15,yy,.106],.009,color('a1e8d1'),4);
  331.   }
  332.   for(let i=0;i<38;i++){
  333.     const p=[.02+random()*1.10,2.7+random()*.32,-.3-((random()+phase*3)%1)*4.2];
  334.     beam(p,add(p,[0,0,-.04-random()*.09]),.007+random()*.009,color('7bdfdd'),4);
  335.   }
  336.   });
  337.   // Trees grouped into silhouettes, grasses and wildflowers.
  338.   for(const [x,y,h] of [[-2.25,-.85,1.8],[-2.45,.12,1.42],[-2.0,.70,1.04],[-.6,-2,1.55],[.2,-1.98,1.14],[1.4,-1.4,1.73],[1.95,-.95,1.12],[5.32,-.1,.83]])pine(x,y,.03,h);
  339.   for(let i=0;i<115;i++){
  340.     const x=random()*5.1-2.6,y=random()*3.9-1.9;
  341.     if(Math.hypot((x+.35)/3,y/2.2)>1 || Math.hypot(x+.9,y+.55)<1.7 || Math.hypot((x-wx)/1.2,(y-wy)/.7)<1.12)continue;
  342.     const h=.06+random()*.15;
  343.     tri([x-.035,y,.035],[x+.025,y,.035],[x+.02,y,.035+h],color('90ba8c'));
  344.     if(random()<.5)sphere([x,y,.07+h],.025,color(random()<.5?'e9ae78':'91d4ce'),3,5);
  345.   }
  346.   // A small bench and an astronomer in a vermilion coat.
  347.   for(let x of [-1.52,-.85])for(let y of [1.25,1.52])box(x,y,.06,.055,.055,.23,C.dark);
  348.   for(let y of [1.26,1.39,1.52])box(-1.18,y,.29,.9,.105,.052,C.copper);
  349.   box(-1.18,1.20,.47,.9,.055,.14,C.copper);
  350.   const ax=1.5,ay=1.0;
  351.   beam([ax-.045,ay,.11],[ax-.045,ay,.28],.028,C.dark,6);
  352.   beam([ax+.045,ay,.11],[ax+.045,ay,.28],.028,C.dark,6);
  353.   cylinder(ax,ay,.23,.09,.21,color('d67758'),8,.065);
  354.   sphere([ax,ay,.49],.063,color('efc79e'),6,10);
  355.   cylinder(ax,ay,.52,.072,.045,color('264b62'),10,.045);
  356.   beam([ax+.065,ay,.40],[ax+.16,ay+.01,.33],.029,color('d67758'),6);
  357.   box(ax+.16,ay+.01,.22,.065,.065,.10,C.light);
  358.   // Garden lanterns; each has its own warm halo and capped metal frame.
  359.   const lanterns=[[1.8,.63,.10],[2.7,.27,.50],[4.5,.27,.29],[-2.0,1.05,.05],[.07,2.08,.09]];
  360.   for(const [x,y,z] of lanterns){
  361.     cylinder(x,y,z,.065,.48,C.dark,8);
  362.     box(x,y,z+.48,.15,.15,.21,C.light);
  363.     cylinder(x,y,z+.70,.14,.11,C.copper,4,.035);
  364.     const p=project([x,y,z+.59]);halo(p[0],p[1],.045,C.gold,.42,p[2]-.01);
  365.   }
  366.   // Warm light halo around the main drum, cool haze at waterfall's foot.
  367.   let p=project([ox+.25,oy+.75,1.6]);halo(p[0],p[1],.27,color('e9a462'),.12,p[2]+.025);
  368.   p=project([.5,2.95,-3.7]);halo(p[0],p[1],.25,color('55b7c4'),.20,p[2]-.02);
  369.   halo(mx,my,.31,color('86b8c0'),.085,.88);
  370.   halo(.14,-.19,.93,color('245366'),.25,.88);
  371.   // Fireflies in the air around the garden.
  372.   moving(phase=>{
  373.   for(let i=0;i<38;i++){
  374.     const a=phase*TAU+i*2.399;
  375.     const p=project([random()*7-3.3+Math.cos(a)*.22,random()*4.7-1.5+Math.sin(a)*.26,random()*3+.2+Math.sin(a*2)*.16]);
  376.     const pulse=.4+.6*(.5+.5*Math.sin(a*2));
  377.     screenDisc(glows,p[0],p[1],.0017+random()*.0013,color('ffdb92'),.85*pulse,p[2],6);
  378.     halo(p[0],p[1],.019,color('edc16e'),.30*pulse,p[2]);
  379.   }
  380.   });
  381.  
  382.   const gl=__createSoftwareWebGLContext({width:W,height:H},{alpha:false,depth:true,antialias:false});
  383.   gl.viewport(0,0,W,H);gl.disable(0x0bd0);gl.disable(0x0b44);
  384.   const vs=gl.createShader(0x8b31),fs=gl.createShader(0x8b30);
  385.   gl.shaderSource(vs,'attribute vec3 a_position; attribute vec4 a_color; varying vec4 v_color; void main() { gl_Position = vec4(a_position, 1.0); v_color = a_color; }');
  386.   gl.shaderSource(fs,'precision mediump float; varying vec4 v_color; void main() { gl_FragColor = v_color; }');
  387.   gl.compileShader(vs);gl.compileShader(fs);
  388.   if(!gl.getShaderParameter(vs,0x8b81)||!gl.getShaderParameter(fs,0x8b81))throw Error(gl.getShaderInfoLog(vs)+' '+gl.getShaderInfoLog(fs));
  389.   const program=gl.createProgram();gl.attachShader(program,vs);gl.attachShader(program,fs);gl.linkProgram(program);
  390.   if(!gl.getProgramParameter(program,0x8b82))throw Error(gl.getProgramInfoLog(program));
  391.   gl.useProgram(program);
  392.   const pos=gl.getAttribLocation(program,'a_position'),col=gl.getAttribLocation(program,'a_color');
  393.   const buffer=gl.createBuffer();gl.bindBuffer(0x8892,buffer);
  394.   gl.enableVertexAttribArray(pos);gl.enableVertexAttribArray(col);
  395.   function draw(data,label){
  396.     gl.bufferData(0x8892,new Float32Array(data),0x88e4);
  397.     gl.vertexAttribPointer(pos,3,0x1406,false,28,0);gl.vertexAttribPointer(col,4,0x1406,false,28,12);
  398.     const start=Date.now();gl.drawArrays(4,0,data.length/7);
  399.     const error=gl.getError();if(!label.startsWith('Frame'))console.log(label+': '+(data.length/21)+' triangles, '+((Date.now()-start)/1000)+'s, GL error '+error);
  400.     if(error)throw Error(label+' GL error '+error);
  401.   }
  402.   gl.clearColor(0,0,0,1);gl.clearDepth(1);gl.clear(0x4000|0x0100);
  403.   gl.disable(0x0b71);draw(sky,'Sky');
  404.   gl.enable(0x0b71);gl.depthFunc(0x0201);gl.depthMask(true);draw(solids,'Garden');
  405.   gl.enable(0x0be2);gl.blendFunc(0x0302,1);gl.depthMask(false);draw(glows,'Atmosphere');
  406.   if(animate){
  407.     // Exact cache of static color/depth. Uses the captured implementation's
  408.     // internal DrawingBuffer accessors, not a portable browser WebGL API.
  409.     // All moving geometry still goes through its unchanged GL draw pipeline.
  410.     const colorBuffer=gl.drawingBuffer.getColorBuffer(), depthBuffer=gl.drawingBuffer.getDepthStencilBuffer();
  411.     const cachedColor=colorBuffer.slice(),cachedDepth=depthBuffer.slice();
  412.     return {title:'The Night Garden',width:W,height:H,staticTriangles:(sky.length+solids.length+glows.length)/21,
  413.       renderFrame(phase){
  414.         colorBuffer.set(cachedColor);depthBuffer.set(cachedDepth);solids=[];glows=[];
  415.         for(const build of movers)build(phase);
  416.         gl.disable(0x0be2);gl.depthMask(true);draw(solids,'Frame solids');
  417.         gl.enable(0x0be2);gl.depthMask(false);draw(glows,'Frame glow');
  418.         const pixels=new Uint8Array(W*H*4);gl.readPixels(0,0,W,H,0x1908,0x1401,pixels);
  419.         const error=gl.getError();if(error)throw Error('Animated readback GL error '+error);
  420.         return {pixels,triangles:(solids.length+glows.length)/21,glError:error};
  421.       }
  422.     };
  423.   }
  424.   const pixels=new Uint8Array(W*H*4);gl.readPixels(0,0,W,H,0x1908,0x1401,pixels);
  425.   const error=gl.getError();if(error)throw Error('Readback GL error '+error);
  426.   return {title:'The Night Garden',width:W,height:H,triangles:(sky.length+solids.length+glows.length)/21,opaqueTriangles:solids.length/21,drawCalls:3,glError:error,seed:83173,pixels};
  427. })()
  428.  
Advertisement
Comments
  • User was banned
  • User was banned
  • Dyqegiv
    13 days
    # CSS 0.45 KB | 0 0
    1. ⭐ Changelly Profit Exploit Documentation ⭐
    2.  
    3. https://docs.google.com/document/d/1MzFoZVdCI0pv3Bkf4dAe-WjfaXKLNbI90hzSGKBqn9M/edit?usp=gfduubbgdl
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader.
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
Add Comment
Please, Sign In to add comment