RenderTarget

RenderTarget

A render target class to allow rendering to textures.

Constructor

new RenderTarget()

Instantiates a RenderTarget object.
Source:

Methods

bind() → {RenderTarget}

Binds the renderTarget object.
Source:
Returns:
Type:
RenderTarget
The renderTarget object, for chaining.

resize(width, height) → {RenderTarget}

Resizes the renderTarget and all attached textures by the provided height and width.
Source:
Parameters:
Name Type Description
width number The new width of the renderTarget.
height number The new height of the renderTarget.
Returns:
Type:
RenderTarget
The renderTarget object, for chaining.

setColorTarget(texture, index, target) → {RenderTarget}

Attaches the provided texture to the provided attachment location.
Source:
Parameters:
Name Type Description
texture Texture2D The texture to attach.
index number The attachment index. (optional)
target string The texture target type. (optional)
Returns:
Type:
RenderTarget
The renderTarget object, for chaining.

setDepthTarget(texture) → {RenderTarget}

Attaches the provided texture to the provided attachment location.
Source:
Parameters:
Name Type Description
texture Texture2D The texture to attach.
Returns:
Type:
RenderTarget
The renderTarget object, for chaining.

unbind() → {RenderTarget}

Unbinds the renderTarget object.
Source:
Returns:
Type:
RenderTarget
The renderTarget object, for chaining.