# Sandbox.RenderTarget.GetTemporary

## Overload 1

```csharp
static RenderTarget GetTemporary(int width, int height, ImageFormat colorFormat = -2, ImageFormat depthFormat = -2, MultisampleAmount msaa = 6, int numMips = 1, string targetName = )
```

Get a temporary render target. You should dispose the returned handle when you're done to return the textures to the pool.

### Parameters

- `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.
- `targetName` (`string`), default ``: The optional name of the render target

### Returns

`RenderTarget`: A RenderTarget that is ready to render to.

## Overload 2

```csharp
static RenderTarget GetTemporary(int sizeFactor, ImageFormat colorFormat = -2, ImageFormat depthFormat = -2, MultisampleAmount msaa = 6, int numMips = 1, string targetName = )
```

Get a temporary render target. You should dispose the returned handle when you're done to return the textures to the pool.

### Parameters

- `sizeFactor` (`int`): 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 null we'll choose the most appropriate for where you are in the pipeline.
- `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.
- `targetName` (`string`), default ``: The optional name of the render target

### Returns

`RenderTarget`: A RenderTarget that is ready to render to.

Declared in [Sandbox.RenderTarget](/api/Sandbox.RenderTarget).
Assembly: `Sandbox.Engine`.
