Calculates a 0-1 opacity fade based on distance.
Used to smoothly hide UI elements as they get further from or closer to the camera.
Current distance from camera.
Distance where fading begins.
Distance where element is fully transparent.
Opacity value (0-1).
Calculates a 0-1 opacity fade based on distance.
Used to smoothly hide UI elements as they get further from or closer to the camera.