memoscan
← all memos

Memo 0x9670cd57…414792 on Ethereum

eight),gl.uniform2f(i,dP.shDir[0],dP.shDir[1])}function drawShader(){gl.TRIANGLES;gl.drawArrays(5,0,4)}function setFramebuffer(r,e,t){gl.bindFramebuffer(gl.FRAMEBUFFER,r),gl.viewport(0,0,e,t)}function readURLParams(){const r=window.location.search,e=new URLSearchParams(r);for(var t of e.entries())dP[t[0]]=t[1]}document.addEventListener("keyup",r=>{var e=r.key;r.code;if("s"===e){doSave=!0;var t=new Date;canvas.toBlob(r=>{saveBlob(r,`lacaverna_${tD.tokenId}_${tD.hash}_${t.toISOString()}.png`)})}else"l"===e?keepDrawing=!keepDrawing:"r"===e&&doDraw()},!1),sAP();var canvas=document.querySelector("canvas");canvas.style.width=dP.sW+"px",canvas.style.height=dP.sH+"px",document.body.style.margin=0,document.body.style.overflow="hidden",document.body.style.display="flex",document.body.style.justifyContent="center",document.body.style.alignItems="center",document.body.style.verticalAlign="center";var gl=canvas.getContext("webgl2",{preserveDrawingBuffer:!0});canvas.width=dP.sW*dP.pd*dP.globalResK,canvas.height=dP.sH*dP.pd*dP.globalResK,gl.viewport(0,0,gl.drawingBufferWidth,gl.drawingBufferHeight);const targetTexture1=gl.createTexture(),targetTexture2=gl.createTexture();init1(),gl.useProgram(program),initUniforms(),initDataTexture();var textures=[],framebuffers=[];gl.activeTexture(gl.TEXTURE0+3);for(var ii=0;ii<2;++ii){var texture=createAndSetupTexture(gl);textures.push(texture);var mipLevel=0,internalFormat=gl.RGBA,border=0,srcFormat=gl.RGBA,srcType=gl.UNSIGNED_BYTE,data=null;gl.texImage2D(gl.TEXTURE_2D,mipLevel,internalFormat,canvas.width,canvas.height,border,srcFormat,srcType,data);var fbo=gl.createFramebuffer();framebuffers.push(fbo),gl.bindFramebuffer(gl.FRAMEBUFFER,fbo);var attachmentPoint=gl.COLOR_ATTACHMENT0;gl.framebufferTexture2D(gl.FRAMEBUFFER,attachmentPoint,gl.TEXTURE_2D,texture,mipLevel)}gl.bindTexture(gl.TEXTURE_2D,textures[1]),gl.uniform1i(imageLocation,3),gl.uniform1f(flipYLocation,1);var count=0;init2(),gl.useProgram(program2),initUniforms2();var thisRoundInitTime,d=new Date,initRenderTime=Date.now();function doDraw(){thisRoundInitTime=Date.now(),gl.useProgram(program),gl.activeTexture(gl.TEXTURE0+3);for(var r=0;r<1;++r)gl.uniform1f(uFrameUnLoc,count+1),setFramebuffer(framebuffers[count%2],canvas.width,canvas.height),drawShader(),gl.bindTexture(gl.TEXTURE_2D,textures[count%2]),++count;gl.useProgram(program2),gl.activeTexture(gl.TEXTURE0+3),gl.uniform1i(gl.getUniformLocation(program2,"tex"),3),gl.uniform1f(flipYLocation2,1),gl.uniform1i(u_timeUnLoc,dP.nK),gl.uniform1i(uF,count),setFramebuffer(null,gl.canvas.width,gl.canvas.height),gl.uniform1f(iterUnLoc,count),drawShader()}var finishRenderTime,keepDrawing=!0,finished=!1;setInterval(()=>{keepDrawing&&(count>0?finished||(finished=!0,finishRenderTime=d.getMilliseconds()):doDraw())},250);console.clear();console.log("la caverna / marcelo soria-rodríguez @msoriaro 2023");console.log("CC BY-NC-SA 4.0, https://creativecommons.org/licenses/by-nc-sa/4.0/");console.log("always keep a healthy doubt and take time for self-reflection and outer inspection");console.log("and thanks for inspecting the console")