Class: FilterManager

Tiny. FilterManager

Name Type Description
renderer Tiny.WebGLRenderer

The renderer this manager works for.

Extends

Members

The renderer this manager works for.

Methods

applyFilter(filter, input, output, clear)

Draws a filter.

Name Type Description
filter Tiny.Filter

The filter to draw.

input Tiny.RenderTarget

The input render target.

output Tiny.RenderTarget

The target to output to.

clear boolean

Should the output be cleared before rendering to it

calculateNormalizedScreenSpaceMatrix(outputMatrix){Tiny.Matrix}

Multiply vTextureCoord to this matrix to achieve (0,0,1,1) for filterArea

Name Type Description
outputMatrix Tiny.Matrix

The matrix to output to.

Returns:
Type Description
Tiny.Matrix The mapped matrix.

calculateScreenSpaceMatrix(outputMatrix){Tiny.Matrix}

Calculates the mapped matrix.

TODO playing around here.. this is temporary - (will end up in the shader), this returns a matrix that will normalise map filter cords in the filter to screen space

Name Type Description
outputMatrix Tiny.Matrix

the matrix to output to.

Returns:
Type Description
Tiny.Matrix The mapped matrix.

calculateSpriteMatrix(outputMatrix, sprite){Tiny.Matrix}

This will map the filter coord so that a texture can be used based on the transform of a sprite

Name Type Description
outputMatrix Tiny.Matrix

The matrix to output to.

sprite Tiny.Sprite

The sprite to map to.

Returns:
Type Description
Tiny.Matrix The mapped matrix.

Destroys this Filter Manager.

Name Type Default Description
contextLost boolean false optional

context was lost, do not free shaders

Empties the texture pool.

Frees a render target back into the pool.

Name Type Description
renderTarget Tiny.RenderTarget

The renderTarget to free

Gets a render target from the pool, or creates a new one.

Name Type Description
clear boolean

Should we clear the render texture when we get it?

resolution number

The resolution of the target.

Returns:
Type Description
Tiny.RenderTarget The new render target

Generic method called when there is a WebGL context change.

Called before the renderer starts rendering.

Pops off the filter and applies it.

Adds a new filter to the manager.

Name Type Description
target Tiny.DisplayObject

The target of the filter to render.

filters Array.<Tiny.Filter>

The filters to apply.

Returns a render target to the pool.

Name Type Description
renderTarget Tiny.RenderTarget

The render target to return.

Uploads the uniforms of the filter.

Name Type Description
shader GLShader

The underlying gl shader.

filter Tiny.Filter

The filter we are synchronizing.

Documentation generated by JSDoc 3.4.3 on Fri Jul 09 2021 19:32:26 GMT+0800 (CST)