# Stencil Buffer

**URL:** <https://community.khronos.org/t/stencil-buffer/24145>\
**Category:** OpenGL: Basic Coding\
**Created:** [September 13, 2001, 12:38pm UTC](https://community.khronos.org/t/stencil-buffer/24145 "2001-09-13T12:38:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Boresight](https://community.khronos.org/letter_avatar_proxy/v4/letter/b/94ad74/32.png) [@Boresight](https://community.khronos.org/u/Boresight)\
**Post date:** [September 13, 2001, 12:38pm UTC](https://community.khronos.org/t/stencil-buffer/24145/1 "2001-09-13T12:38:00Z")

</div>

I want use the stencil buffer for a reflection effect in a pure Win32 program, but when I enable the stencil buffer the performance low dramaticaly. 3 or 4 fps in window mode. I’ve try with 1, 8 and 16 in PIXELFORMATDESCRIPTOR.cStencilBits parameteter but I didn’t obtain any change.

I guess that the problem is in the OpenGL context creation.

Somebody know what is the solution?

---

<div class="post-metadata">

**Author:** ![msteinberg](https://community.khronos.org/letter_avatar_proxy/v4/letter/m/e9a140/32.png) [@msteinberg](https://community.khronos.org/u/msteinberg)\
**Post date:** [September 13, 2001, 12:40pm UTC](https://community.khronos.org/t/stencil-buffer/24145/2 "2001-09-13T12:40:00Z")

</div>

You need to be in 32bpp mode and then request 24 bit z and 8 bit stencil. Works here.

---

<div class="post-metadata">

**Author:** ![Boresight](https://community.khronos.org/letter_avatar_proxy/v4/letter/b/94ad74/32.png) [@Boresight](https://community.khronos.org/u/Boresight)\
**Post date:** [September 13, 2001, 12:59pm UTC](https://community.khronos.org/t/stencil-buffer/24145/3 "2001-09-13T12:59:00Z")

</div>

I just try it, and it doesn’t work ![](http://www.opengl.org/discussion_boards/ubb/frown.gif)

[This message has been edited by Boresight (edited 09-13-2001).]

---

<div class="post-metadata">

**Author:** ![DFrey](https://community.khronos.org/letter_avatar_proxy/v4/letter/d/13edae/32.png) [@DFrey](https://community.khronos.org/u/DFrey)\
**Post date:** [September 13, 2001, 2:36pm UTC](https://community.khronos.org/t/stencil-buffer/24145/4 "2001-09-13T14:36:00Z")

</div>

What video card are you using?

---

<div class="post-metadata">

**Author:** ![Boresight](https://community.khronos.org/letter_avatar_proxy/v4/letter/b/94ad74/32.png) [@Boresight](https://community.khronos.org/u/Boresight)\
**Post date:** [September 14, 2001, 7:21am UTC](https://community.khronos.org/t/stencil-buffer/24145/5 "2001-09-14T07:21:00Z")

</div>

It’s a Intel 810 Graphics Controller.

And yes, it’s possible that this card doesn’t have stencil buffer with hardware support, but I’ve run glut examples with stencil buffer and them run well.

I going to try with other card.
