Version: 2023.1
Language : English
Compute shaders
Built-in shaders

Error and loading shaders

Sometimes, Unity can’t render objects with regular shadersA program that runs on the GPU. More info
See in Glossary
. When this happens, Unity renders the objects with special shaders:

The special shader that Unity uses depends on the reason that Unity can’t use the original shader.

The default error shader

Unity renders an object with the default error shader when there’s a problem with that object’s material or shader; for example, if no material is assigned, if the shader doesn’t compile, or if the shader isn’t supported.

Unity uses the default error shader in the Unity Editor, and in builds.

The default error shader is magenta (bright pink).

The magenta error shader.
The magenta error shader.

When you use the BatchRendererGroup API, Unity doesn’t display the default error shader. Use BatchRendererGroup.SetErrorMaterial to set a material to use instead.

The loading shader

Unity renders an object with the loading shader to indicate that Unity is compiling the shader variantA verion of a shader program that Unity generates according to a specific combination of shader keywords and their status. A Shader object can contain multiple shader variants. More info
See in Glossary
needed to display that object.

Unity shows the loading shader in the Unity Editor when asynchronous shader compilation is enabled, or in a development buildA development build includes debug symbols and enables the Profiler. More info
See in Glossary
when Shader Live Link support is enabled.

The loading shader is cyan (bright blue).

The cyan loading shader.
The cyan loading shader.

When you use the BatchRendererGroup API, Unity doesn’t display the loading shader. Use BatchRendererGroup.SetLoadingMaterial to set a material to use instead.

The Virtual Texturing error material

If your project uses Streaming Virtual Texturing (SVT), Unity uses a special material to indicate problems in your SVT setup. For more information, see Virtual Texturing error material.

Compute shaders
Built-in shaders
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961