Class: GlitchFilter

GlitchFilter

The GlitchFilter applies a glitch effect to an object.
originalfilter

new GlitchFilter (options)

Name Type Attributes Default Description
options object <optional>

The more optional parameters of the filter.

options.slices number <optional>
5

The maximum number of slices.

options.offset number <optional>
100

The maximum offset amount of slices.

options.direction number <optional>
0

The angle in degree of the offset of slices.

options.fillMode number <optional>
0

The fill mode of the space after the offset. Acceptable values:

options.seed number <optional>
0

A seed value for randomizing glitch effect.

options.average boolean <optional>
false

true will divide the bands roughly based on equal amounts where as setting to false will vary the band sizes dramatically (more random looking).

options.minSize number <optional>
8

Minimum size of individual slice. Segment of total sampleSize

options.sampleSize number <optional>
512

The resolution of the displacement map texture.

options.red Array<number> <optional>
[0,0]

Red channel offset

options.green Array<number> <optional>
[0,0]

Green channel offset.

options.blue Array<number> <optional>
[0,0]

Blue channel offset.

See:

Extends

  • PIXI.Filter

Members

GlitchFilter.CLAMP number staticreadonly

Fill mode as clamp

Default Value:
  • 3

GlitchFilter.defaults GlitchFilterOptions staticreadonly

Default constructor options.

GlitchFilter.LOOP number staticreadonly

Fill mode as loop

Default Value:
  • 2

GlitchFilter.MIRROR number staticreadonly

Fill mode as mirror

Default Value:
  • 4

GlitchFilter.ORIGINAL number staticreadonly

Fill mode as original

Default Value:
  • 1

GlitchFilter.TRANSPARENT number staticreadonly

Fill mode as transparent

Default Value:
  • 0

average boolean

true will divide the bands roughly based on equal amounts where as setting to false will vary the band sizes dramatically (more random looking).

Default Value:
  • false

blue PIXI.Point | number<Array>

Blue offset.

direction number

The angle in degree of the offset of slices.

Default Value:
  • 0

fillMode number

The fill mode of the space after the offset.

green PIXI.Point | number<Array>

Green channel offset.

minSize number

Minimum size of slices as a portion of the sampleSize

Default Value:
  • 8

offset number

The maximum offset value for each of the slices.

Default Value:
  • 100

offsets Array<number> | Float32Array

Manually set custom slices offset of displacement bitmap, this is a collection of values from -1 to 1. To change the max offset value set offset.

red PIXI.Point | number<Array>

Red channel offset.

sampleSize number

Height of the displacement map canvas.

Default Value:
  • 512

seed number

A seed value for randomizing color offset. Animating this value to Math.random() produces a twitching effect.

Default Value:
  • 0

sizes Array<number> | Float32Array

Manually custom slices size (height) of displacement bitmap

slices number

The count of slices.

Default Value:
  • 5

texture PIXI.Texture readonly

The displacement map is used to generate the bands. If using your own texture, slices will be ignored.

Methods

destroy () void

Removes all references

redraw () void

Redraw displacement bitmap texture, advanced usage.

refresh () void

Regenerating random size, offsets for slices.

shuffle () void

Shuffle the sizes of the slices, advanced usage.