diff --git a/src/gameobjects/particles/ParticleManagerWebGLRenderer.js b/src/gameobjects/particles/ParticleManagerWebGLRenderer.js index ad8614d81..bcb65aee4 100644 --- a/src/gameobjects/particles/ParticleManagerWebGLRenderer.js +++ b/src/gameobjects/particles/ParticleManagerWebGLRenderer.js @@ -77,6 +77,12 @@ var ParticleManagerWebGLRenderer = function (renderer, emitterManager, interpola pipeline.setTexture2D(texture, 0); } + if (emitter.mask) + { + emitter.mask.preRenderWebGL(renderer, emitter, camera); + pipeline.setTexture2D(texture, 0); + } + var tintEffect = 0; for (var i = 0; i < particleCount; i++) @@ -135,6 +141,11 @@ var ParticleManagerWebGLRenderer = function (renderer, emitterManager, interpola pipeline.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, frame.u0, frame.v0, frame.u1, frame.v1, tint, tint, tint, tint, tintEffect, texture, 0); } + + if (emitter.mask) + { + emitter.mask.postRenderWebGL(renderer); + } } };