Kitware / vtk-js

Visualization Toolkit for the Web
https://kitware.github.io/vtk-js/
BSD 3-Clause "New" or "Revised" License
1.24k stars 373 forks source link

Use vtk.js on client and standard vtk for heavy duty on server #815

Closed Garyfallidis closed 3 years ago

Garyfallidis commented 6 years ago

Hi all,

I have the following application need and I need advice from the experts! I want to render some large datasets sitting on a server with GPUs and then use vtk.js on a webpage for the interactivity. That means that the vtk application on the server will have to send frames on the web client (vtk.js) and that vtk.js will have to forward mouse events and keystrokes to the server.

I know such at thing is kind of possible with paravieweb but I want to do this using vtk.js. An alternative would be also to setup a web vnc client but I would like to avoid this if possible.

Let me know what you think!

Best, Eleftherios

jourdain commented 6 years ago

vtk.js is really meant to deal with geometry aka local rendering. Since you don't want to send the geometry (which is more than understandable), ParaViewWeb is definitely the way to go, but ParaViewWeb does not mean ParaView on the server side, you can simply use a plain vtkpython script and use the ParaViewWeb JavaScript library on the client side.

You can look at this example which show the parallel between VTK or ParaView on the server side while still using the same client code.

Garyfallidis commented 6 years ago

Yes, I have seen this example. I wanted something more light than ParaViewWeb. Probably a web based vnc client would be the easiest. Need to think about this... What is very important for me is the event management. I have made my own UI components in VTK and I don't want to have to rewrite those events. It would be too much work.

jourdain commented 6 years ago

Well I don't see how to make things lighter since this example only handle image delivery to the client and mouse events to the server.

Is your UI in the 3D window? Or are you using some Qt components?

jourdain commented 6 years ago

BTW, you don't need the full ParaViewWeb library. I'm guessing you will just be using a couple of pieces of that library which should make things fairly small on the client side.

Garyfallidis commented 6 years ago

My UIs are all in the 3D windows. No Qt policy :) Okay if I can strip down most of the parts. That would be great. Do you know if I can also have multiple sessions running from the same server?

jourdain commented 6 years ago

The strip down on the JS side was always a given with ES6 and using only the code you import from the source. Does your vtk application can be driven by Python? That is the current requirement with ParaViewWeb. For the multi session, ParaViewWeb definitely support that either for collaboration or concurrent users. The later has more doc available online but for collaboration it is just a matter of sharing the sessionURL between users.

Garyfallidis commented 6 years ago

Yes, my application is Python driven. Thank you @jourdain!

jourdain commented 6 years ago

Then you might be able to use the RemoteRenderer example code as is... Meaning the client side does not need to change. You just need to create the server side...

Garyfallidis commented 6 years ago

Yep, yep! Got it!