Description
The HeightExponent
property of the CubemapFogController
class specifies the exponent used for calculating the height falloff of the fog effect. This property determines how the fog density changes with height, allowing for more realistic atmospheric effects. For example, setting this value to 2.0
will make the fog density proportional to the square of the height difference.
Usage
To use the HeightExponent
property, you can set it to a float
value that represents the desired exponent for the height falloff. This will affect how the fog density decreases or increases with height.
For instance, if you want the fog to become denser more quickly as you move upwards, you might set a higher exponent value. Conversely, a lower value will result in a more gradual change in fog density with height.
Example
// Example of setting the HeightExponent property
CubemapFogController fogController = new CubemapFogController();
fogController.HeightExponent = 2.0f; // Sets the height falloff to be proportional to the square of the height difference
// Adjusting the HeightExponent to achieve different fog effects
fogController.HeightExponent = 1.0f; // Linear height falloff
fogController.HeightExponent = 3.0f; // Cubic height falloff