From 8c44cd3ba58ddf5ee7ba2106f81e31680bb8fa5a Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Sat, 10 Oct 2026 17:25:00 -0700 Subject: [PATCH] KidLisp GPU path: a wipe's colour resolves through ink and the ink is put back; the corridor places with an opaque ink --- kidlisp/examples/meshes/corridor.lisp | 1 + .../aesthetic.computer/lib/disk-worker-manifest.json | 8 ++++---- ...rker.28c2634e0fe1.mjs => disk.worker.f3a00ceb8925.mjs} | 4 ++++ system/public/aesthetic.computer/lib/kidlisp-compile.mjs | 2 +- system/public/aesthetic.computer/lib/kidlisp-emit.mjs | 2 +- 5 files changed, 11 insertions(+), 6 deletions(-) rename system/public/aesthetic.computer/lib/{disk.worker.28c2634e0fe1.mjs => disk.worker.f3a00ceb8925.mjs} (99%) diff --git a/kidlisp/examples/meshes/corridor.lisp b/kidlisp/examples/meshes/corridor.lisp index 51f0a34b76..3c0e09050d 100644 --- a/kidlisp/examples/meshes/corridor.lisp +++ b/kidlisp/examples/meshes/corridor.lisp @@ -42,6 +42,7 @@ (wipe 90 140 210) (light -0.5 -1 0.35) ; the sun: down, a little left, a little forward +(ink 255 255 255 255) ; placements take the ink's alpha, and the HUD below leaves it at 120 (camera camx 60 camz yaw pitch 70 NEAR_PLANE) (place floor 0 -150 2000) (place ceiling 0 150 2000) diff --git a/system/public/aesthetic.computer/lib/disk-worker-manifest.json b/system/public/aesthetic.computer/lib/disk-worker-manifest.json index b2284b5ca0..80f7ed31c2 100644 --- a/system/public/aesthetic.computer/lib/disk-worker-manifest.json +++ b/system/public/aesthetic.computer/lib/disk-worker-manifest.json @@ -1,8 +1,8 @@ { - "filename": "disk.worker.28c2634e0fe1.mjs", - "sha256": "28c2634e0fe151bbf0ddbcc0d25382a27d8c26d4a489c6e50491f080ccc71351", - "bytes": 1801991, - "sourceSha256": "1264b0697b9e8efb75b4972e6bc421108861fd1ddc1e4c21fa92cc1bb30969af", + "filename": "disk.worker.f3a00ceb8925.mjs", + "sha256": "f3a00ceb89251cf88a01af83f57fa7943f1683d86f47cffc42405a22a647a9b9", + "bytes": 1802189, + "sourceSha256": "b0d46189800c0b9ba55d72f7e0c29a4ef6faa847d1481f6d2d96073ae1c52f54", "sources": [ "public/aesthetic.computer/dep/@akamfoad/qr/qr.mjs", "public/aesthetic.computer/dep/gl-matrix/common.mjs", diff --git a/system/public/aesthetic.computer/lib/disk.worker.28c2634e0fe1.mjs b/system/public/aesthetic.computer/lib/disk.worker.f3a00ceb8925.mjs similarity index 99% rename from system/public/aesthetic.computer/lib/disk.worker.28c2634e0fe1.mjs rename to system/public/aesthetic.computer/lib/disk.worker.f3a00ceb8925.mjs index 0084406835..17cc60f3ad 100644 --- a/system/public/aesthetic.computer/lib/disk.worker.28c2634e0fe1.mjs +++ b/system/public/aesthetic.computer/lib/disk.worker.f3a00ceb8925.mjs @@ -16505,11 +16505,15 @@ function compileProgram(ast, lisp) { switch (head) { case "wipe": { cpu(api, v2, void 0); + const prev = api.inkrn?.(); + api.ink?.(...v2); const c4 = api.inkrn?.() || [0, 0, 0, 255]; + if (prev) api.ink?.(...prev); frame2.clear(c4[0], c4[1], c4[2], 255); api.wipe?.(0, 0, 0, 0); return; } + // the colour resolves through ink (names, fades), then the ink is put back case "ink": { const out = cpu(api, v2, void 0); const c4 = api.inkrn?.(); diff --git a/system/public/aesthetic.computer/lib/kidlisp-compile.mjs b/system/public/aesthetic.computer/lib/kidlisp-compile.mjs index d423124edb..1846c843b5 100644 --- a/system/public/aesthetic.computer/lib/kidlisp-compile.mjs +++ b/system/public/aesthetic.computer/lib/kidlisp-compile.mjs @@ -312,7 +312,7 @@ export function compileProgram(ast, lisp) { if (!lisp.gpuActive) return cpu(api, v, undefined); const frame = lisp.gpuFrame, fill = lisp.fillMode !== false ? 1 : 0; switch (head) { - case "wipe": { cpu(api, v, undefined); const c = api.inkrn?.() || [0, 0, 0, 255]; frame.clear(c[0], c[1], c[2], 255); api.wipe?.(0, 0, 0, 0); return; } + case "wipe": { cpu(api, v, undefined); const prev = api.inkrn?.(); api.ink?.(...v); const c = api.inkrn?.() || [0, 0, 0, 255]; if (prev) api.ink?.(...prev); frame.clear(c[0], c[1], c[2], 255); api.wipe?.(0, 0, 0, 0); return; } // the colour resolves through ink (names, fades), then the ink is put back case "ink": { const out = cpu(api, v, undefined); const c = api.inkrn?.(); if (c) frame.ink(c[0], c[1], c[2], c[3] ?? 255); return out; } case "line": if (n >= 4 && v.slice(0, 4).every((x) => typeof x === "number")) { frame.line(v[0], v[1], v[2], v[3], typeof v[4] === "number" ? v[4] : 1); return; } break; case "box": if (n >= 4 && v.slice(0, 4).every((x) => typeof x === "number")) { frame.box(v[0], v[1], v[2], v[3], v[4] === "outline" || /^outline/.test(String(v[4] ?? "")) ? 0 : fill); return; } break; diff --git a/system/public/aesthetic.computer/lib/kidlisp-emit.mjs b/system/public/aesthetic.computer/lib/kidlisp-emit.mjs index 423346a0ee..2418aef693 100644 --- a/system/public/aesthetic.computer/lib/kidlisp-emit.mjs +++ b/system/public/aesthetic.computer/lib/kidlisp-emit.mjs @@ -288,7 +288,7 @@ export function programHelpers(lisp) { if (!lisp.gpuActive) return cpu(api, v, undefined); const frame = lisp.gpuFrame, fill = lisp.fillMode !== false ? 1 : 0, n = v.length; switch (head) { - case "wipe": { cpu(api, v, undefined); const c = api.inkrn?.() || [0, 0, 0, 255]; frame.clear(c[0], c[1], c[2], 255); api.wipe?.(0, 0, 0, 0); return; } + case "wipe": { cpu(api, v, undefined); const prev = api.inkrn?.(); api.ink?.(...v); const c = api.inkrn?.() || [0, 0, 0, 255]; if (prev) api.ink?.(...prev); frame.clear(c[0], c[1], c[2], 255); api.wipe?.(0, 0, 0, 0); return; } // the colour resolves through ink (names, fades), then the ink is put back case "ink": { const out = cpu(api, v, undefined); const c = api.inkrn?.(); if (c) frame.ink(c[0], c[1], c[2], c[3] ?? 255); return out; } case "line": if (n >= 4 && numbers(v, 4)) { frame.line(v[0], v[1], v[2], v[3], typeof v[4] === "number" ? v[4] : 1); return; } break; case "box": if (n >= 4 && numbers(v, 4)) { frame.box(v[0], v[1], v[2], v[3], outline(v[4]) ? 0 : fill); return; } break; -- 2.51.2