memoscan
← all memos

Memo 0xa1962266…b5cfbc on Ethereum

site.image(fillPersistentLayer, 0, 0) finalComposite.push() finalComposite.translate(0, maskOffset) finalComposite.image(eyesBlockingCache, 0, 0) finalComposite.pop() const eyeOpacity = _cachedEyeOpacity if (eyeOpacity > 0) { finalComposite.push() finalComposite.translate(0, maskOffset) if (TRAITS.iris === "Omnia") { const omniaCol = _cachedOmniaCol || getOmniaColor() finalComposite.tint(red(omniaCol), green(omniaCol), blue(omniaCol), eyeOpacity * 255) finalComposite.image(omniaEyesBase, 0, 0) } else { finalComposite.tint(255, eyeOpacity * 255) finalComposite.image(eyesCache, 0, 0) } finalComposite.pop() finalComposite.noTint() } } orbitBuffer.clear() orbitBuffer.background(0, 0, 0, 0) for (let orb of orbitingElements) { orb.display(orbitBuffer, false) } finalComposite.image(orbitBuffer, 0, 0) finalShadedBuffer.push() finalShadedBuffer.rectMode(CORNER) finalShadedBuffer.shader(asciiShader) asciiShader.setUniform('u_texture', finalComposite) asciiShader.setUniform('u_resolution', [width, height]) if (!freezeMode) _cachedShaderTime = millis() / 1000.0 asciiShader.setUniform('u_time', _cachedShaderTime) asciiShader.setUniform('u_gridX', _tierGridDensity) asciiShader.setUniform('u_symbolSize', PARAMS.symbolSize) asciiShader.setUniform('u_forceMonochrome', TRAITS.forceMonochrome) asciiShader.setUniform('u_applyNoise', _tierNoiseOverride !== null ? _tierNoiseOverride : TRAITS.applyNoise) asciiShader.setUniform('u_symbolOffset', PARAMS.symbolOffset) asciiShader.setUniform('u_vocabSize', PARAMS.vocabSize) asciiShader.setUniform('u_bwMode', bwMode) finalShadedBuffer.rect(-width / 2, -height / 2, width, height) finalShadedBuffer.pop() image(finalShadedBuffer, 0, 0) // Snapshot hero frame: once the composition has settled, freeze (capture UA only) // and signal Cloudflare the render is ready. No-op for live viewers. if (!_snapshotMarked && window.$art && window.$art.captureMode && frameCount >= SNAPSHOT_FRAME) { _snapshotMarked = true window.$art.snapshot(() => { freezeMode = true }) } } // ─── PIXEL-PERFECT EXPORT ─── // Capture exactly what's on screen. The live canvas already holds the displayed // frame with its real grid, resolution, Perlin-noise term, and coarse symbol // rasterization — so we grab it (rather than re-rendering the shader, which would // resolve thin pattern features at a finer per-cell resolution and drift from the // live look). Crop the top 1:1 square and integer-upscale with smoothing off: a // whole-number scale turns every source pixel into a clean N×N block, staying // pixel-identical to the iframe with no blur. const EXPORT_TARGET_PX = 2048 // aim for ~2048 px; actual = srcSquare × integer scale function renderPixelPerfectSquare() { const src = document.querySelector('canvas') // live displayed 2D canvas const cropSize = Math.min(src.width, src.height) // top square side (= canvas width) const scale = Math.max(1, Math.round(EXPORT_TARGET_PX / cropSize)) const outSize = cropSize * scale const out = document.createElement('canvas') out.width = outSize out.height = outSize const ctx = out.getContext('2d') ctx.imageSmoothingEnabled = false // nearest-neighbor → crisp blocks ctx.drawImage(src, 0, 0, cropSize, cropSize, 0, 0, outSize, outSize) return out } function keyPressed() { if (key === 's' || key === 'S') { const out = renderPixelPerfectSquare() const a = document.createElement('a') a.href = out.toDataURL('image/png') a.download = 'SATARI_' + CURRENT_SEED + '_' + out.width + '.png' a.click() return false } if (key === 'n' || key === 'N') { // Restart current piece from frame 0 — same seed, replay animation resetAndRegenerate() if (DEBUG) console.log(`%c↻ RESTART — same seed (${CURRENT_SEED}), replayed from frame 0`, 'color:#FFD700; font-weight:bold;') return false } if (key === ' ') { freezeMode = !freezeMode if (DEBUG) console.log(`%c${freezeMode ? '❄ FROZEN' : '▶ THAWED'}`, freezeMode ? 'color:#00FFFF; background:#003; font-weight:bold; padding:2px 8px;' : 'color:#39FF14; font-weight:bold;') return false } if (key === 'Escape') { freezeMode = false if (DEBUG) console.log(`%c⟲ RESET — all modes cleared`, 'color:#FFF; background:#333; font-weight:bold; padding:2px 8px;') return false } } </script> <!-- ============================================================ --> <!-- satarimustdie.com capture bridge --> <!-- ============================================================ --> <!-- Listens for postMessage requests from the parent frame and --> <!-- returns PNG data URLs of the live canvas. Used by the site's --> <!-- PNG and GIF save buttons. Restored after the v5 renderer --> <!-- rebuild dropped the original capture handlers. --> <script> (function () { window.addEventListener('message', function (event) { var data = event.data || {}; if (data.action !== 'captureSnapshot') return; var requestId = data.requestId; function respond(success, payload) { var msg = { action: 'snapshotCaptured', requestId: requestId, success: success }; if (success) msg.dataUrl = payload; else msg.error = payload; if (event.source && event.source.postMessage) { event.source.postMessage(msg, '*'); } else { window.parent.postMessage(msg, '*'); } } try { // Pixel-perfect master: reuse the same exact-live-match capture as the 's' key. // renderPixelPerfectSquare() is a top-level function in the sketch script and shares // this page's global scope. Output is a fixed pixel-perfect square, so the requested // options.size is ignored. if (typeof renderPixelPerfectSquare !== 'function') { respond(false, 'renderer not ready'); return; } var out = renderPixelPerfectSquare(); respond(true, out.toDataURL('image/png')); } catch (err) { respond(false, (err && err.message) || 'capture failed'); } }); })(); </script> </body> </html>