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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Extreme load times when preloading shaders in WEBGL

Discussion in 'Editor & General Support' started by DunderStorm, Jun 9, 2020.

  1. DunderStorm

    DunderStorm

    Joined:
    Apr 16, 2013
    Posts:
    2
    Hi!

    I am developing a webgl based game and noticed a lot of stutters when I moved around in my world (tough only the first time, once I hade moved around the world the first time, there where no more stuttering that session).

    I ran the profiler and discovered that the spikes where due to Shader.CreateGPUProgram, and as I further tracked the issue, I found a suggested solution about preloading/prewarming shaders.

    So I cleared the shader tracking, drove around in my world, picked up 29 shaders and 100 variants, saved them as a shader variant collection and added them to the Graphics>shadow loading array.

    So far so good.

    The problem is, when I build my game and try to run my game in chrome, the last 10% of the loading bar takes several minutes and chrome asks several times if I want to wait or kill the process.

    Has anyone else experienced this issue? or is there another workaround to avoid stuttering from shader compile in webgl?

    I am running version 2019.3.13f1 Using the built in render pipeline
     
  2. Daniiii

    Daniiii

    Joined:
    Nov 13, 2013
    Posts:
    24
    Hi, I'm having the same issue currently, did you find a solution?
     
  3. jleven22

    jleven22

    Joined:
    Mar 26, 2019
    Posts:
    400
    I was having some major spikes in my profiler before I updated to 2020.

    Try updating and see if that does anything.
     
  4. TopBananaShana

    TopBananaShana

    Joined:
    Oct 1, 2020
    Posts:
    3
    Hi, I'm having the same exact issue, did you ever find a solution to this?
     
  5. yitz_unity

    yitz_unity

    Joined:
    Jun 22, 2021
    Posts:
    12
    I am having this issue as well. Why do these load so much slower in WebGL?
     
  6. better_in_violet

    better_in_violet

    Joined:
    Sep 4, 2020
    Posts:
    2
    Currently experiencing this issue as well in 2020.3.