Best Practice for Shaders with Variants and Asset Bundles

We are working through the process of dealing with shaders and bundles. There are a couple conditions that work, but there are some concerns that arise around Standard Shader, and one that extends Standard Shader.

Including Standard Shader in “Always Included Shaders” seems to be counter indicated, resulting in the following warning:

Shader “Standard” with 157766 variants
is marked as always included (see
Graphics Settings). This will result
in long build times and runtime memory
consumption. Please use a shader
variant collection instead.

The documentation on how to follow the indicated “instead” is thin at best, and nonexistent perhaps more accurately. A shader variant collection cannot be included into the “Always included Shaders” list, but can be included into the “Preloaded Shaders” list. It is not clear however if the preloaded shader list ALSO achieves force including the selected variants. Right now we are left with a possible false positive because there may be a material getting included into the main build that is doing this for us.

I’m looking for better clarity on the golden path implied by the above warning for using ShaderVariantCollection to force included needed variants.

That doc does not cover the issue, only gets a user to the problem condition outlined. It explains how to force a shader (and ALL of its variants) into the build. It does not appear to describe how to include only select variants.

Unles of course that is to include those variants into the preload collections, but on this point it is not conclusive, and producing a valid test case is far more convoluted than one might think. As I said, we can get our build into working states, but we cannot verify why they are working.

The chief ambiguity is that the doc implies it will preload the shader variants but does not expressly state it includes them in the build. I am simply seeking confirmation on this, or invalidation and the intended work flow.

@KMQ_IGT - Did you ever get resolution to this issue? I’m hitting a similar problem, needing to include a specific variant (or subset of variants). Including the entire list of Standard variants fixes my issues in a standalone game, but build time is too long to be manageable. I’ll be the first to say my ignorance is to blame, just looking for some direction.