Api Sandbox RenderTarget
class

RenderTarget

public sealed class RenderTarget

Essentially wraps a couple of textures that we're going to render to. The color texture and the depth texture.

Properties

Name Type Description
Width Int32 Width of the render target
Height Int32 Height of the render target
ColorTarget Texture The target colour texture
DepthTarget Texture The target depth texture

Methods

static RenderTarget GetTemporary(Int32 width, Int32 height, ImageFormat colorFormat = -2, ImageFormat depthFormat = -2, MultisampleAmount msaa = 6, Int32 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.

width — Width of the render target you want.
height — Height of the render target you want.
colorFormat — The format for the color buffer. If set to default we'll use whatever the current pipeline is using.
depthFormat — The format for the depth buffer.
msaa — 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 — 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 — The optional name of the render target
returns — A RenderTarget that is ready to render to.
static RenderTarget GetTemporary(Int32 sizeFactor, ImageFormat colorFormat = -2, ImageFormat depthFormat = -2, MultisampleAmount msaa = 6, Int32 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.

sizeFactor — Divide the screen size by this factor. 2 would be half screen sized. 1 for full screen sized.
colorFormat — The format for the color buffer. If null we'll choose the most appropriate for where you are in the pipeline.
depthFormat — The format for the depth buffer.
msaa — 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 — 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 — The optional name of the render target
returns — A RenderTarget that is ready to render to.
virtual Void Dispose()

Stop using this texture, return it to the pool

static RenderTarget From(Texture color, Texture depth = null)

Create a render target from these textures

Assembly: Sandbox.Engine Namespace: Sandbox Full Name: Sandbox.RenderTarget