Home Reference Source
import {PixelationEffect} from 'postprocessing/src/effects/PixelationEffect.js'
public class | source

PixelationEffect

Extends:

Effect → PixelationEffect

Indirect Implements:

A pixelation effect.

Warning: This effect cannot be merged with convolution effects.

Constructor Summary

Public Constructor
public

constructor(granularity: Object)

Constructs a new pixelation effect.

Member Summary

Private Members
private

The pixel granularity.

private

resolution: Vector2

The original resolution.

Method Summary

Public Methods
public

Returns the pixel granularity.

public

setGranularity(granularity: Number)

Sets the pixel granularity.

public

setSize(width: Number, height: Number)

Updates the granularity.

Inherited Summary

From class Effect
public

[key]: *

public

The effect attributes.

public

The blend mode of this effect.

public

Preprocessor macro definitions.

public

The fragment shader.

public

The name of this effect.

public

uniforms: Map<String, Uniform>

Shader uniforms.

public

The vertex shader.

public

Performs a shallow search for properties that define a dispose method and deletes them.

public

initialize(renderer: WebGLRenderer, alpha: Boolean)

Performs initialization tasks.

public

setDepthTexture(depthTexture: Texture, depthPacking: Number)

Sets the depth texture.

public

setSize(width: Number, height: Number)

Updates the size of this effect.

public

update(renderer: WebGLRenderer, inputBuffer: WebGLRenderTarget, delta: Number)

Updates the effect by performing supporting operations.

Public Constructors

public constructor(granularity: Object) source

Constructs a new pixelation effect.

Override:

Effect#constructor

Params:

NameTypeAttributeDescription
granularity Object
  • optional
  • default: 30.0

The pixel granularity.

Private Members

private granularity: Number source

The pixel granularity.

private resolution: Vector2 source

The original resolution.

Public Methods

public getGranularity(): Number source

Returns the pixel granularity.

Return:

Number

The granularity.

public setGranularity(granularity: Number) source

Sets the pixel granularity.

A higher value yields coarser visuals.

Params:

NameTypeAttributeDescription
granularity Number

The new granularity.

public setSize(width: Number, height: Number) source

Updates the granularity.

Override:

Effect#setSize

Params:

NameTypeAttributeDescription
width Number

The width.

height Number

The height.