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
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
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