Question

  • How commonly supported is the Stencil Buffer right now by hardware in OpenGL?

  • Is it better/worse supported than shaders?

  • If the hardware doesn't support it, will it be emulated in software?

I haven't been able to find any hard data on the subject unfortunately... I want to assume that since stenciling is an old technology, it'd have ubiquitous support. However, being an old technology, it could just as easily be getting phased out of newer GPU hardware in favour of fragment shaders.

In my scenario, I'd be using an 8-bit stencil buffer in combination with a 24-bit depth buffer, used with VBOs (if that affects anything). If I use the stencil buffer, it won't be possible for those without stencil support to be able to play the game I'm making, thus the worry. If they can at least emulate the stenciling effect in software, while it wouldn't be ideal, it would be enough to put my fears to rest.

Was it helpful?

Solution

Stencil buffers are still in the OpenGL 4.4 spec. They're described in section 9.1 and stencil tests are section 17.3.5.

You're guaranteed stencil buffers. Whether they're done on the GPU or in software is an implementation detail. Any machine that can run the version of OpenGL you're targeting should be able to handle stencil testing on the CPU without breaking a sweat.

OTHER TIPS

How commonly supported is the Stencil Buffer right now by hardware in OpenGL?

Stencil buffers have been commonly supported by GPU since ancient times.

Is it better/worse supported than shaders?

"Is it colder than outside at night?" Yeah, that question makes about as much sense. Stencil buffers server a completely different purpose than shaders.

If the hardware doesn't support it, will it be emulated in software?

Yes, but not in a desireable way: The whole render pipeline will drop back to pure software rendering. The stencil test is implemented by hardwired functionality and can not be emulated by a "drop-in" software that only implements the stencil test while the rest was implemented differently. It simply doesn't work that way.

Luckily every GPU you'll encounter in the wild does support stencil tests. So this is of no concern whatsoever.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top