API Docs for: 2.0.0
Show:

NormalMapFilter Class

The NormalMapFilter 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 offset the x and the g property of the texture is used to offset the y.

Constructor

NormalMapFilter

(
  • texture
)

Parameters:

  • texture Texture

    The texture used for the displacement map * must be power of 2 texture at the moment

Methods

onTextureLoaded

()

Sets the map dimensions uniforms when the texture becomes available.

syncUniforms

()

Syncs the uniforms between the class object and the shaders.

Properties

fragmentSrc

Array private

map

Texture

The texture used for the displacement map. Must be power of 2 texture.

offset

Point

The offset used to move the displacement map.

padding

Number

passes

Array an array of filter objects private

An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. For example the blur filter has two passes blurX and blurY.

scale

Point

The multiplier used to scale the displacement result from the map calculation.

shaders

Array an array of shaders private

uniforms

Object private