Edit this page

NA-MIC Project Weeks

Back to Projects List

Cinematic rendering in Slicer leveraging VTK Physically Based Rendering (PBR)

Key Investigators

Project Description

Objective

Approach and Plan

  1. Review accessible offerings on cinematic rendering (VTK PBR, VTK backends: OSPRay and OptiX, omniverse, etc) that can be utilized inside Slicer.
  2. Develop prototypes showing how these can be enabled and used in Slicer.
    • Start with surface rendering (PBR, ambient occlusion, global ilumination)
    • Investigate what capabilities can be enabled for volume rendering (perhaps OSPRay).
    • Tradeoffs: Performance vs Image Quality without degrading user experience.
    • Changes to user interface, parameters tuning, simplification.
  3. Review existing Slicer modules (such as Light Module) that enhance Slicer’s rendering capabilities and evaluate how these can be included in the current effort.
  4. Evaluate how integrating these in Slicer will affect other modules such as LookingGlass, OpenXR, etc.

Progress and Next Steps

Use of vtkSSAOPass class to generate ambient occlusion (AO) for volumes:

with stack trace of at vtksys::SystemInformationImplementation::GetProgramStack in C:\D\slicer-d1\VTK\Utilities\KWSys\vtksys\SystemInformation.cxx line 3979 at vtksys::SystemInformation::GetProgramStack in C:\D\slicer-d1\VTK\Utilities\KWSys\vtksys\SystemInformation.cxx line 829 at anonymous namespace'::reportOpenGLErrors in C:\D\slicer-d1\VTK\Rendering\OpenGL2\vtkOpenGLState.cxx line 294 at vtkOpenGLState::SetEnumState in C:\D\slicer-d1\VTK\Rendering\OpenGL2\vtkOpenGLState.cxx line 1069 at vtkOpenGLState::ScopedglEnableDisable::~ScopedglEnableDisable in C:\D\slicer-d1\VTK\Rendering\OpenGL2\vtkOpenGLState.h line 299 at vtkOpenGLState::vtkglBlitFramebuffer in C:\D\slicer-d1\VTK\Rendering\OpenGL2\vtkOpenGLState.cxx line 1758 at vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::CaptureDepthTexture in C:\D\slicer-d1\VTK\Rendering\VolumeOpenGL2\vtkOpenGLGPUVolumeRayCastMapper.cxx line 817 at vtkOpenGLGPUVolumeRayCastMapper::GPURender in C:\D\slicer-d1\VTK\Rendering\VolumeOpenGL2\vtkOpenGLGPUVolumeRayCastMapper.cxx line 3102 at vtkGPUVolumeRayCastMapper::Render in C:\D\slicer-d1\VTK\Rendering\Volume\vtkGPUVolumeRayCastMapper.cxx line 171 at vtkVolume::RenderVolumetricGeometry in C:\D\slicer-d1\VTK\Rendering\Core\vtkVolume.cxx line 380 at vtkProp::RenderFilteredVolumetricGeometry in C:\D\slicer-d1\VTK\Rendering\Core\vtkProp.cxx line 324 at vtkDefaultPass::RenderFilteredVolumetricGeometry in C:\D\slicer-d1\VTK\Rendering\OpenGL2\vtkDefaultPass.cxx line 167 at vtkVolumetricPass::Render in C:\D\slicer-d1\VTK\Rendering\OpenGL2\vtkVolumetricPass.cxx line 44 at vtkSequencePass::Render in C:\D\slicer-d1\VTK\Rendering\OpenGL2\vtkSequencePass.cxx line 71 at vtkCameraPass::Render in C:\D\slicer-d1\VTK\Rendering\OpenGL2\vtkCameraPass.cxx line 145 at vtkRenderStepsPass::Render in C:\D\slicer-d1\VTK\Rendering\OpenGL2\vtkRenderStepsPass.cxx line 207 at vtkSSAOPass::RenderDelegate in C:\D\slicer-d1\VTK\Rendering\OpenGL2\vtkSSAOPass.cxx line 240 at vtkSSAOPass::Render in C:\D\slicer-d1\VTK\Rendering\OpenGL2\vtkSSAOPass.cxx line 499 at vtkOpenGLRenderer::DeviceRender in C:\D\slicer-d1\VTK\Rendering\OpenGL2\vtkOpenGLRenderer.cxx line 285 at vtkRenderer::Render in C:\D\slicer-d1\VTK\Rendering\Core\vtkRenderer.cxx line 385 at vtkRendererCollection::Render in C:\D\slicer-d1\VTK\Rendering\Core\vtkRendererCollection.cxx line 53 at vtkRenderWindow::DoStereoRender in C:\D\slicer-d1\VTK\Rendering\Core\vtkRenderWindow.cxx line 347 at vtkRenderWindow::Render in C:\D\slicer-d1\VTK\Rendering\Core\vtkRenderWindow.cxx line 306 at vtkOpenGLRenderWindow::Render in C:\D\slicer-d1\VTK\Rendering\OpenGL2\vtkOpenGLRenderWindow.cxx line 2345 at main in C:\D\Shadows\Shadows.cxx line 132 ``

Adapt vtkSSAOPass to create local ambient occlusion (LAO) implementation for volumes:

Through discussions with the VTK team (Timothee Chabat, Mathieu Westphal), we identified another feature which could help improve shading in volume rendering:

4

Image Courtesy: Gaspard Thevenon

Illustrations

Background and References

Related modules:

Slicer Discourse References:

  1. https://discourse.slicer.org/t/how-to-perform-3d-cinematic-rendering/7313
  2. https://discourse.slicer.org/t/is-there-interest-in-higher-quality-rendering-for-slicer/6862/5
  3. https://discourse.slicer.org/t/2021-01-19-hangout/15585/2

VTK References:

  1. VTK PBR https://www.kitware.com/vtk-pbr/
  2. PBR integration in Paraview https://www.kitware.com/physically-based-rendering-improvements-in-paraview/
  3. Related merge request for VTK https://gitlab.kitware.com/vtk/vtk/-/merge_requests/5584