Skip to main content
added 366 characters in body
Source Link
user213769
  • 138
  • 1
  • 9

Note: Variant Prefiltering landed in 2023.1.0a14 and is being backported to other LTS versions. It's not perfect yet (a lot of variants are processed anyway), but you will notice a reduction of time of about one or two orders of magnitude after having it.

Currently, the issue with too many variants and abysmal build times can happen because of two reasons:

Currently, the issue with too many variants and abysmal build times can happen because of two reasons:

Note: Variant Prefiltering landed in 2023.1.0a14 and is being backported to other LTS versions. It's not perfect yet (a lot of variants are processed anyway), but you will notice a reduction of time of about one or two orders of magnitude after having it.

Currently, the issue with too many variants and abysmal build times can happen because of two reasons:

added 22 characters in body
Source Link
user213769
  • 138
  • 1
  • 9
  1. you actually have too many shader variants needed for your scene, due to e.g. different quality settings spanning through too many options (quite unlikely, and mostly unsolvable in a way other than optimizing those options),
  2. you're unlucky enough to use a stock Unity shader code, either by using Shader Graph or #including / copy-pasting some of their shader code or using Shader Graph.
  1. you actually have too many shader variants needed for your scene, due to e.g. different quality settings spanning through too many options (quite unlikely, and mostly unsolvable in a way other than optimizing those options),
  2. you're unlucky enough to use a stock Unity shader code, either by #including some of their code or using Shader Graph.
  1. you actually have too many shader variants needed for your scene, due to e.g. different quality settings spanning through too many options (quite unlikely, and mostly unsolvable in a way other than optimizing those options),
  2. you're unlucky enough to use a stock Unity shader code, either by using Shader Graph or #including / copy-pasting some of their shader code.
added 133 characters in body
Source Link
user213769
  • 138
  • 1
  • 9

The most efficient solution would be to either use a plugin/asset that allows to handle this (or even write a stripper plugin oneself) automatically (e.g. via IPreprocessShaders or similar). Still, if you're OK with fixing the problem by hand, the actual solution is quite simple:

The most efficient solution would be to either use a plugin/asset that allows to handle this (or even write a stripper plugin oneself) automatically. Still, if you're OK with fixing the problem by hand, the actual solution is quite simple:

The most efficient solution would be to either use a plugin/asset that allows to handle this (or even write a stripper plugin oneself) automatically (e.g. via IPreprocessShaders or similar). Still, if you're OK with fixing the problem by hand, the actual solution is quite simple:

Source Link
user213769
  • 138
  • 1
  • 9
Loading