Testing mask component on Camera

This commit is contained in:
Richard Davey 2019-04-10 18:10:03 +01:00
parent 1a9f6130bf
commit c188dfde12
2 changed files with 15 additions and 0 deletions

View file

@ -62,6 +62,7 @@ var BaseCamera = new Class({
Mixins: [
Components.Alpha,
Components.Mask,
Components.Visible
],

View file

@ -1719,6 +1719,13 @@ var WebGLRenderer = new Class({
{
this.pushScissor(cx, cy, cw, ch);
var mask = camera.mask;
if (mask)
{
mask.preRenderWebGL(this, null, camera);
}
if (color.alphaGL > 0)
{
TextureTintPipeline.drawFillRect(
@ -1748,6 +1755,13 @@ var WebGLRenderer = new Class({
camera.dirty = false;
var mask = camera.mask;
if (mask)
{
mask.postRenderWebGL(this);
}
this.popScissor();
if (camera.renderToTexture)