ReflectionProbe
Inherits:VisualInstance3D<Node3D<Node<Object
Captures its surroundings to create fast, accurate reflections from a given point.
Description
Captures its surroundings as a cubemap, and stores versions of it with increasing levels of blur to simulate different material roughnesses.
TheReflectionProbe is used to create high-quality reflections at a low performance cost (whenupdate_mode isUPDATE_ONCE).ReflectionProbes can be blended together and with the rest of the scene smoothly.ReflectionProbes can also be combined withVoxelGI, SDFGI (Environment.sdfgi_enabled) and screen-space reflections (Environment.ssr_enabled) to get more accurate reflections in specific areas.ReflectionProbes render all objects within theircull_mask, 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: UnlikeVoxelGI and SDFGI,ReflectionProbes only source their environment from aWorldEnvironment node. If you specify anEnvironment resource within aCamera3D node, it will be ignored by theReflectionProbe. This can lead to incorrect lighting within theReflectionProbe.
Note: When using the Mobile rendering method, only8 reflection probes can be displayed on each mesh resource, while the Compatibility rendering method only supports up to2 reflection probes on each mesh. Attempting to display more than8 reflection probes on a single mesh resource using the Mobile renderer will result in reflection probes flickering in and out as the camera moves, while the Compatibility renderer will not render any additional probes if more than2 reflection probes are being used.
Note: When using the Mobile rendering method, reflection probes will only correctly affect meshes whose visibility AABB intersects with the reflection probe's AABB. If using a shader to deform the mesh in a way that makes it go outside its AABB,GeometryInstance3D.extra_cull_margin must be increased on the mesh. Otherwise, the reflection probe may not be visible on the mesh.
Tutorials
Properties
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
|
Enumerations
enumUpdateMode:🔗
UpdateModeUPDATE_ONCE =0
Update the probe once on the next frame (recommended for most objects). The corresponding radiance map will be generated over the following six frames. This takes more time to update thanUPDATE_ALWAYS, but it has a lower performance cost and can result in higher-quality reflections. The ReflectionProbe is updated when its transform changes, but not when nearby geometry changes. You can force aReflectionProbe update by moving theReflectionProbe slightly in any direction.
UpdateModeUPDATE_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 withUPDATE_ALWAYS at most per scene. For all other use cases, useUPDATE_ONCE.
enumAmbientMode:🔗
AmbientModeAMBIENT_DISABLED =0
Do not apply any ambient lighting inside theReflectionProbe's box defined by itssize.
AmbientModeAMBIENT_ENVIRONMENT =1
Apply automatically-sourced environment lighting inside theReflectionProbe's box defined by itssize.
AmbientModeAMBIENT_COLOR =2
Apply custom ambient lighting inside theReflectionProbe's box defined by itssize. Seeambient_color andambient_color_energy.
Property Descriptions
Colorambient_color =Color(0,0,0,1)🔗
Colorget_ambient_color()
The custom ambient color to use within theReflectionProbe's box defined by itssize. Only effective ifambient_mode isAMBIENT_COLOR.
floatambient_color_energy =1.0🔗
floatget_ambient_color_energy()
The custom ambient color energy to use within theReflectionProbe's box defined by itssize. Only effective ifambient_mode isAMBIENT_COLOR.
AmbientModeambient_mode =1🔗
AmbientModeget_ambient_mode()
The ambient color to use within theReflectionProbe's box defined by itssize. The ambient color will smoothly blend with otherReflectionProbes and the rest of the scene (outside theReflectionProbe's box defined by itssize).
floatget_blend_distance()
Defines the distance in meters over which a probe blends into the scene.
boolis_box_projection_enabled()
Iftrue, 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 theReflectionProbe node.
intget_cull_mask()
Sets the cull mask which determines what objects are drawn by this probe. EveryVisualInstance3D with a layer included in this cull mask will be rendered by the probe. It is best to only include large objects which are likely to take up a lot of space in the reflection in order to save on rendering cost.
This can also be used to prevent an object from reflecting upon itself (for instance, aReflectionProbe centered on a vehicle).
boolare_shadows_enabled()
Iftrue, computes shadows in the reflection probe. This makes the reflection probe slower to render; you may want to disable this if using theUPDATE_ALWAYSupdate_mode.
floatget_intensity()
Defines the reflection intensity. Intensity modulates the strength of the reflection.
boolis_set_as_interior()
Iftrue, reflections will ignore sky contribution.
floatget_max_distance()
The maximum distance away from theReflectionProbe an object can be before it is culled. Decrease this to improve performance, especially when using theUPDATE_ALWAYSupdate_mode.
Note: The maximum reflection distance is always at least equal to the probe's extents. This means that decreasingmax_distance will not always cull objects from reflections, especially if the reflection probe's box defined by itssize is already large.
floatget_mesh_lod_threshold()
The automatic LOD bias to use for meshes rendered within theReflectionProbe (this is analog toViewport.mesh_lod_threshold). Higher values will use less detailed versions of meshes that have LOD variations generated. If set to0.0, automatic LOD is disabled. Increasemesh_lod_threshold to improve performance at the cost of geometry detail, especially when using theUPDATE_ALWAYSupdate_mode.
Note:mesh_lod_threshold does not affectGeometryInstance3D visibility ranges (also known as "manual" LOD or hierarchical LOD).
Vector3origin_offset =Vector3(0,0,0)🔗
Vector3get_origin_offset()
Sets the origin offset to be used when thisReflectionProbe is inbox_projection mode. This can be set to a non-zero value to ensure a reflection fits a rectangle-shaped room, while reducing the number of objects that "get in the way" of the reflection.
intget_reflection_mask()
Sets the reflection mask which determines what objects have reflections applied from this probe. EveryVisualInstance3D with a layer included in this reflection mask will have reflections applied from this probe. See alsocull_mask, which can be used to exclude objects from appearing in the reflection while still making them affected by theReflectionProbe.
Vector3size =Vector3(20,20,20)🔗
Vector3get_size()
The size of the reflection probe. The larger the size, the more space covered by the probe, which will lower the perceived resolution. It is best to keep the size only as large as you need it.
Note: To better fit areas that are not aligned to the grid, you can rotate theReflectionProbe node.
UpdateModeupdate_mode =0🔗
UpdateModeget_update_mode()
Sets how frequently theReflectionProbe is updated. Can beUPDATE_ONCE orUPDATE_ALWAYS.