We have created two effectors and named them "Far" and "Near". Since the fog values in Animator are always the distance to the camera you are currently using we will use the effectors positions to calculate the distance to the camera position and feed the result into the fog channels.
World.Fog.FogInsideRadius = distance( Camera_1.Position, Near.Position );
World.Fog.FogOutsideRadius = distance( Camera_1.Position, Far.Position );
The distance function uses two vector arguments and returns the current distance between the two vectors. The distance between the Near effector and the Camera will be assigned to the Inside Fog Radius. The distance between the Far effector and the Camera will be assigned to the Outside Fog Radius.
|