vtkHardwareSelector and multi-layer rendering

Hello,

is vtkHardwareSelector capable to work correctly in multi-layered rendering setup? My setup is following:

  • 2 layers
  • layer 0 contains all actors
  • layer 1 contains widget representations and some special actors used for highlighting
  • renderers of both layers share the same camera

I use the vtkHardwareSelector for implementation of custom picking. Regardless which of the two renderers is assigned to the selector by calling vtkHardwareSelector::SetRenderer() after calling vtkHardwareSelector::CaptureBuffers() the subsequent calls to vtkHardwareSelector::GetPixelInformation() return props from the renderer of layer 0 or sometimes layer 1. By default props of the layer 0 are returned even renderer 1 is assigned to selector. After some interaction within the scene and clicking on a widget representation and refresing the buffers by vtkHardwareSelector::CaptureBuffers() the props from layer 1 are returned suddenly but no props from layer 0. After clicking outside any widget and refreshing selector buffers again props from layer 0 are returned.

How can I control which renderer/layer is used for the vtkHardwareSelector? I expect that the method vtkHardwareSelector::SetRenderer() does this job, but it seems that it does not. Can someone please explain it?

Petr

@mat127 take a look of how this project https://github.com/OpenGeoscience/vtkMap is using vtkHardwareSelector (file: vtkGeoMapFeatureSelector.cxx). It’s a slippy map that may contains many layers.

1 Like