A render target is a buffer where the video card draws pixels for a scene that is being rendered in the background. It is used in different effects, such as applying postprocessing to a rendered image before displaying it on the screen.


WebGLRenderTarget(width : Number, height : Number, options : Object)

width - The width of the renderTarget.
height - The height of the renderTarget.
options - (optional object that holds texture parameters for an auto-generated target texture and depthBuffer/stencilBuffer booleans. For an explanation of the texture parameters see Texture. The following are valid options:

wrapS - default is ClampToEdgeWrapping.
wrapT - default is ClampToEdgeWrapping.
magFilter - default is LinearFilter.
minFilter - default is LinearFilter.
format - default is RGBAFormat.
type - default is UnsignedByteType.
anisotropy - default is 1. See Texture.anistropy
encoding - default is LinearEncoding.
depthBuffer - default is true. Set this to false if you don't need it.
stencilBuffer - default is true. Set this to false if you don't need it.

Creates a new WebGLRenderTarget


.width undefined : number

The width of the render target.

.height undefined : number

The height of the render target.

.scissor undefined : Vector4

A rectangular area inside the render target's viewport. Fragments that are outside the area will be discarded.

.scissorTest undefined : boolean

Indicates whether the scissor test is active or not.

.viewport undefined : Vector4

The viewport of this render target.

.texture undefined : Texture

This texture instance holds the rendered pixels. Use it as input for further processing.

.depthBuffer undefined : boolean

Renders to the depth buffer. Default is true.

.stencilBuffer undefined : boolean

Renders to the stencil buffer. Default is true.

.depthTexture undefined : DepthTexture

If set, the scene depth will be rendered to this texture. Default is null.


.setSize (width : Number, height : Number) : null

Sets the size of the render target.

.clone () : WebGLRenderTarget

Creates a copy of this render target.

.copy (source : WebGLRenderTarget) : WebGLRenderTarget

Adopts the settings of the given render target.

.dispose () : null

Dispatches a dispose event.

EventDispatcher methods are available on this class.


For more info on how to obtain the source code of this module see this page.