At edge of the view, fog near is further away. For example, notice the characters become more visible when I look around and they are near the edge of the viewport:
In reality, when we rotate our heads, fog doesn’t move away.
Seems like the distance calculation needs to start from the position of the camera.