Class FogComposer
The one writer of the scene's fog: the region's fog is the base, the weather's is laid on top. Region fog changes go to Base; weather goes to SetWeather(float, Color, float, float).
public static class FogComposer
- Inheritance
-
FogComposer
- Inherited Members
Fields
EditorFogOff
The editor's fog switch (Dashboard → Weather Tools → Fog): kept in EditorPrefs and set again after every domain reload. Always false in a build. Core so the fog's off switch reaches the region's fog without the weather.
public static bool EditorFogOff
Field Value
Properties
Active
Whether the fog written fogs anything: what RenderSettings.fog said before it stayed on. Read this, not
RenderSettings.fog, which is now on whatever the fog does.
public static bool Active { get; }
Property Value
Base
The region fog, before weather. Taken from the scene on first use.
public static FogState Base { get; set; }
Property Value
DrawFog
Whether any fog is drawn: off, the region's fog and the weather's all stop at once.
public static bool DrawFog { get; }
Property Value
Methods
Apply()
public static void Apply()
Compose(FogState, float, Color, float, float)
The combined fog for a base and a weather contribution.
public static FogState Compose(FogState region, float amount, Color color, float addedDensity, float endDistance)
Parameters
Returns
Reset()
Forgets the base (a new scene brings its own) and the weather.
public static void Reset()
SetRegionFog(FogState)
Sets the region fog, marking its colour as the region's own (it then beats the sky's).
public static void SetRegionFog(FogState fog)
Parameters
fogFogState
SetSkyColor(Color)
The sky's horizon colour. Fog takes it unless a region set its own colour, so distant ground and sky meet without a seam.
public static void SetSkyColor(Color color)
Parameters
colorColor
SetWeather(float, Color, float, float)
The weather's share (0..1), its colour, the extinction it adds (1/m, exponential fog) and the visibility it pulls a linear fog's end to (m) — all of them the distance fog's part of the weather only (WeatherFogPresenter.UniformExtinction): what is falling, and the fog's drops only where nothing draws their layer. While the cloud march draws the fog, handed the drops here as well they would take their light twice, once in the layer and again as a flat wash over everything — and switch this fog on, which melts the sky's horizon into it.
public static void SetWeather(float amount, Color color, float addedDensity, float endDistance)