FogSettings - jimdroberts/FishMMO GitHub Wiki
Serializable class for configuring fog settings in a region, including mode, color, density, and transition properties. Used to control environmental fog effects in FishMMO regions.
-
public bool Enabled
Whether fog is enabled for the region.
-
public float ChangeRate
The rate at which fog settings change (e.g., for smooth transitions between regions).
-
public FogMode Mode
The mode of the fog (Linear, Exponential, ExponentialSquared).
-
public Color Color
The color of the fog.
-
public float Density
The density of the fog (used in exponential modes).
-
public float StartDistance
The starting distance from the camera where fog begins (used in linear mode).
-
public float EndDistance
The ending distance from the camera where fog reaches full effect (used in linear mode).
- Create and configure a
FogSettings
instance for a region. - Set the desired fog mode, color, density, and transition parameters.
- Apply the settings to the region's environment controller or rendering system.
// Example 1: Configuring fog settings for a region
FogSettings fog = new FogSettings
{
Enabled = true,
Mode = FogMode.Exponential,
Color = Color.gray,
Density = 0.02f,
ChangeRate = 1.0f
};
- Use
ChangeRate
to smoothly transition fog settings between regions for better visual effects. - Adjust
Density
,StartDistance
, andEndDistance
to achieve the desired atmospheric look. - Set
Enabled
to false for clear regions or indoor environments. - Use appropriate
FogMode
values to match the region's style and performance needs.