<div dir="ltr">Hi Steve, <div><br></div><div>If you intend to get the depth values from volume (and not just geometry), then not clearing the depth buffer will not help either since we don't write to depth buffer (the defaults won't make sense anyways). If you are looking for depth values from both volume and geometry, then you may want to look into this option RenderToImage in the base class (<a href="https://github.com/Kitware/VTK/blob/master/Rendering/Volume/vtkGPUVolumeRayCastMapper.h">https://github.com/Kitware/VTK/blob/master/Rendering/Volume/vtkGPUVolumeRayCastMapper.h</a>). Give it a try and let us know if that works for you. If you enable this option then you can call GetColorImage and GetDepthImage for the depth values. </div><div><br></div><div>Thanks,</div><div><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Oct 4, 2016 at 12:34 PM Aashish Chaudhary <<a href="mailto:aashish.chaudhary@kitware.com">aashish.chaudhary@kitware.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">That is because we make a call to clear the depth buffer bit  that is: glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT). I have to think all of the use-cases but I think we don't need to clear the depth buffer. We can push a simple fix for it on the master branch. </div><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">- Aashish<br class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div></div></div></div></div><br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Tue, Oct 4, 2016 at 12:12 PM stevep <<a href="mailto:steve.petruzza@gmail.com" class="gmail_msg" target="_blank">steve.petruzza@gmail.com</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br class="gmail_msg">
<br class="gmail_msg">
I used the vtkPolyDataMapper to render a surface and then with the<br class="gmail_msg">
vtkRenderWindow I can get correctly the ZBuffer using GetZbufferData and the<br class="gmail_msg">
RGB data via vtkWindowToImageFilter.<br class="gmail_msg">
<br class="gmail_msg">
When I use, starting from the same vtkImageData, a volume rendering like the<br class="gmail_msg">
SmartVolumeMapper (as in the following):<br class="gmail_msg">
<a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/VolumeRendering/SmartVolumeMapper" rel="noreferrer" class="gmail_msg" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/VolumeRendering/SmartVolumeMapper</a><br class="gmail_msg">
<br class="gmail_msg">
The RGB data are correct but the ZBuffer contains all values == 1 (checked<br class="gmail_msg">
dumping the float array to disk).<br class="gmail_msg">
<br class="gmail_msg">
I get the same result changing blend mode and using a<br class="gmail_msg">
vtkFixedPointVolumeRayCastMapper.<br class="gmail_msg">
<br class="gmail_msg">
What am I missing?<br class="gmail_msg">
<br class="gmail_msg">
Thank you<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
--<br class="gmail_msg">
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/Volume-Rendering-and-zbuffer-tp5740662.html" rel="noreferrer" class="gmail_msg" target="_blank">http://vtk.1045678.n5.nabble.com/Volume-Rendering-and-zbuffer-tp5740662.html</a><br class="gmail_msg">
Sent from the VTK - Users mailing list archive at Nabble.com.<br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
Powered by <a href="http://www.kitware.com" rel="noreferrer" class="gmail_msg" target="_blank">www.kitware.com</a><br class="gmail_msg">
<br class="gmail_msg">
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" class="gmail_msg" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br class="gmail_msg">
<br class="gmail_msg">
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" class="gmail_msg" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br class="gmail_msg">
<br class="gmail_msg">
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" class="gmail_msg" target="_blank">http://markmail.org/search/?q=vtkusers</a><br class="gmail_msg">
<br class="gmail_msg">
Follow this link to subscribe/unsubscribe:<br class="gmail_msg">
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" class="gmail_msg" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br class="gmail_msg">
</blockquote></div></blockquote></div></div></div>