Version: Unity 6 (6000.0)
Language : English
Detect asynchronous shader compilation
Reducing the size or number of shaders

Troubleshooting asynchronous shader compilation

Advanced rendering solutions rely on generating data once and reusing it in later frames. If the Editor uses a placeholder shaderA program that runs on the GPU. More info
See in Glossary
during this process, it might pollute the generated data. If this happens, you can see the cyan color or other rendering artifacts in your sceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary
, even after the shader variants have finished compiling.

To avoid this, you can Disable asynchronous shader compilation.

Customize compile time rendering

You can make your custom tools draw something other than the placeholder shader for each material. This way, you can avoid rendering in plain cyan, and instead draw something else while the shader variant compiles.

To check if a specific shader variant has compiled, see Detecting asynchronous shader compilation.

To trigger compilation manually, you can use ShaderUtil.CompilePass. This way, you can avoid rendering with the cyan placeholder, and draw something else while the shader variant compiles.

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