On the World tab, there's an Ambient Occlusion setting that allows you to sort of add indirect lighting to the scene. The manual says that this effect can also be applied on a per-shader basis using the Ambient Occlusion node.
The node in question has a Color and an AO output, and I understand that these can be used to create cavity masks and such. However... how exactly do I use this node to replicate the "add indirect lighting" effect of the Ambient Occlusion setting on the World tab?
More precisely, how would one go about integrating the Ambient Occlusion node into an existing material in order to replicate the World Ambient Occlusion setting (Factor + Distance) on a per-shader basis?