[vtkusers] update,interact and render in different threads

David Lonie david.lonie at kitware.com
Wed Jan 4 14:06:07 EST 2017


It can be done, but you'll need to keep all of the input data / pipeline
logic in a background thread, and all of the renderable polydata / mapper /
actor stuff in a rendering thread, and then synchronize the threads to copy
the data from the background -> rendering thread after an update completes.
This will let you interact with the scene while data is being recomputed.

On Wed, Dec 28, 2016 at 11:59 AM, Antonio Fortino <thoniorf at gmail.com>
wrote:

> Hello to everyone,
>
> I'm trying to develop a simple example that update the celldata of a
> polydata in a thread while rendering in the main thread.
> My final goal is to interact with the scene, and pause the updates.
>
> To archive this i'm using a simple mutex and a boolean.
> However it seams that i'm trying to access the render for two different
> threads, and the mutex isn't enough, because when interacting with the
> scene errors like the one below appears, and at random the program stops
> with a segmentation.
>
> vtkOpenGLPolyDataMapper (0x1b62980): failed after UpdateShader 1 OpenGL
> errors detected
>
> 0 : (1282) Invalid operation
>
>
> I attach the code, any help is very appreciated.
>
> Best regards
> Antonio Fortino
>
>
>
>
> _______________________________________________
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170104/fa7c86d2/attachment.html>


More information about the vtkusers mailing list