I'm trying to perform the depth peeling algorithm, to draw in correct order transparent objects in a scene already full of opaque objects (A terrain that almost occludes the transparent objects most of the time).
I have already separated the draw calls for opaque/transparent objects, drawing the opaque ones first. The problem lies in that each one of the "transparent objects drawing passes" the algorithm needs will actually use it's own (empty) z-buffer, but I need to check if a opaque object is occluding the view before drawing, and hence I need to reuse the z-buffer obtained after drawing the opaque objects multiple times, and not a empty one each.
Im aware i could dump the z-buffer state after drawing the opaque objects to a texture, and performing the depth comparisons from it in the fragment shader, but im afraid that performing the depth comparisons in the fragment shader would be extremelly slow. There is another faster way to solve that problem?
Edit: My target is a 3.X OpenGL version, so using the A-buffer is not an option in this particular case.