Repository navigation
ae3d.batch: a frame in one buffer from a host (three.js on sae), MeshNormalMaterial as a quoted pair - #1102
Merged
Conversation
…hNormalMaterial as a quoted pair A sae page running three.js describes its frame in one buffer a frame (its AeRenderer): the eye's view and lens, each draw's world matrix and material, and the meshes that are new or changed. ae3d.batch checks it whole against the host's limits, keeps the meshes under the host's ids, and queues canvas draws with ae3d.batchmaterials' pair for three.js's MeshNormalMaterial; batch_draw and batch_pixels draw and read it back with no window (gl.renderer_draw_canvases, gl.renderer_canvas_pixels). tests/test_batch: the cube's faces the colour of their normals in the eye's space to 2/255 by hand-worked pose, five refusals changing nothing, and three.js's README cube from batches made on sae's engine, held by three.js's own maths to 1/255 (Mesa llvmpipe on Linux). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
paul-hammant
added a commit
to aether-lang-dev/three.js
that referenced
this pull request
Nov 26, 2026
src/renderers/sae/AeRenderer.js walks the scene once a frame and hands the host one buffer (ae3d.batch's layout, version 1): the camera, each visible mesh's world matrix and material, and the geometry that is new or changed. First cut: Mesh + MeshNormalMaterial. sae-port/cube: the README's cube through it. Its batches, made on sae's engine (byte-identical to Node), drawn by ae3d (aether-lang-dev/ae3d#1102) on cachyos, match three.js's own normal-matrix maths at every visible face centre to 1/255. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
paul-hammant
added a commit
to aether-lang-dev/sae-it-aint-so
that referenced
this pull request
Nov 26, 2026
… counted, not drawn) gfx.scene, gfx.submit, gfx.stats and gfx.free, in the gate spec with their seals (docs/gpu-pages.md's first slice, shaped by three.js's AeRenderer, aether-lang-dev/three.js branch sae-port). A page hands over one buffer a frame in ae3d.batch's layout (aether-lang-dev/ae3d#1102): the host checks it whole, holds it to the page's budgets (4 scenes, 256 meshes and a million vertices over them, 4096 draws and 16 MB a batch) or throws a TypeError saying why with nothing changed, and frees every scene with its page. sae does not link ae3d yet, so nothing is drawn (gfx.stats says drawn: false). site/gfx.ts and spec_nav's "gfx"; the gate dump and spec_globals know the new global. Verified on cachyos (0.946.0 release install): check_gate 42/42, tests/run_all.sh 97 of 98 (spec_app_rexxconsole needs a RexxAE sibling that was not there), and three.js's README cube as a sae page: its batches arrive natively, 1,176 bytes then 252 a frame, render() 0.1-0.2 ms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e on It printed "test_batch: ok", so the Linux suites runner called it FAIL with every check in it ok. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The ae3d half of the first three.js-on-sae spike (three.js fork, branch
sae-port,PORT.md).A sae page runs three.js's own JavaScript; its
AeRendererwalks the scene once a frame and hands over one buffer. This PR is what ae3d needs to draw it, with no window:ae3d.batch: the buffer's layout (version 1, in the module header): the eye's view and lens, clear colour, meshes new or changed (positions, normals, uvs, indices) under the host's ids, frees, and draws (mesh id, material, flags, opacity, world matrix).batch_submitchecks the whole buffer first (bounds, indices, ids, the host's limits frombatch_set_limits) and refuses with a reason, changing nothing. Then it queues canvas draws (gl.renderer_canvas_draw), computing each draw's MVP and normal matrix natively.batch_draw/batch_pixelsdraw and read back.ae3d.batchmaterials: three.js'sMeshNormalMaterialas a quoted vertex + pixel pair:normalize(n_eye) * 0.5 + 0.5, written as is (three.js's normal material has no colour-space step).gl.renderer_canvas_pixelsandgl.renderer_draw_canvases: a canvas read back (rows top first), and the canvases drawn without a frame around them. Additive.tests/test_batch(inGPU_SUITES): a cube whose visible faces are, at their centres, their eye-space normal's colour to 2/255 (worked out by hand from the pose); a second pose moves the silhouette; five malformed / over-limit batches each refused with nothing changed. WithAE3D_BATCH_FILES+AE3D_BATCH_OUTit draws a page's own batches.OpenGL only for now. Vulkan would need the pair's SPIR-V made at build time through
quotegen, asexamples/canvas.aedoes.Verified
On cachyos (Mesa 26.3.1 llvmpipe under Xvfb):
test_batchpasses. Three.js's README cube (BoxGeometry(0.2),MeshNormalMaterial, at t=1200 and t=2600 ms) was batched byAeRendereron sae's engine (tools/saejs, byte-identical to Node), drawn by this PR, and checked against three.js's own normal-matrix maths: every visible face centre within 1/255, the corners clear, and 1,633 pixels differing between the frames.No motion code touched.
🤖 Generated with Claude Code