Render mesh in front of another mesh but not in general

Hey there,
I was wondering if it is possible to let a mesh appear to be in front of another mesh even though it is behind it world space. I need it for an optical illusion.
I figured there is a Option in ShaderLab called ZTest Always.
In this example I’ve seperated the mesh into two pieces. The one behind the other has a shader with ZTest Always. Thats what it looks like:


It kind of does what I want it to do but there is a problem with this method.
If there is anything else, like a cube, on top of the mesh it appears to be behind the mesh again but it shouldn’t. That is the problem.

So I was wondering if there is a way to render the mesh only in front of a specific mesh but not all meshes.

I also stumbled across the option of sorting layers like it’s used by the SpriteRenderer only for the MeshRenderer (here) but it didn’t work for me.

I’ve also tried to change the “Custom Render Queue” of the Material but it didn’t work too.
I also couldn’t succeed with the Queue in the shader itself. I’ve tried something like this:

Shader "Queue"
{

	SubShader
	{
		Tags {  "Queue"="Geometry+1" }
		
		Pass
		{
....

What did I do wrong?
Thank you for reading.

Generally, shaders on 3d meshes write to (and cull based on) the depth buffer. That’s what the ZTest bit is for. So objects are drawn in front of others based on their distance to the camera.
In contrast, the default shaders used to draw 2d sprites do not write to the depth buffer - the order in which they are drawn is instead based on the sorting layer.

But there’s no reason why you can’t apply the logic used in the Sprites-Default shader, say, onto a 3d mesh - disable depth testing and use sorting layers instead (you might find installing the “Sorting Layer Exposed” component" from here helpful to assign layers to meshrenderers in the inspector: www.github.com/nickgravelyn/UnityToolbag)

I would watch this video about the making of monumentum valley. I believe they also talk a bit about pathfinding in combination with such illusions.