Version: 2022.2
LanguageEnglish
  • C#

BatchRendererGroup.SetErrorMaterial

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public void SetErrorMaterial(Material material);

Parameters

material The material to display when there is a problem with a shader or material. If this value is null, Unity does not display anything.

Description

Set the error material for the BatchRendererGroup. This material will be used internally by Unity to render the draw commands referring to erroneous shaders. You can also pass 'null' to this method to unset the material.

When you render with a BatchRendererGroup and there is a problem with the shader or material, Unity doesn't display the default error shader. Use this function to display a given material instead. **Note:** For performance reasons, Unity only displays this material in the Editor and in development builds. Unity does not display this material in release builds.

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