Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Rendering with OffscreenCanvas #3056

Open
neo15201788751 opened this issue Apr 10, 2024 · 3 comments
Open

[Feature] Rendering with OffscreenCanvas #3056

neo15201788751 opened this issue Apr 10, 2024 · 3 comments
Labels
type: feature request 💡 Desired capabilities / enhancements

Comments

@neo15201788751
Copy link

Feature Request

Add RenderWindow which supporting OffscreenCanvas

Motivation and Detailed Description

It is easy to produce bad performance with rendering in main execution thread only,
OffscreenCanvas inside a worker context could be helpful.

@neo15201788751 neo15201788751 added the type: feature request 💡 Desired capabilities / enhancements label Apr 10, 2024
@bruyeret
Copy link
Contributor

bruyeret commented Apr 10, 2024

I made a branch named offscreen-canvas-demo in my fork to show that with very few changes, it is possible to use an OffscreenCanvas
It is based on #3051
It doesn't use WebWorkers though
The example uses a single WebGL context (from the offscreen canvas) to do all the rendering and calls drawImage to draw to the "normal" canvases that you can see

Use npm run example ManyRenderWindows to start the example

@neo15201788751
Copy link
Author

Thanks, But OffscreenCanvas inside main thread can not help.

@bruyeret
Copy link
Contributor

This branch is just to show that it is possible to use an offscreen canvas with the OpenGL render window with just a few changes
There is still work to do, you will have for example to:

  • create a canvas, call transferControlToOffscreen() on it and send it to the web worker
  • create the VTK rendering pipeline in the web worker
  • find a way to send the events to the interactor (maybe through a proxy)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request 💡 Desired capabilities / enhancements
Projects
None yet
Development

No branches or pull requests

2 participants