Using One Object to Constrain Another’s Visibility in Eevee

I have two objects, each with its own material that I want to preserve: Object 1 is the Card, and Object 2 is the Character. I’m aiming for a real-time setup in Eevee where any parts of the Character that extend beyond the boundaries of the Card become invisible, based on the camera’s view.

Is there maybe a way in Blender to have two objects with different shaders, where I can set up Object 1’s shader to reference Object 2 directly as a texture or input, entirely within the Shader Editor?
The effect I’m trying to copy is from a game made in Unity. It’s used for a Parallax effect and somewhere along the shader pipeline they seem to be using a Stencil Mask. The character itself is not a texture, but a 3d object/mesh that has some depth to it.

After days of trying and countless hours of googling I’m not even sure it’s technically possible to make this work in eevee for the real-time viewport. If there’s anyone able to offer help or any pointers that could guide me I’d really appreciate it.
I’ve watched several videos about “parallax cards” or “Portal Effects”. But unless I’m missing something, none of these seem to offer what I’m looking for.

Please see the references for more clarity.


1 Like

Quick idea:

You maye have a look at the portal node feature of the newer blender versions… (?)