PIXI.filters.GlitchFilter

class GlitchFilter extends PIXI.Filter

The GlitchFilter applies a glitch effect to an object.
originalfilter

See:

Constructor


new PIXI.filters.GlitchFilter(options: object) → {}
Parameters:
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.

Summary


Properties from GlitchFilter

number
static CLAMP = 3

Fill mode as clamp

GlitchFilterOptions
static defaults

Default constructor options.

number
static LOOP = 2

Fill mode as loop

number
static MIRROR = 4

Fill mode as mirror

number
static ORIGINAL = 1

Fill mode as original

number
static TRANSPARENT = 0

Fill mode as transparent

boolean
average = false
PIXI.Point | number<Array>
blue

Blue offset.

number
direction = 0
number
fillMode

The fill mode of the space after the offset.

PIXI.Point | number<Array>
green

Green channel offset.

number
minSize = 8

Minimum size of slices as a portion of the sampleSize

number
offset = 100

The maximum offset value for each of the slices.

Array<number> | Float32Array
offsets
PIXI.Point | number<Array>
red

Red channel offset.

number
sampleSize = 512

Height of the displacement map canvas.

number
seed = 0
Array<number> | Float32Array
sizes

Manually custom slices size (height) of displacement bitmap

number
slices = 5
PIXI.Texture
texture

Methods from GlitchFilter

void
destroy()

Removes all references

void
redraw()

Redraw displacement bitmap texture, advanced usage.

void
refresh()

Regenerating random size, offsets for slices.

void
shuffle()

Shuffle the sizes of the slices, advanced usage.

Properties inherited from Filter

boolean
autoFit = true
PIXI.BLEND_MODES
blendMode = PIXI.BLEND_MODES.NORMAL
boolean
enabled

If enabled is true the filter is applied, if false it will not.

boolean
legacy
PIXI.MSAA_QUALITY
multisample

The samples of the filter.

number
padding
number
resolution
PIXI.State
state

The WebGL state the filter requires to render.

Properties inherited from Shader

PIXI.Program
program

Program that the shader uses.

Dict<any>
uniforms

Public Properties


CLAMP GlitchFilter.ts:62
static CLAMP: number = 3

Fill mode as clamp

defaults GlitchFilter.ts:38
static defaults: GlitchFilterOptions

Default constructor options.

LOOP GlitchFilter.ts:59
static LOOP: number = 2

Fill mode as loop

MIRROR GlitchFilter.ts:65
static MIRROR: number = 4

Fill mode as mirror

ORIGINAL GlitchFilter.ts:56
static ORIGINAL: number = 1

Fill mode as original

TRANSPARENT GlitchFilter.ts:53
static TRANSPARENT: number = 0

Fill mode as transparent

average GlitchFilter.ts:74
average: boolean = 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).

blue GlitchFilter.ts:395
blue: PIXI.Point | number<Array>

Blue offset.

direction GlitchFilter.ts:345
direction: number = 0

The angle in degree of the offset of slices.

fillMode GlitchFilter.ts:71
fillMode: number

The fill mode of the space after the offset.

green GlitchFilter.ts:381
green: PIXI.Point | number<Array>

Green channel offset.

minSize GlitchFilter.ts:86
minSize: number = 8

Minimum size of slices as a portion of the sampleSize

offset GlitchFilter.ts:68
offset: number = 100

The maximum offset value for each of the slices.

offsets GlitchFilter.ts:303
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 GlitchFilter.ts:367
red: PIXI.Point | number<Array>

Red channel offset.

sampleSize GlitchFilter.ts:89
sampleSize: number = 512

Height of the displacement map canvas.

seed GlitchFilter.ts:80
seed: number = 0

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

sizes GlitchFilter.ts:284
sizes: Array<number> | Float32Array

Manually custom slices size (height) of displacement bitmap

slices GlitchFilter.ts:324
slices: number = 5

The count of slices.

texture GlitchFilter.ts:95
texture: PIXI.Texture

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

Public Methods


destroy GlitchFilter.ts:409
destroy() → {void}

Removes all references

Returns:
Type Description
void
redraw GlitchFilter.ts:254
redraw() → {void}

Redraw displacement bitmap texture, advanced usage.

Returns:
Type Description
void
refresh GlitchFilter.ts:244
refresh() → {void}

Regenerating random size, offsets for slices.

Returns:
Type Description
void
shuffle GlitchFilter.ts:212
shuffle() → {void}

Shuffle the sizes of the slices, advanced usage.

Returns:
Type Description
void

Powered by webdoc!