Shader to occlude what is behind

Hi,
I want to use a material / shader which applied to a surface occlude everything that is behind this surface and render everything that is in front. If an object in between, this object will be sliced by the surface. Do you know how to achieve this or if this material / shader exists ? Many thanks in advance for your help.