question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Regression: some URP shaders have too many variants in 2021.2

See original GitHub issue

Describe the bug Not sure if this is a regression in URP or in glTFast, I believe the former is more likely. When adding the glTFast shaders to the list of “Always included” shaders, building to Android on 2021.2.0f1 fails with the error message: Shader Graphs/glTF-metallic-Premultiply-double has too many Shader variants(201326592).To resolve this, go to Project Settings > Graphics and remove this Shader from the Always Included Shaders list.For more explicit control over how Unity includes specific Shader variants in a build, use a ShaderVariantCollection.

As the goal for the glTFast shaders would indeed be to be always included (so that all models can be loaded), I think this is a blocker for using glTFast for runtime loading on 2021.2 right now.

To Reproduce Steps to reproduce the behavior:

  1. make a project on 2021.2 with URP targeting Android
  2. add the glTFast shadergraph shaders to the list of always included shaders
  3. try to build

Expected behavior Building works, actually error message prevents building

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:20 (13 by maintainers)

github_iconTop GitHub Comments

3reactions
hybridherbstcommented, Nov 5, 2021

For reference,

shaders_2020 3_all
shaders_2020 3_skip-unused
2020.3

shaders_2021 2-all
shaders_2021 2-skip-unused
2021.2

1reaction
attenedercommented, Dec 15, 2022

Closing, since this was fixed by the URP devs:

It’s now fixed in Universal RP 12.1.5 (2021.2.14f1), 13.1.6 (2022.1.0b10), 14.0.2 (2022.2.0a9), and above.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug - Build time taking almost a day - URP
URP added a lot of features in 2021.2, and the logic that figures out the variants became a bottleneck (it has to process...
Read more >
How to deal with insane amount of shader variants waiting ...
Since Unity 2021.2.0b7 (that is, URP 12.0.0), there has been a well known problem with absurd number of shader variants wanting to be...
Read more >
[Shader Graph] "Graph is generating too many variants" error ...
"Graph is generating too many variants" error is thrown when using SubGraphs with Keywords and specified Shader Variant Limit is not reached.
Read more >
Unity Issue Tracker - "Compiling shader variants&quot
"Compiling shader variants" takes too much time when building the project. URP ... Couldn't test with: 2021.2.13f1 (URP package errors).
Read more >
Let There Be Light: Writing Unity URP Shaders with Code, Part 2
In this video, I will show how to add lighting to a shader. This includes a simple explanation of shadow mapping — how...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found