How can the occlusion transparency feature be implemented in a 2D game?

Godot Version

v4.3.rc3.official [03afb92ef]

Question

I would like to implement a feature where, when the player is behind objects such as buildings, trees, or bushes, the occluding object becomes partially transparent so that the player can be seen, as shown in the image below.

Is there any existing code or implementation approach that I can refer to? It’s important to note that the transparency should be localized and not applied to the entire occluding object.

If you have a good implementation method or approach, I would appreciate your assistance.

I need help.

You could have a global player_position uniform. Then have all the buildings etc. use a shader that makes the area near the player_position transparent.

Quick search gave this tutorial: https://www.youtube.com/watch?v=-YMVdnQGuhk

Not the same exact technique I described but seems similar.