public final class AmbientOcclusionEffect extends Object implements AutoCloseable
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.
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.
Note that Ambient Occlusion is only applied in 3D views.
You cannot create an AmbientOcclusionEffect
. Instead, you can retrieve it from GraphicsEffects#getAmbientOcclusion
.
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected void |
finalize() |
double |
getPower()
Returns the power factor which determines how strongly the effect is applied to the view.
|
double |
getRadius()
Returns the radius in meters at which the effect is sampled.
|
boolean |
isEnabled() |
void |
set(double radius,
double power)
Sets the radius and power values for the ambient occlusion effect.
|
void |
setEnabled(boolean enabled)
Enables or disables the Ambient Occlusion effect.
|
void |
setPower(double power)
Sets the power factor which determines how strongly the effect is applied to the view.
|
void |
setRadius(double radius)
Sets the radius in meters at which the effect is sampled.
|
public void close()
close
in interface AutoCloseable
public boolean isEnabled()
public void setEnabled(boolean enabled)
The default is false.
enabled
- true to enable the Ambient Occlusion effect or false to disable it.public double getRadius()
public void setRadius(double radius)
A lower value produces sharper results, while higher values produce softer results.
The default radius is 30m.
radius
- radius in meters at which the effect should be sampled.public double getPower()
public void setPower(double power)
The power factor determines how much to brighten or darken the effect.
Values should be a positive floating point number, generally between 0 and 5. Higher values are accepted, but not recommended.
The default power value is 1.
power
- factor to brighten or darken the effect.