Currently VRChat does not support native runtime lightmap swapping. Creators must rely on workarounds such as duplicated geometry sets with toggles baked separately, or shader PropertyBlock overrides that depend on internal shader property names. These approaches increase build size, complicate workflows, and can be fragile.
This limitation blocks common world features such as day and night cycles and multi scenario lighting setups. Exposing Unity’s lightmap API to Udon would enable a clean and supported solution.
Requested API exposure in Udon
Core requirements
LightmapSettings.lightmaps read and write access
Ability to assign an array of LightmapData at runtime
LightmapData access
Support for lightmapColor
Support for lightmapDir for directional lightmaps
Support for shadowMask for shadowmask workflows
Renderer mapping
Write access to Renderer.lightmapIndex
Write access to Renderer.lightmapScaleOffset
These are necessary to correctly remap renderers when lightmap atlases and packing differ between bakes.
Strongly recommended additions
LightmapSettings.lightmapsMode
So creators can use non directional or directional bakes reliably
Light probes access or swapping support
LightmapSettings.lightProbes and or equivalent support
This is important for dynamic objects and avatars that rely on probes
Reflection probe refresh or reassignment hooks
A supported way to refresh probes or reassign custom reflections after a swap to keep reflections consistent between scenarios
Why this matters
With these APIs, creators could bake multiple lighting scenarios such as day, night, indoor, event themes and swap them at runtime without realtime lights and realtime shadows. This reduces performance cost, avoids inflated builds from duplicate geometry, and removes reliance on unsupported shader internals.
Suggested minimal acceptance criteria
A sample UdonSharp script can assign a new LightmapData array, then update affected renderers lightmapIndex and lightmapScaleOffset, and the scene displays correct baked lighting for both directional and shadowmask modes.