Skip to content

Upgrade to VTK 9.1

Andrew Wilson requested to merge andrew.wilson/iMSTK:VTKUpgrade9_1 into master

This upgrades to VTK 9.1. This is super useful to us because it adds the clearcoat model which can be used to make internal organ tissues look wet. This also introduces a nice new fancy example, RenderingColonExample, which will take you on a journey through a very clean colon.


Summary of Changes:

  • Clearcoat model added in this MR
  • RenderingColon example added (as shown in gif) to show off the clearcoat model
  • VTKs VR interface changed, it was updated to appropriately.
    • This includes support for the rest of the Oculus Touch buttons & analog thumbsticks/trackpad.
  • Camera initialized to looking down z (ie: identity camera). Works best with VR when the user doesn't want to touch the camera.
  • When VR is used, the camera view is premultiplied to the VR one. This allows a user to still control the view & was implemented in OpenVRControllerExample with thumstick movement controls (left stick moves, right stick rotates view).
  • Some render/texture issues occurred with VTK 9.1. Various related texture features were updated.
    • Texture wrapping in iMSTK is given via an enum now.
    • Texture wrapping also allows a border color.
    • Various unused bits removed while I was in imstkTexture (from old integration with Vulkan).
      • ImageBasedLighting boolean in RenderMaterial.
      • Tessellated boolean in RenderMaterial
      • isParticle, isDecal, isLineMesh functions in RenderMaterial.
    • Rendering with edge visibility in PBR mode will make the texture appear whitish/low constrast.
    • Backface culling now makes hidden lines/edges invisible as well in WireframeSurface mode.
  • The VTKXRenderWindowInteractor ProcessEvents call was fixed in VTK 9.1. I have removed our custom version of it with the fix.
  • VTK appears to be using a different TBB version. Warnings were thrown by TBB so I upgraded the TBB version to resolve this.

A Note on VTK9 compatibility. The only VTK 9.1 dependent changes were in rendering & the SimulationManager's Viewer classes. If rendering & viewer is split off from SimulationManager & turned off, iMSTK can still be built with VTK 9.

Future note, this should make it easier to upgrade to VTK 10, or whatever is next. OpenXR is of interest to iMSTK and sitting in VTK master right now. We could start prototyping that now that this is dealt with. The VR interface needs to be expanded on a bit, that would be a good opportunity.

Addresses: #382 (closed)

Edited by Andrew Wilson

Merge request reports