Search Issue Tracker
By Design
Votes
0
Found in
2020.3
2021.1
2021.2
2021.2.0b3
2022.1
Issue ID
1350225
Regression
No
Baked Cookies don't appear in the scene when baking lighting with custom Falloff
How to reproduce:
1. Open the attached project's Scene labeled "SampleScene"
2. In the Game View, inspect the baked Spot Light's Cookie
3. Add the CustomFalloff Script to a GameObject
4. Change the Spot Light's Intensity value slightly
5. Bake Lighting
6. In the Game View, inspect the Cookie again
Expected result: Cookie is baked
Actual result: Cookie disappears
Reproducible with: 2020.3.15f1, 2021.16f1, 2021.2.0b5, 2022.1.0a3
Couldn't test with: 2019.4.29f1 (Spot Light doesn't have a baked cookie)
Note:
- The script can be found on Unity docs: https://docs.unity3d.com/2021.2/Documentation/Manual/ProgressiveLightmapper-CustomFallOff.html
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Resolution Note (2022.1.X):
This is by design. The struct outputted by the RequestLightsDelegate contains data needed for baked cookies to function. When using the baked cookies, you should make sure to initialize this data. One way to do this is to use the LightDataGI.Init overload that takes both a light reference and cookie reference, and use LightmapperUtils.Extract to extract the cookie.
The script on the documentation page does not do this, is misleading, and should be changed.
For more information, please look at the default RequestLightsDelegate implementation, note how baked cookies are explicitly handled, and base your delegate implementation on this: https://github.com/Unity-Technologies/UnityCsReference/blob/master/Runtime/Export/GI/Lightmapping.cs#L647