[vtk-developers] Fwd: Picking problem with OpenGL2 and DepthPeeling

Xabi Riobe xabivtk at gmail.com
Fri Sep 25 07:49:46 EDT 2015


Hi Ken,

with the patch we can pick the transparent surfaces but not the opaque ones
anymore. for example in the sample you can pick on the plane but not on the
spheres that are created.

2015-09-24 16:37 GMT+02:00 Ken Martin <ken.martin at kitware.com>:

> Thanks! I believe the new depth peeling code is probably leaving the
> zbuffer in a different state than the opaque z buffer. If you get a second
> could you try the attached patch and see if it works for you. It is based
> on a more recent VTK but it is a tiny patch.
>
>
>
> Thanks
>
> Ken
>
>
>
> Ken Martin PhD
>
> Chairman & CFO
>
> Kitware Inc.
>
> 28 Corporate Drive
>
> Clifton Park NY 12065
>
> ken.martin at kitware.com
>
> 919 869-8871 (w)
>
>
>
>
>
> This communication, including all attachments, contains confidential and
> legally privileged information, and it is intended only for the use of the
> addressee.  Access to this email by anyone else is unauthorized. If you are
> not the intended recipient, any disclosure, copying, distribution or any
> action taken in reliance on it is prohibited and may be unlawful. If you
> received this communication in error please notify us immediately and
> destroy the original message.  Thank you.
>
>
>
> *From:* vtk-developers [mailto:vtk-developers-bounces at vtk.org] *On Behalf
> Of *Xabi Riobe
> *Sent:* Thursday, September 24, 2015 5:29 AM
> *To:* VTK Developers
> *Subject:* [vtk-developers] Picking problem with OpenGL2 and DepthPeeling
>
>
>
> Hi,
>
>
>
> I try to pick in a scene that contains a translucent object and the pick
> fails if I use the OpenGL2 backend (v6.3.0), tested on VS2013 32 bits with
> nVidia Quadro 4000 (driver 353.30)
>
>
>
> The same code works with OpenGL backend.
>
>
>
> I can reproduce it with the sample code attached, based on the example at
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/Picking  with these
> lines added:
>
>
>
>    renderer->SetUseDepthPeeling(1);
>
>    renderer->SetMaximumNumberOfPeels(8);
>
>    renderWindow->SetAlphaBitPlanes(1);
>
>    renderWindow->SetMultiSamples(0);
>
>
>
> and the opacity set to 0.5 for the plane.
>
>
>
> If i don't use depth peeling, or if the plane is opaque, the picker works
> as expected.
>
>
>
> It seems that the pick fails when in vtkOpenGLRenderer::DonePick the float
> value returned by GetZbufferData is 1.0
>
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20150925/33be5af6/attachment.html>


More information about the vtk-developers mailing list