Class EnvironmentMapEffect
- All Implemented Interfaces:
AutoCloseable
- Skybox: background imagery seen in all directions. Drawn behind everything, so high-resolution imagery (typically 2K to 4K) is recommended. When set, it takes priority over the
AtmosphereEffect. - Reflection map: the environment reflected by physically based rendering (PBR) objects and the source of their image-based lighting. Never shown as background. Low-resolution imagery (typically 256 to 512 pixels) is recommended here: it reduces the higher memory cost per pixel of the recommended HDR imagery, and the lower detail is less noticeable in reflections.
Both roles are optional and independent, and are held by an immutable EnvironmentMapModel. Read the current setup with getModel and change it by building a new model and passing it to setModel. A common setup is a reflection map with no skybox, letting the atmosphere provide the visible background while objects still reflect a detailed environment. By default the map installs a neutral gray reflection map and no skybox.
The effect is only applied on 3D views. On a 2D view it has no effect.
You cannot create an EnvironmentMapEffect. Instead, you can retrieve it from GraphicsEffects#getEnvironmentMap.
- Since:
- 2026.1
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected voidfinalize()getModel()Returns the model that configures the skybox and reflection map.booleanReturns whether the environment map effect is enabled.voidsetEnabled(boolean enabled) Sets whether the environment map effect is enabled.voidsetModel(EnvironmentMapModel model) Sets the model that configures the skybox and reflection map.
-
Method Details
-
finalize
protected void finalize() -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
isEnabled
public boolean isEnabled()Returns whether the environment map effect is enabled.- Returns:
- whether the environment map effect is enabled.
-
setEnabled
public void setEnabled(boolean enabled) Sets whether the environment map effect is enabled.The default is
true. Disabling the effect keeps the configured model, but stops painting the skybox and stops lighting PBR content with the reflection map.- Parameters:
enabled- true to enable the effect or false to disable it.
-
getModel
Returns the model that configures the skybox and reflection map.- Returns:
- the model that configures the skybox and reflection map.
-
setModel
Sets the model that configures the skybox and reflection map.- Parameters:
model- the model that configures the skybox and reflection map.- Throws:
NullPointerException- when the model isnull.
-