I am getting undefined values on some ATI hw with later drivers installed when reding depth buffer with GL_DEPTH_COMPONENT/GL_FLOAT from pbuffer. Can anybody confirm that non written fragments get undefined z values even if z buffer is cleared before rendering ? Is this a correct behaviour ?
The same program on NVidia HW gives defined depth values even if fragemnt is not written.
Fragments clear with glClear is not updated on ATI hw ??
I am amazed that nobody answers ?
maybe I am to vague in my description… lets try again with more details…
I render to a pbuffer.
- First I clear the depth to 1.0
- I render a model with z updates enabled
- I read the pbuffer with readpixel with GL_DEPTH_COMPONENT and GL_FLOAT size
On ATI latest drivers i get undefined (random) z values where no fragment have been updated that is not 1.0 even if i cleared the entire z buffer with glClear
On NVidia drivers I get defined 1.0
It seemes as ATI hw doesn’t clear the actual fragments to 1.0 even if I do the glClear. I only get correct z values from fragments that have actually been rendered.
Now i wonder what is correct. I suppose a lot of people uses the depth values for shadow mapping ? What is the correct behaviour ? Should I expect defined z values or not ?
My guess is that it is an ATI driver bug !
Of course you should get defined depth values. That’s what glClear does.
I don’t understand why your confused, you’re dealing with ATI, the only people who put a tip-of-the-day on their blue screens.
Report this driver bug to the ATI developer relations, or whatever.