pixi-noise-filter

A noise filter for pixi.js

Usage no npm install needed!

<script type="module">
  import pixiNoiseFilter from 'https://cdn.skypack.dev/pixi-noise-filter';
</script>

README

pixi-noise-filter

A noise filter for pixi.js.

Installation

npm

npm install --save pixi.js
npm install --save pixi-noise-filter

Usage

Browserify

var PIXI = require('pixi.js');
var NoiseFilter = require('pixi-noise-filter');

var renderer = PIXI.autoDetectRenderer();
document.body.appendChild(renderer.view);
var stage = new PIXI.Stage();

var filter = new NoiseFilter();
filter.noiseLevelRGBA = [0.05, 0.05, 0.05, 0];
stage.filters = [filter];
renderer.render(stage);

Properties

noiseLevelRGBA = [R, G, B, A]

How much noise to apply. Array of RGBA floats with values between 0 (no noise) and 1 (maximum noise). Defaults are [0.05, 0.05, 0.05, 0].