Skip to content

Whitelist Bakery runtime components so Bakery-baked worlds keep their lightmaps#915

Merged
dooly123 merged 1 commit into
BasisVR:developerfrom
CompuGeniusCode:feat/whitelist-bakery-lightmaps
Jul 2, 2026
Merged

Whitelist Bakery runtime components so Bakery-baked worlds keep their lightmaps#915
dooly123 merged 1 commit into
BasisVR:developerfrom
CompuGeniusCode:feat/whitelist-bakery-lightmaps

Conversation

@CompuGeniusCode

@CompuGeniusCode CompuGeniusCode commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Bug: Bakery-baked worlds load with broken/partial baked lighting, and the console logs MonoBehaviour ftLightmapsStorage is not approved and will be removed. Bakes and builds clean; only wrong once the world bundle is loaded.

Cause: Bakery ships a runtime ftLightmapsStorage (on !ftraceLightmaps) that re-applies the baked lightmaps into LightmapSettings and sets each renderer's lightmapIndex/lightmapScaleOffset at scene load. ContentPoliceControl.ContentControl DestroyImmediates any scene MonoBehaviour whose type isn't in the World ContentPoliceSelector; ftLightmapsStorage isn't listed, so it's stripped — and its OnDestroy (ftLightmaps.UnloadScene) then tears down the lightmap array it had already applied.

Fix: Add Bakery's runtime scene components to SceneContentPoliceSelector (the World selector) so they survive the content scrub. They only touch lightmap/renderer/shader-keyword state — no file/network I/O, reflection, or AddComponent.

Bakery-baked worlds ship an ftLightmapsStorage MonoBehaviour (on the
!ftraceLightmaps object) that re-applies baked lightmaps into LightmapSettings
and sets each renderer's lightmapIndex/lightmapScaleOffset at scene load. On
world load ContentPoliceControl was stripping it (and the other Bakery scene
components) as unapproved MonoBehaviours, and ftLightmapsStorage.OnDestroy then
tore down the lightmaps it had just applied - leaving broken/partial baked
lighting plus a "not approved and will be removed" error. Add the Bakery runtime
components to SceneContentPoliceSelector (the World selector) so Bakery-baked
worlds keep their lighting. These components only manipulate
lightmap/renderer/shader-keyword state; no file/network I/O, reflection, or
AddComponent.
@CompuGeniusCode CompuGeniusCode marked this pull request as ready for review July 2, 2026 05:21
@dooly123 dooly123 merged commit ba065fe into BasisVR:developer Jul 2, 2026
9 of 11 checks passed
@CompuGeniusCode CompuGeniusCode deleted the feat/whitelist-bakery-lightmaps branch July 2, 2026 05:58
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.

2 participants