O que você está procurando?
Unity Platform

Improved Shader Variants Management

Apr 2, 2025
Planned
Safe harbor statement

The following is intended for informational purposes only, and may not be incorporated into any contract. No purchasing decisions should be made based on the following materials. Unity is not committing to deliver any functionality, features or code. The development, timing and release of all products, functionality and features are at the sole discretion of Unity, and are subject to change.

How to share roadmap feedback

If you have accepted to use functional cookies and logged in using your Unity ID at the top right of the page, then sharing feedback is as simple as clicking a card below, selecting a topic’s importance, adding your point of view, and submitting. If you prefer not to accept functional cookies or log in, you will be prompted to enter an email address and validate it, so we know how to reach out when the topic evolves. For more information read the Feedback and privacy terms.

Summary

Shader variant compilation is a form of static branching which provides authoring and runtime control of conditional shader features, as well as runtime performance, by compiling individual shader variants per branch.

This comes at the cost of build time, file size and runtime memory usage.

Shader variants are mostly introduced using preprocessor directives that evaluate Variant Keywords. As keyword usage grows, so does the build and runtime overhead of shader variants.

Workflows and tools exist to log shader compilation, profile runtime memory usage, and perform build time stripping of variants based on keywords. However, these workflows are time consuming and complex.

We wish to improve Shader Variant Management as a whole, from tracking of shader variants - to keyword filtering and variant stripping.

Intended Behaviour / Usecase

  • Introduce tools to analyse the project's generated shader variants (and their associated keywords) , providing insights such as:
    • Which shaders/keywords generate the most variants?
    • Which variants are loaded or missing at runtime?
  • Provide additional control and improved workflows for shader variant generation and stripping.
Help us deliver the deliver that matter to you. Let us know how important is this for you.
By submitting you agree to the Unity’s feedback terms and privacy policy.
Discover upcoming updates and share your feedback