Description
The EndDistance
property of the CubemapFogController
class specifies the distance from the player at which the fog effect reaches its full strength. This property is used to control the visual appearance of fog in a scene, allowing developers to create more immersive environments by adjusting how far the fog extends from the player before it becomes fully opaque.
Usage
To use the EndDistance
property, you need to have an instance of the CubemapFogController
class. You can set this property to a float
value representing the desired distance in the game world units. This value should be greater than the StartDistance
to ensure a smooth transition of the fog effect.
Example
// Create an instance of CubemapFogController
CubemapFogController fogController = new CubemapFogController();
// Set the distance at which the fog is at full strength
fogController.EndDistance = 1000.0f;
// Ensure the fog is enabled
fogController.Enabled = true;
// Optionally, set other properties to customize the fog effect
fogController.StartDistance = 500.0f;
fogController.Tint = new Color(0.5f, 0.5f, 0.5f, 1.0f);