Shader that hides/cuts objects between the player and the camera

Godot Version

4.2.1

Question

Hello everyone. I went on a bit of a search to find a good way to hide things between the camera and the player. Most solutions suggest using a raycast to hide whole objects. I wonder if there is a way to do a similar effect to say Baldursgate 3, where only sections get cut out in order to allow seeing the player. Image for reference:

image

2 Likes

So far I’ve only found that one can shoot a ray from the camera to the players, gathering up objects and applying this dissolve shader to each one, or you can potentially render the scene twice, both the background and the foreground and dissolve out the foreground. I haven’t tried either, they both sound quite tedious.