mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 05:03:37 +00:00
Added ColorMatrix
This commit is contained in:
parent
2d58ee2453
commit
720417c3dd
3 changed files with 12 additions and 4 deletions
|
@ -112,6 +112,8 @@ var PipelineManager = new Class({
|
||||||
this.postPipelineClasses = new CustomMap([
|
this.postPipelineClasses = new CustomMap([
|
||||||
[ 'BloomFX', FX.Bloom ],
|
[ 'BloomFX', FX.Bloom ],
|
||||||
[ 'BlurFX', FX.Blur ],
|
[ 'BlurFX', FX.Blur ],
|
||||||
|
[ 'CircleFX', FX.Circle ],
|
||||||
|
[ 'ColorMatrixFX', FX.ColorMatrix ],
|
||||||
[ 'GlowFX', FX.Glow ],
|
[ 'GlowFX', FX.Glow ],
|
||||||
[ 'GradientFX', FX.Gradient ],
|
[ 'GradientFX', FX.Gradient ],
|
||||||
[ 'PixelateFX', FX.Pixelate ],
|
[ 'PixelateFX', FX.Pixelate ],
|
||||||
|
|
|
@ -67,7 +67,7 @@ var FXPipeline = new Class({
|
||||||
this.shine = new FX.Shine(game);
|
this.shine = new FX.Shine(game);
|
||||||
this.gradient = new FX.Gradient(game);
|
this.gradient = new FX.Gradient(game);
|
||||||
|
|
||||||
// This is a sparse array
|
// This array is intentionally sparse. Do not adjust.
|
||||||
this.fxHandlers = [];
|
this.fxHandlers = [];
|
||||||
|
|
||||||
this.fxHandlers[FX_CONST.GLOW] = this.onGlow;
|
this.fxHandlers[FX_CONST.GLOW] = this.onGlow;
|
||||||
|
@ -248,11 +248,15 @@ var FXPipeline = new Class({
|
||||||
this.copySprite(this.target, this.source);
|
this.copySprite(this.target, this.source);
|
||||||
},
|
},
|
||||||
|
|
||||||
onColorMatrix: function (config, width, height)
|
onColorMatrix: function (config)
|
||||||
{
|
{
|
||||||
this.copySprite(this.source, this.target, true, true, false, config);
|
this.setShader(this.colorMatrixShader);
|
||||||
|
|
||||||
this.copySprite(this.target, this.source);
|
this.set1i('uMainSampler', 0);
|
||||||
|
this.set1fv('uColorMatrix', config.getData());
|
||||||
|
this.set1f('uAlpha', config.alpha);
|
||||||
|
|
||||||
|
this.runDraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -12,6 +12,8 @@ var FX = {
|
||||||
|
|
||||||
Bloom: require('./BloomFXPipeline'),
|
Bloom: require('./BloomFXPipeline'),
|
||||||
Blur: require('./BlurFXPipeline'),
|
Blur: require('./BlurFXPipeline'),
|
||||||
|
Circle: require('./CircleFXPipeline'),
|
||||||
|
ColorMatrix: require('./ColorMatrixFXPipeline'),
|
||||||
Glow: require('./GlowFXPipeline'),
|
Glow: require('./GlowFXPipeline'),
|
||||||
Gradient: require('./GradientFXPipeline'),
|
Gradient: require('./GradientFXPipeline'),
|
||||||
Pixelate: require('./PixelateFXPipeline'),
|
Pixelate: require('./PixelateFXPipeline'),
|
||||||
|
|
Loading…
Reference in a new issue