Class AtmosphereEffect

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

public final class AtmosphereEffect extends Object implements AutoCloseable
Graphics effect which adds a sky/atmosphere background to a 3D view.

The effect is enabled by default, but it is only applied to a 3D view. On a 2D view it has no visible effect.

The atmosphere is described by an immutable AtmosphereModel, of which there are two:

  • GradientAtmosphereModel (the default) draws a simple sky/horizon color gradient around the globe.
  • ScatteringAtmosphereModel draws a physically based Rayleigh/Mie scattering sky. It requires a geocentric 3D view and a light configured through GraphicsEffects#getLight. Without both, it falls back to the gradient. Rendering it has a minor additional performance cost compared to the gradient model.

Gradient model (the default) on the left, physically based scattering model on the right
Scattering seen from space: aerial perspective disabled on the left, enabled on the right

The atmosphere describes the planet's sky and, optionally, tints distant terrain so it fades into the sky with distance (an effect known as aerial perspective). That tinting is physically derived from the sun position and the air, so it is realistic but not directly adjustable. If you want to control haze yourself, and set its color and the distance at which things fade from view, use FogEffect instead. See the map effects article for guidance on choosing between the two.

Read the active model with getModel and narrow it to its concrete type, and change it by building a new model and passing it to setModel.

You cannot create an AtmosphereEffect. Instead, you can retrieve it from GraphicsEffects#getAtmosphere.

Since:
2023.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 atmosphere effect is enabled.
      Returns:
      whether the atmosphere effect is enabled.
    • setEnabled

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

      The default is true.

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

      @NotNull public AtmosphereModel getModel()
      Returns the atmosphere model.
      Returns:
      the atmosphere model.
      Since:
      2026.1
    • setModel

      public void setModel(@NotNull AtmosphereModel model) throws NullPointerException
      Sets the atmosphere model.

      The default is a GradientAtmosphereModel with default parameters.

      Parameters:
      model - the atmosphere model.
      Throws:
      NullPointerException - when the model is a null value.
      Since:
      2026.1