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

Spikes caused by compiling shader variants that should have been warmed up in a ShaderVariollection

Discussion in 'Asset Bundles' started by ldewet-ct, Sep 8, 2021.

  1. ldewet-ct

    ldewet-ct

    Joined:
    Jul 8, 2019
    Posts:
    12
    I have an issue where I get lots of spikes as a result of shader compiling. I do have shadervariantcollections for all the shaders in a specific scene, and it is warmed up at loading time for that scene. When I enable the Graphics setting to show shader compilation, I can clearly see that the cause of the spike is a variant compiling, BUT that shader variant have actually already been added to the variantcollection. It looks like it does not warm everything up maybe? Is there a known issue around this or a workaround?

    One suggestion was that shaders in assetbundles cannot also be in shadervariantcollections because their source is not added to the build. How can I ensure that the shaders do not get added to assetbundles? I add scenes to the assetbundles, then I add all the shaders to their own assetbundle. Is there a way to say "dont include these shaders"? Or to force include the source for them?
     
    Hello-There-Dev likes this.
  2. night533

    night533

    Joined:
    Jan 15, 2015
    Posts:
    7
    I also have similar issue