Skip to content

Instantly share code, notes, and snippets.

View robojiannis's full-sized avatar

Jiannis Sotiropoulos robojiannis

View GitHub Profile
/**
*
* @filter Vignette
* @description Adds a simulated lens edge darkening effect.
*
* param size 0 to 1 (0 for center of frame, 1 for edge of frame)
* param amount 0 to 1 (0 for no effect, 1 for maximum lens darkening)
*
* Original shader by Evan Wallace.
*
@robojiannis
robojiannis / ZoomBlur.js
Created February 28, 2018 05:37
Phaser.FIlter.Zoomblur
Phaser.Filter.ZoomBlur = function (game) {
Phaser.Filter.call(this, game);
this.uniforms.center = {type: '2f', value:{x:0, y:0}};
this.uniforms.strength = {type: '1f', value:0.1};
this.uniforms.innerRadius = {type: '1f', value:0};
this.uniforms.radius = {type: '1f', value:1};
//this.uniforms.blur = {type: '1f', value:1};
//this.uniforms.filterArea = {type: '4f', value:{x:0, y:0, width:1280,height:720}};