Re: pbuffer with depth buffer
Phil Keslin (philk++at++cthulhu.engr.sgi.com)
Tue, 22 Dec 1998 10:31:45 -0800
Liu Xiaoyan wrote:
>
> Hi, all,
>
> I'm having a very strange problem here rendering to a pbuffer with depth
> buffer( r/g/b = 8, Z=24). The images I save from this pbuffer are always
> the same each time I run it with different objects or even empty scene
> graph attached to this channel. I don't know where does this image come
> from, doesn't look like garbage, looks like the very very first objects
> I used to run the program and then it sticks to the memory. Even I
> explicitly clear the buffers in the draw callback or even stupidly
> reboot my Octane, the same image comes out.
>
> However, if I allocate a pbuffer without depth buffer, things go fine.
> What could cause such behaviour?
>
> I'd like to point out that I'm doing all these with another package
> library (CAVE) which deals with stereo display and allocates pipes and
> channels before my code for pbuffer allocation.
>
> void DrawPbuf (pfChannel *channel, void *data)
> { static int no = 0;
> int depth, color;
>
> glGetIntegerv(GL_DEPTH_BITS, &depth);
> glGetIntegerv(GL_COLOR_ARRAY_SIZE, &color);
> glClearColor(1, 0, 0, 0);
> glClearDepth(0.0f);
> glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
> glEnable(GL_DEPTH_TEST);
>
> /* pfClearChan(channel); */
> /* pfDraw(); */
> /* pfDrawChanStats(channel); */
> }
When do you read the contents of the pbuffer? Did you allocate the
pbuffer with PRESERVED_CONTENTS? If not, any process with an active GL
context could force your pbuffer to get clobbered. On the OCTANE MXI and
a display resolution of 1280x1024, your pbuffer will share depth with
the front planes. It is possible that your depth planes are getting
clobbered resulting in failure of the depth test. The contents of the
pbuffer color buffers won't change in that instance.
- Phil
--
Phil Keslin <philk++at++engr.sgi.com>
This archive was generated by hypermail 2.0b2
on Tue Dec 22 1998 - 10:31:50 PST