# Screen-space ambient occlusion for volume rendering

**URL:** <https://discourse.slicer.org/t/screen-space-ambient-occlusion-for-volume-rendering/32323>\
**Category:** Development\
**Tags:** volume-rendering\
**Created:** [October 19, 2023, 9:16am UTC](https://discourse.slicer.org/t/screen-space-ambient-occlusion-for-volume-rendering/32323 "2023-10-19T09:16:17Z")\
**Posts on this page:** 1\
**Showing post:** 44

<div class="post-metadata">

**Author:** ![LucasGandel](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lucasgandel/32/18202_2.png) [@LucasGandel](https://discourse.slicer.org/u/LucasGandel)\
**Post date:** [December 1, 2023, 7:13am UTC](https://discourse.slicer.org/t/screen-space-ambient-occlusion-for-volume-rendering/32323/44 "2023-12-01T07:13:39Z")

</div>

The final change ([VTK!10725](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/10725)) has been merged! 🚀  
This makes SSAO available for volumes, but not with the vtkRenderer::UseSSAOOn() function, you must explicitly set the render passes like this:

```auto
 // Render passes setup
  vtkNew<vtkRenderStepsPass> basicPasses;
  vtkNew<vtkSSAOPass> ssao;
  ssao->SetRadius(40);
  ssao->SetKernelSize(128);
  ssao->SetBias(0.01);
  ssao->BlurOn();
  // The depth format must be Fixed32 for the volume mapper to successfully copy the depth texture
  ssao->SetDepthFormat(vtkTextureObject::Fixed32);
  ssao->SetVolumeOpacityThreshold(0.95);
  ssao->SetDelegatePass(basicPasses);

  renderer->SetPass(ssao);

```

I’ll start working on screenshots and will try to kick off a doc for technical writing.

---

_[View the full topic](https://discourse.slicer.org/t/screen-space-ambient-occlusion-for-volume-rendering/32323)._
