Difference between vtk-wasm-sdk Docker image and GitLab tar.gz bundles, and when to use RemoteSession

Hi,

I’m building a web-based VTK application using Emscripten. Currently I compile VTK myself with OffscreenCanvas and threading support, write embind wrappers, and do all rendering client-side in the browser.

I have a few questions about the recent VTK.wasm infrastructure:

1. What is the difference between the Docker image and the GitLab bundles?

The kitware/vtk-wasm-sdk Docker image contains wasm32, wasm32-threads, wasm64, and wasm64-threads builds. But the tar.gz bundles on the GitLab package registry (vtk-wasm32-emscripten, vtk-wasm64-emscripten) only seem to have non-threaded variants. What exactly is the relationship between these two? Are they meant for completely different use cases?

2. Do the GitLab bundles support OffscreenCanvas and multithreading?

When using the tar.gz bundles via @kitware/vtk-wasm npm package (createNamespace()), is it possible to enable OffscreenCanvas and multithreading? Or are these features only available when building from source / using the Docker SDK?

3. When does RemoteSession provide a real advantage?

My understanding is that RemoteSession serializes the scene state (object properties + geometry blobs) from the server to the client WASM. If no server-side filtering is applied, the serialized data is roughly the same size as the original mesh. So RemoteSession only helps with data transfer when the server reduces the geometry through filters (contour, clip, etc.) before sending.

Is this correct? For CFD datasets ranging from ~50MB to several GB where users interactively apply filters, would RemoteSession be the recommended approach?

Thanks!

Hello @leehyeonseop

This docker image is an SDK. It has headers, libraries, and cmake modules that let you build your own C++ code via CMake and link to VTK with find_package(VTK). The use cases are in https://gitlab.kitware.com/vtk/vtk/-/tree/master/Examples/Emscripten/Cxx?ref_type=heads.

The tar.gz bundles are effectively made of just 4 files. vtkWebAssembly.wasm, vtkWebAssembly.mjs, vtkWebAssemblyAsync.wasm, vtkWebAssemblyAsync.mjs. Their use cases are explained here VTK.wasm from JavaScript | VTK.wasm. This website is a work in progress so some UI is not very good.

No.

Yes.

Yes, remote session is useful when you have some kind of server side reduction. This can be extracting the surface of a volumetric dataset, or contour, clip, etc.

The GitHub - Kitware/trame-vtklocal: Local Rendering using VTK.wasm to match server side rendering pipeline on the client side. · GitHub uses RemoteSession and makes it more accessible.