# Sandbox.Rendering.CommandList.DrawModelInstancedIndirect

## Overload 1

```csharp
void DrawModelInstancedIndirect(Model model, GpuBuffer buffer, int bufferOffset = 0, RenderAttributes attributes = null)
```

Draws multiple instances of a model using GPU instancing with the number of instances being provided by indirect draw arguments.
Use `SV_InstanceID` semantic in shaders to access the rendered instance.

### Parameters

- `model` (`Model`): The model to draw
- `buffer` (`GpuBuffer`): The GPU buffer containing the DrawIndirectArguments
- `bufferOffset` (`int`), default `0`: Optional offset in the GPU buffer
- `attributes` (`RenderAttributes`), default `null`: Optional attributes to apply only for this draw call

## Overload 2

```csharp
void DrawModelInstancedIndirect(Model model, GpuBuffer transformBuffer, GpuBuffer indirectArgs, int argsOffset = 0, int lodLevel = 0, RenderAttributes attributes = null)
```

Draws instances of a model using GPU instancing, with per-instance transforms read from
`transformBuffer` and the instance count provided by indirect draw arguments.
Feeds the standard `GetTransformMatrix()` path, so normal/custom material shaders render unchanged.

### Parameters

- `model` (`Model`): The model to draw
- `transformBuffer` (`GpuBuffer`): Per-instance transforms, indexed 0..count-1
- `indirectArgs` (`GpuBuffer`): Buffer containing the DrawIndexedInstancedArguments
- `argsOffset` (`int`), default `0`: Optional byte offset into the indirect args buffer
- `lodLevel` (`int`), default `0`: LOD level to render (0 = highest detail)
- `attributes` (`RenderAttributes`), default `null`: Optional attributes to apply only for this draw call

Declared in [Sandbox.Rendering.CommandList](/api/Sandbox.Rendering.CommandList).
Assembly: `Sandbox.Engine`.
