Skip to content

RenderTexture

extends Texture

The RenderTexture class contains all the textures that can be rendered to and can be used to implement image-based rendering effects, dynamic shadows, projectors, reflections, or surveillance cameras.

Instance Properties

RenderTexture.antiAliasing : AntiAliasingLevel
(Read Only) The anti-aliasing level of the render texture.
RenderTexture.renderTextureFormat : RenderTextureFormat
(Read Only) The format of the render texture.
RenderTexture.depthStencilFormat : GraphicsFormat
(Read Only) The format of the depth and stencil buffer.
RenderTexture.depthType : DepthType
(Read Only) The depth buffer format of the current rendering texture.

Static Properties

RenderTexture.active : RenderTexture
The currently active render texture.

Instance Method

RenderTexture.ReleaseCPUMemory ( ) : void
Manually clears CPU memory related to textures.
RenderTexture.GetPixel ( x : number , y : number , mipLevel : number ) : Color
Get the pixel color at coordinates (x, y).
RenderTexture.GetPixels ( x : number , y : number , blockWidth : number , blockHeight : number , mipLevel : number? ) : Color|undefined []
Get the pixel color of the block with a width of blockWidth and a height of blockHeight at the coordinates (x, y) in the upper right corner.
RenderTexture.SetPixel ( x : number , y : number , col : Color , mipLevel : number ) : void
Set the pixel color at coordinates (x, y).
RenderTexture.SetPixels ( x : number , y : number , blockWidth : number , blockHeight : number , colors : Color[] , mipLevel : number? ) : void
Get the pixel color of the block with a width of blockWidth and a height of blockHeight at the coordinates (x, y) in the upper right corner.
RenderTexture.Apply ( mipLevel : number? ) : void
Applies a texture to the screen.

Static Methods

RenderTexture.GetTemporary ( width : number , height : number , colorFmt : RenderTextureFormat , depth : DepthType , aa : AntiAliasingLevel? ) : RenderTexture|null
Allocate a temporary render texture.
RenderTexture.ReleaseTemporary ( rt : RenderTexture ) : void
Release the temporary texture allocated using GetTemporary.
RenderTexture.CreateRenderTexture ( width : number , height : number , colorFmt : RenderTextureFormat , depth : DepthType , aa : AntiAliasingLevel? , mip : boolean? ) : RenderTexture
Create a render texture.