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

Depth/Stencil buffer + 2D URP + WebGL broken

Discussion in 'WebGL' started by aromana, Jan 19, 2021.

  1. aromana

    aromana

    Joined:
    Nov 11, 2018
    Posts:
    137
    I just filed a bug about this, but wondering if others are experiencing the same issue.

    I'm using URP 2D, and when I check "Use Depth/Stencil buffer" in my 2d config, the project builds but the player just shows a black screen and 100 of these in the console:

    GL_INVALID_FRAMEBUFFER_OPERATION: Framebuffer is incomplete. 


    Just unchecking the option to use stencil buffer fixes the issue.

    I'm using the latest stable build of Unity (2020.2.1f12).

    Anyone else experiencing this issue? Interestingly, I'm not even using anything in the scene that should require stencil buffers (e.g. sprite masks)...
     
    Arriken and fnnbrr like this.
  2. fnnbrr

    fnnbrr

    Joined:
    Jan 26, 2021
    Posts:
    10
    Same here on Unity 2019.4.14 with URP 7.5.1.

    Currently implementing a feature that requires the stencil buffer to use UI masking, so I hope there's a fix incoming. I'll update you if I can find a way to get it working, but it seems like "Use Depth/Stencil buffer" leads to a 100% broken WebGL build.
     
  3. aromana

    aromana

    Joined:
    Nov 11, 2018
    Posts:
    137
    I filed a bug report with Unity, and they told me the bug will is fixed in 2021.
    However they noted that a workaround is simply to change the color space from gamma to linear. As I understand it, there shouldn’t be an appreciable performance hit, but it does mean dropping WebGL 1 support (and thus safari for now). That’s what I’ve done in my project.
     
    fnnbrr likes this.
  4. fnnbrr

    fnnbrr

    Joined:
    Jan 26, 2021
    Posts:
    10
  5. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    944
    We are very much looking towards WebGL 2 today. It is unfortunate that Safari is outdated and does not offer WebGL 2 yet.

    They do however have an experimental WebGL 2 support in Safari Tech Preview. One thing that would be amazing if you can try out, is whether your game works correctly if you download Safari Tech Preview, and in its experimental settings panel, enable WebGL 2. When doing the game build, mark its Graphics APIs to limit to only WebGL 2 so it won't accidentally run against WebGL 1 on Safari.

    Actually that is something that we could use a lot more eye pairs on. I posted a thread at https://forum.unity.com/threads/req...der-correctly-in-safari-tech-preview.1050890/ to collect more comments from developers about experiences.
     
    Bentoon likes this.
  6. Arriken

    Arriken

    Joined:
    Oct 11, 2019
    Posts:
    1
    Thank you! We just finished a project and were frustrated the WebGL version wouldn't render correctly. You saved us!