Version: 2021.2
LanguageEnglish
  • C#

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

Parameters

mesh The Mesh to draw.
subMeshIndex Specifies which subset of the mesh to draw. This applies only to meshes that are composed of several materials.
material Material to use.
layer Layer to use.
castShadows Whether the meshes cast shadows.
receiveShadows Whether the meshes receive shadows.
invertCulling Specify whether to invert the backface culling (true) or not (false). This flag can "flip" the culling mode of all rendered objects. Major use case: rendering reflections for mirrors, water etc. Since virtual camera for rendering the reflection is mirrored, the culling order has to be inverted. You can see how the Water script in Effects standard package does that.
bounds Bounds to use. Should specify the combined bounds of all the instances.
instanceCount The number of instances to draw.
customProps Additional material properties to apply. See MaterialPropertyBlock.
associatedSceneObject The GameObject to select when you pick an object that the batch renders.
sceneCullingMask Additional culling mask usually used for scene based culling. See Also: EditorSceneManager.GetSceneCullingMask.
renderingLayerMask Rendering layer this batch will lives on. See Also: Renderer.renderingLayerMask.

Returns

int The batch's index in the BatchedRendererGroup.

Description

Adds a new batch to the group.

Each batch corresponds to a new draw call. As long as the batch is not removed and the group is not disposed of, the command is persistent and doesn't need to be called every frame. Returns the batch's index within the group.

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