[vtkusers] How to use OpenVR overlay with VTK ?

liyang lin linlycode at gmail.com
Fri May 19 11:49:17 EDT 2017


Hi, I have a simple Virtual Reality app that uses VTK for visualization,
and I'm trying to make GUI using OpenVR overlay but can't get it working.

I tried to use two threads to do the job, In the main thread, I set up
OpenVRRenderWindow, renderer and interactor, and starts the interactor;
In the overlay thread, I create an OpenVR overlay and an OpenGL context
that associated with a Qt offscreen surface, then render a Qt widget into a
framebuffer object in the OpenGL context, then extract the texture from the
framebuffer object, and feed it into the overlay using setOverlayTexture.
The second thread also listens for OpenVR overlayShown, mouse move/up/down
event, and dispatch them to the widget.

The overlay appears as expected, but the 3D scene rendered by VTK is
problematic, scene in the left eye flashes and doesn't react to HMD
movement, and when I points the controller to the overlay(which cause
rerender of the widget, and a setOverlayTexture call), the scene just
disappears.

I have no idea why this happens since I use my own OpenGL context in the
overlay thread, why is the scene rendered by VTK is affected ?

I also looked into vtkOpenVROverlay, it seems that it's a dashboard overlay
and hard to be reused.

Anybody know how to create GUI in VTK with OpenVR ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170519/fbceb343/attachment.html>


More information about the vtkusers mailing list