Screen-space ambient occlusion for volume rendering

Quick comparison of SSAO for surface and volume.
The iso surface value used for extraction corresponds to the half of the volume’s scalar range.
The opacity function used for volume rendering is a ramp with value 0.0 before the half of the volume’s scalar range, and 1.0 after. No gradient function was used.

Inspecting the computed SSAO textures in RenderDoc shows how sensitive to normal computation the SSAO algorithm is. While the surface is perfectly smooth, voxels appear on the volume and make it appear darker. This effect should be mitigated when using a smooth transfer function and a gradient function to improve normals.