# Clear

> Clear the current render buffer.

## Definition

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

## Clear(bool, bool, Color, float)

Clear the current render buffer.

```csharp
public static void Clear(bool clearDepth, bool clearColor, Color backgroundColor, float depth)
```

### Parameters

**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Should the depth buffer be cleared?**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Should the color buffer be cleared?**** (\[Color]\(/engine/6000.0/script-reference/unityengine/color)): The color to clear with, used only if clearColor is true.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The depth to clear the z-buffer with, used only if clearDepth is true. The valid range is from 0 (near plane) to 1 (far plane). The value is graphics API agnostic: the abstraction layer will convert the value to match the convention of the current graphics API.

### Remarks

This clears the screen or the active [RenderTexture](/engine/6000.0/script-reference/unityengine/rendertexture.md) you are drawing into. The cleared area is limited by the active viewport. This operation might alter the model/view/projection matrices.

In most cases, a Camera will already be configured to clear the screen or [RenderTexture](/engine/6000.0/script-reference/unityengine/rendertexture.md) and you will not need to perform this operation manually.

Additional Resources: [GL.ClearWithSkybox](/engine/6000.0/script-reference/unityengine/gl/clearwithskybox.md).

## Clear(bool, bool, Color)

Clear the current render buffer.

```csharp
public static void Clear(bool clearDepth, bool clearColor, Color backgroundColor)
```

### Parameters

**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Should the depth buffer be cleared?**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Should the color buffer be cleared?**** (\[Color]\(/engine/6000.0/script-reference/unityengine/color)): The color to clear with, used only if clearColor is true.

### Remarks

This clears the screen or the active [RenderTexture](/engine/6000.0/script-reference/unityengine/rendertexture.md) you are drawing into. The cleared area is limited by the active viewport. This operation might alter the model/view/projection matrices.

In most cases, a Camera will already be configured to clear the screen or [RenderTexture](/engine/6000.0/script-reference/unityengine/rendertexture.md) and you will not need to perform this operation manually.

Additional Resources: [GL.ClearWithSkybox](/engine/6000.0/script-reference/unityengine/gl/clearwithskybox.md).
