Class AmbientOcclusionEffect

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

public final class AmbientOcclusionEffect extends Object implements AutoCloseable
This class implements the Ambient occlusion effect, which shades areas of 3D geometry based on their proximity to other 3D geometry.

This mimics a behavior of the real world where light gets trapped in tight areas. Typical examples are the corners of a room, which are slightly darker than the rest of the room as the light is trapped in the corners.

Left: ambient occlusion disabled, Right: ambient occlusion enabled
Left: ambient occlusion disabled, Right: ambient occlusion enabled

Ambient Occlusion is recommended for cases in which 3D datasets with simple colors, such as 3D CAD & BIM models, are visualized. For these types of datasets, Ambient Occlusion can help give the dataset more depth and make it easier to understand how geometry relates to each other. On top of that, it also improves the visual quality of such datasets, and gives an overall better impression.

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

Note that Ambient Occlusion is only applied in 3D views.

You cannot create an AmbientOcclusionEffect. Instead, you can retrieve it from GraphicsEffects#getAmbientOcclusion.

  • 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 Ambient Occlusion effect is enabled.
      Returns:
      whether the Ambient Occlusion effect is enabled.
    • setEnabled

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

      The default is false.

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

      @NotNull public AmbientOcclusionModel getModel()
      Returns the ambient-occlusion model.
      Returns:
      the ambient-occlusion model.
    • setModel

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