baking lightmap is too late or stacking with animating shader

Hi, this is my first forum post, so please let me know if I’m incomplete :slight_smile:

I’m baking a lightmap for a background asset in 2022.3 or later versions of URP, and when the shaders are animated (e.g. UV scrolling), the Global Illumination progress gets stuck and takes a very long time or never ends. This is reproduced in the following example.
This did not happen when I was testing with 2022.2.8f1, nor did it happen with 2023.2.0b1,
It seems to reproduce from 2022.3.0f1 to 2022.3.11f1 (I have not tried all versions, but have tried about 4 of them: 0, 4, 8, 11)
It also seems that Windows users on the team are experiencing the same symptoms.

-How to reproduce
1.Create a ShaderGraph in Lit.
2.From the Time node, connect it to the Fraction node, which is connected to the base color output.
3.Bake with appropriate settings.

  • Result
    Global Illumination is stacked at 5%, or goes back and forth between 5% and 96%.

9443987--1325117--upload_2023-11-1_20-0-50.png

  • Environment
    Apple M2, OS Ventura 13.6

Does anyone have similar experience with these symptoms, solutions, or information on Issue Tracker?

This should be fixed in 2022.3.2f1

Edit: Looks like I misread OP - since it seems you have tested on 2022.3.11f1. This bug should have been fixed in the version I mentioned above. If you are seeing it on newer versions, it must have regressed again, or the fix was botched - you should file a bug report.

The issue tracker is here Unity Issue Tracker - Lights are generated indefinitely when a GameObject has a material with a shader that uses scrolling UVs

For the time being you might be able to work around it by pausing the editor while baking, using the pause button in the top menu. There are some people commenting with workarounds in the issue tracker I linked above.

Hello, thank you for your valuable information.:slight_smile:

it was mentioned in the release notes of 2023.2.0a15 that the issue has been resolved,
It is possible that this issue has not been resolved in the 2022.3 version.
On the Issue, it says it was fixed in 2022.2.22f1, but as far as I can ascertain, 2022.2 appears to have ended version at 21.
I am not sure of the situation, but will consider resubmitting it as an Issue.
Thank you for indicating a solution as well!

Relying on what I read in the issue above, I found a tentative workaround.
It is to hide the Scene and Game views. They do not have to be closed, only hidden.

Pausing Editor won’t pause timed shaders, but the solution given by naoto_isobe works, thanks!