WebAssembly Support

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

WebAssembly Support

VTK - Dev mailing list
Hello all,

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.)

Kyle
_______________________________________________
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

Reply | Threaded
Open this post in threaded view
|

Re: WebAssembly Support

VTK - Dev mailing list
Hey Kyle, are you working with Matt McCormick?

When we were WebAssembling VTK last year, they chose to strip disable rendering, one reason being that we already have good support for rendering on the web via vtk.js.

I also believe that we dropped ES2 support a release or two ago. Ken Martin can confirm that.

David E DeMarle
Kitware, Inc.
Principal Engineer


On Wed, Jan 9, 2019 at 3:19 PM Kyle Edwards via vtk-developers <[hidden email]> wrote:
Hello all,

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.)

Kyle
_______________________________________________
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


_______________________________________________
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

Reply | Threaded
Open this post in threaded view
|

Re: WebAssembly Support

VTK - Dev mailing list
On Wed, 2019-01-09 at 16:01 -0500, David E DeMarle wrote:
Hey Kyle, are you working with Matt McCormick?

No, this is for the vision team.

When we were WebAssembling VTK last year, they chose to strip disable rendering, one reason being that we already have good support for rendering on the web via vtk.js.

I also believe that we dropped ES2 support a release or two ago. Ken Martin can confirm that.

I thought ES2 was needed to support Android and iOS. Does VTK still support them? Do they allow full OpenGL instead of just ES?

Kyle

_______________________________________________
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

Reply | Threaded
Open this post in threaded view
|

Re: WebAssembly Support

VTK - Dev mailing list
ES3 support is active.

David E DeMarle
Kitware, Inc.
Principal Engineer


On Wed, Jan 9, 2019 at 4:06 PM Kyle Edwards <[hidden email]> wrote:
On Wed, 2019-01-09 at 16:01 -0500, David E DeMarle wrote:
Hey Kyle, are you working with Matt McCormick?

No, this is for the vision team.

When we were WebAssembling VTK last year, they chose to strip disable rendering, one reason being that we already have good support for rendering on the web via vtk.js.

I also believe that we dropped ES2 support a release or two ago. Ken Martin can confirm that.

I thought ES2 was needed to support Android and iOS. Does VTK still support them? Do they allow full OpenGL instead of just ES?

Kyle

_______________________________________________
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

Reply | Threaded
Open this post in threaded view
|

Re: WebAssembly Support

VTK - Dev mailing list
Ah, my mistake. I didn't realize you meant that only version 2 had been dropped - I thought you meant ES support had been dropped entirely.

So if ES3 is supported, what would be needed to activate it in WebAssembly? Would it be a matter of adding a new mobile platform type, similar to Android and iOS? Would I just need to edit the CMake scripts to turn on some build flags, or would more work need to be done in the OpenGL code itself?

Kyle

On Wed, 2019-01-09 at 16:09 -0500, David E DeMarle wrote:
ES3 support is active.

David E DeMarle
Kitware, Inc.
Principal Engineer


On Wed, Jan 9, 2019 at 4:06 PM Kyle Edwards <[hidden email]> wrote:
On Wed, 2019-01-09 at 16:01 -0500, David E DeMarle wrote:
Hey Kyle, are you working with Matt McCormick?

No, this is for the vision team.

When we were WebAssembling VTK last year, they chose to strip disable rendering, one reason being that we already have good support for rendering on the web via vtk.js.

I also believe that we dropped ES2 support a release or two ago. Ken Martin can confirm that.

I thought ES2 was needed to support Android and iOS. Does VTK still support them? Do they allow full OpenGL instead of just ES?

Kyle


_______________________________________________
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

Reply | Threaded
Open this post in threaded view
|

Re: WebAssembly Support

VTK - Dev mailing list
I think it will be just a new platform type as you suggest. Once the CMake sets the right flags the rendering code will do the right thing.

David E DeMarle
Kitware, Inc.
Principal Engineer


On Wed, Jan 9, 2019 at 4:14 PM Kyle Edwards <[hidden email]> wrote:
Ah, my mistake. I didn't realize you meant that only version 2 had been dropped - I thought you meant ES support had been dropped entirely.

So if ES3 is supported, what would be needed to activate it in WebAssembly? Would it be a matter of adding a new mobile platform type, similar to Android and iOS? Would I just need to edit the CMake scripts to turn on some build flags, or would more work need to be done in the OpenGL code itself?

Kyle

On Wed, 2019-01-09 at 16:09 -0500, David E DeMarle wrote:
ES3 support is active.

David E DeMarle
Kitware, Inc.
Principal Engineer


On Wed, Jan 9, 2019 at 4:06 PM Kyle Edwards <[hidden email]> wrote:
On Wed, 2019-01-09 at 16:01 -0500, David E DeMarle wrote:
Hey Kyle, are you working with Matt McCormick?

No, this is for the vision team.

When we were WebAssembling VTK last year, they chose to strip disable rendering, one reason being that we already have good support for rendering on the web via vtk.js.

I also believe that we dropped ES2 support a release or two ago. Ken Martin can confirm that.

I thought ES2 was needed to support Android and iOS. Does VTK still support them? Do they allow full OpenGL instead of just ES?

Kyle


_______________________________________________
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

Reply | Threaded
Open this post in threaded view
|

Re: WebAssembly Support

VTK - Dev mailing list
In reply to this post by VTK - Dev mailing list
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

Reply | Threaded
Open this post in threaded view
|

Re: WebAssembly Support

VTK - Dev mailing list
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 <[hidden email]> 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


_______________________________________________
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

Reply | Threaded
Open this post in threaded view
|

Re: WebAssembly Support

VTK - Dev mailing list
In reply to this post by VTK - Dev mailing list
On Wed, 2019-01-09 at 16:16 -0500, Ben Boeckel wrote:
> Brad did this at some point. What errors are you seeing? What are the
> OpenGL-related settings (see
> Utilities/OpenGL/vtkOpenGLOptions.cmake)?

This was a while ago, and I don't remember the details, but I know it
was attempting to use OpenGL functions that are not present in ES2/3.
Of course, this is probably because I hadn't actually told it to build
as ES3 - as you said, I will have to modify the CMake script to do
that.

Kyle
_______________________________________________
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

Reply | Threaded
Open this post in threaded view
|

Re: WebAssembly Support

VTK - Dev mailing list
In reply to this post by VTK - Dev mailing list
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 <[hidden email]> 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 <[hidden email]> 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
>>
_______________________________________________
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