How to clear the stencil buffer?

Is there a way to manually clear the stencil buffer?

I am trying to create 2d stencil shadows, and I need to make sure the stencil
buffer is clean at the start of every frame.

I have noticed the “clearStencilBufferAfterLightPass” flag, but this is no working for me
for some reason. At the moment I am drawing a full screen quad at the start of every frame and setting every pixels stencil value back to 0.

I know this stuff is still new, but I am hoping someone knows more than I do.

Thanks in advance.

I have not tried this myself, but would GL.Clear do what you need if you pass true as the first param to clear the depth buffer?

Only been messing around with the Stencil stuff myself recently but I believe the stencil data is an extra per-pixel byte in the depth buffer, so clearing the depth buffer manually might just do what you are asking…