Render the Camera masks

This commit is contained in:
Richard Davey 2019-04-11 17:10:03 +01:00
parent 79409f0479
commit 186970bd69
2 changed files with 13 additions and 1 deletions

View file

@ -426,6 +426,13 @@ var CanvasRenderer = new Class({
this.currentContext = ctx;
var mask = camera.mask;
if (mask)
{
mask.preRenderCanvas(this, null, camera._maskCamera);
}
if (!camera.transparent)
{
ctx.fillStyle = camera.backgroundColor.rgba;
@ -476,6 +483,11 @@ var CanvasRenderer = new Class({
camera.dirty = false;
if (mask)
{
mask.postRenderCanvas(this);
}
// Restore pre-clip context
ctx.restore();

View file

@ -1723,7 +1723,7 @@ var WebGLRenderer = new Class({
if (mask)
{
mask.preRenderWebGL(this, null, camera);
mask.preRenderWebGL(this, null, camera._maskCamera);
}
if (color.alphaGL > 0)