Skip to content

Add ambient occlusion to surfaces

Summary

Ambient occlusion is a rendering technique that can be used to Adding ambient occlusion can help improve the depth in the image and make detailed surfaces more clear. In this tutorial, you will learn how to apply ambient occlusion to a napari surface layer using the "ambient occlusion controls" plugin.

Instructions

  1. Open the ambient_occlusion_plugin.py example. The viewer is initialized in 3D rendering mode and should display a mesh of a triceratops.

    example loaded

  2. Select the "triceratops" layer from the plugin selection box and click the "update ambient occlusion" button. This should complete quickly for the triceratops mesh. For larger meshes, this will take longer.

    select_layer

  3. You should now see the triceratops has shadows in regions that would be blocked from ambient light.

  4. You can deactivate the ambient occlusion by de-selecting the layer in the plugin selection box and clicking the "update ambient occlusion" button.