Constructs a new glitch effect.
TODO Change ratio to 0.15.
Optional options: { The options.
Optional blendThe blend function of this effect.
Optional chromaticA chromatic aberration offset. If provided, the glitch effect will influence this offset.
Optional columns?: numberThe scale of the blocky glitch columns.
Optional delay?: Vector2The minimum and maximum delay between glitch activations in seconds.
Optional dtThe size of the generated noise map. Will be ignored if a perturbation map is provided.
Optional duration?: Vector2The minimum and maximum duration of a glitch in seconds.
Optional perturbationA perturbation map. If none is provided, a noise texture will be created.
Optional ratio?: numberThe threshold for strong glitches.
Optional strength?: Vector2The strength of weak and strong glitches.
Readonly blendThe blend mode of this effect.
The chromatic aberration offset.
Readonly definesPreprocessor macro definitions.
Call Effect.setChanged after changing macro definitions.
The minimum and maximum delay between glitch activations in seconds.
Use minDelay and maxDelay instead.
The minimum and maximum duration of a glitch in seconds.
Use minDuration and maxDuration instead.
Readonly extensionsWebGL extensions that are required by this effect.
Call Effect.setChanged after adding or removing extensions.
The effect mode.
The name of this effect.
The ratio between weak (0.0) and strong (1.0) glitches. Range is [0.0, 1.0].
This value is currently being treated as a threshold for strong glitches, i.e. it's inverted.
TODO Resolve inversion.
Protected rendererThe renderer.
The strength of weak and strong glitches.
Use minStrength and maxStrength instead.
Readonly uniformsShader uniforms.
Call Effect.setChanged after adding or removing uniforms.
Indicates whether the glitch effect is currently active.
The glitch column size.
Experimental The input color space.
Protected Experimental Sets the main camera.
Sets the main scene.
The maximum delay between glitch activations.
The maximum duration of sporadic glitches.
The strength of strong glitches.
The minimum delay between glitch activations.
The minimum duration of sporadic glitches.
The strength of weak glitches.
Experimental The output color space.
Should only be changed if this effect converts the input colors to a different color space.
Protected Experimental The perturbation map.
Returns the effect attributes.
The attributes.
Returns the current glitch mode.
The mode.
Use mode instead.
Performs initialization tasks.
This method is called when the associated EffectPass is added to an EffectComposer.
The renderer.
Whether the renderer uses the alpha channel or not.
The type of the main frame buffers.
if(!alpha && frameBufferType === UnsignedByteType) { this.myRenderTarget.texture.format = RGBFormat; }
Protected setProtected Sets the effect attributes.
Effects that have the same attributes will be executed in the order in which they were registered. Some attributes imply a higher priority.
The attributes.
Protected setProtected Informs the associated EffectPass that this effect requires a shader recompilation.
Should be called after changing macros or extensions and after adding/removing uniforms.
Sets the depth texture.
You may override this method if your effect requires direct access to the depth texture that is bound to the associated EffectPass.
A depth texture.
Optional depthPacking: DepthPackingStrategiesThe depth packing.
Protected setSets the current glitch mode.
The mode.
Use mode instead.
Updates the size of this effect.
You may override this method if you want to be informed about the size of the backbuffer/canvas. This method is called before initialize and every time the size of the EffectComposer changes.
The width.
The height.
Protected setUpdates this effect.
The renderer.
A frame buffer that contains the result of the previous pass.
Optional deltaTime: numberThe time between the last frame and the current one in seconds.
A glitch effect.
This effect can be used in conjunction with the ChromaticAberrationEffect.
Reference: https://github.com/staffantan/unityglitch