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 |
Members
-
filterStack :Array.<object>
-
Stores filter data for the render target
Type:
- Array.<object>
-
frame :Rectangle
-
The frame.
Type:
-
frameBuffer :WebGLFrameBuffer
-
A frame buffer
Type:
- WebGLFrameBuffer
-
gl :WebGLRenderingContext
-
The current WebGL drawing context.
Type:
- WebGLRenderingContext
-
projectionMatrix :Matrix
-
The projection matrix
Type:
-
resolution :number
-
The current resolution
Type:
- number
-
root :boolean
-
Whether this object is the root element or not
Type:
- boolean
-
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:
-
stencilBuffer :WebGLRenderBuffer
-
The stencil buffer stores masking data for the render target
Type:
- WebGLRenderBuffer
-
stencilMaskStack :StencilMaskStack
-
The data structure for the stencil masks
Type:
-
texture :Texture
-
The texture
Type:
-
transform :Matrix
-
The object's transform
Type:
Methods
-
activate()
-
Binds the buffers and initialises the viewport.
-
attachStencilBuffer()
-
Binds the stencil buffer.
-
calculateProjection()
-
Updates the projection matrix based on a projection frame (which is a rectangle)
-
clear( [bind])
-
Clears the filter texture.
Parameters:
Name Type Argument Default Description bind
boolean <optional>
false Should we bind our framebuffer before clearing?
-
destroy()
-
Destroys the render target.
-
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