New feature: Surface rendering with ambient shadows for improved depth perception

Slicer Preview Release uses an upgraded version of the VTK rendering library, which has many new rendering features that can make renderings in Slicer more realistic.

We exposed one of these new features: ambient shadows. These shadows make regions darker that are farther than nearby regions in the rendered image. The implementation is very fast, normally there should be no difference in rendering speed (the algorithm is called “screens space ambient occlusion”, as it performs computations in screen space).

Examples:

  1. Model with large space inside

  1. Model with small crevices

  1. Model with several flat, parallel surfaces

How to try:

  • Download latest Slicer Preview Release
  • Install Sandbox extension (in Examples category)
  • Go to “Lights” module
  • Select a 3D view and click “Setup lights”
  • Scroll down to “Ambient shadows” section and check “Enable”
  • Adjust the “Size scale” slider (it selects the size scale of relevant features)

Notes:

  • The shadows are applied to all nodes that are rendered as polygonal meshes (models, segmentations, fiber bundles, markups, etc.) but not to volume rendering.
  • Rendering results are typically better when surface normals are available. You can use Surface Toolbox module / Normals option to compute surface normals.
  • In the near future we will explore with enabling more of the recently added VTK rendering features, such as physically based rendering. If someone wants to explore these features then this example in the script repository is a good starting point.

Acknowledgment: This work was funded in part by NIH R01 HL153166, PI: M. A. Jolley (Children’s Hospital of Philadelphia - CHOP)

3 Likes

Thank you for the great work. It looks very nice …

1 Like

Very nice. For comparison, can you also post an image of how the surface looks like without ambient shadows?

1 Like

View 2 with ambient shadows

1 Like