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
- Texture is stored upside down when using Blit
- [VFX] Missing Expand Toggle with Output Slot
- [OpenGLES][XR] Zooming in on the camera's URP opaque texture causes "double vision" on Quest in OpenGLES3
- “[Worker0] Could not generate preview image“ error when opening macOS native plugin in the Inspector with Architecture to build for set to ARM 64-bit
- [iOS] Application.absoluteURL is empty on Awake/Start when opening via deep link with Splash Screen disabled
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