I’ve set up a pbuffer with 24 color bits and 8 alpha bits. I’m successfully able to share bound textures between my screen context & pbuffer. I’m using RGBA textures where I both frequently modify the alpha channel in the texture itself & modify the opacity for the entire texture with the material. I use:
And all of this works as expected on the screen and it also works as expected when I do a glReadPixels on the pbuffer (including getting the expected alpha out of the pbuffer) except…
There is one major glitch, the alpha values I get from the pbuffer are not correct when I have an object with transparency in front of another object. In that case the alpha values of the front object end up being the alpha values in the buffer… The fact that the object behind it that was rendered first and was completely opaque has no bearing…
I’ve been messing with the glBlendFunc to no avail.
As a further clue (this may be what’s killing me) I also frequently clear out my depth buffer.
Can anyone set me straight?