pixijs: Can't get RenderTexture to work with mask

Hey, I’m trying in v4 to get a texture of a masked graphic by another graphic, using this piece of code:

const container = new PIXI.Container()
const item = getBaseGraphic()
const mask = getMaskGraphic()
item.mask = bites
container.addChild(item)
container.addChild(mask)
const renderTexture = PIXI.RenderTexture.create(256, 256)
renderer.render(container, renderTexture)
return renderTexture

The problem is the texture is empty as long as I apply a mask on item. If I comment out the mask assignment, I get the texture but without the mask - just the 2 graphics on top of each other.

I’m using the WebGLRenderer.

Any idea what am I doing wrong?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 18 (5 by maintainers)

Most upvoted comments

Hi @ShayDavidson, this should be fixed now on the dev branch 👍