Download

Tinting materials inside a mesh area

I’ve been trying to replicate this effect found in games like the Division and Xcom for some time:

As far as I can tell there’s some sort of spherical mesh writing to a custom depth buffer. However, I’m having some problems using this mask in a post processing shader that only tints objects inside the mask rather than rendering the whole thing. Does anyone have any pointers or tips on how to achieve this effect? I’d preferably like to avoid having every single object in the game check a buffer every time they render.

it’s just a post process material effect.

fade the scene color to a color of your choosing in a sphere mask:
Result:

Material

I have come across that approach before. I was trying to do it with more arbitrary shapes but I guess there just might be no easy way to go about it with just one or two shaders. I’ll present another way of achieving this in a more general way soon in case anyone needs a similar solution.

If you want to use a shape you should just cheat and use a trasparente material.
Just alpha mask the transparency with the distance from pivot in order to fade out, and move the shape around to create the effect.
Realistically, the end result is the same, even if maybe the PP is a little lighter on rendering cost and perhaps less prone to errors.
With a transparent material you may have sorting issues.