Class: GlitchFilter

GlitchFilter

The GlitchFilter applies a glitch effect to an object.
originalfilter

new GlitchFilter (options)

Name Type Attributes Description
options GlitchFilterOptions <optional>

Options for the GlitchFilter constructor.

Extends

  • Filter

Members

defaults GlitchFilterOptions staticreadonly

Default constructor options.

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 PointData

Blue offset.

Default Value:
  • {x:0,y:0}

direction number

The angle in degree of the offset of slices.

Default Value:
  • 0

fillMode FILL_MODES

The fill mode of the space after the offset.

Default Value:
  • FILL_MODES.TRANSPARENT

green PointData

Green channel offset.

Default Value:
  • {x:0,y:0}

minSize number

Minimum size of slices as a portion of the sampleSize

Default Value:
  • 8

offset number

The maximum offset amount of 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 PointData

Red channel offset.

Default Value:
  • {x:0,y:0}

sampleSize number

Height of the displacement map canvas.

Default Value:
  • 512

seed number

A seed value for randomizing glitch 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 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.