Erase part of RenderTarget when drawing primitives?

Posted by user1495173 on Stack Overflow See other posts from Stack Overflow or by user1495173
Published on 2012-08-29T09:37:36Z Indexed on 2012/08/29 9:38 UTC
Read the original article Hit count: 154

Filed under:

I'm creating a paint like application using XNA.

I have a render target which acts as a canvas. When the user draws something I draw corresponding triangles using DrawUserPrimitives and triangle strips to make lines and other curves.

I want to implement an eraser in the application, so that the user can erase the triangles from the texture. I've used OpenGL in the past and there I would just use a blend function like so: glBlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_ALPHA);

How would I do this in XNA? I tried setting the GraphicsDevice blend mode to AlphaBlend, Additive, etc.. but it did not work. Any ideas?

Thanks!

© Stack Overflow or respective owner

Related posts about XNA