Class FogEffect

java.lang.Object
com.luciad.maps.effects.FogEffect
All Implemented Interfaces:
AutoCloseable

public final class FogEffect extends Object implements AutoCloseable
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 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
  • Method Details

    • finalize

      protected void finalize()
      Overrides:
      finalize in class Object
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • isEnabled

      public boolean isEnabled()
      Returns whether the fog effect is enabled.
      Returns:
      whether the fog effect is enabled.
    • setEnabled

      public void setEnabled(boolean enabled)
      Sets whether the fog effect is enabled.

      The default is false.

      Parameters:
      enabled - true to enable the fog effect or false to disable it.
    • getModel

      @NotNull public FogModel getModel()
      Returns the fog model.
      Returns:
      the fog model.
    • setModel

      public void setModel(@NotNull FogModel model) throws NullPointerException
      Sets the fog model.
      Parameters:
      model - the fog model.
      Throws:
      NullPointerException - when the model is a null value.