I'm looking to create a shader in Eevee where object A inside of object B casts a ray/projection/mask over a set distance towards the camera to mask out its shape in object B. Here's what I've managed so far:
This works to an extent, however it's important that the projected silhouette of object A on object B is sharp and accurate. For this example I've used face corner values. While it could be made sharper by kicking up the subdivisions, this is not ideal. Here's how it looks up close:
(In the past I've used compositing to achieve the effect I'm looking for but with that method I would have over 20 render layers per character, since the character had to be cut into parts for the masking to function as intended.)
Though my understanding of the Cycles engine is limited I think it might be better suited to create a shader like this, but I hope to stick with the Eevee engine since it works well in my workflow.
If anything is unclear, let me know. Any suggestions are appreciated!