ReflectionProbe
Captures its surroundings to create fast, accurate reflections from a given point.
Capture its surroundings as a dual paraboloid image, and stores versions of it with increasing levels of blur to simulate different material roughnesses.
The is used to create high-quality reflections at a low performance cost (when is UPDATE_ONCE). ReflectionProbe
s can be blended together and with the rest of the scene smoothly. ReflectionProbe
s can also be combined with and screen-space reflections (Environment.ss_reflections_enabled) to get more accurate reflections in specific areas. ReflectionProbe
s render all objects within their , so updating them can be quite expensive. It is best to update them once with the important static objects and then leave them as-is.
Note: Unlike GIProbe, ReflectionProbe
s only source their environment from a node. If you specify an Environment resource within a node, it will be ignored by the ReflectionProbe
. This can lead to incorrect lighting within the ReflectionProbe
.
Note: By default, Godot will only render 16 reflection probes. If you need more, increase the number of atlas subdivisions. This setting can be found in ProjectSettings.rendering/quality/reflections/atlas_subdiv.
Note: The GLES2 backend will only display two reflection probes at the same time for a single mesh. If possible, split up large meshes that span over multiple reflection probes into smaller ones.
enum UpdateMode:
UPDATE_ALWAYS = 1 —- Update the probe every frame. This provides better results for fast-moving dynamic objects (such as cars). However, it has a significant performance cost. Due to the cost, it’s recommended to only use one ReflectionProbe with at most per scene. For all other use cases, use UPDATE_ONCE.
- bool box_projection
Default |
|
Setter | set_enable_box_projection(value) |
Getter | is_box_projection_enabled() |
If true
, enables box projection. This makes reflections look more correct in rectangle-shaped rooms by offsetting the reflection center depending on the camera’s location.
Note: To better fit rectangle-shaped rooms that are not aligned to the grid, you can rotate the ReflectionProbe
node.
- cull_mask
Default |
|
Setter | set_cull_mask(value) |
Getter | get_cull_mask() |
Sets the cull mask which determines what objects are drawn by this probe. Every VisualInstance with a layer included in this cull mask will be rendered by the probe. To improve performance, it is best to only include large objects which are likely to take up a lot of space in the reflection.
- enable_shadows
Default |
|
Setter | set_enable_shadows(value) |
Getter | are_shadows_enabled() |
If true
, computes shadows in the reflection probe. This makes the reflection probe slower to render; you may want to disable this if using the UPDATE_ALWAYS .
- Vector3 extents
The size of the reflection probe. The larger the extents the more space covered by the probe which will lower the perceived resolution. It is best to keep the extents only as large as you need them.
Note: To better fit areas that are not aligned to the grid, you can rotate the node.
- intensity
Default |
|
Setter | set_intensity(value) |
Getter | get_intensity() |
Defines the reflection intensity. Intensity modulates the strength of the reflection.
Default |
|
Setter | set_interior_ambient(value) |
Getter |
Sets the ambient light color to be used when this probe is set to interior_enable.
- interior_ambient_contrib
Default |
|
Setter | set_interior_ambient_probe_contribution(value) |
Getter | get_interior_ambient_probe_contribution() |
Sets the contribution value for how much the reflection affects the ambient light for this reflection probe when set to interior_enable. Useful so that ambient light matches the color of the room.
- interior_ambient_energy
Sets the energy multiplier for this reflection probe’s ambient light contribution when set to interior_enable.
- interior_enable
Default |
|
Setter | set_as_interior(value) |
Getter | is_set_as_interior() |
If true
, reflections will ignore sky contribution. Ambient lighting is then controlled by the interior_ambient_*
properties.
- float max_distance
Default |
|
Setter | set_max_distance(value) |
Getter | get_max_distance() |
The maximum distance away from the ReflectionProbe
an object can be before it is culled. Decrease this to improve performance, especially when using the update_mode.
Note: The maximum reflection distance is always at least equal to the . This means that decreasing max_distance will not always cull objects from reflections, especially if the reflection probe’s are already large.
- Vector3 origin_offset
Default |
|
Setter | set_origin_offset(value) |
Getter | get_origin_offset() |
Sets the origin offset to be used when this ReflectionProbe
is in mode. This can be set to a non-zero value to ensure a reflection fits a rectangle-shaped room, while reducing the amount of objects that “get in the way” of the reflection.
- UpdateMode update_mode