Getting visible part of actor, if any

I would like to add annotations to my rendered view.
For this I need to know if an actor is visible (ie: not occluded by other actors) and, if it is partially occluded, which part is visible.

All my actors are created from polydata, so it is quite easy to use the vtkSelectVisiblePoints filter to get the visible vertices. This is however slow and only partially works (all vertices could be occluded while the surface bewteen is still visible).

The best option could be using the buffer from the hardware-selector and checking if any pixels with the right color are present. But before I dive into this I’d like to know if any other (better?) ideas.

Yep, using the hardware selector with SetArea for the whole window should give decent performance. I have some rudimentary picking benchmark code here: PickingBenchmark/PickingBenchmark.cxx at fa7eb5f925f3f43c72cc3d62923822e86920b452 · sankhesh/PickingBenchmark · GitHub

1 Like