Graphics.SetRenderTarget Manual     Reference     Scripting  
Scripting > Runtime Classes > Graphics
Graphics.SetRenderTarget

static function SetRenderTarget (rt : RenderTexture) : void

static function SetRenderTarget (colorBuffer : RenderBuffer, depthBuffer : RenderBuffer) : void

static function SetRenderTarget (colorBuffers : RenderBuffer[], depthBuffer : RenderBuffer) : void

Description

Sets current render target.

This function sets which RenderTexture or a RenderBuffer combination will be rendered into next. Use it when implementing custom rendering algorithms, where you need to render something into a render texture manually.

The function call with colorBuffers array enables techniques that use Multiple Render Targets (MRT), where fragment shader can output more than one final color.

See Also: RenderTexture, Graphics.activeColorBuffer, Graphics.activeDepthBuffer, SystemInfo.supportedRenderTargetCount.