Table of Contents

Class FogComposer

Namespace
FishMMO.Client
Assembly
FishMMO.Client.dll

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

bool

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

bool

Base

The region fog, before weather. Taken from the scene on first use.

public static FogState Base { get; set; }

Property Value

FogState

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

bool

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

region FogState
amount float
color Color
addedDensity float
endDistance float

Returns

FogState

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

fog FogState

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

color Color

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)

Parameters

amount float
color Color
addedDensity float
endDistance float