How to render a character through walls with full texture set

Struggling with a year with this problem.

I know how to use a post process material to render a character in flat shade through walls or an outline…but I need to be able to render his texture sets as well. Is there a way to do this? I know depth priority groups don’t work anymore but they were seriously useful for things like 3D side-scrollers

See how the Boo ghosts are rendered on top and don’t clip through

See how donkey kong is rendered on top

Let’s assume you have set the custom stencil value of the main character to 1 for example. If you use translucent materials for the walls or platform, you could set the opacity to 0 if the pixel’s custom stencil value equals the character’s stencil value. The downside with this method is that you would have to put this logic in the material for anything that you want the main character to draw over.

you could set the opacity to 0 if the pixel’s custom stencil value equals the character’s stencil value

Are you sure? For my knowledge that’s impossible. Since stencil buffer is available in post process shaders only, and you can’t control opacity of a generic shader from post process (well, cause it’s POST rendering stage).

I think translucent materials can still read the stencil buffer. At least I thought I could in 4.15. I would test it right now, but I don’t have access to UE4. Perhaps doing this requires some special configuration that I forgot about?

thank you guys for the answers, do you perchance have any examples of this setup?