Bakery Light Baking
ASecurityDiagnose and fix baked-lighting artifacts (red/green chroma blobs, blue sheen, washed-out bakes) in Unity + Bakery for VRChat worlds; tune emissive fixtures (BakeryLightMesh power, SSS lampshades, lamps that glow but light nothing); includes scripted bake/probe recipes, a two-stage draft/final preset workflow, and the free fallbacks when Bakery isn't installed (GLIM, then Unity's Progressive GPU). Use when: baking lightmaps with Bakery, GLIM or Progressive, lightmap looks blotchy/noisy/discol...
- 4 stars
- 0 votes
- 0 copies
- 1 view
- Added November 29, 2026
Works with
Security analysis
100/100Pro scans all 7 files and shows the line behind each finding
npx -y skills add tsuseki/Agentic-VRChat-World-Development-Kit --skill bakery-light-baking --agent claude-codeAre you the author of Bakery Light Baking?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/tsuseki-bakery-light-baking)---
name: "bakery-light-baking"
description: "Diagnose and fix baked-lighting artifacts (red/green chroma blobs, blue sheen, washed-out bakes) in Unity + Bakery for VRChat worlds; tune emissive fixtures (BakeryLightMesh power, SSS lampshades, lamps that glow but light nothing); includes scripted bake/probe recipes, a two-stage draft/final preset workflow, and the free fallbacks when Bakery isn't installed (GLIM, then Unity's Progressive GPU). Use when: baking lightmaps with Bakery, GLIM or Progressive, lightmap looks blotchy/noisy/discolored, building or tuning lamps/sconces/emissive props, an emitter's intensity seems to do nothing, iterating on world lighting, setting up fast test bakes, or automating bakes via the editor bridge/editor scripting."
---
# Bakery Light Baking: Artifact Diagnosis & Scripted Bakes
> Turn "why is my lightmap blotchy" from guesswork into a 4-step diagnostic, and drive Bakery bakes/probes reliably from editor scripts.
## Quick Reference
| Symptom | Likely cause | Fix |
|---------|-------------|-----|
| Soft red/green mottled blobs on dim walls/ceilings | GI Samples too low (e.g. 4; Bakery default 16); denoiser smears chroma noise into blobs | Raise GI Samples to 16, or 32 for clean dim interiors |
| Green/magenta blocky shifts in dark gradients | Encoding/compression artifacts, including platform-specific Android formats | Check actual imported format and High Quality desktop encoding; A/B with an uncompressed importer on the target platform |
| Blobs look huge / low detail | Insufficient effective chart resolution or poor packing | Inspect Checker/Atlas Preview; raise relevant density/group resolution or atlas limit only if actually limiting detail |
| Blue sheen on glossy surfaces after rebake | Reflection probes have NULL bakedTexture → skybox fallback | Re-render reflection probes after EVERY bake |
| Blue tint persists with reflections disabled | Sky-lit hidden exterior faces; UV charts bleed into interior charts | Fix/exclude exterior geometry; re-UV or separate charts |
| Whole bake looks flat and washed out | Shadowless realtime directional light adding over lightmaps | Restrict helper lights via cullingMask to a dedicated layer, or delete before judging |
| Dynamic objects render near-black | Light probe bake silently aborted (geometry changed since full bake) | Bake probes immediately after a full bake; verify with `LightProbes.GetInterpolatedProbe` |
| Contact shading is too weak for the intended style | Missing/weak physical occlusion or desire for extra artistic darkening | Check lighting/geometry first; Bakery AO is optional nonphysical darkening, disabled at intensity 0 |
| A wall bakes solid black with nothing visibly in front of it | Bakery treats **all back-faces as opaque** — an inverted or single-sided face nearby blocks light invisibly | Check normals/winding of neighbouring geometry, not the light |
| Bright fringe / fireflies along shadow edges | Denoiser edge case, not a sample-count problem | Denoise → enable **Fix Bright Edges** |
| Light leaks through a thin wall | Samples landing on the wrong side of the surface | Enable **Adjust Sample Positions** before moving geometry |
| Emitter's `intensity` is a "dead knob" — 3× changes nothing | Almost always **underpowered**, not broken. Intensity is per-AREA, so a number copied from a bigger emitter can be 10–100× under | Compute `worldArea × intensity` and compare to a working emitter |
| Emissive material glows but contributes zero GI | Material export/Meta Pass, `BakedEmissive` flags, UVs, occlusion, samples or stale export | Inspect the material-emission path; use a `BakeryLightMesh` for explicit small/bright emitters, not because material emission is unsupported |
| Emitter object bakes with `lightmapIndex = -1` | **Correct, not a bug** — Bakery hard-skips lightmapping anything carrying a `BakeryLightMesh` | Split emitter and visible body if the body must be lightmapped |
| A glowing lampshade lights nothing | Sealed shell traps the bulb, **or** the glow is the SSS pass — which does not re-radiate | Count boundary edges; add an invisible emitter or open the shade |
| SSS does nothing on a translucent mesh | It's a **per-group** checkbox and needs a closed volume | Give the mesh its own group asset + selector; model real thickness; `shadowCastingMode = On` |
| Glossy surfaces glow/reflect sky inside dark baked corners ("Unity shine") even with correct probes | Standard has no lightmap-driven specular occlusion | Default: lower smoothness / probe intensity on the affected materials. Only if the user approves a shader change: Filamented (Exposure Occlusion), ORL Standard (Reflection Probe Occlusion) or Graphlit Lit; these also support Bakery MonoSH and bicubic lightmaps. Offer, never swap unasked |
| Light-Volume-lit props white, near-black or off their lightmapped neighbours after a bake or after rooms moved | Volumes not re-fitted and re-baked with the moved geometry; a selected-groups render rewrote the Bakery volumes from part of the scene; the atlas packed twice at once | "Light Volumes follow the geometry"; restore volumes and atlas from the last full Render; `bake_fingerprint.py compare` and the `LightVolumeAudit` definition locate it; "Bake loop" step 4 is where it must be seen |
## Baking rules (user rules, 2026-11-05)
Test and iteration bakes must be quick. Overnight, five draft-quality bakes of 37–76 minutes ran
in a fix loop (user: "don't bake more than 10 min"). Re-baking is fine; the rule is about how long
one bake takes (user: "nonono you can do rebakes I meant just do low samples so a quick test
doesn't take 1h").
**GPU gate (user, 2026-11-11):** never start a bake while another runs. Before every launch:
`python .omp/scripts/gpu_bake_gate.py acquire --owner "<project>/<agent>"` (exit 1 = busy, retry
later); after it ends or is cancelled: `... release --owner ...`. The gate checks the shared lock
file, Bakery tracer processes (`ftrace*`, `lmrebake*`, denoisers) and `nvidia-smi` over 10 s:
busy at ≥ 60 % mean utilization or ≥ 50 % of VRAM in use (user, 2026-11-26: "memory matters just
as much"; a transcription job held 88 % of VRAM at 33 % utilization).
1. **Every test or iteration bake is QUICK, with a hard 10-minute cap on wall time:**
- GI samples 4, Samples Multiplier 1/8, half the draft texel density;
- fast denoise, no AO, no SSS;
- bounces equal to final, so brightness stays trustworthy.
This covers mood checks, fix-loop re-bakes and reviewer rounds. Save it as the scene's default
preset (QUICK).
2. **Fit the cap before you launch.** Estimate from the light count, the hidden emitters and the
atlas size. If it won't fit in 10 minutes, bake fewer lightmap groups (selected groups), merge
hidden emitters, or lower the samples further. Watch the clock and cancel at 10 minutes (see
"Stopping a bake"), then shrink the scope and relaunch. Log each bake's time and stage split.
**The biggest lever is the number of mesh lights.** Bakery runs the tracer once per
`BakeryLightMesh` per lightmap, about 5 s each; point lights are batched and nearly free. For a
quick bake, turn strip rows, rail strips and shaft slots into chains of point lights and keep
only a handful of mesh lights. (rp-world 2026-11-05: 108 mesh lights ran past 25 min before
being killed, breaking the cap; the point-chain version baked in 3 min 46 s.)
3. **Re-bakes are allowed** as often as the work needs, each one QUICK. At this quality only
low-sample artefacts are excused: grain, soft colour blotches, soft or stair-stepped shadow
edges, seams. Those are never a finding on a QUICK bake; everything else is. "Noise is never a
finding" never means "nothing is a finding".
4. **The normal bake** (final preset, any length; also called the final, full-quality or slow
bake) runs only when the user explicitly asks for the final lighting, and then only on a QUICK
that passed the "Bake loop" below on the current scene state. Within that request the loop
decides when it runs. A QUICK that has not passed never leads to a normal bake, however small
the open defect looks.
**Stopping a bake.** Follow these steps in order, then check that the editor is back on the real
scene:
1. Set static `ftRenderLightmap.userCanceled = true`. It winds down in about 30–60 s.
2. Confirm no `ftrace*` process is running. The tracer restarts once per light, so sample
`tasklist` several times over about 15 s.
3. If `bakeInProgress` or the progress window lingers, unhook `RenderLightmapUpdate` from
`EditorApplication.update`, then call `simpleProgressBarEnd()` and `ProgressBarEnd(true)`.
4. If the active scene is an untitled scene with one root, Bakery's temporary state, reopen the
world scene from disk.
5. Re-enable anything disabled for the bake, then save.
Killing the agent that launched the bake does not stop the bake.
### Bake loop: QUICK, look at everything, tweak, then the normal bake
The kit's one bake workflow (user, 2026-12-04: "you're supposed to check if everything looks all
right after a quick bake"; "you do tweaks until everything looks allright then do a normal bake").
A QUICK bake exists to show every defect the normal bake would have, the ones made by the
post-bake steps included, while a re-bake still costs minutes. "No black, no leaks" is not a pass:
one QUICK passed that way was followed at once by the normal bake, and only then did the user find
Light-Volume-lit props rendering full-bright white (the volume atlas file had doubled in size)
and picture canvases covered in blocky lightmap rectangles and darker than before.
**Words.** QUICK and normal name the quality (rules 1 and 4). Full Render and selected groups name
the scope. The pipeline's "draft bake" is a QUICK bake.
1. **Baseline, before anything changes.**
- Write the **pose list** (a shots file kept with the bake report). For every area in the bake
scope: one pose per kind of the look list (step 4) that the area contains. For every area
outside the scope (other lightmap groups, other buildings, every teleport island): its
entrance view, one Light-Volume-lit prop, one glossy or glass surface and one picture or
screen.
- Shoot it on the last accepted bake with the review rig (`WorldCapture`, eye height, no added
light, the capture preconditions of `agent-verification`: reflection intensity re-set, Light
Volume `UpdateVolumes()`, `ResetAspect()`, LOD cross-fade settled). Frames from an earlier
session or commit are not a baseline. An area's first bake has no baseline; its frames are
judged on their own.
- `python .omp/scripts/bake_fingerprint.py snapshot <project> <before.json>` (`.omp/scripts/README.md`).
- Light Volumes fitted to the geometry and the coverage check clean ("Light Volumes follow the
geometry", under "Workspace lighting standard").
2. **QUICK bake** (rules 1–2, GPU gate).
3. **The post-bake sequence on the QUICK result, all of it:** exactly the steps the normal bake
will get (Light Volume atlas, light probes, reflection probes, the world's own re-samples,
verify, save; "Post-bake sequence"). A defect a post-bake step makes must show here, not after
the slow bake. Then `bake_fingerprint.py compare <before.json> <after.json>` and read every flag.
4. **Look check.** Re-shoot the pose list and open every baseline | QUICK pair at full resolution.
Light-Volume-lit kinds are also shot in play mode, where the volumes are live (wait for
`Shader.GetGlobalFloat("_UdonLightVolumeEnabled") == 1`); the edit-mode frame stays in the set
because it is the view the user opens first. Each frame gets two tests: does it look right for
what it is, and does it differ from the baseline by anything but the change being baked.
| Kind (one pose per kind per area) | Fails when |
|---|---|
| Lightmapped shell: walls, floor, ceiling, from the entrance and in each room | a black, leaking or flat face; a room at another level than before |
| Lightmapped furniture and big props | a black, flat or unbaked piece (`lightmapIndex == -1`); parts of one piece in different tones |
| Light-Volume-lit static props: sculptures, bowls, books, fruit, small decor | white, black, tinted or flat beside their lightmapped neighbours |
| Dynamic Light-Volume-lit objects: pickups, plushies, Udon-moved and animated parts | the same, at their rest position |
| Pictures, canvases, posters, signs, screens, head-on | rectangles or blocks across the image; darker or brighter than before; glowing |
| Lamps, lit signs and SSS shades, each with its pool | a lamp without a pool, a pool without a lamp, a shade gone flat or dark |
| Glass, mirrors, metal and glossy surfaces, at a grazing angle | sky-blue or black reflections; the wrong room reflected |
| Plants and soft goods: cushions, bedding, curtains | black or grey crowns; a piece off its neighbours |
| Water, where there is any | flat, black or reflecting the wrong thing |
| Doorways and seams to areas outside the scope | a step in brightness or colour across the threshold |
| Every area outside the scope (its four poses) | any visible change at all |
A kind an area does not have is written down as such ("no water"). A kind that is there and
was not shot is "not looked at", and the QUICK has not passed.
Measured locators, each pointing at frames and never clearing one: the `bake_fingerprint.py`
flags, the post-bake verify numbers, the `LightVolumeAudit` classes (`.omp/docs/unity-tools.md`),
and in play mode one grey sphere on an LV shader beside one on Standard per baked area
(`material-reviewer` criterion 5: a luminance ratio to the lightmapped neighbour outside
0.5–2.0 fails).
5. **Verdict on the QUICK.** It fails on any frame that fails either test, unless the difference
is the change being baked or an artefact rule 3 excuses. "It will come right at full quality"
explains only those artefacts: a suspected resolution effect is proven by re-baking that one
object's group at final density inside the 10-minute cap, or it is a failure. On a failure fix
the cause, re-QUICK (10 minutes at most; selected groups when one area changed, by "Partial
bakes" below) and repeat steps 3–4 for the changed scope plus every outside-scope pose, until
everything looks all right.
6. **Who looks.**
- **The builder** opens every pair and returns the QUICK evidence (below).
- **The orchestrator** opens every sheet himself, writes down per area and kind what he saw,
and names what he did not look at. The builder's word passes nothing.
- **The reviewers, once,** on the QUICK that builder and orchestrator pass, saved and
committed: `final-reviewer` DRAFT (mood, plus the lighting side of the look list from its
own captures) and `material-reviewer` DRAFT (light response and the Light Volume pass in
play mode). Not on every iteration. Own frames are no gate (hard rule 4); the defects of the
case above belong to these two reviewers' criteria, which until then ran only after the slow
bake; and Light-Volume-lit props can only be judged in play mode, which among the lighting
gates only `material-reviewer` enters.
7. **The normal bake is refused** (the builder does not launch it, the orchestrator does not
brief it) unless all of this holds for the current commit: the QUICK evidence is complete with
every kind looked at; the orchestrator's own look is written down; both DRAFT rounds returned
DRAFT OK; the user asked for the final lighting; nothing changed since that QUICK except the
quality preset. A change to geometry, lights, materials, reception or volumes means a new
QUICK. After a preset switch the bake is a full Render.
8. **After the normal bake:** the post-bake sequence, `bake_fingerprint.py compare`, then the look
check again with the passed QUICK's frames as the baseline. Expected differences are less
grain, sharper shadows and finer detail. Anything else is a finding and goes back to step 5
with QUICK bakes, never straight into another normal bake. Then the post-bake allocation
checks (`.omp/skills/lightmap-allocation/SKILL.md` §5), `material-reviewer` M2 and
`final-reviewer` FINAL.
**QUICK evidence: what the builder returns for every QUICK he calls passed.**
- the pose list file and the commit hash;
- one contact sheet per area of baseline | QUICK pairs, one pair per kind; the outside-scope
sheet; the play-mode sheet of the Light-Volume-lit kinds;
- the look table: area × kind → frame, `same` / `changed as intended` / `not present`, and one
line of what was seen;
- the post-bake verify numbers, the `bake_fingerprint.py compare` output, the `LightVolumeAudit`
numbers, the bake's scope and wall time.
**Partial bakes** (selected groups, one area, one island). The rest of the world must be proven
unchanged and looked at:
- lightmap files of every group outside the scope byte-identical
(`bake_fingerprint.py compare --scope <glob of the baked groups>`);
- Bakery volume textures and the Light Volume atlas byte-identical to the last full Render
(`--selected`). A selected-groups render rewrites every Bakery volume from the selected groups
alone: restore the volumes and the atlas from the last full Render and verify the hashes. A
volume whose bounds or surroundings changed needs a full Render;
- the light-probe asset byte-identical, or re-rendered on purpose and verified (selected renders
skip light probes);
- bindings: dump path → `lightmapIndex` and scale-offset before and after; only renderers in the
scope differ, and the storage `maps` count equals the live count;
- reflection probes are re-rendered after every bake, so frames prove them, not hashes;
- the outside-scope poses of step 1 for every other area and island, opened as pairs.
## Workspace lighting standard (user rules)
Defaults for every world, whichever lightmapper bakes it. The user may change them for a specific world; the
change and the user's words go in that world's `WORLD.md` Decisions log, and then `WORLD.md` wins.
- **No realtime or Mixed directional light**, even outdoors; lighting is fully baked (no realtime or
Mixed lights at all). The sun stays in the scene as **Baked** so Bakery can cast from it; aim for
large-scale shadows only. Bakery if licensed, else GLIM (free), else Unity Progressive GPU.
- **VRC Light Volumes in every world** (`red.sim.lightvolumes` 3.x, user 2026-10-26): volumes cover
every playable area and are baked by the full Bakery Render, or by GLIM when Bakery isn't
available (LV also bakes with Progressive). Everything that isn't lightmapped is lit by them:
dynamic and non-static props, pickups, Udon-moved and animated parts, plushies, and the static
exceptions below. Each uses an LV-compatible shader (`Light Volume Samples/Light Volume PBR`, or
lilToon, Poiyomi and similar listed shaders for stylised assets) through a `<name>_LV.mat` copy;
a Standard-shader dynamic prop is a finding. Setup traps: lessons-probes "VRC Light Volumes".
- **Light Volumes follow the geometry** (user, 2026-12-04: "everytime you move the rooms around
you also have to move the LV"). Whenever a room, wall, island or shell part is moved, resized,
cut or added, in the same pass:
- re-fit the volumes that light it to the new geometry, each cropped to its own room's walls; a
new room gets a volume, a removed room loses its volume and that volume's Bakery helper;
- re-bake them with the new geometry by a full Render (a selected-groups render never bakes a
changed volume correctly) and let the atlas re-pack once;
- before any bake, run the coverage check: every Light-Volume-lit renderer lies inside a baked
volume of its own area or island, and no volume sits where its room no longer is
(`.omp/docs/unity-tools.md` "LightVolumeAudit"; by hand from that definition while the tool
is not built).
Until that bake, the moved area's Light-Volume-lit props are reported as unbaked. Reflection
probes and the fallback probe grid of the moved part are re-seated in the same pass.
- **Light probes are a fallback only**: legacy avatars on non-LV shaders and pixels outside every
volume (Light Probes Blending on). A simple coverage grid is enough; don't tune probe placement or
brightness for world objects, and never judge world props by probe light.
- **Nothing that doesn't move goes unlightmapped by default** (user, 2026-10-22: "no lighting by
probes on objects that don't move"). Every static opaque renderer is ContributeGI + Receive GI
Lightmaps with UV2, however small; give small pieces a higher Scale In Lightmap (≥ ~8 texels
across the short side of their main face). Exceptions: transparent surfaces, runtime screens,
objects carrying a `BakeryLightMesh` (which Bakery can't lightmap), and **small props whose UV2
fails the audit** (fruit, figurines, small statues, pillows): they get Receive GI Light Probes and
an LV shader, keep ContributeGI so they still cast into the bake, and are lit by the volumes. A
many-island chart on a small object never bakes clean without giant atlases; the volume lights it
smoothly (user, 2026-10-22). Furniture, lamps, rugs, big plants and pots and statues stay
lightmapped.
- **Who gets texels and how many** (the per-class reception table, these exceptions included, density
targets, groups, UV2 quality and the pre-/post-bake allocation audit): `.omp/skills/lightmap-allocation/SKILL.md`.
- **Every interior space gets its own light source** (user, 2026-11-04: "all inside areas need some
kind of illumination"): halls, side rooms, corridors, tunnels, stair runs and lift lobbies. Sky and
bounce alone leave enclosed spaces black. Corridors get rhythmic ceiling or bulkhead fixtures
(about 6–8 m apart, pools with darker gaps between them), with the brightest light at junctions,
ends and doors so players are pulled forward. Before any bake, run a coverage check that counts the
baked sources reaching each interior room or corridor; a space with 0 is a finding.
- **Cozy/night interiors go darker than instinct.** Deep shadow with small warm pools; when it seems
done, cut another ~15% before asking, and never raise a level the user approved. "Lamp too bright"
usually means the spill (emitter intensity), not the shade's own emission; they are separate knobs.
- **Reflection probes immediately after every bake** (hard rule 6; procedure under "Probes after
every bake" below).
## The Problem
Bakery bakes in dim interiors often come out with soft red/green mottled blotches ("chroma blobs") on flat walls and ceilings. Bounced light carries surface albedo color; at low GI sample counts each texel's color channels converge differently, producing chroma noise. The denoiser (Denoise = on) then smears that grain into large soft colored blobs — it cannot recover detail that was never sampled. Dark scenes are worst: HDR encoding spends little precision there, and human vision is highly sensitive to hue shifts on flat dim surfaces.
The trap is diagnosing from memory or the Bakery UI. The settings that actually produced a bake live in serialized scene data — read those first.
## Solutions
### Diagnostic order (always in this sequence)
1. **Read actual settings from `ftLightmapsStorage`** — the component on the `!ftraceLightmaps` GameObject holds the per-scene render settings that were really used (fields prefixed `renderSettings*`). Do not trust the UI or memory. Script: see `reference/examples.md` (Snippet 1).
2. **Check GI Samples first.** Found at 4 in the diagnosed case; default is 16. Set 16 (good) or 32 (clean dim interiors). The sample number is **the square root of the ray count** — 32 samples = 1024 rays, 64 = 4096 — so cost is **quadratic**, not linear: 16 → 32 is ~4× the GI time, and 16 → 96 is ~36×. If only some areas stay blotchy, raise per-object sample multipliers instead of the global value. Bakery warns above 64 GI samples (`ValidateSamples`) — that is a "you probably don't need this" nudge, not an error.
3. **Check encoding/compression.** For desktop, check High Quality lightmap encoding and the actual imported format (commonly BC6H); Android compression needs its own A/B. Temporarily compare an uncompressed importer. (In the diagnosed case encoding was already fine — check, don't assume.)
4. **Check texel density.** Inspect Checker/Atlas Preview and the receiving renderer's effective chart resolution. `MaxAutoResolution` limits each atlas, but more atlases can be allocated; raising 1024 to 2048 helps only when that limit actually constrains the needed layout/detail. Neither a 1024 atlas nor 20 texels/unit alone diagnoses starvation.
### Scripted bakes (verified recipe)
Static `ftRenderLightmap.RenderLightmap()` **silently does nothing**. The working recipe:
1. `EditorWindow.GetWindow(ftRenderLightmap type)`
2. Invoke `LoadRenderSettings()`
3. Invoke `RenderButton(false)`. **From the bridge, queue it**: check `bakeInProgress == false`, then
`EditorApplication.delayCall += () => <RenderButton(false) by reflection>;` exactly once in a short
bridge `eval` call, and return. A direct call blocks through the export (or on a modal) and times the bridge
call out with "started or not" unknown.
4. Poll from separate calls. Started = the active scene becomes `Assets/Bakery/_tempScene.unity` (and
`bakeInProgress` true); the first polls can read `bakeInProgress == false` for up to ~100 s, so never
re-queue on that. A `delayCall` waits for an editor tick: an unfocused or busy editor can delay it for
minutes, so check the window before re-queuing. Done = `bakeInProgress` false again, the scene back, and the
configured output's lightmaps rewritten (`Assets/BakeryLightmaps/*_final.hdr` in the verified project;
inspect Output path and format before watching files). Then run the post-bake sequence below.
Selective bake: use the installed version's **Render Selected Groups** path with `Selection.objects` set to the area's renderers/roots. **Bakery 1.96 `RenderButton(false)` resets `selectedOnly=false`; setting the flag beforehand silently requests a full bake.** Inspect the native button implementation and verify unrelated atlas hashes/timestamps remain unchanged. Per-area `BakeryLightmapGroup` assets make subset rebakes cheap. Selector fields: `active`, `lmgroupAsset` (NOT `lmgroup`), `instanceResolutionOverride`, `instanceResolution`.
What a partial bake must prove unchanged, and what is looked at afterwards: "Bake loop",
"Partial bakes".
Full code: `reference/examples.md` (Snippets 2–3).
### Two-stage workflow: draft preset → final preset
Iterating lighting at final quality is the single biggest time sink in a world project. Keep **two named settings presets** and switch between them instead of hand-editing the Bakery window each time.
**Quick bakes** (GI 4, Samples Multiplier 1/8, half the draft texel density, bounces equal to final) are the only kind of bake before final lighting; see "Baking rules" above. What is checked on each one before the normal bake may run: "Bake loop".
Bakery already has the mechanism: `ftSettingsAsset` ScriptableObjects, exposed in the Bakery window under **Presets** (only visible when Settings Mode = Experimental). Assigning one copies its values into the scene's `ftLightmapsStorage`. Both classes use identical `renderSettings*` field names, so presets can be created and applied by copying fields by name — see `reference/examples.md` (Snippet 6).
Bake cost scales roughly as **(texel count) × (ray count)**, texel count scales with `texelsPerUnit²`, and ray count scales with `giSamples²`. A measured pair from a 6-group VRChat world:
| Setting | FINAL | DRAFT | Why |
|---|---|---|---|
| `renderSettingsGISamples` | 96 | 16 | ~36× fewer rays per texel (samples are √rays) |
| `renderSettingsTexelsPerUnit` | 20 | 5 | ~16× fewer texels |
| `renderSettingsMaxAutoResolution` | 4096 | 1024 | atlases land 1024/512 instead of 4096/2048 |
| `renderSettingsHackAOSamples` | 32 | 8 | AO is a separate pass with its own samples |
| `renderSettingsFixSeams` | true | false | polish, irrelevant to a test bake |
| `renderSettingsBounces` | 4 | **4** | keep identical — see below |
Full render: **22 min → 95 s**.
**Keep `bounces` the same in both presets.** Bounce count changes how bright a sealed room bakes (multi-bounce gain is `1/(1-albedo)`), and brightness is one of the things every test bake is judged on. Lowering it makes the draft lie in a dimension you are testing.
**Bakery has a lighter-weight draft knob of its own: "Samples Multiplier".** It is a single slider (displayed inverted, as `1/N`), stored as `renderSettingsSampleDiv` / static `ftRenderLightmap.sampleDivisor`, and applied as `SampleCount(s) = max(s / sampleDivisor, 1)` to **GI samples and every light's sample count** — the manual's own advice is "use this to quickly change between draft and final quality". The crucial difference from a texel-based draft preset:
> `sampleDivisor` does **not** touch texel density or atlas layout, so it never sets `sceneNeedsToBeRebuilt` — *Render selected groups* keeps working across a switch.
So the two knobs serve different loops. Use `sampleDivisor` for the tight inner loop (tweak a light → rebake one area at 1/8 samples, seconds); use the full draft preset when you want the whole world cheap and are willing to pay one full Render. If you only ever rebake single areas, the multiplier alone may be all you need.
Rules that make the two-stage loop actually work:
- **After switching presets the next bake must be a full Render.** Changing texel density or atlas size sets `ftBuildGraphics.sceneNeedsToBeRebuilt`, and *Render selected groups* is refused ~40 s in with `Scene geometry/layout changed since last full bake. Use Render button instead.` The refusal is a **modal dialog**: the editor main thread blocks and every bridge call times out until someone presses Enter (find it with a desktop screenshot; send Enter to the editor window; unattended bakes need a watcher that answers "Bakery" / "Bakery error" windows). A scene that never had its own full bake (e.g. one sharing another scene's lightmaps) is refused the same way. Per-area selected bakes work fine **within** one preset — that is the fast inner loop: switch to draft once, then rebake single areas as you move lights.
- **A draft bake overwrites the final atlases.** Both presets write to the same `renderSettingsOutPath`, so the shipped bake is gone until re-baked at final. Giving draft its own output folder is worse than it sounds: the scene rebinds renderers to whatever was baked last, so you end up with half-draft/half-final bindings and no way to restore without baking anyway.
- **Capture FINAL from the live storage, never hardcode it.** Settings get tuned constantly; a hardcoded "final" silently reverts that tuning the first time someone applies it.
- **Applying a preset in play mode is a silent no-op** — the storage is a scene component, so the change is discarded on play-mode exit. Guard on `EditorApplication.isPlaying`.
- **Leave `storage.renderSettingsAsset` null after applying.** If a preset stays assigned, `AreSettingsEnabled()` returns `modifySettingsAsset` and the whole settings UI greys out — it reads like a broken window.
What the lightmaps of a draft bake can and cannot tell you:
- **Can**: light placement and reach, leaks, surfaces baking black, occluder mistakes, overall brightness balance, albedo blowouts.
- **Cannot**: shadow crispness, seams, denoiser artifacts, texel-starvation blotches — all of those are resolution-dependent. **Re-render reflection probes immediately after every draft bake too**; otherwise mirrors/glossy surfaces cannot be judged. This workspace requirement has no draft exception.
That is the lightmap side only. A draft bake is also where Light-Volume-lit props, pictures and screens, lamps, reflections and the areas that were not baked are looked at, after the whole post-bake sequence: "Bake loop" step 4.
### Probes after every bake (non-optional)
- **Reflection probes** must be re-rendered immediately after every bake, including drafts and selective bakes (workspace policy). Stale or cleared texture references can produce skybox fallback/blue sheen. Prefer Bakery's own: invoke instance method `RenderReflectionProbesButton(bool showMsgWindows)` on the window. Alternative: `UnityEditor.Lightmapping.BakeReflectionProbe(probe, path)`. The manual's **Always render reflection probes** project setting can automate supported render paths; verify actual completion and custom bindings. Capture geometry needs `ReflectionProbeStatic`, not just `ContributeGI`; exclude glass and video screens from capture. Missing flags produce identical skybox-only cubemaps **without any error**: compare the probe `.exr` checksums (`md5sum`), not just luminance.
- **Light probes can fail SILENTLY.** In the verified workflow `RenderLightProbesButton` aborts if geometry changed since the last full bake (console: "Scene geometry/layout changed since last full bake. Use Render button instead"), leaving `bakeInProgress = false` — indistinguishable from success. L1/L2 normally bake with full lightmaps; Legacy is separate. Verify probe data at deliberately differently lit positions and on a dynamic receiver; identical coefficients alone are not proof of failure in a uniformly lit space. Run any required separate pass immediately after a full bake, never standalone after geometry edits.
Code: `reference/examples.md` (Snippets 4–5).
### Post-bake sequence (in this order)
1. **Finished:** the bake log's finished line, `bakeInProgress` false, the active scene back from
`_tempScene`, lightmap files newer than the launch.
2. **Light Volumes and light probes**, whatever this bake wrote or invalidated:
- the volume atlas packed once from this render's volumes (a full Render with Light Volumes
packs it itself; never start a second pack beside it);
- after a selected-groups render, the Bakery volume textures and the atlas restored from the
last full Render and hash-verified;
- the light-probe pass or repair the world uses, verified at 2–3 differently lit spots
("Probes after every bake").
3. **Reflection probes** (cube and box-projected), rendered last of the baked data, file mtimes
newer than the lightmaps. Under closed canopy, box-projected Custom probes over the woods plus
a sky-only default probe (`cullingMask = 0`); also re-bake them after any fog change.
4. **Restore the project-wide storage** if version control tracks it and the change was not intended:
`git restore -- Assets/Bakery/ftGlobalStorage.asset`.
5. **Re-sample whatever copies baked data**: merged probe-lit cells' SH tables, the lightmapped-renderers probes-Off
lever (`lightProbeUsage = Off` on `0 <= lightmapIndex < 65534`; `vrchat-world-optimization`
`scripts/LightmappedProbes.cs.txt`), baked lookups.
6. **Verify:** expected lightmap count; every lightmapped renderer bound with a finite, non-negative scale-offset
(`.omp/skills/lightmap-allocation/SKILL.md` §5); renderers of any prefab family re-imported since the last bake
bound (a re-import gives new LOD child IDs and unbinds every instance until a re-bake); Light Volume count as
planned and textures non-null; the atlas file's size and dimensions against the last accepted bake
(`python .omp/scripts/bake_fingerprint.py compare`: a change of more than 10 % with no volume added, removed or
resized is explained before anything else happens); the `LightVolumeAudit` classes; 0 lights that are not Baked.
7. **Guarded save:** active scene path is the world scene, play mode off, `MarkSceneDirty`, save, commit.
The sequence is the same after a QUICK and after a normal bake, and it ends in the look check of
"Bake loop" step 4. A bake nobody looked at is not finished.
### Emissive fixtures and SSS
**Intensity is radiance PER UNIT AREA — power is `worldArea × intensity`.** `worldArea` scales with `lossyScale` *squared*, so copying an intensity between emitters of different size silently rescales the light by the area ratio. Solve for it: `newIntensity = refArea × refIntensity × k / newArea`. Independently-tuned emitters in a scene cluster in a narrow power band (one cabin: bulbs 0.19, shade shell 0.29, console glow 0.15, ceiling strips ~0.6) — anything orders of magnitude outside it is the bug. Corollary: **"intensity is a dead knob" means underpowered far more often than broken** (3× of ~nothing is ~nothing). Check the power ratio before hunting mesh/UV/group failures.
**Bakery NEVER lightmaps an object carrying a `BakeryLightMesh`** — `ftBuildGraphics.cs` ~8570 is a hard `continue` in the UV G-buffer pass. Those objects are permanently probe-lit whatever their static flags say, and `lightmapIndex == -1` on them is correct. So anything that must both emit *and* be properly lit has to be split: emitter child carries the light mesh, visible body stays lightmappable.
That split is a knob-layout choice. Light mesh **on the visible surface** → its material emission is a free no-rebake appearance knob, but the face looks flat. Light mesh on a **hidden child** + SSS body → soft gradient, but every appearance tweak costs a bake. If a human is going to say "a bit brighter" three times, pick the first.
**Emitter faces need a gradient, not a flat colour.** Without bloom a flat-emission lamp face reads as a uniform sticker. Give visible emitter faces an emission texture (centre-hot falloff, filament or diffuser pattern) and judge them with post-processing off. For ambient fill prefer concealed cove (lights the ceiling) / cornice (lights the wall) strips whose emitters can't be seen from eye height: they read correctly with or without bloom.
**SSS (translucent meshes) — the two requirements that aren't obvious:**
1. **It is a per-lightmap-group checkbox**, so a translucent mesh needs its **own group asset** with `computeSSS` on, assigned via a `BakeryLightmapGroupSelector` on that object. It cannot share a group with the opaque geometry around it — and conversely, turning SSS on for convenience applies the trace to everything else in that group.
2. **The mesh must be a closed volume with real thickness.** Bakery traces light from one side of the volume to the other; a flat polygon does nothing, and even a curtain needs modelled thickness. `shadowCastingMode = On` is likewise a precondition, not a preference — SSS transmits light *through* an occluder, so a non-casting shade lets light pass unimpeded and the pass has nothing to do.
Also: the SSS surface's own material emission must be **~0** or the flat add compresses the gradient into pale cardboard. And SSS **does not re-radiate** — it lights only its own lightmap, so no `sssColor`/`sssScale`/`sssDensity` will make a sealed shade illuminate a room (one group at `sssScale 10` measured *dimmer* than another at `sssScale 1`; the value isn't even a brightness ordering). A sealed shell traps 100% of an interior bulb — count boundary edges (0 = closed) before blaming intensity.
**An SSS shade cannot witness its own bulb** — it's dominated by the SSS pass and nearly deaf to the emitter, so it reads healthy while the room gets nothing. Use a direct-lit witness, and check the witness is actually *reached*: one back-plate read a constant 0.1554 across a 63× intensity sweep and looked like a dead emitter, but was occluded by the shade's own wall and lit purely by bounce. A witness that never moves is either a dead emitter or a bad witness, and those are indistinguishable until you check the geometry.
**Invisible-emitter escape hatch.** To light the room from a surface that must not render (or must stay lightmapped), give a *copy* of it a `BakeryLightMesh` and set `MeshRenderer.enabled = false`. Bakery needs only a MeshFilter — the collector checks `obj.enabled` on the **component**, and a disabled renderer is skipped when gathering traced geometry, so it emits, renders nothing, occludes nothing, and is never lightmapped. Push it a few cm out along its normals and delete faces pointing at anything close.
**Equal power ≠ equal room brightness** across differently-shaped fixtures. A bulb in a vented shade vs a flat slab against a wall measured ~70% delivery at identical power — the fixture read switched-off while its own face was within 2% of the reference lamp. Calibrate on the *rendered* result: 2–3 `(power, frame-mean)` points, fit `frame ≈ base + slope × power`, solve. Related: grade a lamp by **shade-vs-surround ratio**, not absolute luminance (below ~1.2 it reads unlit whatever the number), and to tone down a probe-lit shade turn down **albedo**, not emission — killing emission outright moved one shade 0.699 → 0.671.
### Non-obvious behaviour (from the official manual)
Things that are easy to get wrong because nothing in the UI hints at them:
- **Incremental re-bakes require correct checkbox semantics.** Uncheck *Export Geometry and Maps* only when geometry, textures and lightmap layout/resolution are unchanged (export took ~40 s in a measured world, not universally). Disable *Update Unmodified Lights* to skip unchanged direct-light passes; keep *Update Modified Lights and GI* enabled to recalculate changed lights and GI. Enabling both does not mean "changed lights only."
- **Texels-per-unit values are starting examples, not minimums**: the manual gives 1–5 for large outdoors, 10–20 for smaller outdoors, and 100 for a high-quality interior at 1 unit = 1 m. **20 does not prove an interior is undersampled.** Diagnose from chart density, padding, shadow detail, view distance and a rendered A/B before increasing resolution or blaming texel starvation.
- **`scaleInLightmap = 0` is an occluder switch.** Objects with Scale In Lightmap set to 0 are not baked at all, but **still cast shadows and contribute GI**. Use it for geometry players see that needs no lightmap of its own (it then needs probe lighting). Geometry that must cast but stay invisible (shadow proxies, zero-thickness walls) is a `ShadowsOnly` renderer instead: a scale-0 object still renders.
- **Bakery treats all back-faces as opaque.** Single-sided shells, inverted normals, and "it looks fine in the editor" geometry will block light from behind with no visual warning. This is the root cause behind a whole family of "why is this wall black" bugs.
- **`BakeryAlwaysRender`** bakes an object even when its renderer is disabled — worth knowing if you disable renderers to hide helper geometry and then wonder where the lighting went. **`BakerySharedLODUV`** is Bakery's "lightmap stealing" (LODs reusing LOD0's lightmap).
- **Denoise → "Fix Bright Edges"** specifically targets bright fringes/fireflies around shadow boundaries — a distinct artifact from chroma blobs, and not fixed by more samples.
- **"Adjust Sample Positions"** exists to prevent lighting leaks by relocating samples. Try it before moving geometry when a thin wall leaks.
- **Light Probe Mode matters.** The current manual lists L2 (default, recommended with occlusion probes), L1 and Legacy. L1/L2 bake alongside lightmaps; Legacy gathers cubemaps in a separate, potentially slower pass and can disagree with nonphysical shaders. L2 has project-level ringing removal; shader-only de-ringing is no longer the sole option. Unity 2019.3's Legacy + occlusion-probe issue is historical, not universal.
- **Checker Preview / Atlas Preview validate texel density *before* baking** — the cheapest possible way to catch "this wall got 12 texels", which no amount of sample tuning will fix.
- **RTX mode is mandatory on Ampere and newer** GPUs, and Bakery wants the **Game-Ready** driver, not Studio.
- **Driver R590+ removed OptiX 6 support.** Bakery 1.96's `ftraceRTX.exe` fails with `Error (1546): Failed to load OptiX library`, even with a correctly installed driver. Use an owned newer Bakery with its **OptiX 9** path (1.98 has `ftraceRTX9.exe`), not copied system DLLs. A pre-R590 supported driver is a fallback only if upgrading Bakery is unavailable. Run the bundled tiny hardware test before committing to a scene bake.
- **Close Unity before a clean GPU-driver installation.** Saving and pausing is insufficient: live replacement produced a fatal D3D11 swapchain-reset dialog. Reopen afterward; restart HWiNFO too if its memory-junction sensor disappears because it retained the old NVAPI.
- **Light meshes: fewer, more complex meshes bake faster than many simple ones**, which is the opposite of the usual draw-call intuition. They also do not receive lighting and occupy no lightmap space. Physical intensity conversions: sun = Lux/π, point = Candela/π.
- The manual itself says *Render Selected Groups* is "currently less convenient than using **Sectors** for partial baking" — if per-area iteration is a core workflow, Sectors is the officially blessed path.
### Washed-out bake debug sequence
A shadowless realtime directional light is additive over lightmaps and penetrates all geometry; ceilings look fine (facing away), which disguises it.
0. **Zero-light baseline (first draft of a new world, or any "glow from nowhere"):** draft-bake with every Light, `BakeryLightMesh` and `BakerySkyLight` disabled. Every non-black pixel is an uncontrolled source: emissive material (intended?), Unlit or toon shader on environment (switch to Standard), skybox reflection on smooth surfaces (add/bake a reflection probe), skybox ambient on probe-lit renderers (add `LightProbeGroup` coverage / rebake probes). Clear the list, then add sources one at a time.
1. Sample the `.hdr` atlas directly — is the shadow present in the data?
2. Check renderer `lightmapIndex` / receive-GI settings.
3. Swap to a plain white material: renders flat **BRIGHT** = additive realtime light; flat **DARK** = missing lightmap.
### Without Bakery: GLIM (free)
Lightmapper order: **Bakery** (paid) if the user owns it, else **GLIM** (free, MIT), else Unity's
**Progressive GPU** (below). GLIM ([z3y/glim](https://github.com/z3y/glim)) is a Vulkan GPU
lightmapper for the Built-in pipeline that reads normal Unity light components. It does
non-directional, dominant-direction and MonoSH lightmaps, emissive materials, area/disc lights,
L2 light probes, VRC Light Volumes, lightmap groups, OIDN denoising and seam stitching. Same
workflow as with Bakery: "Bake loop" above (QUICK → post-bake steps → look check → normal bake).
- **Install:** the VPM listing <https://z3y.github.io/vpm-package-listing/> in VCC/ALCOM (or the
release zip as a UPM package from disk). Close Unity before updating it. It is young and
releases often: **pin one version per project** and update between bakes, never mid-stage. It
runs on NVIDIA, AMD and Intel (Vulkan ray queries, software fallback), so it is also the choice
when a machine has no NVIDIA GPU for Bakery.
- **Denoiser:** download Open Image Denoise from <https://github.com/RenderKit/oidn/releases>,
extract it, set the user env var `OpenImageDenoise_DIR` to that folder, restart Unity Hub and
Unity. Without it GLIM skips denoising silently; check before judging noise.
- **Bake:** lights set to **Baked** (the lighting standard above holds), static flags and lightmap
UVs as usual, then *Tools → Glim → Bake*, adjust the created settings GameObject and press
*Generate Lighting*. Before scripting it, list GLIM's types by reflection from bridge `eval`
(or the bridge's reflection tool); don't guess its API.
- **Differences from Bakery and Unity:**
- Scale In Lightmap is computed differently: re-check texel density after switching
lightmappers.
- One lightmap holds the whole scene by default. Add a `Lightmap Group Selector` with a
*Create → Lightmap Group (Glim)* asset per area to split it.
- Light cookies use RGB, not alpha.
- Ambient comes only from the **skybox** (× `ambientIntensity`). Trilight or Color ambient is ignored, so
give it a skybox cubemap that matches your ambient before comparing it with another lightmapper.
- Not supported: terrain trees, Subtractive mode, meta-pass fallback. Renderers that are ContributeGI
but receive GI from light probes are left out of the bake entirely (no occlusion, no bounce): put them
in a lightmap group with `Discard` on instead. Hand-authored LOD groups lightmap only LOD0 (lower LODs
fall back to probes; importer-made LODs share UVs and work).
- **Double-sided GI is half done in 0.11.0:** probes honour `Material.doubleSidedGI`, but the lightmap bounce
pass returns black for every back-face hit. Two-sided leaf crowns bake about 40 % darker than Progressive.
Use the double-sided GI fork (two-shader patch, `PATCHES.md` in the fork; single-sided bakes stay
byte-identical) or bake foliage with Progressive or Bakery. Note: `.omp/knowledge/notes/glim-backface-black-on-two-sided-foliage.md`.
- Close the Bakery window first: while Bakery's `!ftraceLightmaps` object exists, GLIM stops on a modal
"Remove bakery script" dialog. Save the scene before every scripted bake, or GLIM's internal probe pass
stops on a "Scene(s) Have Been Modified" dialog. Scripted start: build `Glim.Bindings.GlimConfig` exactly
as `GlimLightmapperEditor`'s Generate Lighting button does, call `Glim.Bake.Start`, and poll
`Glim.Bake.IsBaking` and `Bake.LoadReport(scenePath)`. Turn the lightmapper's `bakeReflectionProbes` off
when a bake-only skybox is swapped in, and bake the probes after restoring the real sky.
- Texel density: one atlas per group at a fixed resolution; `scaleExponent` 1.0 makes density proportional
to world size × Scale In Lightmap (default 0.8 starves big pieces). Terrain gets its own group via a
selector on the Terrain. Measured on a 40 × 65 m garden chunk: 4096 at exponent 1.0 ≈ 7 texels/m per
Scale In Lightmap unit. GLIM writes uncompressed EXRs, about 5× Progressive's disk size at the same VRAM.
GLIM's own pass takes 40–90 s where Progressive GPU takes about 13 min on the same chunk.
- Bakery components (`BakeryLightMesh`, `BakerySkyLight`, Bakery lightmap groups) do nothing
here: emitters are emissive materials or Unity area lights. Moving a Bakery scene to GLIM is a
re-setup of every group and light mesh, not a switch.
- Reflection probes after the bake exactly as below (hard rule 6).
### Without Bakery or GLIM: Progressive GPU
Worlds without Bakery or GLIM bake with Unity's lightmapper. Same workflow as with Bakery: "Bake
loop" above (QUICK → post-bake steps → look check → normal bake).
**Presets** (`var s = Lightmapping.lightingSettings;` then set fields; create a `LightingSettings`
asset first if the scene has none):
| Field | Draft | Final |
|---|---|---|
| `lightmapper` | `ProgressiveGPU` | `ProgressiveGPU` (`ProgressiveCPU` on very large scenes, see below) |
| `lightmapResolution` (texels/unit) | 4–6 | 12–20 interiors, 2–4 terrain/exterior |
| `directSampleCount` / `indirectSampleCount` / `environmentSampleCount` | 16 / 128 / 64 | 64 / 1024 / 512 |
| `maxBounces` | 2 | 2–4 (keep equal to the draft if you judge brightness from the draft) |
| `lightmapMaxSize` | 1024 | 2048 |
| `filteringMode` | `Auto` | `Auto` |
Keep bounces equal between draft and final so the draft's brightness is trustworthy, exactly as
with Bakery presets.
**Scripted bake and wait.** `Lightmapping.BakeAsync()` returns immediately. Poll from separate
bridge `eval` (never `Thread.Sleep`). `Lightmapping.isRunning == false`
is **not** done: the files land later. Wait for `LightingData.asset`'s mtime to pass the bake's
start time. If `buildProgress` sits near 1 % for minutes, grep `Editor.log` for `PathTracer ... 0rpt`:
a dead GPU bake (zero rays), not a slow one. Cancel (`Lightmapping.Cancel()`) and switch to
`ProgressiveCPU`.
**Reflection probes, immediately after** (hard rule 6), once the lightmaps are on disk:
```csharp
foreach (var rp in Object.FindObjectsOfType<ReflectionProbe>(true)) {
if (rp.mode != UnityEngine.Rendering.ReflectionProbeMode.Baked) continue;
string path = rp.bakedTexture ? AssetDatabase.GetAssetPath(rp.bakedTexture)
: $"Assets/Lighting/Probe_{rp.name}.exr";
Lightmapping.BakeReflectionProbe(rp, path);
}
```
`Lightmapping.BakeAllReflectionProbes()` does not exist in 2022.3. Then check that the probe
`.exr` timestamps are newer than the lightmaps and that the probe files are not byte-identical
(skybox-only captures: renderers missing `ReflectionProbeStatic`).
## Trade-offs
| Approach | Pros | Cons |
|----------|------|------|
| GI Samples 16 | Default quality, moderate bake time | Dim interiors may still show faint chroma noise |
| GI Samples 32 | Clean dim interiors | ~4× the GI time of 16 — samples are √rays, so cost is quadratic |
| Per-object sample multipliers | Fixes only problem areas, cheap | Must identify affected objects manually |
| Higher atlas maximum | Can accommodate larger charts or different packing when the limit is restrictive | Does not automatically improve density; 4× texels per doubled texture dimension pair is not necessarily 4× scene memory |
| Uncompressed lightmap importer | Useful compression A/B test | Higher VRAM; shipping requires a measured target-platform budget, not a blanket prohibition |
| Scripted bake via window reflection | Automatable, supports selective bakes | Internal API — field/method names may change across Bakery versions |
| Draft preset (low texels + low samples) | Order-of-magnitude faster iteration; brightness still trustworthy if bounces are unchanged | Overwrites the final atlases; forces a full Render on the next preset switch |
| Samples Multiplier (`sampleDivisor`) alone | Same speedup lever without touching atlas layout — per-area bakes keep working | Only scales samples; texel starvation and atlas-size problems stay unchanged (and unseen) |
| Uncheck "Export Geometry and Maps" | Skips the entire export stage on unchanged geometry | Silently stale if anything *did* move — the bake looks fine and is wrong |
| Per-area groups + selected-only bakes | Rebake one room in a fraction of the time | Refused after ANY geometry edit or atlas-resolution change — batch edits, then bake |
## Edge Cases
- **An internal light needs an air cavity, not burial in solid SSS material.** Bakery's
`RenderLMSSS` redistributes existing surface irradiance through the volume; it does not
directly integrate a point embedded in solid glass. Make a hollow optical shell with an
inward-facing inner boundary, valid thickness and nonoverlapping UV2, or put the light
behind the glass in genuinely clear fixture air. Both shell boundaries belong to the
same SSS group. Check that the ceiling, housing, cable or another surface does not occupy
the cavity; source spread must fit within clear air. Do not fix this with emission or
brightness escalation. Controlled Bakery1.98 test at identical source power: solid SSS
outer meanHDR0.000011; hollow SSS0.22882; hollow without SSS0.001019; flipped-normal solid
SSS0.000011. Flipping the solid volume is not a substitute for an illuminated inner wall.
- **A rejected geometry-changing selective bake can clear stored texture bindings.**
Bakery1.98's `ValidateScaleOffsetImmutability` rejects changed atlas layout, but storage
may already have been mutated. Do not save that partial state as a valid baked scene.
Retain a pre-attempt snapshot of texture order, renderer IDs/ST and scene data. Reload the
known-good state or do the required full bake. `ftLightmaps.RefreshFull()` cannot recover
an empty `ftLightmapsStorage.maps` list; restoring texture paths alone also does not prove
that renderer chart assignments remain correct. Verify a matched render after recovery.
- **A linear HDR screenshot can falsely make a readable room look black.** Direct `ARGBHalf`
(`sRGB=false`) render-target → `RGB24 ReadPixels` → PNG does not supply the missing sRGB
transfer. For ordinary visual-review PNGs, use the verified default
`RenderTexture.GetTemporary(width,height,24)` (`ARGB32`, `sRGB=true`) while retaining the
camera's HDR/post-processing settings, or explicitly implement and verify the transfer.
Compare identical-pose captures before changing exposure or lighting. Floating-point linear
readback remains appropriate for numeric HDR/irradiance measurements, not display-ready PNGs.
- **Blue tint baked INTO the lightmap** (not from probes): A/B test with `RenderSettings.reflectionIntensity = 0` — if blue persists, it's in the lightmap data (sky-lit hidden exterior faces with UV charts bleeding into interior charts), not a probe issue.
- **ProBuilder `ToMesh()` invalidates Bakery UV2** — always rebake after mesh edits.
- **Scripted scene edits don't dirty the scene** (`SetParent`, rename) — call `EditorSceneManager.MarkSceneDirty` before saving, or a Bakery reload wipes them.
- **Play mode requests revert silently on compile errors** — grep the console for `error CS` before assuming a script change took effect.
- `PlayerSettings.GetLightmapEncodingQualityForPlatformGroup` is **internal in Unity 2022.3** — must be called via reflection (see Snippet 1).
- **Mid-bake, the scene you are querying is not your scene.** Bakery swaps the editor to `Assets/Bakery/_tempScene.unity` for the duration of a render, so `GameObject.Find("…")` returns **null** for objects that plainly exist and every scene query lies. Check `ftRenderLightmap.bakeInProgress` before concluding an object is missing or a component failed to attach — verify after the bake lands, not during it.
- **Output folders and formats are configurable.** `Assets/BakeryLightmaps/` was the verified project's output, not a universal path. Read Bakery Output path, scene-named-output setting and format before watching files. A watcher on the wrong folder reports `baseline=0` and can time out while the bake succeeds.
- **Not every field you remember exists in your Bakery version.** Reflection on a missing field (e.g. `exportTerrainTrees` on `ftRenderLightmap`) fails silently, so a scripted "force this off" pre-bake step can be a no-op that gets cited for months as having done something. Assert the field was found before trusting the step.
- **Chart values move when the atlas repacks.** A renderer's baked-chart mean can change dramatically between bakes with no input change, purely because `lightmapScaleOffset` now points at a different slot. Confirm any surprising chart delta with a render before diagnosing it.
## Related
- `reference/examples.md` — complete copy-pasteable C# editor snippets
- [Silent lighting guides + Bakery manual — reviewed 2026-09-12](reference/silent-lighting-guides.md) — UVs/density, directional shader compatibility, light vs reflection probes, PPv2 setup/VR comfort, bake checklist, and corrections to historical advice.
- **The bundled Bakery source is the authority for anything scripted.** The wiki
documents the UI, not the fields. Field/method names in this skill were verified
against `<project>/Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs`
(`LoadRenderSettings` ~13113, `SaveRenderSettings` ~3150, `SampleCount` ~915,
`sampleDivisor` 244, `ValidateSamples` ~5876). Grep that file before trusting a
remembered field name — it is the ground truth and it ships with the package.
- Sources: SOURCES.md (not needed to use this skill).
Lessons checklists (one rule per lesson, read before a bake or when lighting looks wrong): [reference/lessons-lighting.md](reference/lessons-lighting.md), [reference/lessons-probes.md](reference/lessons-probes.md).
Files in this skill
- README.md
- SKILL.md
- SOURCES.md
- reference/examples.md
- reference/lessons-lighting.md
- reference/lessons-probes.md
- reference/silent-lighting-guides.md
Attribution
Related skills
View all in development →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.