Skip to main content

Advanced Bakery Notes

Mixed Lighting

Mixed lighting incurs the same costs as realtime lighting for dynamic objects. Because the first directional light is free, you can combine high quality baked lighting with real-time shadows using Shadowmask mode. Combine a Unity directional light in Mixed mode with a Bakery directional light set to "Shadowmask and Indirect" and you'll create a shadowmasked directional light. With this, you can get the look of dynamic shadows while only needing to render a depth buffer and dynamic object shadows.

To take full advantage of this, enable Occlusion Probes in Bakery. Occlusion Probes store the shadowing of the directional light into the light probes. Unity will darken the main directional light when objects are in shadow according to the probe values, as though they were receiving shade from the lighting.

Light Probe Ringing

Bakery will bake the full range of incoming lighting into light probes. However, due to the nature of the light probe calculation, it's possible for areas with high contrast lighting to get extremely strong shadows where there are high incoming levels of light from a single direction. This phenomenon is known as ringing. This mainly affects objects using Standard shading.

There are a few ways to avoid ringing. Objects in the scene can be set to use Bakery's Standard shader, which has an option to use "non-linear SH" which performs a filtering step to avoid the issue. However, objects where the shaders on them can't be controlled, like avatars, will need to incorporate the change seperately.

Mixed lighting with shadowmasks can avoid the issue by moving the high intensity directional light - a main cause of ringing - out of the light probes and into the shader calculations. However, this won't affect smaller sources of light. Alternatively, the problem can be avoided by avoiding high levels of contrast in scene lighting.

The situation may change if Bakery adds its own deringing filter to light probes.

Realtime GI

I recommend not using Bakery in the same project as a map that relies on Unity's Realtime GI, because Bakery will automatically turn it off for you. You can use Bakery and Realtime GI together if you tick the option to "combine with Enlighten realtime GI" in Bakery's settings. As the setting notes, this is using Enlighten, which means that you'll be waiting a while for Unity to finish baking it. Then Bakery's lightmap will be added on top.

https://github.com/MerlinVR/VRC-Bakery-Adapter

A script that handles converting Bakery RNM and SH directional lightmap bindings into a format that VRChat can process without the Bakery scripts being whitelisted.

http://techblog.sega.jp/entry/2019/04/25/100000

A guide to setting up believable physically based lighting in Unity.

https://gitlab.com/s-ilent/lightmap-quality-regions

My tool for setting up Lightmap Quality on models in regions. Compatible with Bakery.