Class EnvironmentMap.CubeMapBuilder
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
EnvironmentMap
EnvironmentMap from six cubemap faces.
All six faces are mandatory and must be square and equally sized. The faces are uploaded directly into a GPU cube texture, which requires square faces of matching dimensions. Non-square or differently sized faces are not supported.
The faces make up the six sides of a cube centered on the camera. Each face image is oriented as you would see it looking outward at that side, with orientation 0 (north) pointing along the front face. Unfolded, the faces lay out as the following cross:
+--------+
| top |
+--------+--------+--------+--------+
| left | front | right | back |
+--------+--------+--------+--------+
| bottom |
+--------+
At orientation 0, the faces map to world directions as: front = north, right = east, back = south, left = west, top = up, bottom = down.- Since:
- 2026.1
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the back face.Sets the bottom face.build()Builds the environment map.voidclose()protected voidfinalize()Sets the front face.intensity(double intensity) Sets the brightness of the environment, as a non-negative factor by which the environment color is multiplied.Sets the left face.orientation(Azimuth orientation) Sets the heading of the environment.Sets the right face.Sets the top face.
-
Constructor Details
-
CubeMapBuilder
Copy constructor.- Parameters:
other- the builder to copy.
-
-
Method Details
-
finalize
protected void finalize() -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
front
@NotNull public EnvironmentMap.CubeMapBuilder front(@NotNull Image front) throws NullPointerException, IllegalArgumentException Sets the front face.This is mandatory. The image must be square.
- Parameters:
front- the front face. Cannot benull.- Returns:
- this builder.
- Throws:
NullPointerException- when the image isnull.IllegalArgumentException- when the image is not square.
-
back
@NotNull public EnvironmentMap.CubeMapBuilder back(@NotNull Image back) throws NullPointerException, IllegalArgumentException Sets the back face.This is mandatory. The image must be square.
- Parameters:
back- the back face. Cannot benull.- Returns:
- this builder.
- Throws:
NullPointerException- when the image isnull.IllegalArgumentException- when the image is not square.
-
left
@NotNull public EnvironmentMap.CubeMapBuilder left(@NotNull Image left) throws NullPointerException, IllegalArgumentException Sets the left face.This is mandatory. The image must be square.
- Parameters:
left- the left face. Cannot benull.- Returns:
- this builder.
- Throws:
NullPointerException- when the image isnull.IllegalArgumentException- when the image is not square.
-
right
@NotNull public EnvironmentMap.CubeMapBuilder right(@NotNull Image right) throws NullPointerException, IllegalArgumentException Sets the right face.This is mandatory. The image must be square.
- Parameters:
right- the right face. Cannot benull.- Returns:
- this builder.
- Throws:
NullPointerException- when the image isnull.IllegalArgumentException- when the image is not square.
-
bottom
@NotNull public EnvironmentMap.CubeMapBuilder bottom(@NotNull Image bottom) throws NullPointerException, IllegalArgumentException Sets the bottom face.This is mandatory. The image must be square.
- Parameters:
bottom- the bottom face. Cannot benull.- Returns:
- this builder.
- Throws:
NullPointerException- when the image isnull.IllegalArgumentException- when the image is not square.
-
top
@NotNull public EnvironmentMap.CubeMapBuilder top(@NotNull Image top) throws NullPointerException, IllegalArgumentException Sets the top face.This is mandatory. The image must be square.
- Parameters:
top- the top face. Cannot benull.- Returns:
- this builder.
- Throws:
NullPointerException- when the image isnull.IllegalArgumentException- when the image is not square.
-
orientation
Sets the heading of the environment.The default is north (0 degrees).
- Parameters:
orientation- the heading of the environment.- Returns:
- this builder.
-
intensity
@NotNull public EnvironmentMap.CubeMapBuilder intensity(double intensity) throws IllegalArgumentException Sets the brightness of the environment, as a non-negative factor by which the environment color is multiplied.This method is optional. If it is not called, the intensity is 1, which paints the imagery as-is. Values above
1brighten the environment and values below1darken it:2is twice as bright and0.5is half as bright. A value of0paints an environment black and leaves a reflection map casting no light.- Parameters:
intensity- the brightness factor applied to the environment. Must not be negative.- Returns:
- this builder.
- Throws:
IllegalArgumentException- when the intensity is negative.
-
build
Builds the environment map.- Returns:
- the built environment map.
- Throws:
IllegalStateException- when any of the six faces was not set.IllegalStateException- when the faces do not all have the same dimensions.
-