Postprocess material outline with intersect

Using a Postprocess material I’m creating an outline of a mesh, using methods described <here>.

However, I would like the outline to highlight also where my mesh intersects with other meshes, for example using the “DistanceToNearestSurface” node. Any ideas on how to make this work in the Postprocess material? Using AbsoluteWordPosition (as described <here>) seem to work only for normal materials.