Shader Variants for Billboards even though they are not used
I tracked the shaders used in my project (through Project Settings -> Graphics first clear, then save after running the game), and I noticed that I get the newly introduced billboard variant, even though I'm not using it... or at least not actively.
Here is a part of the tracked shaders:
As you can see, I have the Billboard for Regular Polygon, Disc and Line, but not for Rect.
Things I'm using:
- Regular Polygon with Transform Object
- Rectangle with Transform Object
- Disc with Transform and RectTransform Object
- Line with RectTransform Object
Do you have an idea why I'm getting those variants/if I can disable this? I noticed that shader compiling creates noticable stutters when happening and cutting on the variants would be nice, especially if they are not used.
right now I believe they should all compile regardless of which branches you use, which I recall I had to use due to some other issue that happened when they were lazily loaded
The stutters are kinda because it's designed to load shaders as you run into them, I feel like this shouldn't be related to variants though
you might want to warm them up when loading your app to prevent that from happening during gameplay?
https://docs.unity3d.com/ScriptReference/Shader.WarmupAllShaders.html