Order Independent Transparency in Unity

March 3, 2021

One year after announcing support for VTK into Unity, Kitware is pleased to present new features that have been integrated to the latest release of the VTKUnity-ActiViz plugin.

Among all changes, we would like to highlight the following:

  • Upgrade to VTK 9.0.1 to include the latest awesome features provided by the community.
  • Split of the VTK rendering pipeline into multiple render passes to minimize state changes between Unity and VTK. It is now fully interlaced within the Unity rendering pipeline.
  • Support Unity dual depth peeling to mix many VTK props with Unity game objects. Check out the VTK Technical Highlight: Dual Depth Peeling post for an extended presentation of the technique.

Order independent transparency

Prior to rendering, the Unity pipeline sorts the translucent objects from back to front, resulting in a correct alpha blending in most of the cases. However, this has some limitations when objects are intersecting each other.

Unity relies on the center of objects to sort them. As a result, rendering artefacts can appear when the order of centers changes. In opposition, dual depth peeling, presented on the right side of the image, produces the expected interlaced geometries.

Unity back-to-front sorting (left) compared to Unity dual depth peeling (right)

Supporting depth peeling also has a huge advantage when it comes to mixing rendering of VTK with Unity game objects. In previous versions of the plugin, VTK translucent actors and volumes were always rendered on top of the Unity scene. It now integrates seamlessly within the Unity depth peeling render passes, producing the expected compositing of objects from both VTK and Unity worlds.

VTK Volume rendering without (left) and with (right) depth peeling

Going further

We will continue working on better integration and seamless coexistence of the VTK and Unity scenes. Supporting depth peeling is already a huge step towards this goal, leveraging the use of native pointers for sharing resources. This brings up even more interesting topics, that we plan for the next release:

  • Share the Unity skybox with VTK.
  • Support rendering and interaction with VTK actors from the Unity Editor Scene View.
  • Implement a vtkPolyData-GameObjects bridge to process Unity geometries with VTK filters.

Visit kitware.eu/activiz/ to request a trial version of ActiViz for Unity.

Acknowledgement

This work was mainly supported by K2 Medical.

K2 Medical is developing an innovative dielectric imaging modality for structural heart disease that enables interventional cardiologists to image a variety of device implant procedures, using a standard disposable 3F multi electrode catheter.  K2 provides real time, 4 dimensional, high definition hybrid anatomical-functional images of the heart without the need of TEE and fluoroscopy.  K2 redefines interventional cardiac imaging by enabling interventional cardiologists full control of the imaging the procedure from access through validation, simplifying procedure logistics and improving overall procedure economics and outcomes.

Leave a Reply