Bad pixels in PBuffer for some viewport sizes

In my application Im using offscreen rendering in a Pbuffer for rendering images files of the scene. Reading the Pbuffer content (using glReadPixels()) I get some invalid colored pixels near the upper left and the lower right corner of the rectangle. But this effect occurres only for selected viewport dimensions (e.g. 720x576 and 100x100 pixels is ok, but 400x230 pixels will fail. NVidia GeforceFX5900 used.

Any ideas?

This is funny, and I don’t have a real answer. :slight_smile: , but if it’s windows and in a windowed mode, try clipping regions to see what happens. otherwise, the basic rendering interface does this when rendering.

I had the same problem a few months ago. The applications i’m writing have DV resolution as input (720x576). At certain subsample levels my textures were completely messed up and I had no idea why. The only way I could slve it was by using POTD textures and POTD viewport.
Originally I also used texture rectangles to support NPOTD textures, so maybe the bug could have been there.

It’s very strange indeed…


Thanks for replying!

To Krisztian:
I checked clipping planes, and the bug seems to depend on clipping. The effect occurres:

  • only in ortho projection (using perspective projection everything is ok.)
  • when objects will be clipped at viewing frustum borders

I’m still checking this subject and I guess that it’s enough when one clipping plane is multiple defined.

To NiCo:
Yes, my textures aren’t powers of two dimensioned. But I have to use it in this dimensions. Hmm.