123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298 |
- :github_url: hide
- .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
- .. DO NOT EDIT THIS FILE, but the ReflectionProbe.xml source instead.
- .. The source is found in doc/classes or modules/<name>/doc_classes.
- .. _class_ReflectionProbe:
- ReflectionProbe
- ===============
- **Inherits:** :ref:`VisualInstance3D<class_VisualInstance3D>` **<** :ref:`Node3D<class_Node3D>` **<** :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:`VoxelGI<class_VoxelGI>`\ s and Screen Space Reflections to achieve high quality reflections. ``ReflectionProbe``\ s 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
- ---------
- - :doc:`Reflection probes <../tutorials/3d/reflection_probes>`
- Properties
- ----------
- +------------------------------------------------------+----------------------------------------------------------------------------------+-------------------------+
- | :ref:`Color<class_Color>` | :ref:`ambient_color<class_ReflectionProbe_property_ambient_color>` | ``Color(0, 0, 0, 1)`` |
- +------------------------------------------------------+----------------------------------------------------------------------------------+-------------------------+
- | :ref:`float<class_float>` | :ref:`ambient_color_energy<class_ReflectionProbe_property_ambient_color_energy>` | ``1.0`` |
- +------------------------------------------------------+----------------------------------------------------------------------------------+-------------------------+
- | :ref:`AmbientMode<enum_ReflectionProbe_AmbientMode>` | :ref:`ambient_mode<class_ReflectionProbe_property_ambient_mode>` | ``1`` |
- +------------------------------------------------------+----------------------------------------------------------------------------------+-------------------------+
- | :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(10, 10, 10)`` |
- +------------------------------------------------------+----------------------------------------------------------------------------------+-------------------------+
- | :ref:`float<class_float>` | :ref:`intensity<class_ReflectionProbe_property_intensity>` | ``1.0`` |
- +------------------------------------------------------+----------------------------------------------------------------------------------+-------------------------+
- | :ref:`bool<class_bool>` | :ref:`interior<class_ReflectionProbe_property_interior>` | ``false`` |
- +------------------------------------------------------+----------------------------------------------------------------------------------+-------------------------+
- | :ref:`float<class_float>` | :ref:`lod_threshold<class_ReflectionProbe_property_lod_threshold>` | ``1.0`` |
- +------------------------------------------------------+----------------------------------------------------------------------------------+-------------------------+
- | :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_ReflectionProbe_UpdateMode:
- .. _class_ReflectionProbe_constant_UPDATE_ONCE:
- .. _class_ReflectionProbe_constant_UPDATE_ALWAYS:
- enum **UpdateMode**:
- - **UPDATE_ONCE** = **0** --- Update the probe once on the next frame. The corresponding radiance map will be generated over the following six frames. This is slower to update than :ref:`UPDATE_ALWAYS<class_ReflectionProbe_constant_UPDATE_ALWAYS>` but can result in higher quality reflections.
- - **UPDATE_ALWAYS** = **1** --- Update the probe every frame. This is needed when you want to capture dynamic objects. However, it results in an increased render time. Use :ref:`UPDATE_ONCE<class_ReflectionProbe_constant_UPDATE_ONCE>` whenever possible.
- ----
- .. _enum_ReflectionProbe_AmbientMode:
- .. _class_ReflectionProbe_constant_AMBIENT_DISABLED:
- .. _class_ReflectionProbe_constant_AMBIENT_ENVIRONMENT:
- .. _class_ReflectionProbe_constant_AMBIENT_COLOR:
- enum **AmbientMode**:
- - **AMBIENT_DISABLED** = **0**
- - **AMBIENT_ENVIRONMENT** = **1**
- - **AMBIENT_COLOR** = **2**
- Property Descriptions
- ---------------------
- .. _class_ReflectionProbe_property_ambient_color:
- - :ref:`Color<class_Color>` **ambient_color**
- +-----------+--------------------------+
- | *Default* | ``Color(0, 0, 0, 1)`` |
- +-----------+--------------------------+
- | *Setter* | set_ambient_color(value) |
- +-----------+--------------------------+
- | *Getter* | get_ambient_color() |
- +-----------+--------------------------+
- ----
- .. _class_ReflectionProbe_property_ambient_color_energy:
- - :ref:`float<class_float>` **ambient_color_energy**
- +-----------+---------------------------------+
- | *Default* | ``1.0`` |
- +-----------+---------------------------------+
- | *Setter* | set_ambient_color_energy(value) |
- +-----------+---------------------------------+
- | *Getter* | get_ambient_color_energy() |
- +-----------+---------------------------------+
- ----
- .. _class_ReflectionProbe_property_ambient_mode:
- - :ref:`AmbientMode<enum_ReflectionProbe_AmbientMode>` **ambient_mode**
- +-----------+-------------------------+
- | *Default* | ``1`` |
- +-----------+-------------------------+
- | *Setter* | set_ambient_mode(value) |
- +-----------+-------------------------+
- | *Getter* | get_ambient_mode() |
- +-----------+-------------------------+
- ----
- .. _class_ReflectionProbe_property_box_projection:
- - :ref:`bool<class_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.
- ----
- .. _class_ReflectionProbe_property_cull_mask:
- - :ref:`int<class_int>` **cull_mask**
- +-----------+----------------------+
- | *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:`VisualInstance3D<class_VisualInstance3D>` 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.
- ----
- .. _class_ReflectionProbe_property_enable_shadows:
- - :ref:`bool<class_bool>` **enable_shadows**
- +-----------+---------------------------+
- | *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>`.
- ----
- .. _class_ReflectionProbe_property_extents:
- - :ref:`Vector3<class_Vector3>` **extents**
- +-----------+-------------------------+
- | *Default* | ``Vector3(10, 10, 10)`` |
- +-----------+-------------------------+
- | *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.
- ----
- .. _class_ReflectionProbe_property_intensity:
- - :ref:`float<class_float>` **intensity**
- +-----------+----------------------+
- | *Default* | ``1.0`` |
- +-----------+----------------------+
- | *Setter* | set_intensity(value) |
- +-----------+----------------------+
- | *Getter* | get_intensity() |
- +-----------+----------------------+
- Defines the reflection intensity. Intensity modulates the strength of the reflection.
- ----
- .. _class_ReflectionProbe_property_interior:
- - :ref:`bool<class_bool>` **interior**
- +-----------+------------------------+
- | *Default* | ``false`` |
- +-----------+------------------------+
- | *Setter* | set_as_interior(value) |
- +-----------+------------------------+
- | *Getter* | is_set_as_interior() |
- +-----------+------------------------+
- If ``true``, reflections will ignore sky contribution.
- ----
- .. _class_ReflectionProbe_property_lod_threshold:
- - :ref:`float<class_float>` **lod_threshold**
- +-----------+--------------------------+
- | *Default* | ``1.0`` |
- +-----------+--------------------------+
- | *Setter* | set_lod_threshold(value) |
- +-----------+--------------------------+
- | *Getter* | get_lod_threshold() |
- +-----------+--------------------------+
- ----
- .. _class_ReflectionProbe_property_max_distance:
- - :ref:`float<class_float>` **max_distance**
- +-----------+-------------------------+
- | *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.
- ----
- .. _class_ReflectionProbe_property_origin_offset:
- - :ref:`Vector3<class_Vector3>` **origin_offset**
- +-----------+--------------------------+
- | *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.
- ----
- .. _class_ReflectionProbe_property_update_mode:
- - :ref:`UpdateMode<enum_ReflectionProbe_UpdateMode>` **update_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>`.
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
- .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
- .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
- .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
- .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
|