Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Shaders view reference

Displays issues related to the shaders in your project.
Read time 5 minutesLast updated 13 days ago

The Shaders view displays information related to the shaders in your project and how they impact the performance of your project. You can select from the following views:

Shaders view

Project Auditor window with the Shaders view open

The table of issues has the following columns. Use the table controls to configure how to organize and display the data.

Property

Description

Shader NameThe shader name, as declared inside the .shader file itself. For the actual asset file name, refer to the Path column.
SizeThe file size of the shader, as reported in the most recent build report. Shaders that weren't included in the build are reported as being 0 bytes in size.
Max VariantsNumber of potential shader variants for a single stage (for example: fragment), per rendering platform API (for example: Vulkan). This is the raw number of variants from considering keyword combinations, and contributes to build times and sizes. The build process might strip these variants down to a smaller number of variants that are actually included in the build.
Built Fragment VariantsNumber of fragment shader variants per rendering platform API (for example: Vulkan) that were actually included in the build.
Num PassesThe number of passes included in this shader.
Num KeywordsThe number of keywords referenced in this shader, including both globally keywords and local keywords declared in
#pragma
statements in this shader.
Num PropertiesThe number of properties in this shader.
Num Tex PropertiesThe number of properties in this shader which can hold a texture object.
Render QueueThe shader's render queue, which determines the order in which objects are rendered
InstancingDisplays a tick if any of this shader's passes enable GPU Instancing. Refer to Creating shaders that support GPU instancing for more information.
SRP BatcherDisplays a tick if this shader is compatible with the Scriptable Render Pipeline batcher.
Always IncludedDisplays a tick if this shader is on the list of Always Included Shaders in the Graphics settings.
PathThe full path and file name of the source shader asset.

Shader Variants View

Displays all shader variants included in the build. Built-in shaders are included only after building the project for the target platform.
To populate the data in the table, build your project and then select the Refresh button (⟳).

Project Auditor window with the Shader Variants view open

Runtime shader compilation

To also view which Shader Variants were requested and compiled at runtime:
  • Go to Settings > Graphics > Shader Preloading and enable Log Shader Compilation
  • Ensure that the build you create is a Development build
  • Run the build on the target platform. Be sure to test every scene and view in the build if you want to generate a complete list of compiled variants.
  • Stop running the build, and locate the
    Player.log
    file. Drag this file onto the Shader Variants View.
Project Auditor then parses the compilation log and populates the Compiled column.

Issue table

The table of issues has the following columns. Use the table controls to configure how to organize and display the data.

Property

Description

Shader NameThe name of the shader that includes this shader variant.
CompiledShows a tick if this shader variant was compiled and used at runtime, as reported in a player log.
Graphics APIThe graphics API which this shader variant targets.
TierIn the Built-in Render Pipeline, indicates the hardware tier that this shader variant targets. Refer to Graphics tiers and shader variants for more information.
StageThe stage in the rendering pipeline in which this shader variant runs. Refer to the
ShaderType
API documentation for a full list of stages.
Pass TypeThe shader pass type in which this shader variant runs.Refer to the
PassType
API documentation for more information.
Pass NameThe name of the shader pass in which this shader variant runs.
KeywordsA list of all the shader keywords that represent this specific shader variant. See the selected item detail panel to the right for an alternative view of this keyword list.
Platform KeywordsA list of all the
BuiltInShaderDefine
keywords set by the Editor for this shader variant. Refer to the selected item detail panel to the right for an alternative view of this keyword list.
RequirementsA list of all the
ShaderRequirements
features required by this shader variant. Refer to the selected item detail panel to the right for an alternative view of this requirement list.

Compiler Messages view

Displays shader compiler error and warning messages encountered during the build process.
The table of issues has the following columns. Use the table controls to configure how to organize and display the data.

Property

Description

Log LevelThe log level of the compiler message (Error/Warning).
MessageThe error/warning message string reported by the compiler. If you select a report item in the table, this message is displayed in the selected item detail panel to the right.
Shader NameThe name of the shader that generated the message. Double-click on any report item to automatically open the shader file or in a Shadergraph window.
PathThe full path and filename of the source shader asset that generated the message.

Materials view

Displays all material assets in the project's Assets folder, along with their properties and asset import settings.
Tip
Enable Show/Hide hierarchy and select Group By: Shader to view all the materials that reference a particular shader.
The table of issues has the following columns. Use the table controls to configure how to organize and display the data.

Property

Description

NameThe material file name.
ShaderThe name of the shader referenced by this material.
Source AssetThe full path to the source material asset within the Assets folder.

Additional resources