accessing z-buffer texture when using jit.gl.cameras @capure 1

maybites's icon

hi

I wonder: is there a way to access the z-buffer texture when using a jit.gl.camera with @capture 1? if not, can anybody tell me the algorithm used for creating a z-buffer texture? here my current solution. but while it looks ok, it somehow does not work with the SSAO-shaders I have found on the web so far. :-(

    shader to capture depth and linearize values (0-1)
    
Morgan's icon
maybites's icon

thanks, but I know already that solution (I started actually based on that depth shader) but it didnt work either.

There are different ways to encode the depth information in a texture, and I wondered how the z-buffer of opengl does it.

Rob Ramirez's icon

here's one technique that gives a linearized, normalized depth buffer:

maybites's icon

rob, thank you. I assume now the answer in regards of the z-buffer for @capture 1 is: no.