Zbuffer with Volume Rendering

Hello everyone,
I’m trying to read the Zbuffer / depth buffer during volume rendering. For this I use
renWin-> GetZbufferData (x1, y1, x2, y2) and if I look at the values, there are all values equal to 1. If I have the image output with vtkWindowToImageFilter, it is simply black.
Does anyone know where my problem is and how to read the ZBuffer in volume rendering?

Best regards,
Alex

The volume mapper just writes the bounding polygon to the Z buffer. To access true depth data of raycasting, enable RenderToImage and once rendering is complete, access the color and depth data using GetColorImage / GetDepthImage methods.