Files
shinyobjectz bbd7369548 One loop, raea goal: every rule in TypeScript, held at edit, render, publish and done; raea make is the asset tools
The rules are raea/goal's (sdk/goal), run by `raea goal check` at four moments: the hook after a save, every
render's end, raea cloud's publish, and the Stop hook. Rust's cut and goal gates and the box's word, sound, frame and
place checks are packs (MK30-MK39); runtime/cut-plan, runtime/goal-plan, raea make status and the box's check code
are gone with no alias (MK41).

brief.ts is the one registered root (MK43): raea runs it, and every file that imports raea must be reached from it
(the registered check, an error at publish and done). Its tasks are its `plan` (MK44), read from its run and written
back where each is written by `raea goal tasks`, the one path for the app, agents and the box. Its `goal` is one
goal or a workflow of several (MK46), each with its step, after and rules, checked and reported alone. Taste lines
and signed asks run inside the loop (MK47).

`raea goal check|tasks|seen|judge|gates|next` is the loop; `raea make clothes|motion|solid|wear|splat|physics|bake|
sao|tokensynth|sounds|component|blockout|...` the asset tools (MK45). Old names are refused with where they went.
docs/make.feature is docs/goal.feature; tools/legacy-names.sh holds the old names out.

raea's Node mode on JavaScriptCore now gives a CommonJS package's names as named exports (React's jsx), loads a
file a tool imports by URL, keeps process.exit's code from a promise callback, and reads stdin as fd 0, so the goal
runner runs on the shipped binary.
2026-11-29 16:02:31 -08:00

57 lines
3.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "raea make bake"
summary: "Bake a composition's bounce light into lightmaps on raea's own ray tracer, and measure the bake against Cycles."
order: 109
sources: ["apps/lightbake/src/lib.rs", "apps/lightbake/src/compare.rs", "apps/lightbake/sets.json", "bench/bake/"]
---
`raea make 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 make 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 make 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 make bake light --compare out/bake/
raea make 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 make bake light EDIT.tsx [--composition ID] [--samples N] | raea make 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 -->