diff --git a/src/pixelate/PixelateFilter.ts b/src/pixelate/PixelateFilter.ts index cb7f0382c..8b5a13e7c 100644 --- a/src/pixelate/PixelateFilter.ts +++ b/src/pixelate/PixelateFilter.ts @@ -1,4 +1,4 @@ -import { Filter, GlProgram, GpuProgram, Point, UniformGroup } from 'pixi.js'; +import { Filter, GlProgram, GpuProgram, Point } from 'pixi.js'; import { vertex, wgslVertex } from '../defaults'; import fragment from './pixelate.frag'; import source from './pixelate.wgsl'; @@ -15,20 +15,11 @@ type Size = number | number[] | Point; */ export class PixelateFilter extends Filter { - /** Default values for options. */ - public static readonly DEFAULT_SIZE: Size = 10; - /** * @param {Point|Array|number} [size=10] - Either the width/height of the size of the pixels, or square size */ - constructor(size: Size) + constructor(size: Size = 10) { - size = size ?? PixelateFilter.DEFAULT_SIZE; - - const pixelateUniforms = new UniformGroup({ - uSize: { value: new Float32Array(2), type: 'vec2' }, - }); - const gpuProgram = GpuProgram.from({ vertex: { source: wgslVertex, @@ -50,7 +41,9 @@ export class PixelateFilter extends Filter gpuProgram, glProgram, resources: { - pixelateUniforms, + pixelateUniforms: { + uSize: { value: new Float32Array(2), type: 'vec2' }, + }, }, });