[vtkusers] How to use OpenVR overlay with VTK ?

Ken Martin ken.martin at kitware.com
Fri Jun 2 08:42:42 EDT 2017

Yes vtkOpenVROverlay is intended to be a dashboard overlay. Using Qt to
create the texture for an overlay (per the OpenVR SDK example) seems like a
fine idea. Not sure why you are running into issues as long as you keep the
thread/context boundaries clean. I have not tried that approach personally
but I think it is a fine way to go.


On Fri, May 19, 2017 at 11:49 AM, liyang lin <linlycode at gmail.com> wrote:

> 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 ?
> _______________________________________________
> Powered by www.kitware.com
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Search the list archives at: http://markmail.org/search/?q=vtkusers
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers

Ken Martin PhD
Distinguished Engineer
Kitware Inc.
28 Corporate Drive
Clifton Park NY 12065

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170602/7aa12f53/attachment.html>

More information about the vtkusers mailing list