How can I approach making a top down line of sight/object fade system?

I haven’t found much regarding the topic so I am going to ask here. Is anyone familiar with these types of systems and how to even start making them? What I am referring to is the way line of sight works in games like Diablo, Path of Exile, XCOM2. Whenever a character would be near an object that object would have a kind of fade effect or in the case of walls, half/3 quarters of the wall would disappear so you can see that character.

As far as I have seen, just the line of sight is a post process material which shouldn’t be too tough to make (very basic black one). On the other end I have no idea how to start on the other thing. In my game the camera cannot be rotated. I’d like to hide walls/objects that are obstructing the player and the enemies but not fully, the player should still be aware that there is a wall next to them.

^ Above video shows kind of what I am going for, however the creator mentions several times that it was very, very complicated to make and it influences the way assets need to be made for the game (i.e. walls in two parts or two different wall meshes). I definitely need to know how assets need to be created in order to do so but on the other end I am not sure if I alone can pull this off.

Thanks for the reply! I have adjusted that to fit my own game and it is working as intended. One thing I am however curios about is how to approach the material change? I do not want the Fade Material to become the other meshes material, just want to change the opacity of the already existing material when actors are occluded. Is it possible to do this in C++? Is there any way I could maybe add a mask to it or something else?

It’s possible but you’d have to edit all your materials to make them Translucent and add an Opacity parameter. Then you can easily control that opacity parameter without replacing the existing materials. But making all your materials translucent with parameter can be very tedious.

The main advantage of the snippet is that it doesn’t require any change to the rest of the game. So yes in that scenario the fade material is gonna be the same for all meshes.