Hi there!
I’m attempting to create a visual effect similar to the “out of sight” mechanic in Mark of the Ninja. In this effect, there’s a vision radius emanating from the player character, with everything within this radius appearing in full color and clarity. However, objects obstructed by environmental elements such as walls, floors, or doors are desaturated and blurred.
I’ve included a screenshot to illustrate what I’m aiming for:
You can see this effect in action in this part of the video:
The closest methods I’ve found to achieve this are demonstrated in this video:
The creator uses code to draw a mesh, overlays a dark sprite above the scene, and employs a Forward Renderer to mask the dark sprite based on the mesh.
Additionally, I came across this informative article: SIGHT & LIGHT - How to create 2D visibility/shadow effects for your game.
However, as I’m not yet familiar with renderers and shaders, I’m struggling to understand the purpose of each element in these solutions.
My concern is achieving a smooth, gradual transition between the visible and out-of-sight effects. Using a mesh seems to result in a sharp transition.
I’m reaching out because I’m unsure where to begin. I’ve tried searching for terms like “fog of war” or “sight effect,” but I’m not sure which Unity 2D SDK components I need to learn and utilize.
Thank you in advance for any guidance you can provide!
