# Sandbox.Rendering.CommandList.GetRenderTarget

## Overload 1

```csharp
RenderTargetHandle GetRenderTarget(string name, ImageFormat format, int numMips = 1, int sizeFactor = 1)
```

Get a screen sized temporary render target. You should release the returned handle when you're done to return the textures to the pool.

### Parameters

- `name` (`string`): The name of the render target handle.
- `format` (`ImageFormat`): The format for the color buffer. If set to default we'll use whatever the current pipeline is using.
- `numMips` (`int`), default `1`: Number of mips you want in this texture. You probably don't want this unless you want to generate mips in a second pass.
- `sizeFactor` (`int`), default `1`: Divide the screen size by this factor. 2 would be half screen sized. 1 for full screen sized.

### Returns

`RenderTargetHandle`: A RenderTarget that is ready to render to.

## Overload 2

```csharp
RenderTargetHandle GetRenderTarget(string name, int sizeFactor = 1, ImageFormat colorFormat = -2, ImageFormat depthFormat = -2, MultisampleAmount msaa = 6, int numMips = 1)
```

Get a screen sized temporary render target. You should release the returned handle when you're done to return the textures to the pool.

### Parameters

- `name` (`string`): The name of the render target handle.
- `sizeFactor` (`int`), default `1`: Divide the screen size by this factor. 2 would be half screen sized. 1 for full screen sized.
- `colorFormat` (`ImageFormat`), default `-2`: The format for the color buffer. If set to default we'll use whatever the current pipeline is using.
- `depthFormat` (`ImageFormat`), default `-2`: The format for the depth buffer.
- `msaa` (`MultisampleAmount`), default `6`: The number of msaa samples you'd like. Msaa render textures are a pain in the ass so you're probably gonna regret trying to use this.
- `numMips` (`int`), default `1`: Number of mips you want in this texture. You probably don't want this unless you want to generate mips in a second pass.

### Returns

`RenderTargetHandle`: A RenderTarget that is ready to render to.

## Overload 3

```csharp
RenderTargetHandle GetRenderTarget(string name, int width, int height, ImageFormat colorFormat = -2, ImageFormat depthFormat = -2, MultisampleAmount msaa = 6, int numMips = 1)
```

Get a temporary render target. You should release the returned handle when you're done to return the textures to the pool.

### Parameters

- `name` (`string`): The name of the render target handle.
- `width` (`int`): Width of the render target you want.
- `height` (`int`): Height of the render target you want.
- `colorFormat` (`ImageFormat`), default `-2`: The format for the color buffer. If set to default we'll use whatever the current pipeline is using.
- `depthFormat` (`ImageFormat`), default `-2`: The format for the depth buffer.
- `msaa` (`MultisampleAmount`), default `6`: The number of msaa samples you'd like. Msaa render textures are a pain in the ass so you're probably gonna regret trying to use this.
- `numMips` (`int`), default `1`: Number of mips you want in this texture. You probably don't want this unless you want to generate mips in a second pass.

### Returns

`RenderTargetHandle`: A RenderTarget that is ready to render to.

Declared in [Sandbox.Rendering.CommandList](/api/Sandbox.Rendering.CommandList).
Assembly: `Sandbox.Engine`.
