# pBuffer's stencil buffer support

**URL:** <https://community.khronos.org/t/pbuffers-stencil-buffer-support/59430>\
**Category:** OpenGL\
**Tags:** windows\
**Created:** [December 10, 2009, 10:27pm UTC](https://community.khronos.org/t/pbuffers-stencil-buffer-support/59430 "2009-12-10T22:27:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![him\_me2](https://community.khronos.org/letter_avatar_proxy/v4/letter/h/50afbb/32.png) [@him\_me2](https://community.khronos.org/u/him_me2)\
**Post date:** [December 10, 2009, 10:27pm UTC](https://community.khronos.org/t/pbuffers-stencil-buffer-support/59430/1 "2009-12-10T22:27:23Z")

</div>

Hi All,

I’m using the pBuffer (WGL\_ARB\_pbuffer) for rendering offscreen.  
I’m trying to get the stecil buffer for the pbuffer but i’m not getting allocated stencil buffer bits.

i’m also setting the stencil buffer bits in the PIXELFORMATDESCRIPTOR but there i’m getting the valid pixel format.  
The attribute list is shown here

```auto
int pf_attr[] =
	{
		WGL_SUPPORT_OPENGL_ARB, TRUE, // P-buffer will be used with OpenGL
		WGL_DRAW_TO_PBUFFER_ARB, TRUE, // Enable render to p-buffer
		WGL_RED_BITS_ARB, 8, // At least 8 bits for RED channel
		WGL_GREEN_BITS_ARB, 8, // At least 8 bits for GREEN channel
		WGL_BLUE_BITS_ARB, 8, // At least 8 bits for BLUE channel
		WGL_ALPHA_BITS_ARB, 8, // At least 8 bits for ALPHA channel
		WGL_DEPTH_BITS_ARB, 0, // At least 16 bits for depth buffer
		WGL_STENCIL_BITS_ARB, 0,
		WGL_FULL_ACCELERATION_ARB, 1,

		WGL_DOUBLE_BUFFER_ARB, FALSE, // We don't require double buffering
		0 // Zero terminates the list
	};

```

And my second doubt is that my card doesn’t show support for pBuffer Extension, but still i’m getting access to the pBuffer for rendering. Is i’m getting the software support only??

I also tried setting the Flags in attribute list as WGL\_GENERIC\_ACCELERATION\_ARB and WGL\_NO\_ACCELERATION\_ARB, but after setting i’m not getting the valid pixel format.

in documentation it is written like that  
" WGL\_ACCELERATION\_ARB  
Indicates whether the pixel format is supported by the driver.  
If this is set to WGL\_NO\_ACCELERATION\_ARB then only the software  
renderer supports this pixel format; if this is set to  
WGL\_GENERIC\_ACCELERATION\_ARB then the pixel format is supported  
by an MCD driver; if this is set to WGL\_FULL\_ACCELERATION\_ARB  
then the pixel format is supported by an ICD driver.  
"

Also when i’m checking the particular pixel format using

bool check = wglGetPixelFormatAttribivARB(m\_hDC, PixelFormat, 0, 9, (const int\*)pf\_attr, pixVal);

//here PixelFormat is the supported pixel format of the DC through PixelFormat = ChoosePixelFormat( m\_hDC, &pfd );

it is returning always false (for any pixel format). Though i’m getting a valid pixel format through

wglChoosePixelFormatARB( m\_hDC,(const int\*)pf\_attr, NULL, 1, &pixelFormat, &count);

Please help me in this regard. Thanks

---

<div class="post-metadata">

**Author:** ![The\_Fiddler](https://community.khronos.org/letter_avatar_proxy/v4/letter/t/71e660/32.png) [@The\_Fiddler](https://community.khronos.org/u/The_Fiddler)\
**Post date:** [December 11, 2009, 2:21am UTC](https://community.khronos.org/t/pbuffers-stencil-buffer-support/59430/2 "2009-12-11T02:21:39Z")

</div>

```auto
WGL_DEPTH_BITS_ARB, 0, // At least 16 bits for depth buffer
WGL_STENCIL_BITS_ARB, 0,

```

You are not specifying any depth/stencil bits. Try 24/8 to see if that works (in my experience, 16/8 usually doesn’t work).

---

<div class="post-metadata">

**Author:** ![ZbuffeR](https://community.khronos.org/letter_avatar_proxy/v4/letter/z/ce7236/32.png) [@ZbuffeR](https://community.khronos.org/u/ZbuffeR)\
**Post date:** [December 11, 2009, 2:22am UTC](https://community.khronos.org/t/pbuffers-stencil-buffer-support/59430/3 "2009-12-11T02:22:17Z")

</div>

What is your hardware, OS, driver version ?

Do you really need to support pbuffers ? The modern replacement FBO is much easier and better compatible accross plateforms :  
[http://www.opengl.org/wiki/GL\_EXT\_framebuffer\_object](http://www.opengl.org/wiki/GL_EXT_framebuffer_object)

Also check gamedev FBO tutorials.

---

<div class="post-metadata">

**Author:** ![him\_me2](https://community.khronos.org/letter_avatar_proxy/v4/letter/h/50afbb/32.png) [@him\_me2](https://community.khronos.org/u/him_me2)\
**Post date:** [December 11, 2009, 3:02am UTC](https://community.khronos.org/t/pbuffers-stencil-buffer-support/59430/4 "2009-12-11T03:02:11Z")

</div>

hey actually i’m now getting the stencil Bits support… actually the wglGetPixelFormatAttribivARB function was always returning the false.

---

<div class="post-metadata">

**Author:** ![him\_me2](https://community.khronos.org/letter_avatar_proxy/v4/letter/h/50afbb/32.png) [@him\_me2](https://community.khronos.org/u/him_me2)\
**Post date:** [December 11, 2009, 3:04am UTC](https://community.khronos.org/t/pbuffers-stencil-buffer-support/59430/5 "2009-12-11T03:04:43Z")

</div>

Actually i’m not getting the FBO extension in my system. I’m having an low quality intel card.

But the card doesnt even list the pBuffer ext but i’m getting it to render when i’m doing??  
What may be the reason??

Thanks for the reply

---

<div class="post-metadata">

**Author:** ![system](https://community.khronos.org/uploads/default/original/2X/b/ba89cb49313a0e869198c8be354afde8bcae027e.png) [@system](https://community.khronos.org/u/system)\
**Post date:** [October 19, 2021, 6:20pm UTC](https://community.khronos.org/t/pbuffers-stencil-buffer-support/59430/6 "2021-10-19T18:20:56Z")

</div>

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.
