I am trying to make a very similar effect the line of sight in the game Darkwood. Here is a video for reference:
Getting the line of sight is fairly easy to cause enemy units to be rendered or not, but I would like to make what is in the cone of vision brighter, sharper, more saturated, etc. How can I best either add a post process in a cone or remove a global post process in a cone that I can dynamically effect? Maybe adding a material to a cone shaped plane? Any suggestions would be appreciated!
Post process effects apply to the entire screen, but there are a couple ways to mask them into the cone shape that you want:
Use a mesh over top of the area you want to mask, set it to translucent, and use the “SceneTexture” node with the “Scene Color” setting. From there, nodes like cheap-contrast, add, power, and multiply can quickly modify the color. The downside is that you cannot use any other translucent materials under this one, since the cone needs to be set to 100% opacity for the full effect.
Add a cone shaped mesh to the scene, in its details, set “Render in Main Pass” to false, then set “Render Custom Depth” to true. Now, you can use the custom depth in a blendable material on your post process volume in order to to create the color shifting, sharpening, etc. Tom Looman goes into a fair bit of detail on this topic, so that’s a great place to start: