Jump to content

Erase from Rendertexture


alexh
 Share

Recommended Posts

Hello, I'm wondering how to erase something from a rendertexture. I don't want to clear the whole thing and it might not necessarily be a rectangle. (for rectangles I found http://www.html5gamedevs.com/topic/9031-trying-to-build-a-paint-application-with-pixi/#entry54977)

 

Usually I would try to disable all blendmodes and draw transparent stuff onto the rendertexture, but blendModes.NORMAL still does alpha blending, so it doesn't change anything to the texture.

Is there a way of doing this?

 

EDIT:

For the WebGL renderer I discovered that this works:

renderer.renderSession.gl.disable(renderer.renderSession.gl.BLEND);//draw with alpha 0renderer.renderSession.gl.enable(renderer.renderSession.gl.BLEND);

How would you do it with the Canvas renderer? Thanks

Link to comment
Share on other sites

  • 2 months later...

What is behind the rendertexture, does it have a static background, or there are things moving behind it? If it has a static texture as a background, then instead of erasing, you can draw that bg texture on the rendertexture, masked with the brush sprite.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...