Particle Emitters can now be masked

This commit is contained in:
Richard Davey 2019-04-12 17:46:52 +01:00
parent 9dd3e7cd15
commit 754ae7caa2

View file

@ -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);
}
}
};