# BatchDrawCommand

> The Rendering.BatchDrawCommand struct defines instructions for drawing multiple objects in a single instanced draw call. It specifies parameters like meshes, materials, transforms, and shader properties for rendering.

## Definition

* **Type:** Struct
* **Namespace:** [UnityEngine.Rendering](/engine/6000.7/script-reference/unityengine/rendering.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public struct BatchDrawCommand
```

## Remarks

The Rendering.BatchDrawCommand struct helps render large numbers of similar objects by reducing the overhead of individual draw calls.

Use it for custom rendering workflows, especially with BatchRendererGroup, where manual control over GPU draw calls is required. It's common in advanced rendering scenarios, like custom culling or procedural object batches.

Set up a BatchDrawCommand with required properties (mesh, material, transforms) and pass it to BatchRendererGroup.

Additional Resources: [BatchRendererGroup](/engine/6000.7/script-reference/unityengine/rendering/batchrenderergroup.md).

## Fields

| Value                                                                                                                | Description                                                                                                                                                                                                                                                  |
| -------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [activeMeshLod](/engine/6000.7/script-reference/unityengine/rendering/batchdrawcommand/activemeshlod.md)             | Currently active Mesh LOD.                                                                                                                                                                                                                                   |
| [batchID](/engine/6000.7/script-reference/unityengine/rendering/batchdrawcommand/batchid.md)                         | The batch ID that this draw command uses. Determines the metadata values that are available to a shader.                                                                                                                                                     |
| [flags](/engine/6000.7/script-reference/unityengine/rendering/batchdrawcommand/flags.md)                             | Specifies rendering options for the draw command.                                                                                                                                                                                                            |
| [lightmapIndex](/engine/6000.7/script-reference/unityengine/rendering/batchdrawcommand/lightmapindex.md)             | The index of the baked lightmap used in this draw command. If [BatchDrawCommandFlags.UseLegacyLightmapsKeyword](/engine/6000.7/script-reference/unityengine/rendering/batchdrawcommandflags/uselegacylightmapskeyword.md) is not set, this value is ignored. |
| [materialID](/engine/6000.7/script-reference/unityengine/rendering/batchdrawcommand/materialid.md)                   | Identifies which [Material](/engine/6000.7/script-reference/unityengine/material.md) to use to render the instances in this draw command.                                                                                                                    |
| [meshID](/engine/6000.7/script-reference/unityengine/rendering/batchdrawcommand/meshid.md)                           | Identifies which [Mesh](/engine/6000.7/script-reference/unityengine/mesh.md) to use to render the instances in this draw command.                                                                                                                            |
| [sortingPosition](/engine/6000.7/script-reference/unityengine/rendering/batchdrawcommand/sortingposition.md)         | Together with [BatchDrawCommand.flags](/engine/6000.7/script-reference/unityengine/rendering/batchdrawcommand/flags.md), this specifies how to depth sort the instances in this draw command.                                                                |
| [splitVisibilityMask](/engine/6000.7/script-reference/unityengine/rendering/batchdrawcommand/splitvisibilitymask.md) | Indicates which splits that the draw command is visible in.                                                                                                                                                                                                  |
| [submeshIndex](/engine/6000.7/script-reference/unityengine/rendering/batchdrawcommand/submeshindex.md)               | Specifies which sub-mesh of the Mesh identified by [BatchDrawCommand.meshID](/engine/6000.7/script-reference/unityengine/rendering/batchdrawcommand/meshid.md) to use to render the instances in this draw command.                                          |
| [visibleCount](/engine/6000.7/script-reference/unityengine/rendering/batchdrawcommand/visiblecount.md)               | The number of instances to draw with this draw command. This must be a value greater than `1`.                                                                                                                                                               |
| [visibleOffset](/engine/6000.7/script-reference/unityengine/rendering/batchdrawcommand/visibleoffset.md)             | The index of the element in [BatchCullingOutputDrawCommands.visibleInstances](/engine/6000.7/script-reference/unityengine/rendering/batchcullingoutputdrawcommands/visibleinstances.md) that matches the first instance in this draw command.                |
