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

Bug URP in WebGL build very bright

Discussion in '2021.1 Beta' started by Laur3nt1u, Jan 27, 2021.

  1. Laur3nt1u

    Laur3nt1u

    Joined:
    Apr 30, 2014
    Posts:
    23
    WebGL build made with URP 11.0.0 in 2021.1.0b2 and b3 is very washed as you can see in the image attached, it works fine in 2020.2.2 URP 10.2.2

    Screenshot 2021-01-30 203345.jpg

    Workaround: Go to the camera settings, enable the post processing and disabled the anti-aliasing
     
    Last edited: Jan 30, 2021
    KamilCSPS likes this.
  2. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,106
    Hi @Laur3nt1u,

    Could you please submit a bug report for this issue with a reproduction project attached to it?
     
  3. KamilCSPS

    KamilCSPS

    Joined:
    May 21, 2020
    Posts:
    376
    @Laur3nt1u, can you inform us if you submitted one? I also have this issue, don't want to duplicate the ticket.
     
  4. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,106
    If you can, please do submit a bug report. Even if it turns out to be a duplicate, it will help us cover more scenarios.
     
    KamilCSPS likes this.
  5. Laur3nt1u

    Laur3nt1u

    Joined:
    Apr 30, 2014
    Posts:
    23
    I did submit a bug report
     
    LeonhardP likes this.
  6. KamilCSPS

    KamilCSPS

    Joined:
    May 21, 2020
    Posts:
    376
    Submitted bug #1310136 in fogbug
     
    LeonhardP likes this.
  7. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,106
    Thank you both.
     
  8. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,494
    This happened to me a while back, not sure your issue is the same but figured I'd mention what it was. In one of the updates, the effect of Bloom was made more similar between Linear and Gamma color space. This caused a huge difference in what I thought was lighting from one version of the editor to the next.. quickly fixed once I knew about the change (just by adjusting properties of Bloom in the Volume).
     
  9. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,494
  10. Laur3nt1u

    Laur3nt1u

    Joined:
    Apr 30, 2014
    Posts:
    23
  11. Laur3nt1u

    Laur3nt1u

    Joined:
    Apr 30, 2014
    Posts:
    23
    Workaround:

    Go to the camera settings, enable the post processing and disable the anti-aliasing

    - it doesn't work if post processing is enabled and anti-aliasing is FXAA
    - it doesn't work if post processing is disabled
     
    Last edited: Feb 2, 2021
  12. Magistr_AVSH

    Magistr_AVSH

    Joined:
    Jun 6, 2017
    Posts:
    6
    Not fully workaround, bloom not working.
     
  13. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,106
  14. KamilCSPS

    KamilCSPS

    Joined:
    May 21, 2020
    Posts:
    376
    Still doesn't work for me. Neither does deleting the library folder and / or re-importing all assets to rebuild the cache. Yet, Unity couldn't reproduce the issue on their end so I am puzzled. They bundled my bug report with your issue... I guess we'll see.
     
  15. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    944
    Thanks for reporting. It looks like the graphics team is on top the issue already (at https://forum.unity.com/threads/urp-in-webgl-build-very-bright.1046554/#post-6792533). Let's hope they are able to resolve the issue before the beta is over.

    Off the top of my head the issue looks like gamma->linear conversion would be getting performed twice. Tried out the test scene in URPWebGLBug.zip on my system, but unfortunately the issue did not reproduce there at least (Windows 10, RTX 2060, Chrome 87 and Firefox Nightly 87.0a1). All the three scenes looked normal there. But by the linked comment, the graphics team seems to be aware of the issue.

    Btw, noticed that the test project URPWebGLBug.zip seems to have Gamma color space active instead of Linear. I wonder if changing it to Linear would affect the issue? (or WebGL 1 vs WebGL 2 API?)
     
  16. KamilCSPS

    KamilCSPS

    Joined:
    May 21, 2020
    Posts:
    376
    It's happening in my project (case #1310136 in fogbug) too which is in linear, WebGL2. (Windows 10, RTX 2080, Chrome 88/FF85). Only in the build, never in the editor.

    Edit:
    As no one could reproduce my issue, I dug a bit further.

    I am using Unity's Accelerator. As such, in order to rebuild the cache, I am using the "Re-import all" functionality in Unity (and could see the new cache being pushed to the accelerator cache server). Thus I assumed it was properly rebuilding the cache. Deleting the /library folder before/after re-importing all didn't change anything.

    Finally, I tried shutting down the cache server and deleting the /library folder. This finally fixed the issue. "Re-import all" doesn't appear to rebuild all the cache apparently.

    Hope it helps other users too.
     
    Last edited: Feb 3, 2021
  17. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    334
    The issue with URP being over bright when post processing is disabled, is due to the Optimize Size build configuration. We are working on fixing this. In the meantime, using Optimize Speed in the Build Settings for WebGL should resolve the issue.
     
    Blarp likes this.
  18. KamilCSPS

    KamilCSPS

    Joined:
    May 21, 2020
    Posts:
    376
    Do you have any news about this? Still happening in 2021.2b2 unfortunately.
     
  19. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    334
    Yeah, sorry, I'm still aware of it and it's being a really difficult and time consuming bug to track down. I will continue working to crack it.
     
    KamilCSPS likes this.
  20. larskroll

    larskroll

    Joined:
    Dec 17, 2013
    Posts:
    50
    Any news on this one ?

    My webGL build is already too fat, so I'd really prefer to be able to optimise for size...
     
  21. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    334
    Lots of other tasks kept bumping this, but it's actually on my current task list.
     
  22. farrellart

    farrellart

    Joined:
    Dec 14, 2019
    Posts:
    16
    I have to keep using 2020.3LTS because of this. I am making my virtual gallery in 2021.1 and I love the new point light shadows ( I only need to use two ) as they create a subtle shadowing effect to the scene. When I publish to WebGL it's all over-exposed. I will test with PP settings. I use WebGL.2 and Gamma colour space.
     
  23. larskroll

    larskroll

    Joined:
    Dec 17, 2013
    Posts:
    50
    For me, switching to "Optimise for Speed" rather than "Optimise for size" did the trick.
     
  24. farrellart

    farrellart

    Joined:
    Dec 14, 2019
    Posts:
    16
    Thank you larskroll - that fixed it for me too. Such a weird bug. The file size doesn't seem that different using Optimise for Speed over Optimise for size, I am wondering what had been broken in the 2021 version.
     
  25. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    334
    @farrellart I have this fixed in the latest version, but I haven't backported it to 2021 yet.
    The problem was caused when the size compile option was added, it revealed an code inlining issue causing the linear->sRGB color conversion to be applied twice.
    When I get a chance I'll get the fix backported to 2021.
     
    Laur3nt1u likes this.
  26. DhiaSendi

    DhiaSendi

    Joined:
    May 16, 2018
    Posts:
    42
    Fixed by upgrading to Unity 2021.2.19f
     
  27. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    637
    It's still a problem with linux builds on openGL but with build in render pipeline Will that be fixed in Post processing package? (when turning on SMAA antialiasing) unity 2019.4.32
     
  28. angiemon

    angiemon

    Joined:
    Mar 26, 2018
    Posts:
    30
    Hello, lovely people of/using Unity!

    I wanted to offer another (kinda dumb) solution to a (specific, really) problem, which has nothing to do with this bug or URP, but I figured it might help someone out who stumbled upon this while frantically googling!

    So our specific problem was that we use multiple projects, and e.g. have all our assets in a package that gets then loaded via addressables into the projects.

    The respective webGL projects where the scenes were horribly bright was relatively new, so all the multiple layers we had were missing. Post Processing can't have that, so

    tl;dr: IF YOU'RE USING MULTIPLE PROJECTS, MAKE SURE THEY ALL HAVE THE SAME LAYERS, all the layers, in the correct order, otherwise your PP Volumes won't be on the correct layer and then everything looks like a lighthouse from hell.

    Sometimes it's the simplest things.. :')

    Edit: typo
     
    Last edited: Sep 12, 2023
    brendanduncan_u3d likes this.