class_reflectionprobe.rst 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/ReflectionProbe.xml.
  6. .. _class_ReflectionProbe:
  7. ReflectionProbe
  8. ===============
  9. **Inherits:** :ref:`VisualInstance<class_VisualInstance>` **<** :ref:`CullInstance<class_CullInstance>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. Captures its surroundings to create fast, accurate reflections from a given point.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Capture its surroundings as a dual paraboloid image, and stores versions of it with increasing levels of blur to simulate different material roughnesses.
  15. The **ReflectionProbe** is used to create high-quality reflections at a low performance cost (when :ref:`update_mode<class_ReflectionProbe_property_update_mode>` is :ref:`UPDATE_ONCE<class_ReflectionProbe_constant_UPDATE_ONCE>`). **ReflectionProbe**\ s can be blended together and with the rest of the scene smoothly. **ReflectionProbe**\ s can also be combined with :ref:`GIProbe<class_GIProbe>` and screen-space reflections (:ref:`Environment.ss_reflections_enabled<class_Environment_property_ss_reflections_enabled>`) to get more accurate reflections in specific areas. **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 as-is.
  16. \ **Note:** Unlike :ref:`GIProbe<class_GIProbe>`, **ReflectionProbe**\ s only source their environment from a :ref:`WorldEnvironment<class_WorldEnvironment>` node. If you specify an :ref:`Environment<class_Environment>` resource within a :ref:`Camera<class_Camera>` node, it will be ignored by the **ReflectionProbe**. This can lead to incorrect lighting within the **ReflectionProbe**.
  17. \ **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 :ref:`ProjectSettings.rendering/quality/reflections/atlas_subdiv<class_ProjectSettings_property_rendering/quality/reflections/atlas_subdiv>`.
  18. \ **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.
  19. .. rst-class:: classref-introduction-group
  20. Tutorials
  21. ---------
  22. - :doc:`../tutorials/3d/reflection_probes`
  23. .. rst-class:: classref-reftable-group
  24. Properties
  25. ----------
  26. .. table::
  27. :widths: auto
  28. +----------------------------------------------------+------------------------------------------------------------------------------------------+-------------------------+
  29. | :ref:`bool<class_bool>` | :ref:`box_projection<class_ReflectionProbe_property_box_projection>` | ``false`` |
  30. +----------------------------------------------------+------------------------------------------------------------------------------------------+-------------------------+
  31. | :ref:`int<class_int>` | :ref:`cull_mask<class_ReflectionProbe_property_cull_mask>` | ``1048575`` |
  32. +----------------------------------------------------+------------------------------------------------------------------------------------------+-------------------------+
  33. | :ref:`bool<class_bool>` | :ref:`enable_shadows<class_ReflectionProbe_property_enable_shadows>` | ``false`` |
  34. +----------------------------------------------------+------------------------------------------------------------------------------------------+-------------------------+
  35. | :ref:`Vector3<class_Vector3>` | :ref:`extents<class_ReflectionProbe_property_extents>` | ``Vector3( 1, 1, 1 )`` |
  36. +----------------------------------------------------+------------------------------------------------------------------------------------------+-------------------------+
  37. | :ref:`float<class_float>` | :ref:`intensity<class_ReflectionProbe_property_intensity>` | ``1.0`` |
  38. +----------------------------------------------------+------------------------------------------------------------------------------------------+-------------------------+
  39. | :ref:`Color<class_Color>` | :ref:`interior_ambient_color<class_ReflectionProbe_property_interior_ambient_color>` | ``Color( 0, 0, 0, 1 )`` |
  40. +----------------------------------------------------+------------------------------------------------------------------------------------------+-------------------------+
  41. | :ref:`float<class_float>` | :ref:`interior_ambient_contrib<class_ReflectionProbe_property_interior_ambient_contrib>` | ``0.0`` |
  42. +----------------------------------------------------+------------------------------------------------------------------------------------------+-------------------------+
  43. | :ref:`float<class_float>` | :ref:`interior_ambient_energy<class_ReflectionProbe_property_interior_ambient_energy>` | ``1.0`` |
  44. +----------------------------------------------------+------------------------------------------------------------------------------------------+-------------------------+
  45. | :ref:`bool<class_bool>` | :ref:`interior_enable<class_ReflectionProbe_property_interior_enable>` | ``false`` |
  46. +----------------------------------------------------+------------------------------------------------------------------------------------------+-------------------------+
  47. | :ref:`float<class_float>` | :ref:`max_distance<class_ReflectionProbe_property_max_distance>` | ``0.0`` |
  48. +----------------------------------------------------+------------------------------------------------------------------------------------------+-------------------------+
  49. | :ref:`Vector3<class_Vector3>` | :ref:`origin_offset<class_ReflectionProbe_property_origin_offset>` | ``Vector3( 0, 0, 0 )`` |
  50. +----------------------------------------------------+------------------------------------------------------------------------------------------+-------------------------+
  51. | :ref:`UpdateMode<enum_ReflectionProbe_UpdateMode>` | :ref:`update_mode<class_ReflectionProbe_property_update_mode>` | ``0`` |
  52. +----------------------------------------------------+------------------------------------------------------------------------------------------+-------------------------+
  53. .. rst-class:: classref-section-separator
  54. ----
  55. .. rst-class:: classref-descriptions-group
  56. Enumerations
  57. ------------
  58. .. _enum_ReflectionProbe_UpdateMode:
  59. .. rst-class:: classref-enumeration
  60. enum **UpdateMode**:
  61. .. _class_ReflectionProbe_constant_UPDATE_ONCE:
  62. .. rst-class:: classref-enumeration-constant
  63. :ref:`UpdateMode<enum_ReflectionProbe_UpdateMode>` **UPDATE_ONCE** = ``0``
  64. 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 :ref:`UPDATE_ALWAYS<class_ReflectionProbe_constant_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.
  65. .. _class_ReflectionProbe_constant_UPDATE_ALWAYS:
  66. .. rst-class:: classref-enumeration-constant
  67. :ref:`UpdateMode<enum_ReflectionProbe_UpdateMode>` **UPDATE_ALWAYS** = ``1``
  68. 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 :ref:`UPDATE_ALWAYS<class_ReflectionProbe_constant_UPDATE_ALWAYS>` at most per scene. For all other use cases, use :ref:`UPDATE_ONCE<class_ReflectionProbe_constant_UPDATE_ONCE>`.
  69. .. rst-class:: classref-section-separator
  70. ----
  71. .. rst-class:: classref-descriptions-group
  72. Property Descriptions
  73. ---------------------
  74. .. _class_ReflectionProbe_property_box_projection:
  75. .. rst-class:: classref-property
  76. :ref:`bool<class_bool>` **box_projection** = ``false``
  77. .. rst-class:: classref-property-setget
  78. - void **set_enable_box_projection** **(** :ref:`bool<class_bool>` value **)**
  79. - :ref:`bool<class_bool>` **is_box_projection_enabled** **(** **)**
  80. 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.
  81. \ **Note:** To better fit rectangle-shaped rooms that are not aligned to the grid, you can rotate the **ReflectionProbe** node.
  82. .. rst-class:: classref-item-separator
  83. ----
  84. .. _class_ReflectionProbe_property_cull_mask:
  85. .. rst-class:: classref-property
  86. :ref:`int<class_int>` **cull_mask** = ``1048575``
  87. .. rst-class:: classref-property-setget
  88. - void **set_cull_mask** **(** :ref:`int<class_int>` value **)**
  89. - :ref:`int<class_int>` **get_cull_mask** **(** **)**
  90. 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. To improve performance, it is best to only include large objects which are likely to take up a lot of space in the reflection.
  91. .. rst-class:: classref-item-separator
  92. ----
  93. .. _class_ReflectionProbe_property_enable_shadows:
  94. .. rst-class:: classref-property
  95. :ref:`bool<class_bool>` **enable_shadows** = ``false``
  96. .. rst-class:: classref-property-setget
  97. - void **set_enable_shadows** **(** :ref:`bool<class_bool>` value **)**
  98. - :ref:`bool<class_bool>` **are_shadows_enabled** **(** **)**
  99. 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>`.
  100. .. rst-class:: classref-item-separator
  101. ----
  102. .. _class_ReflectionProbe_property_extents:
  103. .. rst-class:: classref-property
  104. :ref:`Vector3<class_Vector3>` **extents** = ``Vector3( 1, 1, 1 )``
  105. .. rst-class:: classref-property-setget
  106. - void **set_extents** **(** :ref:`Vector3<class_Vector3>` value **)**
  107. - :ref:`Vector3<class_Vector3>` **get_extents** **(** **)**
  108. 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.
  109. \ **Note:** To better fit areas that are not aligned to the grid, you can rotate the **ReflectionProbe** node.
  110. .. rst-class:: classref-item-separator
  111. ----
  112. .. _class_ReflectionProbe_property_intensity:
  113. .. rst-class:: classref-property
  114. :ref:`float<class_float>` **intensity** = ``1.0``
  115. .. rst-class:: classref-property-setget
  116. - void **set_intensity** **(** :ref:`float<class_float>` value **)**
  117. - :ref:`float<class_float>` **get_intensity** **(** **)**
  118. Defines the reflection intensity. Intensity modulates the strength of the reflection.
  119. .. rst-class:: classref-item-separator
  120. ----
  121. .. _class_ReflectionProbe_property_interior_ambient_color:
  122. .. rst-class:: classref-property
  123. :ref:`Color<class_Color>` **interior_ambient_color** = ``Color( 0, 0, 0, 1 )``
  124. .. rst-class:: classref-property-setget
  125. - void **set_interior_ambient** **(** :ref:`Color<class_Color>` value **)**
  126. - :ref:`Color<class_Color>` **get_interior_ambient** **(** **)**
  127. Sets the ambient light color to be used when this probe is set to :ref:`interior_enable<class_ReflectionProbe_property_interior_enable>`.
  128. .. rst-class:: classref-item-separator
  129. ----
  130. .. _class_ReflectionProbe_property_interior_ambient_contrib:
  131. .. rst-class:: classref-property
  132. :ref:`float<class_float>` **interior_ambient_contrib** = ``0.0``
  133. .. rst-class:: classref-property-setget
  134. - void **set_interior_ambient_probe_contribution** **(** :ref:`float<class_float>` value **)**
  135. - :ref:`float<class_float>` **get_interior_ambient_probe_contribution** **(** **)**
  136. 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.
  137. .. rst-class:: classref-item-separator
  138. ----
  139. .. _class_ReflectionProbe_property_interior_ambient_energy:
  140. .. rst-class:: classref-property
  141. :ref:`float<class_float>` **interior_ambient_energy** = ``1.0``
  142. .. rst-class:: classref-property-setget
  143. - void **set_interior_ambient_energy** **(** :ref:`float<class_float>` value **)**
  144. - :ref:`float<class_float>` **get_interior_ambient_energy** **(** **)**
  145. Sets the energy multiplier for this reflection probe's ambient light contribution when set to :ref:`interior_enable<class_ReflectionProbe_property_interior_enable>`.
  146. .. rst-class:: classref-item-separator
  147. ----
  148. .. _class_ReflectionProbe_property_interior_enable:
  149. .. rst-class:: classref-property
  150. :ref:`bool<class_bool>` **interior_enable** = ``false``
  151. .. rst-class:: classref-property-setget
  152. - void **set_as_interior** **(** :ref:`bool<class_bool>` value **)**
  153. - :ref:`bool<class_bool>` **is_set_as_interior** **(** **)**
  154. If ``true``, reflections will ignore sky contribution. Ambient lighting is then controlled by the ``interior_ambient_*`` properties.
  155. .. rst-class:: classref-item-separator
  156. ----
  157. .. _class_ReflectionProbe_property_max_distance:
  158. .. rst-class:: classref-property
  159. :ref:`float<class_float>` **max_distance** = ``0.0``
  160. .. rst-class:: classref-property-setget
  161. - void **set_max_distance** **(** :ref:`float<class_float>` value **)**
  162. - :ref:`float<class_float>` **get_max_distance** **(** **)**
  163. The maximum distance away from the **ReflectionProbe** an object can be before it is culled. Decrease this to improve performance, especially when using the :ref:`UPDATE_ALWAYS<class_ReflectionProbe_constant_UPDATE_ALWAYS>` :ref:`update_mode<class_ReflectionProbe_property_update_mode>`.
  164. \ **Note:** The maximum reflection distance is always at least equal to the :ref:`extents<class_ReflectionProbe_property_extents>`. This means that decreasing :ref:`max_distance<class_ReflectionProbe_property_max_distance>` will not always cull objects from reflections, especially if the reflection probe's :ref:`extents<class_ReflectionProbe_property_extents>` are already large.
  165. .. rst-class:: classref-item-separator
  166. ----
  167. .. _class_ReflectionProbe_property_origin_offset:
  168. .. rst-class:: classref-property
  169. :ref:`Vector3<class_Vector3>` **origin_offset** = ``Vector3( 0, 0, 0 )``
  170. .. rst-class:: classref-property-setget
  171. - void **set_origin_offset** **(** :ref:`Vector3<class_Vector3>` value **)**
  172. - :ref:`Vector3<class_Vector3>` **get_origin_offset** **(** **)**
  173. Sets the origin offset to be used when this **ReflectionProbe** is in :ref:`box_projection<class_ReflectionProbe_property_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.
  174. .. rst-class:: classref-item-separator
  175. ----
  176. .. _class_ReflectionProbe_property_update_mode:
  177. .. rst-class:: classref-property
  178. :ref:`UpdateMode<enum_ReflectionProbe_UpdateMode>` **update_mode** = ``0``
  179. .. rst-class:: classref-property-setget
  180. - void **set_update_mode** **(** :ref:`UpdateMode<enum_ReflectionProbe_UpdateMode>` value **)**
  181. - :ref:`UpdateMode<enum_ReflectionProbe_UpdateMode>` **get_update_mode** **(** **)**
  182. Sets how frequently the **ReflectionProbe** is updated. Can be :ref:`UPDATE_ONCE<class_ReflectionProbe_constant_UPDATE_ONCE>` or :ref:`UPDATE_ALWAYS<class_ReflectionProbe_constant_UPDATE_ALWAYS>`.
  183. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  184. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  185. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  186. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`