# Sandbox.Rendering.CommandList.Clear

## Overload 1

```csharp
void Clear(Color color, bool clearColor = True, bool clearDepth = True, bool clearStencil = True)
```

Clear the current drawing context to given color.

### Parameters

- `color` (`Color`): Color to clear to.
- `clearColor` (`bool`), default `True`: Whether to clear the color buffer at all.
- `clearDepth` (`bool`), default `True`: Whether to clear the depth buffer.
- `clearStencil` (`bool`), default `True`: Whether to clear the stencil buffer.

## Overload 2

```csharp
void Clear(Texture texture, Color color = null)
```

Clears the given texture to a solid color.

### Parameters

- `texture` (`Texture`): The texture to clear.
- `color` (`Color`), default `null`: The color to clear to. Defaults to transparent black.

## Overload 3

```csharp
void Clear(RenderTargetHandle handle, Color color = null)
```

Clears the color texture of the given render target handle to a solid color.

### Parameters

- `handle` (`RenderTargetHandle`): The render target handle whose color texture to clear.
- `color` (`Color`), default `null`: The color to clear to. Defaults to transparent black.

## Overload 4

```csharp
void Clear(GpuBuffer buffer, uint value = 0)
```

Fills the given GPU buffer with a repeated uint32 value.

### Parameters

- `buffer` (`GpuBuffer`): The buffer to clear.
- `value` (`uint`), default `0`: The uint32 value to fill with. Defaults to zero.

Declared in [Sandbox.Rendering.CommandList](/api/Sandbox.Rendering.CommandList).
Assembly: `Sandbox.Engine`.
