Author Topic: Shader Variants Changing After a Save  (Read 59 times)

f0ff886f

  • Newbie
  • *
  • Posts: 10
    • View Profile
Shader Variants Changing After a Save
« on: April 29, 2019, 10:05:05 AM »
So! I am trying to get some shader variants under control, things have gone haywire in my project.

Now, one thing I noticed is that the shader variants for a shader can change dramatically after disabling a keyword and saving the shader. Any idea why that is the case? Its not a small amount either, I went from 2216 variants before the keyword removal, ~1000 after removing the keyword, then when I clicked "Save" it went to 10656 variants!

Also, does the variants equal "programs" in Unity 2018 build log?

[18:56:06][Step 2/4] Compiled shader 'Beautiful Dissolves/Standard Dissolve (Specular setup)' in 5.57s
[18:56:06][Step 2/4]     d3d11 (total internal programs: 30768, unique: 20011)

Wondering if these are connected with the Shader Variants (for this shader it says I have 137 variants in Shader Control).

As always, thank you for the great asset!

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 4554
    • View Profile
Re: Shader Variants Changing After a Save
« Reply #1 on: April 30, 2019, 12:30:37 AM »
That should not happen. Disabling a shader keyword must always reduce variant count. Could you please send me a pm or email with just that shader file? Thanks.

f0ff886f

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Shader Variants Changing After a Save
« Reply #2 on: May 03, 2019, 03:45:24 AM »
Sorry for the delay, I will see what I can do (it is a purchased asset). We're in a small crunch right now, for now I worked around some really big variant exploding with changing all the multi_compile to shader_feature's in the shader source. It's still a nasty shader though, its 300MB uncompressed and I don't know how its that complicated.