Skip to content

102b paper cuts: rounded boxes as a Box setting, shared meshes, fog kinds, cube-map skies, Script events - #595

Open
AlexZ005 wants to merge 12 commits into
mainfrom
feat/102b-papercuts
Open

AlexZ005 wants to merge 12 commits into
mainfrom
feat/102b-papercuts

Conversation

@AlexZ005

Copy link
Copy Markdown
Collaborator

Roadmap 102, lane 102b-papercuts (base v1.72.0, no own release; the 102 int merges it).

What

  1. Rounded box as a Box setting. The Box rows gain Corner radius and Corner segs, each with a tooltip. set_geometry takes {radius, radiusSegments}, and list_scene reports them.
    • A file stores the two numbers instead of every vertex.
    • A baked rounded box (a plain mesh that is exactly one) gets a Convert offer in the Geometry section. It never converts by itself. Enter works on the focused button, and one undo restores the mesh on every peer.
  2. Equal shapes are saved once. Repeated meshes go into sharedGeometries in the file (formatMinor 4).
  3. Paper cuts:
    • Set Shader Uniform takes colour (sRGB to linear) and vector inputs.
    • A Script node can declare event outputs, fired on the rising edge on every peer, with no broadcast.
    • An effect that acts on no object says "acts on nothing" on its card, and validate_scene lists it as effect-no-object.
    • Cube-map skies (cross, strip, six faces) are converted to an equirectangular .hdr on upload, with a toast.
    • Fog has three kinds: Linear, Distance and Height (ground fog). Cinematic lists Height fog under Not shown.

Scene sizes (40 official scenes, measured)

  • With rounded boxes converted plus shared shapes, the scenes' JSON goes from 28.7 MB to 6.1 MB, and the files from 3.6 MB to 2.6 MB. 147 rounded boxes are recognised.
  • Converting the scenes themselves is a later scenes lane (Q2).
  • Per-scene table: ~/.code/lanes-30/after-102/102-102b-papercuts/scenes-before-after.md.

Compatibility (Q1, built as A)

  • A file from this branch opens in 1.72.0 with every object in place. Rounded boxes and repeated meshes show there as plain boxes of the same size.
  • A file without repeats is written byte-for-byte as before.

Battery

New suite papercuts-102b (in battery.json, gpu:false): 55 PASS / 0 FAIL on a local slot (run 9). It covers:

  • two peers for every row, and a B reload + rejoin with the radius still there and still editable;
  • an old scene loads unchanged: topple-tower, minor 2, 24 objects / 27000 floats, read back equal;
  • a lane-saved file opens in the newest release: production 1.72.0 opens it, every object the right size;
  • feature unused = zero change: a Box with no radius stores its six params with no radius keys, and a scene with no repeats writes no sharedGeometries;
  • linear fog is still THREE.Fog (the fog older builds draw).

Other checks:

  • Unit tests are green, including new roundedBox, fogModes, uniformWrite and scriptIO cases.
  • check-ratchet is at baseline 274/37. check:tokens is clean, and npm run build passes.

Test note: section 6 uses a 4 s square wave. The flow tick runs on rAF, and a loaded headless page draws about 3 frames/s, so a 1 Hz wave was sampled too coarsely.

Boot (gzip, vs a local v1.72.0 build): play +3.3 KB, editor +5.0 KB

  • About 0.7 KB (play) and 1.3 KB (editor) of that is hash churn: 550 chunks each grow by about 2 bytes. The lane's own code is play +2.55 KB, editor +3.73 KB.
  • The editor is over the ~3 KB allowance. What is lazy: the rounded-box maths, Convert + its undo, the Convert offer UI, the shared-mesh writer, the height-fog shader patch, the Fog kind rows and the fog editing helpers (fogEdit.js).
  • What stays on boot, because it must run at load:
    • roundedBoxGate 0.79 (the ObjectLoader radius hook every parse path needs, plus the Box builder);
    • flowRuntime 0.64 (Script events, the inert-effect line, uniform writes);
    • Inspector 0.88 (the radius rows, the Fog Near/Far switch and the lazy mounts);
    • fogModes 0.34 + environment 0.19 (fog kind on scene load);
    • sessions 0.26 (the shared-mesh reader on every load);
    • geometryEdit 0.28.
  • The CI boot-size lines are over by about 1 KB (play 2121.1/2120.0, editor 3326.6/3325.0). For the int: please raise them.

Docs: separate PR on docs (docs-102b-papercuts). The changelog lines for the int are in ~/.code/lanes-30/after-102/102-102b-papercuts/docs-fragment.md.

🤖 Generated with Claude Code

AlexZ005 and others added 12 commits November 21, 2026 18:40
A vec2/vec3/vec4 uniform takes a wired vector, then a colour (sRGB to
linear, as the compiler does for an authored colour), then the number in
every component. Float uniforms unchanged. Leaf src/lib/uniformWrite.js
keeps the shader compiler out of the boot chunk.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A typed-socket Script may declare an output of type event; it fires when
the returned value turns true (rising edge), stamped <node>#<output> with
replicate:false (every peer derives the same edge from the same pure code).
The first reading only seeds, so a load or a joiner fires nothing.
Older builds read the output as a number.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A scene-graph effect with no Object Selector picking an object (and no
own target) shows 'acts on nothing: add an Object Selector' on its card,
in the warning ink; validate_scene reports effect-no-object (warning).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…text only)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Upload HDRI takes a cube map (a 4:3 / 3:4 cross, a 6:1 / 1:6 strip, or six
face files named px nx py ny pz nz / right left top bottom front back) and
a plain 2:1 image, and converts them to an equirectangular Radiance .hdr
(three's cube convention, so nothing is mirrored). A 2:1 .hdr/.exr goes in
untouched. No new scene field: older builds see an ordinary sky.
upload_asset converts a cube-layout sky the same way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t (else unchanged)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fog gains an optional kind: distance (three's exponential fog, density)
and height (ground fog: densest at a base height, thinning over a
thickness, integrated along the view ray). Height fog patches three's fog
chunks once at boot with ONE shared uniform (zero = the stock branch).
Near/far stay in the document, so older builds draw linear fog.
Configure Scene > Environment > Fog: Kind, Density, Ground height,
Thickness. Cinematic view draws distance fog and names height fog in the
Not shown chip. set_sky / get_environment carry kind/density/base/thickness.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… saved once

Box gains optional radius / radiusSegments rows (stored only once used); a rounded box
saves as a BoxGeometry with two extra numbers (an older build reads a plain box of the
same size). The Inspector offers Convert for a baked rounded box (never automatic, one
undo step). The .tpscene writer moves repeated meshes into sharedGeometries with a
plain-box stub an older build can still draw; every reader inflates first.
SESSION_FORMAT_MINOR 4. Official scenes: 147 rounded boxes, JSON 28.7 -> 6.1 MB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rounded box split into a boot gate (builder, ObjectLoader hook, cheap tests) and a
lazy chunk (the class, matching, baking); Convert + its undo kind lazy
(roundedBoxConvert.js); the shared-shape writer lazy (sharedGeometryWrite.js); the
height-fog chunk patch lazy (installed with the first height fog, recompiles what is
live); Fog kind rows lazy. Boot vs v1.72.0: play +3.1 KB, editor +4.9 KB gz.
New suite papercuts-102b (all rows, two-peer + reload, old scene, the newest release
opens our file) in battery.json.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… pulse handle, selector field, reload probe, toast watch)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…itor boot -0.4 KB)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hardening

Script event check waits for the first pulse (the sandbox guest loads lazily) and uses a 4 s square wave
(the flow tick rides rAF; a loaded headless page draws ~3 frames/s, so a 1 Hz wave aliased). Fog rows retry
the section open, B's reload has a fallback wait.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant