Engine API Reference - v2.22.0-beta.8
    Preparing search index...

    Interface VolumetricFog

    Properties related to volumetric fog, a raymarched height fog lit by a directional light. The fog samples the light's cascaded shadow map along each view ray, forming visible shafts of light. The raymarch runs at a reduced resolution and is blended into the scene before TAA, so when TAA is enabled, its noise is temporally resolved to a smooth result. Optionally the clustered omni and spot lights scatter light in the fog as well, see localOmniLights and localSpotLights.

    interface VolumetricFog {
        ambientColor: Color;
        ambientIntensity: number;
        anisotropy: number;
        density: number;
        enabled: boolean;
        extinction: number;
        heightBase: number;
        heightFalloff: number;
        intensity: number;
        light: LightComponent | null;
        localIntensity: number;
        localOmniLights: boolean;
        localSpotLights: boolean;
        localSteps: number;
        maxDistance: number;
        scale: number;
        steps: number;
        tint: Color;
    }
    Index
    ambientColor: Color

    The color of the ambient in-scattered light, which keeps the fog in shadowed areas visible. Defaults to white.

    ambientIntensity: number

    The intensity of the ambient in-scattered light. Defaults to 0.02.

    anisotropy: number

    The anisotropy of the scattering, 0-0.95 range. Larger values scatter more light forward, making the fog brighter when looking towards the light. Defaults to 0.6.

    density: number

    The fog density at the base height. Defaults to 0.01.

    enabled: boolean

    Whether the volumetric fog is enabled. Defaults to false.

    extinction: number

    A scale of how quickly the fog absorbs the light passing through it, without affecting how much light it scatters. A value of 1 is physically consistent, where the fog absorbs as much as it scatters, and distant fog and light shafts fade out exponentially with the density. Lower values keep them visible over a longer distance while the fog itself stays as bright, which is not physically correct but is often preferable. Defaults to 1.

    heightBase: number

    The world space height at which the fog density starts to fall off. Below it the density is constant. Defaults to 0.

    heightFalloff: number

    The exponential falloff of the fog density with height above the base height. Value of 0 makes the fog uniform. Defaults to 0.05.

    intensity: number

    The intensity of the light scattering. Defaults to 1.

    light: LightComponent | null

    The directional light providing the scattered light, or null when the fog is lit by the local lights and the ambient term only. When a light of a type other than directional is assigned, the effect is disabled. Defaults to null.

    localIntensity: number

    The intensity of the light scattering of the local lights. Defaults to 1.

    localOmniLights: boolean

    Whether the clustered omni lights scatter light in the fog. Each light adds a raymarch over the part of the view rays inside its volume, sampling the shadow and the cookie atlas of the clustered lighting, and so the cost scales with the screen space size of the light volumes. As an omni light fills its whole bounding sphere, its volume is typically much larger on the screen than the volume of a spot light. Requires clustered lighting, which is enabled by default. Individual lights can scatter more or less light using LightComponent#volumetricScattering. Defaults to false.

    localSpotLights: boolean

    Whether the clustered spot lights scatter light in the fog, forming visible beams. See localOmniLights for details, both types are rendered the same way and share the localIntensity and localSteps settings. Defaults to false.

    localSteps: number

    The number of raymarching steps taken inside the volume of each local light, 2-64 range. Defaults to 12.

    maxDistance: number

    The maximum world space distance the fog is raymarched to. Defaults to 300.

    scale: number

    The resolution scale of the fog texture relative to the scene render target, 0.25-1 range. Defaults to 0.5.

    steps: number

    The number of raymarching steps, 4-128 range. Higher values improve the quality at a higher performance cost. Defaults to 24.

    tint: Color

    The albedo of the fog. Defaults to white.