Shaders Limiter

by [email protected]

This tool can dramatically reduce your project’s build time and runtime memory usage. It gives you faster iterations and better performance.

For more detail this asset from the Unity Asset Store: Click Here

This is a paid asset, but now you can download the “Shaders Limiter” for FREE, Please keep in mind this package is provided only for learning purposes or to be able to test before buying the product, NOT FOR COMMERCIAL PURPOSES.

Shaders Limiter v1.2.0

VIP Only

Shaders Limiter is the best solution to reduce the build time and memory usage of your project. It gives you total control over every single shader variant that goes into your game.

Some core features include:

» Stripping shaders based on keywords or shader variant collections.

» Shader variant collection inspection, modification, and merging.

» A preview of all shader keywords specified by Unity in the project.

» A preview of all currently enabled global keywords used by the project.

» Shaders’ keyword library that can be easily extended.

» Preview of all shaders found inside the shader variant collection with the inspect button to show related shader variants.

» Ability to add shader variants from player logs (the project has to be built in the development mode with the ‘Strict shader variant matching’ or/and ‘Log shader compilation’ flag enabled).

It works in all rendering pipelines and on all platforms. Can be used together with the Addressables package.

Full source code is included with the package. The tool database is version-control friendly (serialized as a scriptable object with sorted lists).

Documentation can be found here.

Installation

After you download and import the package from the Asset Store, new menu items will appear under the ‘Window’ tab. Click on it to open the window.

The tool’s window will pop up with the information that the database hasn’t been created yet. Click on the button below.

Choose the right place for the database (it’s a scriptable object, so it must be within the ‘Assets’ directory).

A newly created database is empty. Please press the red or orange button, depending on the way you wish to initialize the database.

When using the “Delete Cache” option, after you click the button, the editor window will look like the screenshot below. It indicates that everything is set correctly; please build your project! If you are using addressables, don’t forget to build them first.

If you decide to go with the “Add Shaders from the Collection” options, you will be prompted to attach a shader variant collection asset. The tool will also ask if you want to attach this collection to all shaders and enable conditional compilation on them (only variants included in the collection will be compiled during the build time).

After the successful initialization, don’t forget to set the “Strip shaders” flag to true to enable shader stripping in the upcoming builds.

Shaders

Strip Shaders – this is the main setting of the tool, turning it on and off.

Keep in mind that Unity recompiles shaders only if it detects any changes. If you already stripped all of the shaders and started a new build without changing anything, setting this flag to false won’t make any difference. Unity will assume that all shaders are already compiled and ready to be added to the game. It’s usually a good practice to ‘Clear Shaders Cache’ if you set ‘Strip Shaders’ to false.

Display Order – lets you sort all shaders based on total number or stripped keywords.

Visibility – lets you filter out already stripped, hidden, or legacy shaders.

Shader filter – lets you filter out shaders based on the provided string.

Collapse all Shaders – helper function that lets you hide extended views of all shaders.

Clear Shaders Cache – function that will delete all shader caches inside the Library folder, forcing Unity to recompile all of them from the start.

Related Posts

Leave a Comment