WebGL has a clear method that clears an entire surface. What’s the best way to clear just a particular rectangle of the surface? For example I want to set a 100×100 box of pixels starting at (50, 50) to all zeroes (ARGB 0, 0, 0, 0). All I can think of right now is drawing a quad with a fragment shader that writes zeroes. Is there not an easier way?
WebGL has a clear method that clears an entire surface. What’s the best way
Share
You can use the SCISSOR test to constrain clearing (and rendering in general) to a rectangle.