new PIXI.filters.DisplacementFilter(sprite)
The DisplacementFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object.
You can use this filter to apply all manor of crazy warping effects
Currently the r property of the texture is used to offset the x and the g property of the texture is used to offset the y.
Name | Type | Description |
---|---|---|
sprite |
PIXI.Sprite |
the sprite used for the displacement map. (make sure its added to the scene!) |
Extends
Members
-
mapPIXI.Texture
-
The texture used for the displacement map. Must be power of 2 sized texture.
-
paddingnumber
-
The extra padding that the filter might need
-
uniformsobject
-
The uniforms as an object
Methods
-
inherited applyFilter(renderer, input, output, clear)
-
Applies the filter
Name Type Description renderer
PIXI.WebGLRenderer The renderer to retrieve the filter from
input
PIXI.RenderTarget output
PIXI.RenderTarget clear
boolean Whether or not we want to clear the outputTarget
-
inherited getShader(renderer)
-
Grabs a shader from the current renderer
Name Type Description renderer
PIXI.WebGLRenderer The renderer to retrieve the shader from
-
inherited syncUniform()
-
Syncs a uniform between the class object and the shaders.