Class: RenderTarget

RenderTarget


new RenderTarget(gl, width, height, scaleMode, resolution, root)

Parameters:
Name Type Description
gl WebGLRenderingContext

the current WebGL drawing context

width number

the horizontal range of the filter

height number

the vertical range of the filter

scaleMode number

See SCALE_MODES for possible values

resolution number

the current resolution

root boolean

Whether this object is the root element or not

Source:

Members


filterStack :Array.<object>

Stores filter data for the render target

Type:
  • Array.<object>
Source:

frame :Rectangle

The frame.

Type:
Source:

frameBuffer :WebGLFrameBuffer

A frame buffer

Type:
  • WebGLFrameBuffer
Source:

gl :WebGLRenderingContext

The current WebGL drawing context.

Type:
  • WebGLRenderingContext
Source:

projectionMatrix :Matrix

The projection matrix

Type:
Source:

resolution :number

The current resolution

Type:
  • number
Source:

root :boolean

Whether this object is the root element or not

Type:
  • boolean
Source:

scaleMode :number

The scale mode.

Type:
  • number
Default Value:
  • SCALE_MODES.DEFAULT
Source:
See:
  • SCALE_MODES

size :Rectangle

The size of the object as a rectangle

Type:
Source:

stencilBuffer :WebGLRenderBuffer

The stencil buffer stores masking data for the render target

Type:
  • WebGLRenderBuffer
Source:

stencilMaskStack :StencilMaskStack

The data structure for the stencil masks

Type:
Source:

texture :Texture

The texture

Type:
Source:

transform :Matrix

The object's transform

Type:
Source:

Methods


activate()

Binds the buffers and initialises the viewport.

Source:

attachStencilBuffer()

Binds the stencil buffer.

Source:

calculateProjection()

Updates the projection matrix based on a projection frame (which is a rectangle)

Source:

clear( [bind])

Clears the filter texture.

Parameters:
Name Type Argument Default Description
bind boolean <optional>
false

Should we bind our framebuffer before clearing?

Source:

destroy()

Destroys the render target.

Source:

resize(width, height)

Resizes the texture to the specified width and height

Parameters:
Name Type Description
width Number

the new width of the texture

height Number

the new height of the texture

Source: