# DrawMeshInstancedProcedural(Mesh, int, Material, Bounds, int, MaterialPropertyBlock, ShadowCastingMode, bool, int, Camera, LightProbeUsage)

> This function is now obsolete. Use Graphics.RenderMeshPrimitives instead. Draws the same mesh multiple times using GPU instancing.

## Definition

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

```csharp
public static void DrawMeshInstancedProcedural(Mesh mesh, int submeshIndex, Material material, Bounds bounds, int count, MaterialPropertyBlock properties = null, ShadowCastingMode castShadows = ShadowCastingMode.On, bool receiveShadows = true, int layer = 0, Camera camera = null, LightProbeUsage lightProbeUsage = LightProbeUsage.BlendProbes)
```

### Parameters

**** (\[Mesh]\(/engine/6000.6/script-reference/unityengine/mesh)): The [Mesh](/engine/6000.6/script-reference/unityengine/mesh.md) to draw.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Which subset of the mesh to draw. This applies only to meshes that are composed of several materials.**** (\[Material]\(/engine/6000.6/script-reference/unityengine/material)): [Material](/engine/6000.6/script-reference/unityengine/material.md) to use.**** (\[Bounds]\(/engine/6000.6/script-reference/unityengine/bounds)): The bounding volume surrounding the instances you intend to draw.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The number of instances to be drawn.**** (\[MaterialPropertyBlock]\(/engine/6000.6/script-reference/unityengine/materialpropertyblock)): Additional material properties to apply. See [MaterialPropertyBlock](/engine/6000.6/script-reference/unityengine/materialpropertyblock.md).**** (\[ShadowCastingMode]\(/engine/6000.6/script-reference/unityengine/rendering/shadowcastingmode)): Determines whether the Meshes should cast shadows.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Determines whether the Meshes should receive shadows.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): [Layer](/engine/6000.6/manual/working-with-gameobjects/layers.md) to use.**** (\[Camera]\(/engine/6000.6/script-reference/unityengine/camera)): If `null` (default), the mesh will be drawn in all cameras. Otherwise it will be drawn in the given Camera only.**** (\[LightProbeUsage]\(/engine/6000.6/script-reference/unityengine/rendering/lightprobeusage)): [LightProbeUsage](/engine/6000.6/script-reference/unityengine/rendering/lightprobeusage.md) for the instances.

### Remarks

This is similar to [Graphics.DrawMeshInstancedIndirect](/engine/6000.6/script-reference/unityengine/graphics/drawmeshinstancedindirect.md), except that when the instance count is known from script, it can be supplied directly using this method, rather than via a ComputeBuffer. To render the instances with light probes, provide the light probe data via the MaterialPropertyBlock and specify `lightProbeUsage` with [LightProbeUsage.CustomProvided](/engine/6000.6/script-reference/unityengine/rendering/lightprobeusage/customprovided.md). Check [LightProbes.CalculateInterpolatedLightAndOcclusionProbes](/engine/6000.6/script-reference/unityengine/lightprobes/calculateinterpolatedlightandocclusionprobes.md) for the details. Additional Resources: [Graphics.RenderMeshPrimitives](/engine/6000.6/script-reference/unityengine/graphics/rendermeshprimitives.md).
