Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Normal Maps Quality gets set to "Disabled" on game load.

Discussion in '2D' started by Madsen87, Feb 2, 2021.

  1. Madsen87

    Madsen87

    Joined:
    Jan 6, 2019
    Posts:
    15
    So, I've been trying to find some information on this, and I've been messing around with all sorts of settings for the last day and I couldn't figure this one out:

    I have this character I put in the game which has a "Light 2D" component attached. I've saved the "NormalMaps: Quality" to "accurate", and reloaded the prefab to the game, but every time I run the game it automatically returns the NormalMaps quality of the light back to "Disabled". I can manually activate it during the gameplay through inspector window, and the normal maps are working fine... Just can't figure why the game is returning this setting to default on load, and it's annoying the heck out of me. Any pointers?

    upload_2021-2-2_7-48-28.png
     
    Endlesskeks likes this.
  2. Endlesskeks

    Endlesskeks

    Joined:
    Oct 26, 2020
    Posts:
    2
    Any news?
    I have the exact same Problem.
     
  3. YupiNawate

    YupiNawate

    Joined:
    Feb 17, 2021
    Posts:
    11
    Hi,
    Did anybody manage to solve this?
     
  4. kennyy_

    kennyy_

    Unity Technologies

    Joined:
    Apr 7, 2021
    Posts:
    94
    Thanks for reporting this issue. I've managed to reproduce the bug and will be looking into it.
     
    Madsen87 likes this.
  5. YupiNawate

    YupiNawate

    Joined:
    Feb 17, 2021
    Posts:
    11
    Aaaaahm... I dunno if it is about a bug or not, but I found something at:

    C:\Program Files\Unity\Hub\Editor\2021.1.3f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.render-pipelines.universal\Runtime\2D\Light2D.cs


    There's a boolean serialized field that is set to false:

    [SerializeField] bool m_UseNormalMap = false; // This is now deprecated. Keep it here for backwards compatibility.


    And then, in Awake() we have this:

    if (!m_UseNormalMap && m_NormalMapQuality != NormalMapQuality.Disabled)
    m_NormalMapQuality = NormalMapQuality.Disabled;



    So we have that NormalMapQuality is always set to Disabled. As I said, I dunno if it is a bug, but I found no solution anywhere, no answers in forums and I needed this working, so I changed the initial value from false to true in the Light2D.cs file (I had to grant write permissions to do it), I started my project and I replaced all my spot 2d lights with new instances. Result: working.
     
    Madsen87 and kennyy_ like this.
  6. kennyy_

    kennyy_

    Unity Technologies

    Joined:
    Apr 7, 2021
    Posts:
    94
    Yes, I have traced it back to that code as well. While the fix may be obvious, I need to investigate further to find out why it was setup that way to ensure it doesn't cause instability.

    Glad you found a workaround, thanks for your patience.
     
    Madsen87 and YupiNawate like this.
  7. YupiNawate

    YupiNawate

    Joined:
    Feb 17, 2021
    Posts:
    11
    Indeed, I know that the most obvious fix it a potential dangerous issue without the proper investigation. Thanks for your support.
     
    Madsen87 likes this.
  8. kennyy_

    kennyy_

    Unity Technologies

    Joined:
    Apr 7, 2021
    Posts:
    94
    Hi, I wanted to update you that the issue has been addressed and will be going out in the next version.
     
    YupiNawate likes this.
  9. YupiNawate

    YupiNawate

    Joined:
    Feb 17, 2021
    Posts:
    11
    Thank you very much, Kennyy_