Number of bits for the Stencil buffer

Hi averyone

I’m using the stencil buffer and I some pixels have values bigger than 255 in the stencil buffer. Since stencil buffer works with 8 bits, values bigger than 255 are clamped.

Does anybody know how can I set the number of bits for the stencil up to 16 or 32?

Thank you very much.

As far as I know no current hardware supports a stencil format with more than 8 bits.

Really? It sounds strange…

Maybe I can do some trick…

Usually 8 bit stencil is far enough. I don’t know what is your use case, but possibly you can try to reconsider whether there is no other way to achieve the same results.

Btw you can enable wrapping of stencil values instead of clamping if you wish. Depending on what are you using the stencil buffer, maybe that can solve the problem.