LuciadCPillar 2026.1
Loading...
Searching...
No Matches
luciad::FogEffect Class Referencefinal

Graphics effect that fades geometry into a fog color with increasing distance (and optionally with decreasing altitude), improving depth perception on large 3D scenes. More...

#include <luciad/maps/effects/FogEffect.h>

Public Member Functions

 FogEffect (const FogEffect &)=delete
const std::shared_ptr< FogModel > & getModel () const
 Returns the fog model.
bool isEnabled () const
 Returns whether the fog effect is enabled.
FogEffect & operator= (const FogEffect &)=delete
void setEnabled (bool enabled)
 Sets whether the fog effect is enabled.
void setModel (std::shared_ptr< FogModel > model)
 Sets the fog model.

Detailed Description

Graphics effect that fades geometry into a fog color with increasing distance (and optionally with decreasing altitude), improving depth perception on large 3D scenes.

The effect is disabled by default and is only applied to a 3D view. On a 2D view it has no effect.

Fog disabled on the left, enabled on the right

Fog is an artist-controlled alternative to the AtmosphereEffect scattering model: it does not require a light, and you steer it directly with distances in meters. See the map effects article for guidance on when to use fog versus atmospheric scattering.

The fog parameters are held by an immutable luciad::FogModel. Read them with getModel and change them by building a new model and passing it to setModel.

You cannot create a FogEffect. Retrieve it from GraphicsEffects::getFog.

Since
2026.1

Constructor & Destructor Documentation

◆ FogEffect()

luciad::FogEffect::FogEffect ( const FogEffect & )
delete

Member Function Documentation

◆ getModel()

const std::shared_ptr< FogModel > & luciad::FogEffect::getModel ( ) const

Returns the fog model.

Returns
the fog model.

◆ isEnabled()

bool luciad::FogEffect::isEnabled ( ) const

Returns whether the fog effect is enabled.

Returns
whether the fog effect is enabled.

◆ operator=()

FogEffect & luciad::FogEffect::operator= ( const FogEffect & )
delete

◆ setEnabled()

void luciad::FogEffect::setEnabled ( bool enabled)

Sets whether the fog effect is enabled.

The default is false.

Parameters
enabledtrue to enable the fog effect or false to disable it.

◆ setModel()

void luciad::FogEffect::setModel ( std::shared_ptr< FogModel > model)

Sets the fog model.

Parameters
modelthe fog model.
Exceptions
luciad::NullArgumentExceptionwhen the model is a nullptr value.