Skip to main content

Function: clearedFog()

function clearedFog(fog: FogSpec, distance?: number): FogSpec;

Defined in: packages/webxr-environment/src/presets.ts:102

The same fog, pushed far enough away to be invisible.

This is the workaround for the one rule in interpolate.ts: a slot cannot ease between "something" and null, so easing fog IN means transitioning from a fog that is technically present but has no effect. Use this rather than hand-writing a far: 100000 twin of every fog preset:

director.apply({ fog: clearedFog(DUSK.fog!) }); // no visible fog
director.transition({ fog: DUSK.fog! }, { durationMs: 4000 }); // rolls in

Parameters

ParameterTypeDefault value
fogFogSpecundefined
distancenumber100_000

Returns

FogSpec