Hey, very rough paragraph since I'm a bit short on time, but: during some development I came across the issue that clear() (any of them, passing the stencil param as 0) doesn't properly clear the stencil buffer. The reason for this seems to be that glStencilMask(0xFF) is not called before trying to clear the buffer, so if your previous frame happens to end with a draw call that does something other than glStencilMask(0xFF) (like 0x00), clear() wont clear the buffer properly