RenderTexture.create

Create the render-texture.

Before calling this function, the render-texture is in an invalid state, thus it is mandatory to call it before doing anything with the render-texture.

The last parameter, depthBuffer, is useful if you want to use the render-texture for 3D OpenGL rendering that requires a depth-buffer. Otherwise it is unnecessary, and you should leave this parameter to false (which is its default value).

class RenderTexture
bool
create
(
uint width
,
uint height
,
bool depthBuffer = false
)

Parameters

width uint

Width of the render-texture

height uint

Height of the render-texture

depthBuffer bool

Do you want this render-texture to have a depth buffer?

Return Value

Type: bool

True if creation has been successful.

Meta