RenderTexture.RenderTexture Manual     Reference     Scripting  
Scripting > Runtime Classes > RenderTexture

static function RenderTexture (width : int, height : int, depth : int) : RenderTexture


Creates a new RenderTexture object.

The render texture is created with width by height size, with a depth buffer of depth bits (depth can be 0, 16 or 24). The render texture is set to be a non-power of two texture and in color format by default.

Note that constructing a RenderTexture object does not create the hardware representation immediately. The actual render texture is created upon first use or when Create is called manually. So after constructing the render texture, it is possible to set additional variables, like isPowerOfTwo, format, isCubemap and so on.

See Also: isPowerOfTwo variable, format variable.