1 Star 1 Fork 0

天天编程/godot-docs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
class_reflectionprobe.rst 13.07 KB
一键复制 编辑 原始数据 按行查看 历史
github_url: hide

ReflectionProbe

Inherits: :ref:`VisualInstance<class_VisualInstance>` < :ref:`Spatial<class_Spatial>` < :ref:`Node<class_Node>` < :ref:`Object<class_Object>`

Captures its surroundings to create reflections.

Description

Captures its surroundings as a cubemap, 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 the cost of performance. It can be combined with :ref:`GIProbe<class_GIProbe>`s and Screen Space Reflections to achieve high quality reflections. ReflectionProbes render all objects within their :ref:`cull_mask<class_ReflectionProbe_property_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.

Tutorials

Properties

:ref:`bool<class_bool>` :ref:`box_projection<class_ReflectionProbe_property_box_projection>` false
:ref:`int<class_int>` :ref:`cull_mask<class_ReflectionProbe_property_cull_mask>` 1048575
:ref:`bool<class_bool>` :ref:`enable_shadows<class_ReflectionProbe_property_enable_shadows>` false
:ref:`Vector3<class_Vector3>` :ref:`extents<class_ReflectionProbe_property_extents>` Vector3( 1, 1, 1 )
:ref:`float<class_float>` :ref:`intensity<class_ReflectionProbe_property_intensity>` 1.0
:ref:`Color<class_Color>` :ref:`interior_ambient_color<class_ReflectionProbe_property_interior_ambient_color>` Color( 0, 0, 0, 1 )
:ref:`float<class_float>` :ref:`interior_ambient_contrib<class_ReflectionProbe_property_interior_ambient_contrib>` 0.0
:ref:`float<class_float>` :ref:`interior_ambient_energy<class_ReflectionProbe_property_interior_ambient_energy>` 1.0
:ref:`bool<class_bool>` :ref:`interior_enable<class_ReflectionProbe_property_interior_enable>` false
:ref:`float<class_float>` :ref:`max_distance<class_ReflectionProbe_property_max_distance>` 0.0
:ref:`Vector3<class_Vector3>` :ref:`origin_offset<class_ReflectionProbe_property_origin_offset>` Vector3( 0, 0, 0 )
:ref:`UpdateMode<enum_ReflectionProbe_UpdateMode>` :ref:`update_mode<class_ReflectionProbe_property_update_mode>` 0

Enumerations

enum UpdateMode:

Property Descriptions

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.


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 :ref:`VisualInstance<class_VisualInstance>` 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.


Default false
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 :ref:`UPDATE_ALWAYS<class_ReflectionProbe_constant_UPDATE_ALWAYS>` :ref:`update_mode<class_ReflectionProbe_property_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.


Default 1.0
Setter set_intensity(value)
Getter get_intensity()

Defines the reflection intensity. Intensity modulates the strength of the reflection.


Default Color( 0, 0, 0, 1 )
Setter set_interior_ambient(value)
Getter get_interior_ambient()

Sets the ambient light color to be used when this probe is set to :ref:`interior_enable<class_ReflectionProbe_property_interior_enable>`.


Default 0.0
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 :ref:`interior_enable<class_ReflectionProbe_property_interior_enable>`. Useful so that ambient light matches the color of the room.


Default 1.0
Setter set_interior_ambient_energy(value)
Getter get_interior_ambient_energy()

Sets the energy multiplier for this reflection probe's ambient light contribution when set to :ref:`interior_enable<class_ReflectionProbe_property_interior_enable>`.


Default false
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.


Default 0.0
Setter set_max_distance(value)
Getter get_max_distance()

Sets the max distance away from the probe an object can be before it is culled.


Default Vector3( 0, 0, 0 )
Setter set_origin_offset(value)
Getter get_origin_offset()

Sets the origin offset to be used when this reflection probe is in box project mode.


Default 0
Setter set_update_mode(value)
Getter get_update_mode()

Sets how frequently the probe is updated. Can be :ref:`UPDATE_ONCE<class_ReflectionProbe_constant_UPDATE_ONCE>` or :ref:`UPDATE_ALWAYS<class_ReflectionProbe_constant_UPDATE_ALWAYS>`.

Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ttcode-net/godot-docs.git
git@gitee.com:ttcode-net/godot-docs.git
ttcode-net
godot-docs
godot-docs
master

搜索帮助