I am currently working on a game with pre-rendered backgrounds. Therefore I use the 3d model of the rendered scene with a shader(invisible, hides 3d stuff behind it, casts and recieves shadows).
Now I want to cast realtime shadows from my character on the scene and there is the problem.
I want to show just the shadow that is castet by my character but only the parts of it which woudn’t be casted by my invisible scene.
I know it’s hard to understand so here you have some helping pictures:
Picture 1: No realtime shadows

Picture 2: Invisible scene recieves shadow from the character but doesn’t cast one

Picture 3: the region where i want to see the shadow from the character

Picture 4: Invisible scene recieves and casts shadows (picture gets too dark)
Everything i need to do would be something like using the shadows from the invisible scene as a mask for the character shadow but i have no idea how to do that.
I would be really happy if somebody can lead me in the right direction or comes up with a good idea.