Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Question Shader errors in WebGL build + long build times

Discussion in '2021.2 Beta' started by JolanHuyvaertDieKeure, Oct 11, 2021.

  1. JolanHuyvaertDieKeure

    JolanHuyvaertDieKeure

    Joined:
    Mar 1, 2021
    Posts:
    9
    Hey Unity Team,

    For our next project we want to make use of the WebGL improvements made in 2021.2. I decided to convert a prototype from 2020.3 to 2021.2b15 using a few asset store packages we are planning to use. Converting the project broke most of the URP materials it was using (weird shading issues). I then recreated the prototype piece by piece in 2021.2, which then worked fine in editor. When I build for WebGL however, I get a couple of the following error:
    "GLSL link error: FRAGMENT shader texture image units count exceeds MAX_TEXTURE_IMAGE_UNITS(16)
    Note: Creation of internal variant of shader 'Universal Render Pipeline/Terrain/Lit' failed."
    And all the materials look weird again (the same way they did when I converted from 2020.3).
    What's also strange is that building takes over 30 minutes now (both clean as well as incremental), compared to 5 minutes tops in 2020.3. According to the progress UI it is spending most of that time stripping shader variants. I also tried to build for Windows. The build also takes over 30 minutes, but in that build there are no errors or shading issues.
    I added the WebGL build in the link below so you can see what happens in build. I'm not allowed to post the project itself, but I added a video of what it looks like in editor/should look like.

    ( I checked other posts on the forum and one post suggested disabling 'Optimize Mesh Data' and 'Vertex Compression' in player settings. 'Optimize Mesh Data' was already disabled and disabling 'Vertex Compression' didn't seem to have much of an influence either.)

    Link to build + video of what it should look like:
    https://drive.google.com/drive/folders/1Y7bXEon0DmRKcKuzhvU1d_APoD8dfulh?usp=sharing

    Thanks,
    Jolan Huyvaert (die Keure)
     
  2. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,135
    Hi Jolan,

    Thanks for reaching out. Would you be able to submit a bug report for this issue with the project attached so we can have a look? The build itself is probably not enough to debug this.
     
  3. JolanHuyvaertDieKeure

    JolanHuyvaertDieKeure

    Joined:
    Mar 1, 2021
    Posts:
    9
    Thanks for the quick response.
    I submitted a bug report with the project attached.
     
    LeonhardP likes this.
  4. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,135
    Thanks! What's the Issue ID?
     
  5. JolanHuyvaertDieKeure

    JolanHuyvaertDieKeure

    Joined:
    Mar 1, 2021
    Posts:
    9
    The issue id is 1372189. I must add that I changed the color space setting from linear to gamma to test something right before submitting the bug report, but forgot to put it back.
     
    LeonhardP likes this.
  6. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,135
    Thanks! Could you please reply to the confirmation email that you received after submitting the report with this information? That way it will show up in the report.
     
  7. JolanHuyvaertDieKeure

    JolanHuyvaertDieKeure

    Joined:
    Mar 1, 2021
    Posts:
    9
    Thanks! I replied to the confirmation email with the additional info
     
    LeonhardP likes this.
  8. CWatsonT2

    CWatsonT2

    Joined:
    Jan 9, 2019
    Posts:
    114
    Was this ever solved? I'm having the same issue.
     
    Next1on likes this.
  9. Grimraider1

    Grimraider1

    Joined:
    Jan 12, 2022
    Posts:
    3
    The same to me. So, was this ever solved?