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
- Any small change in UI Builder Inspector refreshes Editor Inspector
- Inaccurate Box Collider boundaries on a rotated child Cube when the parent GameObject Scale is non-uniform
- [Android] "SHADOWS_SCREEN" set as shader Keyword when no "_ShadowMapTexture" is bound leads to freeze on a build on some Mali GPU devices
- The global scene list is overridden in a project built with command line when the Override Global Scene List setting is disabled in the build profile
- Global Scenes are not included in the Build when building multiple Build Profiles at the same time
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