Could the variants in Post Porcess Stack to be reduced?

Hi,

I just found the Uber shader within the Post Process Stack uses about 3.74k variants which cause an extreme long time to build the shader.

I’m going to build a mobile game and I think lots of them would not be necessary. Could this variant count to be reduced?

4546288--421873--upload_2019-5-16_11-42-5.png

Yep, just get rid of some of the MULTI_COMPILE lines in the Uber shader and replace with #define’s that you need:

        #pragma multi_compile __ DISTORT
        #pragma multi_compile __ CHROMATIC_ABERRATION CHROMATIC_ABERRATION_LOW
        #pragma multi_compile __ BLOOM BLOOM_LOW
        #pragma multi_compile __ VIGNETTE
        #pragma multi_compile __ GRAIN
        #pragma multi_compile __ FINALPASS

IE. get rid of BLOOM, CHROMATIC_ABERRATION and you’ve just saved a bunch of variants.

Found this file in Packages/Post Processing/Post Processing/Shaders/Builtins folder. I can edit it, but during build it gets reversed to its original contents.

Maybe something has changed during those 4 years. How can I get rid of all those not used variants today (version 2021.3.20)?

Unless there is an override option for the shader in PlayerSettings somewhere, I can’t remember, but don’t think there is one, you’ll need to embed the package into the actual packages folder ( I’m assuming you’ve imported the package from PackageManager or asset store or GitHub ). See this page in the manual.

once embedded you should be able to edit the shader without Unity restoring the contents.