Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Bug Unity imports the diffusion profiles each time I exit play mode or compile, why??

Discussion in 'High Definition Render Pipeline' started by methusalah999, Jan 29, 2024.

  1. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    645
    Dear fellow devs,

    As my HDRP project grows, it becomes more and more difficult to use my Unity (currently 2021.3.25) because of the time lost on startup, compilation and entering/exiting play mode.

    But the very familiar "Hold on (busy..)" windows show something that may be a issue: Unity seems to spend 90% of this time importing diffusion profiles assets (some twice), some shader graphs (always the same few), and launching a method called
    UnityEngine.Rendering.HighDefinition.DiffusionProfileSettings.TryToUpgrade
    .

    I'm loosing a considerable time with this issue and I have the feeling that something is wrong in my setup, but I have no clue how to fix it.

    Some notes:
    - These imported diffusion profiles are declared in the HDRP global settings as overrides.
    - I tested with and without Parallel Import.
    - some diffusion profiles that are not declared in the HDRP settings seem to be re-imported too on Unity startup (but not on exit play mode and such).

    Thank you for your time!

    Meth

    upload_2024-1-29_17-33-11.png

    upload_2024-1-29_17-32-43.png

    upload_2024-1-29_17-41-22.png

    upload_2024-1-29_17-43-22.png
    upload_2024-1-29_17-43-44.png
     
  2. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    645
    So i'm the only one guy with this error?
     
  3. Gasimo

    Gasimo

    Joined:
    Mar 3, 2015
    Posts:
    80
    I had this happen to me about a year ago. The inner workings of Unity re-importing when something seemingly unrelated changes are still a mystery to me.
     
  4. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    645
    re-building the Library did not solve the issue. Other people working on the same project via GIT, with the same version of Unity, do not have the same issue. I will now try to reclone and reinstall Unity but I don't see it solved anytime soon....
     
  5. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    645
    I finally solved it. The value m_Version in the diffusion profile assets was not the correct one, set to 2 instead of 1.

    This was due to the project being upgraded once to HDRP 14 and then downgraded back to HDRP 12. The version number was not correct anymore in these files, the
    UnityEngine.Rendering.HighDefinition.DiffusionProfileSettings.TryToUpgrade
    function was called at each compilation and each exit play mode, spending a minute or two and failing to update the file, which is a shame.

    Setting manually the m_Version to 1 with a text editor for all the diffusion profile assets in the project solved the issue.

    This was all in Unity 2021.3.25
     
    Gasimo likes this.