This is a material that uses distance field to change colors depending on the distance of specified objects.
Material Graph for Interactive shield using the Distance To Nearest Surface node
A video of the shield material interacting with a simple sphere