Fogclass

Authors a fog layer's distance, height and colour settings, with optional directional colour from a sky material. Settings are resolved separately for each camera so scene sky colours follow that camera's visibility.

object→BasePostProcess<T>→Fog
Namespace
Sandbox
Assembly
Sandbox.Engine
Declaration
public sealed class Sandbox.Fog : Sandbox.BasePostProcess<T>

Constructors1

Showing 1 constructors

public Fog()PUBLICCONSTRUCTOR

Methods1

Showing 1 methods

public virtual void Render()PUBLICVIRTUAL

Blend each owner's complete settings once, preserving the unresolved legacy fog share.

Returns:void—

Properties33

Showing 33 properties

public float Sandbox.Fog.AttenuationDistance { get; set; }PUBLICGETSET

Distance removing approximately 63 percent of background light, in engine units.

Returns:float—

public Color Sandbox.Fog.Color { get; set; }PUBLICGETSET

Fog colour, or tint applied to the sky colour. Alpha does not control opacity.

Returns:Color—

public Sandbox.FogColorSource Sandbox.Fog.ColorSource { get; set; }PUBLICGETSET

Constant colour, or directional colour sampled from a sky material.

Returns:FogColorSource—

public virtual int Sandbox.Fog.ComponentVersion { get; set; }PUBLICVIRTUALGETSET

Returns:int—

public bool Sandbox.Fog.DistanceEnabled { get; set; }PUBLICGETSET

Whether distance fog contributes. Height fog can remain enabled independently.

Returns:bool—

public Vector2 Sandbox.Fog.DistanceRange { get; set; }PUBLICGETSET

Start and end distances of the artistic fog ramp, in engine units.

Returns:Vector2—

public float Sandbox.Fog.FalloffExponent { get; set; }PUBLICGETSET

Exponent of the artistic distance ramp.

Returns:float—

public bool Sandbox.Fog.FogEnabled { get; set; }PUBLICGETSET

Whether this layer draws fog. False explicitly suppresses fog; disabling the component instead inherits surrounding fog.

Returns:bool—

public Color Sandbox.Fog.HeightColor { get; set; }PUBLICGETSET

Height fog color or sky tint. Alpha sets its maximum opacity independently of distance fog.

Returns:Color—

public Sandbox.FogColorSource Sandbox.Fog.HeightColorSource { get; set; }PUBLICGETSET

Constant color, or directional color sampled from a sky independently of distance fog.

Returns:FogColorSource—

public bool Sandbox.Fog.HeightEnabled { get; set; }PUBLICGETSET

Draw a height gradient independently of distance fog.

Returns:bool—

public float Sandbox.Fog.HeightExponent { get; set; }PUBLICGETSET

Curve applied to the height gradient, independently of the distance curve.

Returns:float—

public float Sandbox.Fog.HeightGradientLength { get; set; }PUBLICGETSET

World distance from full fog to clear. Positive fades upward; negative fades downward. Zero creates a hard boundary at HeightOffset.

Returns:float—

public float Sandbox.Fog.HeightOffset { get; set; }PUBLICGETSET

Offset above the GameObject's world Z position where height fog reaches full opacity.

Returns:float—

public Sandbox.Material Sandbox.Fog.HeightSky { get; set; }PUBLICGETSET

Sky material used by height fog's Custom Sky source. Missing textures use the constant color.

Returns:Material—

public float Sandbox.Fog.HeightSkyBlur { get; set; }PUBLICGETSET

Blur applied to the height fog sky source, independently of distance fog.

Returns:float—

public virtual bool Sandbox.Fog.IsCameraEffect { get; set; }PUBLICVIRTUALGETSET

Fog supplies material settings during camera preparation without drawing a fullscreen pass.

Returns:bool—

public float Sandbox.Fog.MaxDistance { get; set; }PUBLICGETSET

Distance used to evaluate background fog where the sky has no finite surface depth.

Returns:float—

public float Sandbox.Fog.MaximumOpacity { get; set; }PUBLICGETSET

Upper limit on distance fog opacity, independent of the colour's alpha.

Returns:float—

public Sandbox.Rendering.FogMode Sandbox.Fog.Mode { get; set; }PUBLICGETSET

Distance uses an artistic start/end ramp; exponential uses a physically defined attenuation distance.

Returns:FogMode—

public Sandbox.Material Sandbox.Fog.Sky { get; set; }PUBLICGETSET

Sky material used by Custom Sky. Missing textures fall back to the constant colour.

Returns:Material—

public float Sandbox.Fog.SkyAffect { get; set; }PUBLICGETSET

How strongly fog covers the sky, independently of using sky colours for fog.

Returns:float—

public float Sandbox.Fog.SkyBlur { get; set; }PUBLICGETSET

Blur applied when sampling sky colours, or the near blur when the distance ramp is enabled.

Returns:float—

public bool Sandbox.Fog.SkyBlurDistanceEnabled { get; set; }PUBLICGETSET

Vary sky blur with distance instead of using a fixed value.

Returns:bool—

public Vector2 Sandbox.Fog.SkyBlurDistanceRange { get; set; }PUBLICGETSET

Distances where sky blur starts and finishes changing, in world units.

Returns:Vector2—

public float Sandbox.Fog.SkyBlurFar { get; set; }PUBLICGETSET

Sky blur at the end of the ramp. Values below SkyBlur sharpen with distance; values above it blur with distance.

Returns:float—

public float Sandbox.Fog.StartDistance { get; set; }PUBLICGETSET

Distance from the camera before exponential fog starts, in engine units. Distance is measured in three dimensions.

Returns:float—

public float Sandbox.Fog.SunFadeDistance { get; set; }PUBLICGETSET

Distance over which sun lighting smoothly fades in. Zero gives a hard start; negative values reverse the fade.

Returns:float—

public float Sandbox.Fog.SunIntensity { get; set; }PUBLICGETSET

Multiplier for the dominant sun's color. Reduce this when the sky texture already contains a bright sun.

Returns:float—

public bool Sandbox.Fog.SunLightingEnabled { get; set; }PUBLICGETSET

Add an unshadowed sun-facing glow to distance fog, independently of volumetric lighting.

Returns:bool—

public float Sandbox.Fog.SunLobeWidth { get; set; }PUBLICGETSET

Angle from the sun where the glow reaches half intensity, in degrees. Larger angles give a broader glow.

Returns:float—

public float Sandbox.Fog.SunSaturation { get; set; }PUBLICGETSET

Sun glow saturation. Zero is greyscale, one preserves the light's color, and higher values strengthen it.

Returns:float—

public float Sandbox.Fog.SunStartDistance { get; set; }PUBLICGETSET

Distance from the camera where the sun glow starts fading in, in world units.

Returns:float—

On this page

Constructorspublic Fog()Methodspublic virtual System.Void Render()Propertiespublic System.Single Sandbox.Fog.AttenuationDistance { get; set; }public Color Sandbox.Fog.Color { get; set; }public Sandbox.FogColorSource Sandbox.Fog.ColorSource { get; set; }public virtual System.Int32 Sandbox.Fog.ComponentVersion { get; set; }public System.Boolean Sandbox.Fog.DistanceEnabled { get; set; }public Vector2 Sandbox.Fog.DistanceRange { get; set; }public System.Single Sandbox.Fog.FalloffExponent { get; set; }public System.Boolean Sandbox.Fog.FogEnabled { get; set; }public Color Sandbox.Fog.HeightColor { get; set; }public Sandbox.FogColorSource Sandbox.Fog.HeightColorSource { get; set; }public System.Boolean Sandbox.Fog.HeightEnabled { get; set; }public System.Single Sandbox.Fog.HeightExponent { get; set; }public System.Single Sandbox.Fog.HeightGradientLength { get; set; }public System.Single Sandbox.Fog.HeightOffset { get; set; }public Sandbox.Material Sandbox.Fog.HeightSky { get; set; }public System.Single Sandbox.Fog.HeightSkyBlur { get; set; }public virtual System.Boolean Sandbox.Fog.IsCameraEffect { get; set; }public System.Single Sandbox.Fog.MaxDistance { get; set; }public System.Single Sandbox.Fog.MaximumOpacity { get; set; }public Sandbox.Rendering.FogMode Sandbox.Fog.Mode { get; set; }public Sandbox.Material Sandbox.Fog.Sky { get; set; }public System.Single Sandbox.Fog.SkyAffect { get; set; }public System.Single Sandbox.Fog.SkyBlur { get; set; }public System.Boolean Sandbox.Fog.SkyBlurDistanceEnabled { get; set; }public Vector2 Sandbox.Fog.SkyBlurDistanceRange { get; set; }public System.Single Sandbox.Fog.SkyBlurFar { get; set; }public System.Single Sandbox.Fog.StartDistance { get; set; }public System.Single Sandbox.Fog.SunFadeDistance { get; set; }public System.Single Sandbox.Fog.SunIntensity { get; set; }public System.Boolean Sandbox.Fog.SunLightingEnabled { get; set; }public System.Single Sandbox.Fog.SunLobeWidth { get; set; }public System.Single Sandbox.Fog.SunSaturation { get; set; }public System.Single Sandbox.Fog.SunStartDistance { get; set; }Metadata