skip to Main Content

Usage tips

When using Shader Control to optimize your project, we recommend the following workflow:

1) Remove global shader features

Shader features are stored in the materials of the scene so there’s no need to use global shader features as Unity now supports local keywords. Shader Control can automatically convert global shader features to local, reducing the total number of global keywords in a single, safe operation.

To perform this action, open Shader Control window, go to Project View tab, and click “Scan Project”. If Shader Control finds any global shader feature, it will show a button to convert them to local as shown in the screenshot below:

2) Locate shaders with high number of keywords or variants

From Project View tab, select Sort by Variants Count. Shader Control will list all shaders found in your project sorted by the most consuming shader to the simplest one, allowing you to remove them.

Examine the top shaders in the list and decide if you need those shaders or not. Click “Locate” to select the shader in the Project panel and remove it if you are sure that you don’t need it in your project. You can also expand it and list all the keywords used by the shader. If it’s using many keywords, examine if some of them are related to features that you don’t need. Sometimes the keyword name is self-explanatory. For example, “BLOOM” keyword in a post-processing shader would be related to the bloom effect, so if you’re not using bloom in your game, you could disable that keyword by unticking the checkbox next to it and click “Save”.

The Project View is an excellent tool to learn about the shaders included in many of the assets imported from the Asset Store. Most assets do “too much” so you should make sure only the important shaders are preserved in your project, removing anything else that’s not necessary.

3) Examine shaders included in your build

The Project View shows all shaders that will be included in your build whose source control is accesible. However, there’re some shaders that are located in custom folders or are internal shaders which can’t be examined by Shader Control. From the “Build View” tab, you will be able to examine absolutely all shaders included in your build.

In order to allow Shader Control examine what’s included in your build, click the button “Quick Build” and then do a regular build of your game. Note that this build won’t work properly but will allow Shader Control to learn what’s included in it. The next builds will be fine, only the build done after you click “Quick Build” will be affected by this process. Once you perform this operation, all shaders will be listed in this tab and Shader Control let you select which one do you want to exclude from the final builds, saving further built time and space.

However, please note that shaders or keywords excluded from this “Build View” won’t affect to the maximum keyword count.

Back To Top