Pretty much what the title says. On Unity 2020.3.15f2 (LTS), with Shader Graph version 10.5.1, whenever I try to add an 8th local keyword in any graph’s blackboard panel, I get the following error:
Error in Shader Graph Test:Graph is generating too many variants. Either delete Keywords, reduce Keyword variants or increase the Shader Variant Limit in Preferences > Shader Graph.
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
If I up the shader variant limit from 128 to 512, I get the error when trying to add the 11th keyword instead, which still isn’t a lot. I’m guessing that Unity compiles literally every possible variant of the graph, even ones that are not actually used anywhere, since I’ve noticed the editor starts to update slower and slower as I add more keywords. But I’m new to URP and shader graph, so I don’t really know.
With hand-coded shaders on the built-in renderer, I had about 20 local keywords without issue, which allowed me to turn off specific parts of the shader whenever they weren’t needed and save on computation time. Why is this a problem on URP? Should I just set the shader variant limit to a ludicrously large number and just deal with the slow compile times, or is there a better way to have 20-ish keywords in your shader graphs?