Unfortunately, custom depth is a single pass. It stores depth for all enabled meshes.
The only way is to set custom depth enable for one mesh, and not set it for another, then proceed to a depth tests.
For many objects may be used a custom stencil buffer, but as custom depth it only stores one pass (all of the meshes on single image with different colors, i.e. no overlapping).
In Your example You just subtracting A from A, which leads to 0 (black).
Hi thanks for the fast reply. Not usual at weekend
It seems that the marketplace outline assets works with multiple occlusion detection. Is there a solution for this? Stencil is not what i need. I need a sort of mask to catch all occluded pixels from objects with custom depth enabled.
Best would be within the pp material. There is another solution, but for this i have to put a routine in every material that are used for custom depth objects.