How to include URP variants in ShaderVariantCollection?

I’ve been struggling trying to figure out how to include all the variants of a shader that my game uses. For example, I’ve got a variant in the collection for:
Universal Render Pipeline/Unlit
ScriptableRenderPipeline INSTANCING_ON STEREO_MULTIVIEW_ON

I warm the shader collection on startup, but then later on in the logs I see this statement:
Compiled shader: Universal Render Pipeline/Unlit, pass: Unlit, stage: all, keywords INSTANCING_ON STEREO_MULTIVIEW_ON

So it’s treating that as a different variant I’m guessing. What am I missing? I’m guessing it might be the pass saying Unlit, but I don’t see a way to select that in the collection.

1 Like

You can manually edit it. Changing stereo instancing on to stereo multi view on. I believe this is a bug on Unity’s part

I think you misunderstood the question? I have it with the STEREO_MULTIVIEW_ON keyword there already, but it’s still doing a compile at runtime later on.

Did you ever figure this out? I’m having the same issue with STEREO_INSTANCING_ON causing some of my Standard Shaders to compile at runtime

No, unfortunately I never found a fix for this issue

Ok, thanks for letting me know. If I find out how to fix it, I’ll post it here.

Thanks! Hope you’re able to figure it out