Highlight world position

Hi all!
I need to implement the following functionality - there is an object, let’s say a plane, and it should be highlighted in the place where another object approaches, let’s say a sphere. The closer the sphere is to the plane, the brighter it is highlighted in this place. If the sphere is further than some distance from the sphere, then there is no highlighting. I don’t understand what nodes I need to use for such an implementation. I understand that you can’t do without a script-translator, which throws the coordinates of the sphere object into the plane shader. But this is my maximum at the moment in understanding what to do. Tell me please.

  1. You need to pass sphere position to the shader
  2. Find distance between that position and current pixel (subtract positions)
  3. Calculate magnitude of resulting vector to get distance between them
  4. Use this distance to do some stuff like for example I want pixel to be white when distance 0 and black at maxDistance, then
  5. Divide magnitude (distance) by maxDistance to get normalized value between 0 and 1 and use it to lerp between white and black
    5.1 It would be good to clamp result