Vixen
02b45cc4
csharp
public sealed class FogRenderer

Depth fog, with an optional height falloff and sun scattering.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

A post-process rather than a per-material term, and that is what makes it affordable: fog depends on the distance from the camera to whatever was drawn, which the depth buffer already holds for every pixel of the frame. Adding it in every material's shader would mean every material carrying the fog's parameters and evaluating it whether it is on or not.

Fields and properties (12)

  • public required string Source

    The colour it fogs.

  • public required string Depth

    The depth it reads distance from.

  • public int Mode

    Which falloff curve is used.

  • public bool HeightFalloff

    Whether fog thins with altitude, as an atmosphere does.

  • public bool SunScattering

    Whether looking toward the sun brightens the fog.

  • public RenderView? View

    Clip space back to world, for reconstructing where a pixel was.

  • public Matrix4x4 InverseViewProjection

    Clip back to world, when no View supplies it.

  • public Vector3 CameraPosition

    Where the camera is, which the distance is measured from.

  • public Vector3 Colour

    The fog's colour.

  • public float Density

    How quickly it accumulates with distance.

  • public float Start

    Where it begins, for the linear mode.

  • public float End

    Where it is fully opaque, for the linear mode.

Methods (3)

Used by (2)

  • PostEffectFactoryVixen.Rendering.PostFx
  • PostEffectTestsVixen.Rendering.PostFx.Tests