Skip to content

armgit / raea

Public Imported from GitHub
0

Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.

BK0: done: the test set's Cycles references at 1024 samples and the numbers before any bake

shinyobjectz0cd00209bf99
diff --git a/docs/bake.feature b/docs/bake.feature
index 5a97cd04..a3a4673e 100644
--- a/docs/bake.feature
+++ b/docs/bake.feature
@@ -43,6 +43,7 @@ Feature: Light baked by raea: bounce light into lightmaps on raea's own ray trac
Rule: the bar (BK0)
+ @done
Scenario: BK0. The bake's test set, its references and its numbers
Given the plan
| crate | file | lines | job |
@@ -56,6 +57,30 @@ Feature: Light baked by raea: bounce light into lightmaps on raea's own ray trac
And the bar is: the frame with raea's bake within 0.045 RMSE of Cycles on the table set (lightbake.py gives
0.040), no mesh off by more than a third of a stop on average, in under a quarter of lightbake.py's time
And the numbers before any BK step lands are recorded in this file, as LT1's are in docs/realism.feature
+ And built 11-23: `raea bake light --compare DIR` (apps/lightbake), the sets in apps/lightbake/sets.json, their
+ compositions in bench/bake/ (each set's -cycles composition draws lightbake.py's maps from media/baked/). The
+ atelier is listed but has no reference yet: its Manifold solids stop `raea blender open`, so it joins at BK5
+ with its own tools/bake.sh bake as the comparison
+ And measured 11-23 on the M5 Pro, before any bake code: Cycles at 1024 samples (look.py's still at 1280x720,
+ lightbake.py at the set's texels a metre), each raea frame against the Cycles still
+ | set | frame | RMSE | mean stops | worst tile | lightbake.py | the still |
+ | table | raea, unbaked | 0.0964 | 0.355 | 3.10 | 242 s, 851 MB | 139 s, 1.8 GB |
+ | table | raea, Cycles' maps | 0.0445 | 0.090 | 1.97 | | |
+ | cornell | raea, unbaked | 0.7075 | 5.449 | 8.64 | 235 s, 328 MB | 272 s, 1.7 GB |
+ | cornell | raea, Cycles' maps | 0.0758 | 0.140 | 1.00 | | |
+ | window | raea, unbaked | 0.1884 | 1.210 | 3.32 | 126 s, 767 MB | 506 s, 2.1 GB |
+ | window | raea, Cycles' maps | 0.1446 | 1.121 | 3.02 | | |
+ And what they say: on the table set, Cycles' maps take raea from 0.096 to 0.045, as blender-research's 0.154 ->
+ 0.040 did. Today's unbaked frame is nearer Cycles than the guide's sun + ambient was, but its shaded floor is
+ darker (39/255 from the sky alone, against the guide's 0.61). The table's worst tile with the maps is the chrome
+ ball, which raster raea draws reflecting only the sky (LT9's). The bar's time is a quarter of 242 s: 60 s
+ for the table set. The Cornell box, lit only by its emissive panel, is black in raster raea and within 0.076
+ of Cycles with the maps: emissives and colour bleeding carry. The window room is not near Cycles even with
+ Cycles' own maps: lightbake.py's maps are cooler than the light in Cycles' still (walls facing the window come
+ out neutral where the still is orange), and neither raea's <Environment> (0.151 with it at 0) nor
+ lightbake.py's indirect clamp (0.145 with --clamp 0) explains it. Until that is found, the window room's
+ frame numbers aren't a bar; BK5's per-mesh numbers on it (map_stops, texel for texel on lightbake.py's UVs)
+ don't go through the tone curve and still count
Rule: the five parts (BK1-BK5)
diff --git a/docs/manual/reference/cli/bake.md b/docs/manual/reference/cli/bake.md
new file mode 100644
index 00000000..0bbf094c
--- /dev/null
+++ b/docs/manual/reference/cli/bake.md
@@ -0,0 +1,56 @@
+---
+title: "raea bake"
+summary: "Bake a composition's bounce light into lightmaps on raea's own ray tracer, and measure the bake against Cycles."
+order: 104
+sources: ["apps/lightbake/src/lib.rs", "apps/lightbake/src/compare.rs", "apps/lightbake/sets.json", "bench/bake/"]
+---
+
+`raea bake light` puts the light that bounces around a static set into lightmaps: the sky, emissive surfaces and
+every bounce, so a shadow fills with the colour of what's around it, as in a path-traced still. The sun's direct light
+stays live, so anything that moves still casts its shadow. The bake runs on raea's own ray tracer, with no Blender
+(docs/bake.feature).
+
+`raea bake light EDIT.tsx` bakes a composition's `<LightBake>` ahead of a render. It isn't built yet: it comes with
+BK1-BK5, and says so until then. Today the bake is Cycles' through `raea blender run blender/lightbake.py`
+(`raea guide bevy/blender`).
+
+`raea bake light --compare DIR` measures bakes against Cycles on the test set, `apps/lightbake/sets.json`: the table
+set from `raea guide bevy/realism`, a Cornell box lit only by an emissive panel, and a room lit through one window
+(the compositions are in `bench/bake/`). For each set it makes the Cycles references, a still from blender/look.py and
+a bake from blender/lightbake.py, both at `--samples`. Then it renders the set in raea, unbaked and with Cycles' maps,
+and later with raea's own bake. Each frame is measured against the Cycles still, as RMSE (sRGB 0 to 1, every pixel)
+and in stops (the mean and the worst 64-pixel tile, as `raea light check` measures). The report also gives
+lightbake.py's time and peak memory, and whether the bar is met: on the table set, raea's bake within 0.045 RMSE of
+Cycles, no mesh more than a third of a stop off on average, in under a quarter of lightbake.py's time.
+
+The references are kept in DIR and used again until the set's compositions, its flags or the samples change, or until
+`--fresh`. Cycles' maps go into `bench/bake/media/baked/`, which the `-cycles` compositions read and git ignores.
+It needs Blender (`raea setup blender`).
+
+```sh
+raea bake light --compare out/bake/
+raea bake light --compare out/bake/ --set table --samples 256
+```
+
+<!-- generated:begin by tools/manual-ref/cli.ts from `raea help --json`; edit only the flag descriptions -->
+
+## Usage
+
+```sh
+raea bake light EDIT.tsx [--composition ID] [--samples N] | raea bake light --compare DIR [--sets FILE] [--set NAME] [--samples N] [--fresh] (bounce light baked into lightmaps on raea's ray tracer; --compare measures the test set against Cycles' bake and still, docs/bake.feature)
+```
+
+Headless: it needs nothing running and opens no window. Takes up to 2 arguments besides its flags.
+
+## Flags
+
+| Flag | Takes | What it does |
+| --- | --- | --- |
+| `--compare` | `DIR` | Measure the test set against Cycles instead of baking: each set's frames, references and report.json in this folder. |
+| `--composition` | `ID` | The composition to bake, by its id (the file's first by default). |
+| `--fresh` | – | Make the Cycles references again, even where they're kept from an earlier run. |
+| `--samples` | `N` | Samples a texel, for raea's bake and for both Cycles references (1024 by default). |
+| `--set` | `NAME` | Measure only the set with this name. |
+| `--sets` | `FILE` | The test set to measure (apps/lightbake/sets.json by default). |
+
+<!-- generated:end -->
diff --git a/docs/manual/reference/cli/blender.md b/docs/manual/reference/cli/blender.md
index 60272cdb..d011b9cf 100644
--- a/docs/manual/reference/cli/blender.md
+++ b/docs/manual/reference/cli/blender.md
@@ -1,7 +1,7 @@
---
title: "raea blender"
summary: "Run a Blender Python script headless, with raea's library of mesh scripts: convert, decimate, repair, split, bake, rig, cloth."
-order: 107
+order: 108
sources: ["apps/tools/src/blender.rs", "apps/engines/src/blender_ts.rs"]
---
diff --git a/docs/manual/reference/cli/clothes.md b/docs/manual/reference/cli/clothes.md
index 4935ddd7..0ec89c76 100644
--- a/docs/manual/reference/cli/clothes.md
+++ b/docs/manual/reference/cli/clothes.md
@@ -1,7 +1,7 @@
---
title: "raea clothes"
summary: "Clothes for SOMA's body from words: make sews a garment from a sewing pattern (GarmentCode, MIT), cut to SOMA's measurements and draped by raea's own cloth, as assets/clothes/NAME.json and its .glb; cover lays one on the skin by procedure; wear puts garments on a body."
-order: 105
+order: 106
sources: ["engine/cli/src/cli.rs"]
---
diff --git a/docs/manual/reference/cli/godot.md b/docs/manual/reference/cli/godot.md
index 91826342..a3e67263 100644
--- a/docs/manual/reference/cli/godot.md
+++ b/docs/manual/reference/cli/godot.md
@@ -1,7 +1,7 @@
---
title: "raea godot"
summary: "Run a TypeScript script against Godot's whole API in a headless Godot with GodotJS, record what it draws as frames, or open the editor on the project."
-order: 108
+order: 109
sources: ["apps/engines/src/godot.rs", "apps/engines/src/godot_run.rs"]
---
diff --git a/docs/manual/reference/cli/index.md b/docs/manual/reference/cli/index.md
index ca7212d9..8ae64636 100644
--- a/docs/manual/reference/cli/index.md
+++ b/docs/manual/reference/cli/index.md
@@ -105,12 +105,13 @@ Music read, foley and instruments made on this machine.
## Generate and 3D tools
-Generated media, physics and weathering bakes, clothes and motion for SOMA's body, Blender and Godot.
+Generated media, physics, light and weathering bakes, clothes and motion for SOMA's body, Blender and Godot.
| Verb | What it does |
| --- | --- |
| [`raea gen`](gen.md) | Generate images, video, music, sound, speech, 3D models and text through made.app, fal, Replicate, OpenRouter, Modal or ComfyUI. |
| [`raea physics`](physics.md) | Make the bakes <Physics> and <Goo> play: rigid bodies, soft goo, and parts cut out of a .glb. |
+| [`raea bake`](bake.md) | Bake a composition's bounce light into lightmaps on raea's own ray tracer, and measure the bake against Cycles. |
| [`raea wear`](wear.md) | Bake what weathers a model: where rain reaches and runs, what the sun sees, edges, hollows and touch, as maps raea/wear reads. |
| [`raea clothes`](clothes.md) | Clothes for SOMA's body from words: make sews a garment from a sewing pattern (GarmentCode, MIT), cut to SOMA's measurements and draped by raea's own cloth, as assets/clothes/NAME.json and its .glb; cover lays one on the skin by procedure; wear puts garments on a body. |
| [`raea motion`](motion.md) | Body motion made on this machine by Kimodo (NVIDIA), on MLX on a Mac and on PyTorch on Linux and Windows: a SOMA clip from a line of words and, with --keys, Kimodo constraints (full-body keyframes, hand or foot targets, a root path, as sdk/body/tools/between.ts writes them), as the clip sdk/body/tools/fromkimodo.ts reads. |
diff --git a/docs/manual/reference/cli/motion.md b/docs/manual/reference/cli/motion.md
index 1d292478..2541d0e7 100644
--- a/docs/manual/reference/cli/motion.md
+++ b/docs/manual/reference/cli/motion.md
@@ -1,7 +1,7 @@
---
title: "raea motion"
summary: "Body motion made on this machine by Kimodo (NVIDIA), on MLX on a Mac and on PyTorch on Linux and Windows: a SOMA clip from a line of words and, with --keys, Kimodo constraints (full-body keyframes, hand or foot targets, a root path, as sdk/body/tools/between.ts writes them), as the clip sdk/body/tools/fromkimodo.ts reads."
-order: 106
+order: 107
sources: ["engine/cli/src/cli.rs"]
---
diff --git a/docs/manual/reference/cli/wear.md b/docs/manual/reference/cli/wear.md
index 12ff30c5..c8a77b36 100644
--- a/docs/manual/reference/cli/wear.md
+++ b/docs/manual/reference/cli/wear.md
@@ -1,7 +1,7 @@
---
title: "raea wear bake"
summary: "Bake what weathers a model: where rain reaches and runs, what the sun sees, edges, hollows and touch, as maps raea/wear reads."
-order: 104
+order: 105
sources: ["runtime/wear/src/lib.rs", "systems/weathering/src"]
---
diff --git a/tools/manual-ref/cli.ts b/tools/manual-ref/cli.ts
index 194d60b8..e5f49a5e 100644
--- a/tools/manual-ref/cli.ts
+++ b/tools/manual-ref/cli.ts
@@ -30,7 +30,7 @@ const GROUPS: [string, string, string[]][] = [
["Check", "What's wrong before anyone watches it.", ["check", "judge", "make", "fingerprint", "findings", "scene", "light", "world", "solid", "next", "doctor", "hook", "traces"]],
["Footage", "Takes, cuts and the camera, from your own media.", ["media", "cut", "frame", "track", "splat", "mezz", "neural"]],
["Sound", "Music read, foley and instruments made on this machine.", ["song", "sounds", "sao", "tokensynth", "setup-audio"]],
- ["Generate and 3D tools", "Generated media, physics and weathering bakes, clothes and motion for SOMA's body, Blender and Godot.", ["gen", "physics", "wear", "clothes", "motion", "blender", "godot"]],
+ ["Generate and 3D tools", "Generated media, physics, light and weathering bakes, clothes and motion for SOMA's body, Blender and Godot.", ["gen", "physics", "bake", "wear", "clothes", "motion", "blender", "godot"]],
["Agents and setup", "What an agent reads and shows the person, and the tools raea installs.", ["guide", "fix", "context", "notes", "show", "skill", "skills", "setup", "bug", "ask"]],
]
/** A verb's page: VERB.md, but index.md is this section's own page, so raea index's is indexer.md */
diff --git a/tools/skills.sh b/tools/skills.sh
index 862c9ff0..f6141484 100755
--- a/tools/skills.sh
+++ b/tools/skills.sh
@@ -275,6 +275,7 @@ help_stale() {
# asks whether anything says when and how to use it. COVERAGE_SKIP names what an agent never runs, each with why.
COVERAGE_SKIP="verb:hook (raea skills install sets it up; an agent never runs it)
verb:traces (raea's own session logs, for whoever debugs raea)
+verb:bake (until BK5: today only --compare, raea's own measure of its bake against Cycles; BK5 teaches <LightBake> and raea bake light in bevy/lights, docs/bake.feature)
module:dev_tools (raea's own debugging overlays)
module:test (raea's test harness, for raea's own tests)
module:page-layout (installed by the entry: a composition reads its layout through the DOM on its refs, docs/layout-reads.feature)