I don’t have much experience with materials or shaders; is there any way to create a mask that has parts of as sprite be transparent, and to have that mask only effect certain sprite sorting layers?
Check this thread… Sprite Renderer Mask on Specific Sorting Layer - Unity Engine - Unity Discussions
it has the info that you need.