Hardware Selector with an offscreen renderer ?

Good morning everyone !

I am trying to pick all the cells of a poly data viewed from a camera viewpoint, and I managed to put something together with a vtkOpenGLRenderer & the vtkOpenGLHardwareSelector. When I actually render and display the output of the Renderer before calling the HardwareSelector, its output is correct and I do get the seen cells.
In my application however, I do not need to display anything, I basically have a scene made of a camera and a polydata and I want to get the set of seen cells (view frustum + occlusion culling somehow) … using the OpenGL tools to rely on hardware acceleration would be a dream, but I cannot figure out the strategy to make it work “offscreen”.

Would anyone by any chance have any idea about this ?

Thank you very much in advance !
Thibault

Hi @tbridel,

Offscreen rendering shouldn’t have an impact on hardware selection. As long as the offscreen FBO has the rendered image, the hardware selector just calls glReadPixels on it. Are you missing a Render call before invoking the selector?

Hi @sankhesh,

Thank you for your reply.
It turns out it works indeed, the crashes I was experiencing were coming from somewhere else. For future reference, Renderer + RenderWindow with offscreen rendering + openGL hardware selector does the job !

Hello,would you please share about how to use occlusion culling in vtk?Is there a ready-made method I can use?Or you did it from scratch?Thanks for your sharing!