How to create a mesh which shadows only itself, and a shadowcaster mesh which shadows all but its visible counterpart?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By twi

Recently I created a simple function that aligns the an object’s mesh to one of a given number of orientations relative to the camera vector to emulate the look of multidirectional sprites (like what can be seen in DOOM engine games for example; I had this idea quite a while ago but seeing this video prompted me to realise I probably knew how to actually approach the problem by now and give it a shot). This was pretty straightforward, all things considered; had some difficulty manipulating the UP basis properly but i think i now have a better understanding of how to work with basis in Godot after stumbling on through it.

That all is not the point of the question, but it’s relevant as it causes undesired shadows, so I settled on the initial solution of disabling the mesh’s shadowcasting, and creating a shadows-only duplicate of it which is not subject to this transform. this creates a new problem, though:
(Ignore the line; RayCasts cast shadows when visible collision is on which is kind of silly but not really much of a problem)
When the mesh deviates from the shadowcaster mesh, this ugliness happens because the two meshes are now intersecting imperfectly. The desired outcome can be described like this – the invisible shadowcaster only casts shadows on the terrain and other objects, and ideally, the visible mesh can still cast shadows, but only on itself. (even if i wanted the compromise of no self-shadowing, given that many games that came before had no self-shadowing and often it would go completely unnoticed, “Do Not Receive Shadows” for example wouldn’t work because I still want it to receive shadows from objects other than the shadowcaster.)
Here’s a flowchart explaining the desired outcome if it helps:

I’ve tried using VisualInstance layers to get around this, but no particular configuration seems to do what I want. I thought to try creating a duplicate light that lights just the player’s mesh (putting those in a layer all by themselves), but it seems like objects receive shadows even from objects that are outside the light’s cull mask. Am I missing something here? I can turn up the bias by some amount, but that just causes other visual problems before this one is even solved. Is there any other way of achieving what I’m after? Thanks in advance for your thoughts.