- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
import { vertex } from '@tools/fragments';
import fragment from './ascii.frag';
import { Filter } from '@pixi/core';
// TODO (cengler) - The Y is flipped in this shader for some reason.
// @author Vico @vicocotea
// original shader : https://www.shadertoy.com/view/lssGDj by @movAX13h
/**
* An ASCII filter.<br>
* 
*
* @class
* @extends PIXI.Filter
* @memberof PIXI.filters
* @see @pixi/filter-ascii
* @see pixi-filters
*/
class AsciiFilter extends Filter
{
/**
* @param {number} [size=8] - Size of the font
*/
constructor(size = 8)
{
super(vertex, fragment);
this.size = size;
}
/**
* The pixel size used by the filter.
*/
get size(): number
{
return this.uniforms.pixelSize;
}
set size(value: number)
{
this.uniforms.pixelSize = value;
}
}
export { AsciiFilter };