public sealed class FogRendererDepth fog, with an optional height falloff and sun scattering.
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 (23)
public required string SourceThe colour it fogs.
public required string DepthThe depth it reads distance from.
public int ModeWhich falloff curve is used.
public bool HeightFalloffWhether fog thins with altitude, as an atmosphere does.
public bool SunScatteringWhether looking toward the sun brightens the fog.
public RenderView? ViewThe view the two below are derived from, or null to set them by hand.
public Matrix4x4 InverseViewProjectionClip back to world, when no View supplies it.
public Vector3 CameraPositionWhere the camera is, which the distance is measured from.
public Vector3 ColourWhat the fog looks like away from the sun, as a radiance in cd/m², when Frame has no sky in it.
public float DensityHow quickly it accumulates with distance.
public float StartWhere it begins, for the linear mode.
public float EndWhere it is fully opaque, for the linear mode.
public float HeightThe altitude the authored density holds at.
public float HeightFalloffRateHow fast density thins above Height, per world unit.
public Vector3 SunDirectionWhich way the light travels, when no Sun answers.
public Vector3 SunColourWhat the fog looks like straight down-sun, as a radiance in cd/m², when Sun has no directional light in it.
public ISunSource? SunWhere the frame's directional light comes from, or null to use the authored pair.
public SceneConstants? FrameThe frame's own lighting, which is where the sky's mean radiance comes from.
public float SunAnisotropyHenyey–Greenstein anisotropy, 0 isotropic to just under 1 sharply forward.
public string VolumeThe marched volume VolumetricFogRenderer filled, or empty for the falloff alone.
public float VolumeNearThe volume's own near plane, in view depth.
public float VolumeFarThe volume's own far plane. Past this the analytic falloff is what runs.
public int VolumeSlicesHow many slices it cut between the two.
Methods (3)
public FogRenderer()Depth fog, with an optional height falloff and sun scattering.
public void Apply(in PostProcessOverlay overlay)protected override void Configure(CompositorFrame frame, ParameterCollection parameters, IList<ResourceBinding> bindings)Fills in this frame's parameters and bindings.
Used by (3)
- PhotometricDefaultTestsVixen.Rendering.PostFx.Tests
- PostEffectFactoryVixen.Rendering.PostFx
- PostEffectTestsVixen.Rendering.PostFx.Tests