Updated Filter resolution to a 2f and added Blur and Marble filters.

This commit is contained in:
photonstorm
2013-11-29 12:26:53 +00:00
parent 378ffc7ade
commit 00a9897ae2
17 changed files with 219 additions and 77 deletions
+11 -4
View File
@@ -52,9 +52,9 @@ Phaser.Filter = function (game, uniforms, fragmentSrc) {
*/
this.uniforms = {
resolution: { type: '3f', value: { x: 256, y: 256, z: 0 }},
time: { type: '1f', value: 0 },
mouse: { type: '4fv', value: { x: 0, y: 0, z: 0, w: 0 }}
resolution: { type: '2f', value: { x: 256, y: 256 }},
mouse: { type: '2f', value: { x: 0.0, y: 0.0 }}
};
@@ -97,8 +97,15 @@ Phaser.Filter.prototype = {
if (typeof pointer !== 'undefined')
{
this.uniforms.mouse.x = pointer.x;
this.uniforms.mouse.y = pointer.y;
if (pointer.x > 0)
{
this.uniforms.mouse.x = pointer.x.toFixed(2);
}
if (pointer.y > 0)
{
this.uniforms.mouse.y = pointer.y.toFixed(2);
}
}
this.uniforms.time.value = this.game.time.totalElapsedSeconds();