# DrawProcedural

> Add a "draw procedural geometry" command.

## Definition

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

## DrawProcedural(Matrix4x4, Material, int, MeshTopology, int, int, MaterialPropertyBlock)

Add a "draw procedural geometry" command.

```csharp
public void DrawProcedural(Matrix4x4 matrix, Material material, int shaderPass, MeshTopology topology, int vertexCount, int instanceCount, MaterialPropertyBlock properties)
```

### Parameters

**** (\[Matrix4x4]\(/engine/6000.7/script-reference/unityengine/matrix4x4)): Transformation matrix to use.**** (\[Material]\(/engine/6000.7/script-reference/unityengine/material)): Material to use.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Which pass of the shader to use (or -1 for all passes).**** (\[MeshTopology]\(/engine/6000.7/script-reference/unityengine/meshtopology)): Topology of the procedural geometry.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Vertex count to render.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Instance count to render.**** (\[MaterialPropertyBlock]\(/engine/6000.7/script-reference/unityengine/materialpropertyblock)): Additional material properties to apply just before rendering. See [MaterialPropertyBlock](/engine/6000.7/script-reference/unityengine/materialpropertyblock.md).

### Remarks

When the command buffer executes, this will do a draw call on the GPU, without any vertex or index buffers. This is mainly useful on [Shader Model 4.5](/engine/6000.7/manual/materials-and-shaders/shaders/writing-custom/shader-writing/writing-shader-tags/sl-shader-compile-targets.md) level hardware where shaders can read arbitrary data from [ComputeBuffer](/engine/6000.7/script-reference/unityengine/computebuffer.md) buffers.

In the vertex shader, you'd typically use the SV\_VertexID and SV\_InstanceID input variables to fetch data from some buffers.

Note that the draw call will not have any lighting related shader data (light colors, directions, shadows, light and reflection probes etc.) set up. If the shader used by the material uses any lighting related variables, the results are undefined.

Additional Resources: [CommandBuffer.DrawProceduralIndirect](/engine/6000.7/script-reference/unityengine/rendering/commandbuffer/drawproceduralindirect.md), [MaterialPropertyBlock](/engine/6000.7/script-reference/unityengine/materialpropertyblock.md), [Graphics.DrawProcedural](/engine/6000.7/script-reference/unityengine/graphics/drawprocedural.md).

## DrawProcedural(GraphicsBuffer, Matrix4x4, Material, int, MeshTopology, int, int, MaterialPropertyBlock)

Add a "draw procedural geometry" command.

```csharp
public void DrawProcedural(GraphicsBuffer indexBuffer, Matrix4x4 matrix, Material material, int shaderPass, MeshTopology topology, int indexCount, int instanceCount, MaterialPropertyBlock properties)
```

### Parameters

**** (\[GraphicsBuffer]\(/engine/6000.7/script-reference/unityengine/graphicsbuffer)): The index buffer used to submit vertices to the GPU.**** (\[Matrix4x4]\(/engine/6000.7/script-reference/unityengine/matrix4x4)): Transformation matrix to use.**** (\[Material]\(/engine/6000.7/script-reference/unityengine/material)): Material to use.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Which pass of the shader to use (or -1 for all passes).**** (\[MeshTopology]\(/engine/6000.7/script-reference/unityengine/meshtopology)): Topology of the procedural geometry.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Index count to render.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Instance count to render.**** (\[MaterialPropertyBlock]\(/engine/6000.7/script-reference/unityengine/materialpropertyblock)): Additional material properties to apply just before rendering. See [MaterialPropertyBlock](/engine/6000.7/script-reference/unityengine/materialpropertyblock.md).

### Remarks

When the command buffer executes, this will do a draw call on the GPU, without a vertex buffer. This is mainly useful on [Shader Model 4.5](/engine/6000.7/manual/materials-and-shaders/shaders/writing-custom/shader-writing/writing-shader-tags/sl-shader-compile-targets.md) level hardware where shaders can read arbitrary data from [ComputeBuffer](/engine/6000.7/script-reference/unityengine/computebuffer.md) buffers.

In the vertex shader, you'd typically use the SV\_VertexID and SV\_InstanceID input variables to fetch data from some buffers.

Additional Resources: [CommandBuffer.DrawProceduralIndirect](/engine/6000.7/script-reference/unityengine/rendering/commandbuffer/drawproceduralindirect.md), [MaterialPropertyBlock](/engine/6000.7/script-reference/unityengine/materialpropertyblock.md), [Graphics.DrawProcedural](/engine/6000.7/script-reference/unityengine/graphics/drawprocedural.md).

## DrawProcedural(GraphicsBuffer, Matrix4x4, Material, int, MeshTopology, int, int)

Add a "draw procedural geometry" command.

```csharp
public void DrawProcedural(GraphicsBuffer indexBuffer, Matrix4x4 matrix, Material material, int shaderPass, MeshTopology topology, int indexCount, int instanceCount)
```

### Parameters

**** (\[GraphicsBuffer]\(/engine/6000.7/script-reference/unityengine/graphicsbuffer)): The index buffer used to submit vertices to the GPU.**** (\[Matrix4x4]\(/engine/6000.7/script-reference/unityengine/matrix4x4)): Transformation matrix to use.**** (\[Material]\(/engine/6000.7/script-reference/unityengine/material)): Material to use.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Which pass of the shader to use (or -1 for all passes).**** (\[MeshTopology]\(/engine/6000.7/script-reference/unityengine/meshtopology)): Topology of the procedural geometry.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Index count to render.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Instance count to render.

### Remarks

When the command buffer executes, this will do a draw call on the GPU, without a vertex buffer. This is mainly useful on [Shader Model 4.5](/engine/6000.7/manual/materials-and-shaders/shaders/writing-custom/shader-writing/writing-shader-tags/sl-shader-compile-targets.md) level hardware where shaders can read arbitrary data from [ComputeBuffer](/engine/6000.7/script-reference/unityengine/computebuffer.md) buffers.

In the vertex shader, you'd typically use the SV\_VertexID and SV\_InstanceID input variables to fetch data from some buffers.

Additional Resources: [CommandBuffer.DrawProceduralIndirect](/engine/6000.7/script-reference/unityengine/rendering/commandbuffer/drawproceduralindirect.md), [MaterialPropertyBlock](/engine/6000.7/script-reference/unityengine/materialpropertyblock.md), [Graphics.DrawProcedural](/engine/6000.7/script-reference/unityengine/graphics/drawprocedural.md).

## DrawProcedural(GraphicsBuffer, Matrix4x4, Material, int, MeshTopology, int)

Add a "draw procedural geometry" command.

```csharp
public void DrawProcedural(GraphicsBuffer indexBuffer, Matrix4x4 matrix, Material material, int shaderPass, MeshTopology topology, int indexCount)
```

### Parameters

**** (\[GraphicsBuffer]\(/engine/6000.7/script-reference/unityengine/graphicsbuffer)): The index buffer used to submit vertices to the GPU.**** (\[Matrix4x4]\(/engine/6000.7/script-reference/unityengine/matrix4x4)): Transformation matrix to use.**** (\[Material]\(/engine/6000.7/script-reference/unityengine/material)): Material to use.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Which pass of the shader to use (or -1 for all passes).**** (\[MeshTopology]\(/engine/6000.7/script-reference/unityengine/meshtopology)): Topology of the procedural geometry.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Index count to render.

### Remarks

When the command buffer executes, this will do a draw call on the GPU, without a vertex buffer. This is mainly useful on [Shader Model 4.5](/engine/6000.7/manual/materials-and-shaders/shaders/writing-custom/shader-writing/writing-shader-tags/sl-shader-compile-targets.md) level hardware where shaders can read arbitrary data from [ComputeBuffer](/engine/6000.7/script-reference/unityengine/computebuffer.md) buffers.

In the vertex shader, you'd typically use the SV\_VertexID and SV\_InstanceID input variables to fetch data from some buffers.

Additional Resources: [CommandBuffer.DrawProceduralIndirect](/engine/6000.7/script-reference/unityengine/rendering/commandbuffer/drawproceduralindirect.md), [MaterialPropertyBlock](/engine/6000.7/script-reference/unityengine/materialpropertyblock.md), [Graphics.DrawProcedural](/engine/6000.7/script-reference/unityengine/graphics/drawprocedural.md).
