Share graphical resources (e.g., VBOs) between multiple vtkRenderWindows

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Share graphical resources (e.g., VBOs) between multiple vtkRenderWindows

longbowzhang
Dear vtkUsers, I have a question about sharing VBOs across multiple vtkRenderWindows. The motivation for this is: The data I want to render is quite large, and I plan to use multiple renderwindows (each has its own OpenGL context) to show the several aspects of the data. I googled, and found wglShareLists could be potential friend to achieve this? Does anyone know how to use this function within VTK context? Or do you have a better idea to achieve this? Thanks so much in advance. Best regards, Changgong Zhang Ph.D student in Computer Graphics and Visualization section Dept. Intelligent Systems EWI TU Delft
Reply | Threaded
Open this post in threaded view
|

Re: Share graphical resources (e.g., VBOs) between multiple vtkRenderWindows

Ken Martin
We have talked about sharing buffer objects across contexts and there are definitely cases where it makes a lot of sense. We have not done anything on it yet (well maybe some CUDA/OpenGL stuff) but I have added it to my list of todos. Not sure when we will get to it but I know we want it.

Thanks
Ken

On Wed, Feb 24, 2016 at 5:37 AM, longbowzhang <[hidden email]> wrote:
Dear vtkUsers, I have a question about sharing VBOs across multiple vtkRenderWindows. The motivation for this is: The data I want to render is quite large, and I plan to use multiple renderwindows (each has its own OpenGL context) to show the several aspects of the data. I googled, and found wglShareLists could be potential friend to achieve this? Does anyone know how to use this function within VTK context? Or do you have a better idea to achieve this? Thanks so much in advance. Best regards, Changgong Zhang Ph.D student in Computer Graphics and Visualization section Dept. Intelligent Systems EWI TU Delft

View this message in context: Share graphical resources (e.g., VBOs) between multiple vtkRenderWindows
Sent from the VTK - Users mailing list archive at Nabble.com.

_______________________________________________
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
Chairman & CFO
Kitware Inc.
28 Corporate Drive
Clifton Park NY 12065
518 371 3971

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.

_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: Share graphical resources (e.g., VBOs) between multiple vtkRenderWindows

longbowzhang
Hello Ken,
Thanks a lot for replying.
I tried to communicate between vtkRenderWindows via low-level Windows-specific function wglShareLists function.

The whole process is:
Assume we have two vtkRenderWindow objects (rwA, rwB).
1:
HGLRC glrcA = rwA->GetGenericDisplayId();
2:
and exactly after rwB is created, call
glrcB = rwB->GetGenericDisplayId();
wglMakeCurrent(NULL, NULL);
BOOL error = wglShareLists(glrcA , glrcB);
...

It seems like in this way it can work. I can use VBOs, which was created under rendering context of renderWindow A, at rendering context renderWindowB.

To be honest, I am not 100% sure about correctness.
Based on your vtk developing experience, could you tell if what I've done make sense?

Thanks again.
Best regards,
Changgong
Reply | Threaded
Open this post in threaded view
|

Re: Share graphical resources (e.g., VBOs) between multiple vtkRenderWindows

Ken Martin
My understanding is that what you are doing should work. After that you should be able to create VBOs in one context and access them from the other. But I've never tried it myself.

Thanks
Ken

On Fri, Feb 26, 2016 at 10:32 AM, longbowzhang <[hidden email]> wrote:
Hello Ken,
Thanks a lot for replying.
I tried to communicate between vtkRenderWindows via low-level
Windows-specific function wglShareLists function.

The whole process is:
Assume we have two vtkRenderWindow objects (rwA, rwB).
1:
HGLRC glrcA = rwA->GetGenericDisplayId();
2:
and exactly after rwB is created, call
glrcB = rwB->GetGenericDisplayId();
wglMakeCurrent(NULL, NULL);
BOOL error = wglShareLists(glrcA , glrcB);
...

It seems like in this way it can work. I can use VBOs, which was created
under rendering context of renderWindow A, at rendering context
renderWindowB.

To be honest, I am not 100% sure about correctness.
Based on your vtk developing experience, could you tell if what I've done
make sense?

Thanks again.
Best regards,
Changgong



--
View this message in context: http://vtk.1045678.n5.nabble.com/Share-graphical-resources-e-g-VBOs-between-multiple-vtkRenderWindows-tp5736784p5736871.html
Sent from the VTK - Users mailing list archive at Nabble.com.
_______________________________________________
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
Chairman & CFO
Kitware Inc.
28 Corporate Drive
Clifton Park NY 12065
518 371 3971

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.

_______________________________________________
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