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
- "Shader warning in 'Hidden/Light2D': implicit truncation of vector type" is thrown when building Universal 2D template
- AI Assistant breaks compilation of packages using System.Runtime.CompilerServices.Unsafe via auto-referencing
- Unity Hub checks the "Documentation" module by default on the 6.4 and 6.5 streams despite that it was unchecked with the previous installs
- Shortcut that toggles between Dopesheet and Curves Views in the Animation Window's Timeline is mislabed
- Property List Items Overlap onto the Property List's top edge when scrolling through a long Property List
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