Version: 2021.2
Light Mode: Baked
Creating cookies for the Built-in Render Pipeline

Cookies

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.

Render pipeline compatibility

See render pipeline feature comparison for more information about support for cookies across render pipelinesA series of operations that take the contents of a Scene, and displays them on a screen. Unity lets you choose from pre-built render pipelines, or write your own. More info
See in Glossary
.

Enabling and disabling baked cookies

For Projects created in Unity 2020.1 or above, baked cookies are enabled for Baked LightsLight components whose Mode property is set to Baked. Unity pre-calculates the illumination from Baked Lights before runtime, and does not include them in any runtime lighting calculations. More info
See in Glossary
and Mixed Lights in the Progressive LightmapperA tool in Unity that bakes lightmaps according to the arrangement of lights and geometry in your scene. More info
See in Glossary
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.

Additional information


  • Support for baked light cookies added in 2020.1 NewIn20201
Light Mode: Baked
Creating cookies for the Built-in Render Pipeline
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961