Unity - Scripting API: RenderTexture.active

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Switch to Manual

Description

Currently active render texture.

All rendering goes into the active RenderTexture. If the active RenderTexture is null everything is rendered in the main window.

Setting RenderTexture.active is the same as calling Graphics.SetRenderTarget. Typically you change or query the active render texture when implementing custom graphics effects; if all you need is to make a Camera render into a texture then use Camera.targetTexture instead.

When a RenderTexture becomes active its hardware rendering context is automatically created if it hasn't been created already.

Additional resources: Graphics.SetRenderTarget, GraphicsTexture.active.