Hiding overlapping clothing with a shader

I currently have this issue. I know i can fix this by dragging it away from the body but i want to know how to fix it using a shader if possible

4199125--372961--Capture.PNG

I’m trying to figure out how to make sure that the trousers is always on top of the body.

I can achieve this in various different ways e.g. offset, stencil, ZWrite, ZTest etc. but then I end up with this problem


I don’t want to be able to see through the body.

I am currently using a surface shader as I need the two objects to react to lighting.

Any suggestions on how I might be able to overcome this issue?

thanks,

I’ve tried using Stencils but don’t fully understand it yet and also it doesn’t really seem to do anything in a surface shader.