Class

RenderTexture

RenderTexture(width, height, textureCount, useDepthBufferopt, useStencilBufferopt)

A rendering texture: Supported by WebGL only.

Constructor

new RenderTexture(width, height, textureCount, useDepthBufferopt, useStencilBufferopt)

Constructor
Parameters:
Name Type Attributes Default Description
width number Texture's width
height number Texture's height
textureCount number Texture count
useDepthBuffer boolean <optional>
true True to use a depth buffer
useStencilBuffer boolean <optional>
false True to use a stencil buffer

View Source Renderers/RenderTexture.js, line 13

Extends

Members

null | RenderTask

protected activeTask

A reference to the active task
Inherited From:

View Source Renderers/RenderTarget.js, line 21

Context

protected context

Context instance
Inherited From:

View Source Renderers/RenderTarget.js, line 29

RenderAPI

protected renderApi

The render API to use
Overrides:

View Source Renderers/RenderTexture.js, line 32

Array.<RenderTask>

protected tasks

Tasks to execute
Inherited From:

View Source Renderers/RenderTarget.js, line 37

Methods

begin()

Begin rendering to texture

View Source Renderers/RenderTexture.js, line 101

clear(colornullable)

Clear the texture
Parameters:
Name Type Attributes Description
color Color <nullable>
A Color instance
Overrides:

View Source Renderers/RenderTexture.js, line 87

createTask() → {number}

Create a new task
Inherited From:

View Source Renderers/RenderTarget.js, line 60

RenderTask's index
number

getActiveTask() → (nullable) {RenderTask}

Get the active task
Inherited From:

View Source Renderers/RenderTarget.js, line 112

A RenderTask or null
RenderTask

getHeight() → (non-null) {number}

Get height
Inherited From:

View Source Renderers/RenderTarget.js, line 156

Height in pixels
number

getRenderAPI() → {RenderAPI}

Get the render API
Inherited From:

View Source Renderers/RenderTarget.js, line 129

A Render API instance
RenderAPI

getSize() → {Array.<number>}

Get size
Inherited From:

View Source Renderers/RenderTarget.js, line 138

A array with size on x and y
Array.<number>

getTextures() → {Array.<Texture>}

Output Textures

View Source Renderers/RenderTexture.js, line 120

An array of Texture
Array.<Texture>

getWidth() → (non-null) {number}

Get width
Inherited From:

View Source Renderers/RenderTarget.js, line 147

Width in pixels
number

removeTasks()

Remove all the tasks in memory
Inherited From:

View Source Renderers/RenderTarget.js, line 119

render(scene, camera)

Render the given scene
Parameters:
Name Type Description
scene Scene A Scene instance
camera Camera A Camera instance
Inherited From:

View Source Renderers/RenderTarget.js, line 80

setActiveTask(index)

Set the task with the given index active
Parameters:
Name Type Description
index number An integer representing task's index
Inherited From:

View Source Renderers/RenderTarget.js, line 101