Class: RenderTexturePool

PIXI.RenderTexturePool

Experimental!

Texture pool, used by FilterSystem and plugins Stores collection of temporary pow2 or screen-sized renderTextures

If you use custom RenderTexturePool for your filters, you can use methods getFilterTexture and returnFilterTexture same as in

new PIXI.RenderTexturePool (textureOptions)

Name Type Attributes Description
textureOptions object <optional>

options that will be passed to BaseRenderTexture constructor

textureOptions.scaleMode PIXI.SCALE_MODES <optional>

See PIXI.SCALE_MODES for possible values.

Members

PIXI.RenderTexturePool.SCREEN_KEY number static

Key that is used to store fullscreen renderTextures in a pool

Default Value:
  • -1

enableFullScreen boolean

Allow renderTextures of the same size as screen, not just pow2

Automatically sets to true after setScreenSize

Default Value:
  • false

Methods

clear (destroyTextures) void

Clears the pool

Name Type Attributes Default Description
destroyTextures boolean <optional>
true

destroy all stored textures

createTexture (realWidth, realHeight, multisample) RenderTexture

creates of texture with params that were specified in pool constructor

Name Type Attributes Default Description
realWidth number

width of texture in pixels

realHeight number

height of texture in pixels

multisample PIXI.MSAA_QUALITY <optional>
PIXI.MSAA_QUALITY.NONE

number of samples of the framebuffer

Returns:
Type Description
RenderTexture

getFilterTexture (input, resolution, multisample) PIXI.RenderTexture

Gets extra texture of the same size as input renderTexture

getFilterTexture(input, 0.5) or getFilterTexture(0.5, input)

Name Type Attributes Default Description
input PIXI.RenderTexture

renderTexture from which size and resolution will be copied

resolution number <optional>

override resolution of the renderTexture It overrides, it does not multiply

multisample PIXI.MSAA_QUALITY <optional>
PIXI.MSAA_QUALITY.NONE

number of samples of the renderTexture

Returns:
Type Description
PIXI.RenderTexture

returnFilterTexture (renderTexture) void

Alias for returnTexture, to be compliant with FilterSystem interface

Name Type Description
renderTexture PIXI.RenderTexture

The renderTexture to free

returnTexture (renderTexture) void

Place a render texture back into the pool.

Name Type Description
renderTexture PIXI.RenderTexture

The renderTexture to free

setScreenSize (size) void

If screen size was changed, drops all screen-sized textures, sets new screen size, sets enableFullScreen to true

Size is measured in pixels, renderer.view can be passed here, not renderer.screen

Name Type Description
size PIXI.ISize

Initial size of screen

getOptimalTexture (minWidth, minHeight, resolution, multisample) PIXI.RenderTexture protected

Gets a Power-of-Two render texture or fullScreen texture

Name Type Attributes Default Description
minWidth number

The minimum width of the render texture.

minHeight number

The minimum height of the render texture.

resolution number <optional>
1

The resolution of the render texture.

multisample PIXI.MSAA_QUALITY <optional>
PIXI.MSAA_QUALITY.NONE

Number of samples of the render texture.

Returns:
Type Description
PIXI.RenderTexture The new render texture.