Version: 2022.2
言語: 日本語
コンピュートシェーダー
ビルトインシェーダー

Error and loading shaders

Sometimes, Unity can’t render objects with regular shaders. 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 variant needed to display that object.

Unity shows the loading shader in the Unity Editor when asynchronous shader compilation is enabled, or in a development build 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.

コンピュートシェーダー
ビルトインシェーダー
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961