Version: 2021.2
ライトモード: ベイク
Creating cookies for the Built-in Render Pipeline

クッキー

A cookie is a mask that you place on a Light to create a shadow with a specific shape or color, which changes the appearance and intensity of the Light. Cookies are an efficient way of simulating complex lighting effects with minimal or no runtime performance impact. Effects you can simulate with cookies include caustics, soft shadows, and light shapes.

To apply a cookie to a Light in Unity, assign a texture to the Cookie field of a a Light component.

An example of baked fake caustics achieved using baked light cookies.
An example of baked fake caustics achieved using baked light cookies.

レンダーパイプラインの互換性

For more information on the different render pipelines available in Unity, see Render pipelines.

Built-in Render Pipeline

The Built-in Render Pipeline supports cookies for Enlighten Realtime Lights, and for Baked Lights and Mixed Lights when you use the Progressive Lightmapper. Realtime Global Illumination only provides indirect light. If your game only uses real-time lights, your render pipeline provides your direct lighting and Enlighten Realtime Global Illumination provides the indirect lighting. The Built In Render pipeline supports cookies for the direct lighting it provides, but Enlighten Realtime Global Illumination does not support cookies for the indirect lighting it provides. For this reason, direct lighting takes cookies into account while indirect lighting does not. In the Built-in Render Pipeline, cookies only use data from the alpha channel. This means that you can define a shape for a cookie, but not a color. For more information on cookies in the Built-in Render Pipeline, see Creating cookies for the Built-in Render Pipeline and Texture Type: Cookie."

Universal Render Pipeline (URP)

URP supports cookies for Realtime Lights, and for Baked Lights and Mixed Lights when you use the Progressive Lightmapper. In URP, cookies use data from the RGB channels. As a result, you can define a shape and a color for a cookie.

For more information on cookies in URP, see the URP Light component reference.

High Definition Render Pipeline (HDRP)

HDRP supports cookies for Realtime Lights, and for Baked Lights and Mixed Lights when you use the Progressive Lightmapper. In HDRP, cookies use data from the RGB channels. As a result, you can define a shape and a color for a cookie.

For more information on cookies in HDRP, see High Definition Render Pipeline/Built-in Render Pipeline comparison, Lights in the High Definition Render Pipeline and the HDRP Asset.

Enabling and disabling baked cookies

For Projects created in Unity 2020.1 or above, baked cookies are enabled for Baked Lights and Mixed Lights in the Progressive Lightmapper by default. For Projects created in versions of Unity prior to 2020.1, baked cookies are disabled for Baked Lights and Mixed Lights in the Progressive Lightmapper by default. This is to provide backwards compatibility.

You can toggle whether cookies are enabled for Baked Lights and Mixed Lights in the Progressive Lightmapper in the Editor settings window.

  1. Open the Project Settings window (Edit > Project Settings).
  2. Choose Editor to open the Editor settings.
  3. Navigate to the Graphics section.
  4. Toggle Enable baked cookies support.

その他の情報


  • Support for baked light cookies added in 2020.1 NewIn20201
ライトモード: ベイク
Creating cookies for the Built-in Render Pipeline