Version: 2019.3
Lighting Mode: Shadowmask
The Light Explorer window

Lighting Mode: Subtractive

This page describes the behavior of all Mixed LightsLight components whose Mode property is set to Mixed. Some calculations for Mixed Lights are performed in advance, and some calculations for Mixed Lights are performed at runtime. The behavior of all Mixed Lights in a Scene is determined by the Scene’s Lighting Mode. More info
See in Glossary
in a Scene, when you set that Scene’s Lighting Mode property to Subtractive.

In Subtractive Lighting Mode, all Mixed Lights in your Scene provide baked direct and indirect lighting. Unity bakes shadows cast by static GameObjectsThe fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info
See in Glossary
into the lightmapsA pre-rendered texture that contains the effects of light sources on static objects in the scene. Lightmaps are overlaid on top of scene geometry to create the effect of lighting. More info
See in Glossary
. In addition to the baked shadows, one Directional Light, known as the Main Directional Light, provides real-time shadows for dynamic GameObjects.

Because shadows are baked into the lightmaps, Unity doesn’t have the information it needs to accurately combine baked and real-time shadows at runtime. Instead, Unity provides a Realtime Shadow Color for reducing the contribution from the lightmap to create the illusion of a correct blend between baked and real-time shadows. You can also tweak the color to achieve a certain artistic style.

Subtractive Lighting Mode is useful on low-end hardware where performance is a concern, and where you need only one real-time shadow casting light. It doesn’t provide particularly realistic lighting effects, and is more suitable for stylized aesthetics, such as cel shading.

Render pipeline support

  • The Built-in Render Pipeline supports Subtractive Lighting Mode.
  • The Universal Render Pipeline (URP) supports Subtractive Lighting Mode.
  • The High Definition Render Pipeline (HDRP) does not support Subtractive Lighting Mode.

Mixed Light behavior

When you set a Scene’s Lighting Mode to Subtractive, Mixed Lights behave as follows.

  • Dynamic GameObjects lit by Mixed Lights receive:
    • real-time direct lighting
    • baked indirect lighting, using Light Probes
    • real-time shadows from dynamic GameObjects that are lit by the Main Directional Light, using the shadow map, up to the Shadow Distance
    • shadows from static GameObjects, using Light Probes
  • Static GameObjects lit by Mixed Lights receive:
    • baked direct lighting, using lightmaps
    • baked indirect lighting, using lightmaps
    • baked shadows from static GameObjects, using lightmaps
    • real-time shadows from dynamic GameObjects that are lit by the Main Directional Light, using the shadow map, up to the Shadow Distance

Setting your Scene’s Lighting Mode to Subtractive

  1. Open the Lighting window (menu: Window > RenderingThe process of drawing graphics to the screen (or to a render texture). By default, the main camera in Unity renders its view to the screen. More info
    See in Glossary
    > Lighting Settings).
  2. Select the SceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
    See in Glossary
    tab.
  3. Navigate to Mixed Lighting.
  4. Use the drop-down menu to set the Lighting Mode to Subtractive.

Changing the shadow color

When you set a Scene’s Lighting Mode to Subtractive, Unity displays the Realtime Shadow Color property in the Lighting window. Unity uses this color when it combines real-time shadows with baked shadows. Change this value to approximate the color of the indirect lighting in your Scene, to better match the real-time shadows with the baked shadows.

The Main Directional Light

Unity automatically chooses the Directional Light in your Scene with the highest intensity value to be the Main Directional Light.

Lighting Mode: Shadowmask
The Light Explorer window
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961