Skip to content

Ambient Manager

Andrew Bradley edited this page Feb 26, 2024 · 2 revisions

Ambient Manager

image image

What does it do?

The Ambient Manager is a component. It defines the color of all light and shadows.

By default, the Sun has an Ambient Manager attached to it, which defines the general lighting for the level.

Configuration

Simply pick the Light and Shadow colors in the inspector using the color picker. You will be able to see the changes in the Editor in realtime.

image image

Considerations

Shaders have to be programmed to take into account this lighting. Default Unity shaders have no knowledge of the ambient manager colors, so they won't be affected. It's recommended that for your level materials you use the Ambient Environment shaders found under the BRC shaders as these utilize the environment lighting correctly.

image

Making custom shaders compatible

You can check out the BRCCommon.cginc and AmbientEnvironment.shader files located under Assets/Misc/Shaders to get an idea of how shaders fetch these lighting colors and utilize them.

The light color is passed to the LightColor float4 property to all shaders, while the shadow color is passed to the ShadowColor float4.