Search Unity

Question WEBGL build graphic glitch with square boxes

Discussion in 'Web' started by JumpWire, Apr 20, 2023.

  1. JumpWire

    JumpWire

    Joined:
    Dec 11, 2015
    Posts:
    18
    Has anyone run across this error effect with a webgl build? When a co-worker creates projects they keep getting this when publishing to webgl. I can re-create it on my computer when running their project. Screenshot 2023-04-20 at 11.12.24 AM.png Screenshot 2023-04-20 at 11.16.05 AM.png
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,975
    What browser, OS and Unity version?
    I see Gamma color space. Unless you absolutely HAVE to support WebGL v1 (deprecated now) switch to linear color space and webgl v2.
     
  3. JumpWire

    JumpWire

    Joined:
    Dec 11, 2015
    Posts:
    18
    Unity 2021.3.13.f1. Chrome on Mac Venture. I think I tried that but I will again. Thanks!
     
  4. JumpWire

    JumpWire

    Joined:
    Dec 11, 2015
    Posts:
    18
    Unfortunately the Linear color space did not help. So strange. I am able to build much more complex WEBGL projects without any problem. Just the projects from my co-worker are doing it.
     
  5. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,975
    There have been recent reports regarding such issues on M1 Macs. Check the last couple dozen threads on this forum for possible answers, if any.

    Definitely try with 2022.2 because WebGL is undergoing technical improvements all the time. Be sure to use URP, not legacy render pipeline.

    Since you have working projects I would check for any differences in player and quality settings and use of packages/render pipeline between these two projects.
     
    JumpWire likes this.
  6. JumpWire

    JumpWire

    Joined:
    Dec 11, 2015
    Posts:
    18
    Thanks for your help. I really appreciate it.
     
  7. JumpWire

    JumpWire

    Joined:
    Dec 11, 2015
    Posts:
    18
    Wow. My co-worker just tried it with Unity 2022 and the same thing happened. We are so stumped. Someone must have seen this effect before...
     
  8. unityruba

    unityruba

    Unity Technologies

    Joined:
    Nov 6, 2020
    Posts:
    273
    Hey, could you open a bug report so we can investigate?
     
  9. therealmattkain

    therealmattkain

    Joined:
    Oct 27, 2013
    Posts:
    7
    I just started a new question, but I might be seeing the same thing. I see odd black artifacts on my surfaces when I make a WebGL build and try to run it in Chrome or Safari on macOS or iOS. I'm making a build using Unity 2021.3.23f1. OP, is this in the neighborhood of what you're seeing?
     
  10. atomikm

    atomikm

    Joined:
    Feb 8, 2020
    Posts:
    20
    I'm on Unity 2021.3.8f1 and having the same issue when building to WebGL. I'm also using LODs for all the objects. Running on M1 Mac



    upload_2023-5-24_19-58-0.png
     

    Attached Files:

  11. Nebulaoblivion

    Nebulaoblivion

    Joined:
    Dec 9, 2017
    Posts:
    8
    Hello! I got the same issue. Also M1 mac.
    110cfaab7f56268b03bd64fda3204243e1ec1b78ca83d7e3203eeb06c4f74ec3.jpg

    b10813b5ebab5142a65534fcfa5ccba5b984137647197fbcef294eda336ac126.jpg

    Tried in both Safari and Firefox. I'm using Unity 2022.3.0
    Some video (a year old and without this exact issue) advised turning off a number of compression options for WebGL builds, which did not work. I just switched from gamma to linear and turned off WebGL1 support, and the problem persists.

    edit: oh and I'm using URP forward+ renderer
    edit2: As additional data, I recompiled an older WebGL game in unity 2021.3.8f1 on my M1 and it was totally fine. No graphics issues at all.
    I went and installed the newest unity on my decade old intel macbook that barely functions, I compiled the current game project, and was able to run the localhost version in chrome with no graphics issues. After uploading it to itch.io and trying to run it on my M1, I encountered the same graphics issues.
    edit3: oh also, I tried disabling both SSAO, and post processing, and had no change.
     
    Last edited: Jun 9, 2023
  12. unityruba

    unityruba

    Unity Technologies

    Joined:
    Nov 6, 2020
    Posts:
    273
    a bug report is the fastest way for us to investigate this :) especially if you share the report number here
     
  13. Nebulaoblivion

    Nebulaoblivion

    Joined:
    Dec 9, 2017
    Posts:
    8
    Okay, filed a bug report, IN-43465 Thanks for your time Ruba.
     
    unityruba likes this.
  14. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    437
    I took a look at the project in the bug report and found that Depth Priming Mode in the URP renderer data settings is the culprit for causing the render to glitch. I changed the setting to Disabled and the game rendered correctly.

    I'll make a note to check with the URP team if there's anything we can do about getting it to work on Mac M1/2 WebGL. For now, leaving the Depth Priming Mode setting Disabled is the workaround.
     
  15. Nebulaoblivion

    Nebulaoblivion

    Joined:
    Dec 9, 2017
    Posts:
    8
    Oh awesome! Thanks for looking into it, and getting back to me!