[vtk-developers] WebAssembly Support

Matt McCormick matt.mccormick at kitware.com
Wed Jan 9 17:28:37 EST 2019


With Brad King's help, the non-rendering portion of VTK was
successfully built with WebAssembly. Here is the Docker image for the
build:

  https://github.com/InsightSoftwareConsortium/itk-js/blob/master/src/Docker/itk-js-vtk/Dockerfile

We did not try OpenGL / WebGL. Note that Emscripten targets WebGL 1 /
OpenGL ES2 by default, but WebGL 2 / OpenGL ES 3 can be targeted by
passing flags.

  https://kripken.github.io/emscripten-site/docs/optimizing/Optimizing-WebGL.html


That said, the sweet spot is itk.js-compiled-VTK-filters with vtk.js
for rendering.
 vtk.js supports WebGL 2 with a graceful fallback to WebGL 1, and
itk.js with vtk.js are easier to program and integrate with the rest
of the application.


Hope this helps,
Matt

On Wed, Jan 9, 2019 at 4:19 PM David E DeMarle <dave.demarle at kitware.com> wrote:
>
> Looks like 7.1.1 was the last version with ES2 support. 8.0 went to only ES3.
>
> Definitely talk to Matt McCormick who worked with Brad and probably JC last time.
>
> David E DeMarle
> Kitware, Inc.
> Principal Engineer
>
>
> On Wed, Jan 9, 2019 at 4:16 PM Ben Boeckel via vtk-developers <vtk-developers at vtk.org> wrote:
>>
>> On Wed, Jan 09, 2019 at 15:19:29 -0500, Kyle Edwards via vtk-developers wrote:
>> > A while back, I tried buliding a minimal subset of VTK with Emscripten,
>> > the WebAssembly compiler, but it failed to compile because VTK uses
>> > features that are not in OpenGL ES2. Does anyone here have an idea of
>> > how much work would be needed to port VTK to ES2? (This is not related
>> > to vtk.js. This is an attempt to compile VTK proper from C++ to
>> > WebAssembly.)
>>
>> Brad did this at some point. What errors are you seeing? What are the
>> OpenGL-related settings (see Utilities/OpenGL/vtkOpenGLOptions.cmake)?
>>
>> --Ben
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>
>> Search the list archives at: http://markmail.org/search/?q=vtk-developers
>>
>> Follow this link to subscribe/unsubscribe:
>> https://vtk.org/mailman/listinfo/vtk-developers
>>


More information about the vtk-developers mailing list