ReflectionProbe

Inherits: VisualInstance < CullInstance < Spatial < Node < Object

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 ReflectionProbe is used to create high-quality reflections at a low performance cost (when update_mode is UPDATE_ONCE). ReflectionProbes can be blended together and with the rest of the scene smoothly. ReflectionProbes can also be combined with GIProbe and screen-space reflections (Environment.ss_reflections_enabled) to get more accurate reflections in specific areas. ReflectionProbes render all objects within their cull_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: Unlike GIProbe, ReflectionProbes only source their environment from a WorldEnvironment node. If you specify an Environment resource within a Camera 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.

教程

属性

bool

box_projection

false

int

cull_mask

1048575

bool

enable_shadows

false

Vector3

extents

Vector3( 1, 1, 1 )

float

intensity

1.0

Color

interior_ambient_color

Color( 0, 0, 0, 1 )

float

interior_ambient_contrib

0.0

float

interior_ambient_energy

1.0

bool

interior_enable

false

float

max_distance

0.0

Vector3

origin_offset

Vector3( 0, 0, 0 )

UpdateMode

update_mode

0

枚举

enum UpdateMode:

  • UPDATE_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 than UPDATE_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 a ReflectionProbe update by moving the ReflectionProbe slightly in any direction.

  • 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 UPDATE_ALWAYS at most per scene. For all other use cases, use UPDATE_ONCE.

属性说明

  • bool box_projection

Default

false

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.


Default

1048575

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.


  • bool enable_shadows

Default

false

Setter

set_enable_shadows(value)

Getter

are_shadows_enabled()

如果true,则在反射探测中计算阴影。这使得反射探针渲染更慢;如果想禁用它,可以使用 UPDATE_ALWAYS update_mode


Default

Vector3( 1, 1, 1 )

Setter

set_extents(value)

Getter

get_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 ReflectionProbe node.


Default

1.0

Setter

set_intensity(value)

Getter

get_intensity()

定义反射强度。


  • Color interior_ambient_color

Default

Color( 0, 0, 0, 1 )

Setter

set_interior_ambient(value)

Getter

get_interior_ambient()

设置环境光的颜色,当此探针被设置为interior_enable时使用。


  • float interior_ambient_contrib

Default

0.0

Setter

set_interior_ambient_probe_contribution(value)

Getter

get_interior_ambient_probe_contribution()

当设置为 interior_enable 时,设置反射对该反射探测器的环境光的影响程度的贡献值。环境光与房间的颜色相匹配中很有用。


  • float interior_ambient_energy

Default

1.0

Setter

set_interior_ambient_energy(value)

Getter

get_interior_ambient_energy()

当设置为interior_enable时,为该反射探针的环境光贡献设置能量乘数。


  • bool interior_enable

Default

false

Setter

set_as_interior(value)

Getter

is_set_as_interior()

如果true,反射将忽略天空的贡献。然后环境照明由internal_ambient_*属性控制。


Default

0.0

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_ALWAYS update_mode.


Default

Vector3( 0, 0, 0 )

Setter

set_origin_offset(value)

Getter

get_origin_offset()

Sets the origin offset to be used when this ReflectionProbe is in box_projection 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.


Default

0

Setter

set_update_mode(value)

Getter

get_update_mode()

Sets how frequently the ReflectionProbe is updated. Can be UPDATE_ONCE or UPDATE_ALWAYS.