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: [ Mixins: [
Components.Alpha, Components.Alpha,
Components.Mask,
Components.Visible Components.Visible
], ],

View file

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