# VTK Examples - WASM and CI/CD

**URL:** https://discourse.vtk.org/t/vtk-examples-wasm-and-ci-cd/13264
**Category:** Announcements
**Created:** [February 5, 2024, 9:34pm UTC](https://discourse.vtk.org/t/vtk-examples-wasm-and-ci-cd/13264 "2024-02-05T21:34:42Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)
#### Post date: [February 5, 2024, 9:34pm UTC](https://discourse.vtk.org/t/vtk-examples-wasm-and-ci-cd/13264/1 "2024-02-05T21:34:42Z")

</div>

The [VTK examples](https://examples.vtk.org/site/) have had a significant upgrade:

- WASM has been introduced for the C++ examples. This means that we have a live preview feature in WebAssembly for lots of the C++ examples.
- CI/CD (continuous integration and continuous delivery/deployment) is now running for the C++ examples

## WASM

For a complex example that loads lots of data from different files, please have a look at [PBR\_Skybox\_Texturing](https://examples.vtk.org/site/Cxx/Rendering/PBR_Skybox_Texturing/). Feel free to manipulate the image using the sliders and also do rotate/zoom the image. At the bottom of the WASM window you will see all the data files that are loaded.

## CI/CD

There is a nightly CI/CD run against the vtk/vtk-examples repository which builds and deploys the web site. This also provides an additional testing of the VTK Master against a broad range of examples. Updates will need to be made to the workflow to add the pipeline to Kitware US runners in order to make it work, please see [https://gitlab.kitware.com/vtk/vtk-examples/-/issues/13](https://gitlab.kitware.com/vtk/vtk-examples/-/issues/13) for more information.

## Things to watch out for

Not all C++ examples will work with WASM, please see [2\_NoWASMIntegration](https://examples.vtk.org/site/WASM/2_NoWASMIntegration/) for a list of excluded examples and the reasons why they were excluded.

If you want to contribute an example, please look at [4\_ContributingWASM](https://examples.vtk.org/site/WASM/4_ContributingWASM/). This is especially important if your example needs data. If your example doesn’t work with WASM then you will need to exclude it and provide a reason as outlined in [2\_NoWASMIntegration](https://examples.vtk.org/site/WASM/2_NoWASMIntegration/).

## Acknowledgements

All this work was undertaken by @astucky as part of his internship. The project was originally just to add WASM to the C++ examples.

However he went above and beyond by:

- Writing and compartmentalizing all the WASM scripts. This resulted in minimal changes to the existing scripts
- Clearly documenting reasons why a particular example will not work
- Devising a neat way of ensuring that the WASM examples could access their data
- Setting up CI/CD

We are all grateful for the massive amount of work that **Adrien** has done, and, to the guidance from @Jules_Bourdais and @ben.boeckel throughout the process. @jaswantp gets special mention for his great help with VTK-WASM, Adrien was really grateful for this help. Also for the sysadmins and others who made this all come together.

_Teamwork across many disciplines, works every time!_

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [February 6, 2024, 10:17am UTC](https://discourse.vtk.org/t/vtk-examples-wasm-and-ci-cd/13264/2 "2024-02-06T10:17:55Z")

</div>

This is spectacular !

---

<div class="post-metadata">

### Author: ![will.schroeder](https://discourse.vtk.org/user_avatar/discourse.vtk.org/will.schroeder/32/233_2.png) [@will.schroeder](https://discourse.vtk.org/u/will.schroeder)
#### Post date: [February 6, 2024, 11:12am UTC](https://discourse.vtk.org/t/vtk-examples-wasm-and-ci-cd/13264/3 "2024-02-06T11:12:03Z")

</div>

Wow, just wow!!!

Remind me, do we have any examples that show how to use wasm blobs in VTK.js, or in trame? I’m not sure such examples belong in VTK proper, but it’d be nice to show VTK wasm being used by other applications / inside other frameworks.

---

<div class="post-metadata">

### Author: ![Jules\_Bourdais](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jules_bourdais/32/7064_2.png) [@Jules\_Bourdais](https://discourse.vtk.org/u/Jules_Bourdais)
#### Post date: [February 7, 2024, 1:41pm UTC](https://discourse.vtk.org/t/vtk-examples-wasm-and-ci-cd/13264/4 "2024-02-07T13:41:34Z")

</div>

I know we have examples regarding using VTK.js with itk-wasm here: [vtk.js](https://kitware.github.io/vtk-js/examples/ItkWasmVolume.html) and [vtk.js](https://kitware.github.io/vtk-js/examples/ItkWasmGeometry.html)  
Regarding other examples related to VTK/trame, I don’t think we have examples but @Sebastien_Jourdain might be up to something with this.

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [February 8, 2024, 4:23pm UTC](https://discourse.vtk.org/t/vtk-examples-wasm-and-ci-cd/13264/5 "2024-02-08T16:23:04Z")

</div>

We did integrate into trame an external [vtk/wasm build](https://github.com/Kitware/trame-vtk3d/). I also did a lighting talk show casing that at our team meeting.

Also we are working to use VTK-wasm to support properly local rendering with trame using the same current API (provide server side vtkRenderWindow+widgets so it can be mirrored and rendered client side).
