# DrawMeshNow

> Draw a mesh immediately.

## Definition

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

## DrawMeshNow(Mesh, Vector3, Quaternion, int)

Draw a mesh immediately.

```csharp
public static void DrawMeshNow(Mesh mesh, Vector3 position, Quaternion rotation, int materialIndex)
```

### Parameters

**** (\[Mesh]\(/engine/6000.5/script-reference/unityengine/mesh)): The [Mesh](/engine/6000.5/script-reference/unityengine/mesh.md) to draw.**** (\[Vector3]\(/engine/6000.5/script-reference/unityengine/vector3)): Position of the mesh.**** (\[Quaternion]\(/engine/6000.5/script-reference/unityengine/quaternion)): Rotation of the mesh.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Subset of the mesh to draw.

### Remarks

This function will draw a given mesh immediately. Currently set shader and material (see [Material.SetPass](/engine/6000.5/script-reference/unityengine/material/setpass.md)) will be used.

The mesh will be just drawn once, it won't be per-pixel lit and will not cast or receive real-time shadows. If you want full integration with lighting and shadowing, use [Graphics.DrawMesh](/engine/6000.5/script-reference/unityengine/graphics/drawmesh.md) instead.

```csharp
using UnityEngine;
using System.Collections;

// Attach this script to a Camera
public class ExampleClass : MonoBehaviour {
    public Mesh mesh;
    public Material mat;
    public void OnPostRender() {
        // set first shader pass of the material
        mat.SetPass(0);
        // draw mesh at the origin
        Graphics.DrawMeshNow(mesh, Vector3.zero, Quaternion.identity);
    }
}
```

Additional Resources: [Graphics.DrawMesh](/engine/6000.5/script-reference/unityengine/graphics/drawmesh.md), [Material.SetPass](/engine/6000.5/script-reference/unityengine/material/setpass.md).

## DrawMeshNow(Mesh, Matrix4x4, int)

Draw a mesh immediately.

```csharp
public static void DrawMeshNow(Mesh mesh, Matrix4x4 matrix, int materialIndex)
```

### Parameters

**** (\[Mesh]\(/engine/6000.5/script-reference/unityengine/mesh)): The [Mesh](/engine/6000.5/script-reference/unityengine/mesh.md) to draw.**** (\[Matrix4x4]\(/engine/6000.5/script-reference/unityengine/matrix4x4)): The transformation matrix of the mesh (combines position, rotation and other transformations).**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Subset of the mesh to draw.

### Remarks

This function will draw a given mesh immediately. Currently set shader and material (see [Material.SetPass](/engine/6000.5/script-reference/unityengine/material/setpass.md)) will be used.

The mesh will be just drawn once, it won't be per-pixel lit and will not cast or receive real-time shadows. If you want full integration with lighting and shadowing, use [Graphics.DrawMesh](/engine/6000.5/script-reference/unityengine/graphics/drawmesh.md) instead.

```csharp
using UnityEngine;
using System.Collections;

// Attach this script to a Camera
public class ExampleClass : MonoBehaviour {
    public Mesh mesh;
    public Material mat;
    public void OnPostRender() {
        // set first shader pass of the material
        mat.SetPass(0);
        // draw mesh at the origin
        Graphics.DrawMeshNow(mesh, Vector3.zero, Quaternion.identity);
    }
}
```

Additional Resources: [Graphics.DrawMesh](/engine/6000.5/script-reference/unityengine/graphics/drawmesh.md), [Material.SetPass](/engine/6000.5/script-reference/unityengine/material/setpass.md).

## DrawMeshNow(Mesh, Vector3, Quaternion)

Draw a mesh immediately.

```csharp
public static void DrawMeshNow(Mesh mesh, Vector3 position, Quaternion rotation)
```

### Parameters

**** (\[Mesh]\(/engine/6000.5/script-reference/unityengine/mesh)): The [Mesh](/engine/6000.5/script-reference/unityengine/mesh.md) to draw.**** (\[Vector3]\(/engine/6000.5/script-reference/unityengine/vector3)): Position of the mesh.**** (\[Quaternion]\(/engine/6000.5/script-reference/unityengine/quaternion)): Rotation of the mesh.

### Remarks

This function will draw a given mesh immediately. Currently set shader and material (see [Material.SetPass](/engine/6000.5/script-reference/unityengine/material/setpass.md)) will be used.

The mesh will be just drawn once, it won't be per-pixel lit and will not cast or receive real-time shadows. If you want full integration with lighting and shadowing, use [Graphics.DrawMesh](/engine/6000.5/script-reference/unityengine/graphics/drawmesh.md) instead.

```csharp
using UnityEngine;
using System.Collections;

// Attach this script to a Camera
public class ExampleClass : MonoBehaviour {
    public Mesh mesh;
    public Material mat;
    public void OnPostRender() {
        // set first shader pass of the material
        mat.SetPass(0);
        // draw mesh at the origin
        Graphics.DrawMeshNow(mesh, Vector3.zero, Quaternion.identity);
    }
}
```

Additional Resources: [Graphics.DrawMesh](/engine/6000.5/script-reference/unityengine/graphics/drawmesh.md), [Material.SetPass](/engine/6000.5/script-reference/unityengine/material/setpass.md).

## DrawMeshNow(Mesh, Matrix4x4)

Draw a mesh immediately.

```csharp
public static void DrawMeshNow(Mesh mesh, Matrix4x4 matrix)
```

### Parameters

**** (\[Mesh]\(/engine/6000.5/script-reference/unityengine/mesh)): The [Mesh](/engine/6000.5/script-reference/unityengine/mesh.md) to draw.**** (\[Matrix4x4]\(/engine/6000.5/script-reference/unityengine/matrix4x4)): The transformation matrix of the mesh (combines position, rotation and other transformations).

### Remarks

This function will draw a given mesh immediately. Currently set shader and material (see [Material.SetPass](/engine/6000.5/script-reference/unityengine/material/setpass.md)) will be used.

The mesh will be just drawn once, it won't be per-pixel lit and will not cast or receive real-time shadows. If you want full integration with lighting and shadowing, use [Graphics.DrawMesh](/engine/6000.5/script-reference/unityengine/graphics/drawmesh.md) instead.

```csharp
using UnityEngine;
using System.Collections;

// Attach this script to a Camera
public class ExampleClass : MonoBehaviour {
    public Mesh mesh;
    public Material mat;
    public void OnPostRender() {
        // set first shader pass of the material
        mat.SetPass(0);
        // draw mesh at the origin
        Graphics.DrawMeshNow(mesh, Vector3.zero, Quaternion.identity);
    }
}
```

Additional Resources: [Graphics.DrawMesh](/engine/6000.5/script-reference/unityengine/graphics/drawmesh.md), [Material.SetPass](/engine/6000.5/script-reference/unityengine/material/setpass.md).
