Component · render
HeightFog
Exponential height fog lit by the sun, the sky and local lights (volumetric shafts where shadows cut the beams). Density halves every
falloff × ln 2 metres above baseHeight. The first entity in ID order wins.Fields
density
f32Extinction at
baseHeight, per metre. 0.002 is a light haze (visibility ≈ 1.5 km), 0.02 a thick fog (≈ 150 m).default 0.0020 – 0.1
baseHeight
f32World altitude where the fog has its full density.
default 0m
falloff
f32Scale height: density falls by a factor of e over this many metres of altitude.
default 60m1 – 10000
albedo
colorScattering colour (single-scattering albedo, linear). Grey-white for water fog, warm for dust.
default [0.9,0.9,0.9,1]
anisotropy
f32Forward-scattering bias: 0 is uniform, toward 1 the fog glows around the sun and lamps.
default 0.30 – 0.9
Usage
Every edit is an undoable command: from the CLI as below, or the same JSON from an agent over MCP. See component.add and property.set.
Add it
ara do component.add -p entity=name:Crate -p component=HeightFog --why "Add HeightFog"Set a field
ara do property.set -p entity=name:Crate -p path=HeightFog.density -p value=0.004 --why "Tune HeightFog"In a scene document
{
"HeightFog": {
"density": 0.004
}
}From C#
/// <summary>Thicken ground fog as dusk approaches.</summary>
public static void UseHeightFog(Entity entity, in Tick tick)
{
ref var component = ref World.Get<HeightFog>(entity);
component.Density = 0.03f;
}From C#
Scripts read and write it with Get<HeightFog>(); see the HeightFog struct.