View Full Version : How to remove pixel from the framebuffer?

10-07-2011, 12:15 PM

I want to draw a square and then dig a smaller rectangle hole in it. Is it possible to clear some pixels from the framebuffer for this purpose? Thank you very much!

Best wishes,

10-07-2011, 12:17 PM
I know that I can do this by only drawing the parts except the hole. But I am wondering whether it is possible to draw something in the framebuffer and then remove pixels from it? Thank you very much!

10-13-2011, 10:14 AM
I have used the stencil buffer to do this but found that stencil buffer seems not work in Firefox and only Chrome. Does anyone have similar problem? Thank you!

02-13-2012, 02:54 PM
Have you drawn something into the framebuffer before? If yes, you can render your square into an extra texture (renderbuffer object) and blend that over the framebuffer. For making a hole you can set the alpha value in this texture to zero.