FogSettings - jimdroberts/FishMMO GitHub Wiki

Description

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.


API Access

Fields

  • 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).


Basic Usage

Setup

  1. Create and configure a FogSettings instance for a region.
  2. Set the desired fog mode, color, density, and transition parameters.
  3. Apply the settings to the region's environment controller or rendering system.

Example

// 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
};

Best Practices

  • Use ChangeRate to smoothly transition fog settings between regions for better visual effects.
  • Adjust Density, StartDistance, and EndDistance 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.
⚠️ **GitHub.com Fallback** ⚠️