Skip to content

LinearFog

Linearly interpolated fog effect, assignable to a scene.

This fog model applies a linear blend between no fog and full fog color based on fragment distance. It is intended to be assigned to a [Scene](/reference/nodes/scene)'s fog field at runtime.

cpp
my_scene->fog = vglx::LinearFog::Create(0x444444, 2.0f, 6.0f);

INFO

Derives from Fog and inherits all public properties and methods.

Construction

Constructors


LinearFog()

cpp
vglx::LinearFog::LinearFog(Color color, float near, float far)
ParameterDescription
colorFog color.
nearStart distance of the fog effect.
farEnd distance of the fog effect.

Constructs a LinearFog object.

Factories preferred


LinearFog::Create() auto

cpp
static auto vglx::LinearFog::Create(Color color, float near, float far)
ParameterDescription
colorFog color.
nearStart distance of the fog effect.
farEnd distance of the fog effect.

Creates a shared pointer to a LinearFog object.

Properties

far float

cpp
float far

Distance at which fog reaches full opacity.

near float

cpp
float near

Distance at which fog starts.

Functions

GetType() FogType virtual

cpp
FogType vglx::LinearFog::GetType() const override

Returns fog type.

Released under the MIT License.