question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't get RenderTexture to work with mask

See original GitHub issue

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?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:18 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
GoodBoyDigitalcommented, Jan 16, 2017

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

0reactions
molstcommented, Oct 17, 2019

Howdi,

What’s the status on this one? I’m experiencing the same problem while using rounded rect masks with holes in it in menu layouts (using th new holes API in v5), so I guess the workaround wouldn’t work for me…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Are sprite masks incompatible with Render Textures?
I've just noticed on a new project that Sprite Masks don't seem to work when the camera renders to a texture via a...
Read more >
Unity Camera Target Texture Render Texture How To Get ...
Every texture I render out from the camera doesn't have masks working. I can see the whole version of every graphic on the...
Read more >
Practical Use of Render Textures - The Knights of Unity
For simple water, I have created a shader using depth buffer to mask out noise textures on the edges of other objects. With...
Read more >
Phaser 3 API Documentation - Class: RenderTexture
Note that under WebGL a FrameBuffer, which is what the Render Texture uses internally, cannot be anti-aliased. This means that when drawing objects...
Read more >
Need some help with shaders and RenderTexture for a ...
I'd like to use UdonSharp, but can't get intellisense working in VS Code. ... for the canvas that takes the brush mask (RenderTexture...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found