Struct LinearFog ​
Namespace: ValveResourceFormat.Renderer.SceneEnvironment
Assembly: Renderer.dll
The fog an env_fog_controller sets: a color faded in with distance from a start to an end distance, up to a maximum density. Of what is drawn, only the sky reads it: a sky fogged by distance fades toward its color as far away as the far plane, and a sky fogged by angle fades toward its color.
public readonly record struct LinearFog : IEquatable<LinearFog>Implements ​
Constructors ​
LinearFog(Vector3, float, float, float, float) ​
The fog an env_fog_controller sets: a color faded in with distance from a start to an end distance, up to a maximum density. Of what is drawn, only the sky reads it: a sky fogged by distance fades toward its color as far away as the far plane, and a sky fogged by angle fades toward its color.
public LinearFog(Vector3 Color, float Start, float End, float MaxDensity, float Exponent)Parameters ​
Color Vector3
The linear color the fog fades toward.
Start float
The distance the fog starts at.
End float
The distance the fog reaches its full density at.
MaxDensity float
The most the fog covers, from zero to one.
Exponent float
The power the fraction of the way from start to end is raised to.
Properties ​
BlendDirection ​
Gets the direction to look in to see only LinearFog.Color, or null to not blend colors.
public Vector3? BlendDirection { get; init; }Property Value ​
Color ​
The linear color the fog fades toward.
public Vector3 Color { get; init; }Property Value ​
End ​
The distance the fog reaches its full density at.
public float End { get; init; }Property Value ​
float
Exponent ​
The power the fraction of the way from start to end is raised to.
public float Exponent { get; init; }Property Value ​
float
FarZ ​
Gets the distance the view is clipped at, or zero or less to keep its far plane.
public float FarZ { get; init; }Property Value ​
float
MaxDensity ​
The most the fog covers, from zero to one.
public float MaxDensity { get; init; }Property Value ​
float
None ​
Gets the fog a map without a fog entity is drawn with: black, and nowhere dense.
public static LinearFog None { get; }Property Value ​
SecondaryColor ​
Gets the linear color blended in while looking away from LinearFog.BlendDirection.
public Vector3 SecondaryColor { get; init; }Property Value ​
Start ​
The distance the fog starts at.
public float Start { get; init; }Property Value ​
float
Methods ​
GetAmount(float) ​
Gets how much of what is a distance away the fog covers.
public float GetAmount(float distance)Parameters ​
distance float
The distance from the viewer, which may be infinite.
Returns ​
float
The amount, from zero to one.
GetColor(Vector3) ​
Gets the color the fog fades toward while looking in a direction.
public Vector3 GetColor(Vector3 viewForward)Parameters ​
viewForward Vector3

