Missing shader variants

Hi all,

I’m building some materials at runtime in my Unity project, and I have (most of) the variants in a .shadervariants file.

However, sometimes it happens that I hit a path where I create a material with a shader variant that I hadn’t included in the .shadervariants file, and the model is rendered as black.

  1. Is there a way to detect that this happened? i.e. a way to detect, at runtime, that a particular shader variant was not found and that a fallback is being used.
  2. Is there a way to, at runtime, compile/create a shader variant which wasn’t included at compile time for your project?

Thanks!

Hi!

  1. I’m not sure, but this information can be in the log file.
  2. No, this is not possible.