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'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()
Constructs a LinearFog object.
cpp
LinearFog::LinearFog(Color color, float near, float far);| Parameter | Description |
|---|---|
| color | Fog color. |
| near | Start distance of the fog effect. |
| far | End distance of the fog effect. |
Factories preferred
LinearFog::Create() auto
Creates a shared pointer to a LinearFog object.
cpp
static auto LinearFog::Create(Color color, float near, float far);| Parameter | Description |
|---|---|
| color | Fog color. |
| near | Start distance of the fog effect. |
| far | End distance of the fog effect. |
Properties
far float
Distance at which fog reaches full opacity.
cpp
float far {};near float
Distance at which fog starts.
cpp
float near {};Functions
GetType() FogType virtual
Returns fog type.
cpp
FogType LinearFog::GetType() const override;