I am currently working on a third-person game with a camera far from the player. As the player travels through the map, some objects occlude him from the camera.
I am using the simple BP solution when I make a capsule multitrace from camera to char and hide all objects hit by trace (and unhide all objects not occluding player any more). I also use custom depth stencil outline for player, in case hiding object is not enough. The next thing I would do is instead of hiding storing the object’s material in the array and setting it’s material to transparent fading material, so it looks like the object fades away when the character is running behind it.
However, all these solutions are far from production-level stuff I would like to have. During one of Epic’s live streams, the guy showed a translucent material which was reading player’s position from dynamic parameters and making the part of itself which obstructs player transparent in a sphere radius. Like this:
Now, there is no way we can afford, both in terms of performance and man power, turning every object’s material into custom translucent material with this depth/location-based functionality. The only way around I see is going into engine srcs and extending Opaque blend mode’s code to employ this player-detecting code (player location would be supplied by Cpp pawn data, I guess; a checkbox disabling the code can also be added into material editor to disable the code).
The problem is - I have no idea how hard it is to put this code into the code for Opaque blending. I also don’t know (yet) where to start looking into those engine shaders.