class_reflectionprobe.rst 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  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/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/ReflectionProbe.xml.
  6. .. _class_ReflectionProbe:
  7. ReflectionProbe
  8. ===============
  9. **Inherits:** :ref:`VisualInstance3D<class_VisualInstance3D>` **<** :ref:`Node3D<class_Node3D>` **<** :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. Captures its surroundings as a cubemap, 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:`VoxelGI<class_VoxelGI>`, SDFGI (:ref:`Environment.sdfgi_enabled<class_Environment_property_sdfgi_enabled>`) and screen-space reflections (:ref:`Environment.ssr_enabled<class_Environment_property_ssr_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:`VoxelGI<class_VoxelGI>` and SDFGI, **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:`Camera3D<class_Camera3D>` node, it will be ignored by the **ReflectionProbe**. This can lead to incorrect lighting within the **ReflectionProbe**.
  17. .. rst-class:: classref-introduction-group
  18. Tutorials
  19. ---------
  20. - :doc:`Reflection probes <../tutorials/3d/reflection_probes>`
  21. .. rst-class:: classref-reftable-group
  22. Properties
  23. ----------
  24. .. table::
  25. :widths: auto
  26. +------------------------------------------------------+----------------------------------------------------------------------------------+-------------------------+
  27. | :ref:`Color<class_Color>` | :ref:`ambient_color<class_ReflectionProbe_property_ambient_color>` | ``Color(0, 0, 0, 1)`` |
  28. +------------------------------------------------------+----------------------------------------------------------------------------------+-------------------------+
  29. | :ref:`float<class_float>` | :ref:`ambient_color_energy<class_ReflectionProbe_property_ambient_color_energy>` | ``1.0`` |
  30. +------------------------------------------------------+----------------------------------------------------------------------------------+-------------------------+
  31. | :ref:`AmbientMode<enum_ReflectionProbe_AmbientMode>` | :ref:`ambient_mode<class_ReflectionProbe_property_ambient_mode>` | ``1`` |
  32. +------------------------------------------------------+----------------------------------------------------------------------------------+-------------------------+
  33. | :ref:`bool<class_bool>` | :ref:`box_projection<class_ReflectionProbe_property_box_projection>` | ``false`` |
  34. +------------------------------------------------------+----------------------------------------------------------------------------------+-------------------------+
  35. | :ref:`int<class_int>` | :ref:`cull_mask<class_ReflectionProbe_property_cull_mask>` | ``1048575`` |
  36. +------------------------------------------------------+----------------------------------------------------------------------------------+-------------------------+
  37. | :ref:`bool<class_bool>` | :ref:`enable_shadows<class_ReflectionProbe_property_enable_shadows>` | ``false`` |
  38. +------------------------------------------------------+----------------------------------------------------------------------------------+-------------------------+
  39. | :ref:`Vector3<class_Vector3>` | :ref:`extents<class_ReflectionProbe_property_extents>` | ``Vector3(10, 10, 10)`` |
  40. +------------------------------------------------------+----------------------------------------------------------------------------------+-------------------------+
  41. | :ref:`float<class_float>` | :ref:`intensity<class_ReflectionProbe_property_intensity>` | ``1.0`` |
  42. +------------------------------------------------------+----------------------------------------------------------------------------------+-------------------------+
  43. | :ref:`bool<class_bool>` | :ref:`interior<class_ReflectionProbe_property_interior>` | ``false`` |
  44. +------------------------------------------------------+----------------------------------------------------------------------------------+-------------------------+
  45. | :ref:`float<class_float>` | :ref:`max_distance<class_ReflectionProbe_property_max_distance>` | ``0.0`` |
  46. +------------------------------------------------------+----------------------------------------------------------------------------------+-------------------------+
  47. | :ref:`float<class_float>` | :ref:`mesh_lod_threshold<class_ReflectionProbe_property_mesh_lod_threshold>` | ``1.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-item-separator
  70. ----
  71. .. _enum_ReflectionProbe_AmbientMode:
  72. .. rst-class:: classref-enumeration
  73. enum **AmbientMode**:
  74. .. _class_ReflectionProbe_constant_AMBIENT_DISABLED:
  75. .. rst-class:: classref-enumeration-constant
  76. :ref:`AmbientMode<enum_ReflectionProbe_AmbientMode>` **AMBIENT_DISABLED** = ``0``
  77. Do not apply any ambient lighting inside the **ReflectionProbe**'s :ref:`extents<class_ReflectionProbe_property_extents>`.
  78. .. _class_ReflectionProbe_constant_AMBIENT_ENVIRONMENT:
  79. .. rst-class:: classref-enumeration-constant
  80. :ref:`AmbientMode<enum_ReflectionProbe_AmbientMode>` **AMBIENT_ENVIRONMENT** = ``1``
  81. Apply automatically-sourced environment lighting inside the **ReflectionProbe**'s :ref:`extents<class_ReflectionProbe_property_extents>`.
  82. .. _class_ReflectionProbe_constant_AMBIENT_COLOR:
  83. .. rst-class:: classref-enumeration-constant
  84. :ref:`AmbientMode<enum_ReflectionProbe_AmbientMode>` **AMBIENT_COLOR** = ``2``
  85. Apply custom ambient lighting inside the **ReflectionProbe**'s :ref:`extents<class_ReflectionProbe_property_extents>`. See :ref:`ambient_color<class_ReflectionProbe_property_ambient_color>` and :ref:`ambient_color_energy<class_ReflectionProbe_property_ambient_color_energy>`.
  86. .. rst-class:: classref-section-separator
  87. ----
  88. .. rst-class:: classref-descriptions-group
  89. Property Descriptions
  90. ---------------------
  91. .. _class_ReflectionProbe_property_ambient_color:
  92. .. rst-class:: classref-property
  93. :ref:`Color<class_Color>` **ambient_color** = ``Color(0, 0, 0, 1)``
  94. .. rst-class:: classref-property-setget
  95. - void **set_ambient_color** **(** :ref:`Color<class_Color>` value **)**
  96. - :ref:`Color<class_Color>` **get_ambient_color** **(** **)**
  97. The custom ambient color to use within the **ReflectionProbe**'s :ref:`extents<class_ReflectionProbe_property_extents>`. Only effective if :ref:`ambient_mode<class_ReflectionProbe_property_ambient_mode>` is :ref:`AMBIENT_COLOR<class_ReflectionProbe_constant_AMBIENT_COLOR>`.
  98. .. rst-class:: classref-item-separator
  99. ----
  100. .. _class_ReflectionProbe_property_ambient_color_energy:
  101. .. rst-class:: classref-property
  102. :ref:`float<class_float>` **ambient_color_energy** = ``1.0``
  103. .. rst-class:: classref-property-setget
  104. - void **set_ambient_color_energy** **(** :ref:`float<class_float>` value **)**
  105. - :ref:`float<class_float>` **get_ambient_color_energy** **(** **)**
  106. The custom ambient color energy to use within the **ReflectionProbe**'s :ref:`extents<class_ReflectionProbe_property_extents>`. Only effective if :ref:`ambient_mode<class_ReflectionProbe_property_ambient_mode>` is :ref:`AMBIENT_COLOR<class_ReflectionProbe_constant_AMBIENT_COLOR>`.
  107. .. rst-class:: classref-item-separator
  108. ----
  109. .. _class_ReflectionProbe_property_ambient_mode:
  110. .. rst-class:: classref-property
  111. :ref:`AmbientMode<enum_ReflectionProbe_AmbientMode>` **ambient_mode** = ``1``
  112. .. rst-class:: classref-property-setget
  113. - void **set_ambient_mode** **(** :ref:`AmbientMode<enum_ReflectionProbe_AmbientMode>` value **)**
  114. - :ref:`AmbientMode<enum_ReflectionProbe_AmbientMode>` **get_ambient_mode** **(** **)**
  115. The ambient color to use within the **ReflectionProbe**'s :ref:`extents<class_ReflectionProbe_property_extents>`. The ambient color will smoothly blend with other **ReflectionProbe**\ s and the rest of the scene (outside the **ReflectionProbe**'s :ref:`extents<class_ReflectionProbe_property_extents>`).
  116. .. rst-class:: classref-item-separator
  117. ----
  118. .. _class_ReflectionProbe_property_box_projection:
  119. .. rst-class:: classref-property
  120. :ref:`bool<class_bool>` **box_projection** = ``false``
  121. .. rst-class:: classref-property-setget
  122. - void **set_enable_box_projection** **(** :ref:`bool<class_bool>` value **)**
  123. - :ref:`bool<class_bool>` **is_box_projection_enabled** **(** **)**
  124. 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.
  125. \ **Note:** To better fit rectangle-shaped rooms that are not aligned to the grid, you can rotate the **ReflectionProbe** node.
  126. .. rst-class:: classref-item-separator
  127. ----
  128. .. _class_ReflectionProbe_property_cull_mask:
  129. .. rst-class:: classref-property
  130. :ref:`int<class_int>` **cull_mask** = ``1048575``
  131. .. rst-class:: classref-property-setget
  132. - void **set_cull_mask** **(** :ref:`int<class_int>` value **)**
  133. - :ref:`int<class_int>` **get_cull_mask** **(** **)**
  134. 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. To improve performance, it is best to only include large objects which are likely to take up a lot of space in the reflection.
  135. .. rst-class:: classref-item-separator
  136. ----
  137. .. _class_ReflectionProbe_property_enable_shadows:
  138. .. rst-class:: classref-property
  139. :ref:`bool<class_bool>` **enable_shadows** = ``false``
  140. .. rst-class:: classref-property-setget
  141. - void **set_enable_shadows** **(** :ref:`bool<class_bool>` value **)**
  142. - :ref:`bool<class_bool>` **are_shadows_enabled** **(** **)**
  143. 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>`.
  144. .. rst-class:: classref-item-separator
  145. ----
  146. .. _class_ReflectionProbe_property_extents:
  147. .. rst-class:: classref-property
  148. :ref:`Vector3<class_Vector3>` **extents** = ``Vector3(10, 10, 10)``
  149. .. rst-class:: classref-property-setget
  150. - void **set_extents** **(** :ref:`Vector3<class_Vector3>` value **)**
  151. - :ref:`Vector3<class_Vector3>` **get_extents** **(** **)**
  152. 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.
  153. \ **Note:** To better fit areas that are not aligned to the grid, you can rotate the **ReflectionProbe** node.
  154. .. rst-class:: classref-item-separator
  155. ----
  156. .. _class_ReflectionProbe_property_intensity:
  157. .. rst-class:: classref-property
  158. :ref:`float<class_float>` **intensity** = ``1.0``
  159. .. rst-class:: classref-property-setget
  160. - void **set_intensity** **(** :ref:`float<class_float>` value **)**
  161. - :ref:`float<class_float>` **get_intensity** **(** **)**
  162. Defines the reflection intensity. Intensity modulates the strength of the reflection.
  163. .. rst-class:: classref-item-separator
  164. ----
  165. .. _class_ReflectionProbe_property_interior:
  166. .. rst-class:: classref-property
  167. :ref:`bool<class_bool>` **interior** = ``false``
  168. .. rst-class:: classref-property-setget
  169. - void **set_as_interior** **(** :ref:`bool<class_bool>` value **)**
  170. - :ref:`bool<class_bool>` **is_set_as_interior** **(** **)**
  171. If ``true``, reflections will ignore sky contribution.
  172. .. rst-class:: classref-item-separator
  173. ----
  174. .. _class_ReflectionProbe_property_max_distance:
  175. .. rst-class:: classref-property
  176. :ref:`float<class_float>` **max_distance** = ``0.0``
  177. .. rst-class:: classref-property-setget
  178. - void **set_max_distance** **(** :ref:`float<class_float>` value **)**
  179. - :ref:`float<class_float>` **get_max_distance** **(** **)**
  180. 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>`.
  181. \ **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.
  182. .. rst-class:: classref-item-separator
  183. ----
  184. .. _class_ReflectionProbe_property_mesh_lod_threshold:
  185. .. rst-class:: classref-property
  186. :ref:`float<class_float>` **mesh_lod_threshold** = ``1.0``
  187. .. rst-class:: classref-property-setget
  188. - void **set_mesh_lod_threshold** **(** :ref:`float<class_float>` value **)**
  189. - :ref:`float<class_float>` **get_mesh_lod_threshold** **(** **)**
  190. The automatic LOD bias to use for meshes rendered within the **ReflectionProbe** (this is analog to :ref:`Viewport.mesh_lod_threshold<class_Viewport_property_mesh_lod_threshold>`). Higher values will use less detailed versions of meshes that have LOD variations generated. If set to ``0.0``, automatic LOD is disabled. Increase :ref:`mesh_lod_threshold<class_ReflectionProbe_property_mesh_lod_threshold>` to improve performance at the cost of geometry detail, especially when using the :ref:`UPDATE_ALWAYS<class_ReflectionProbe_constant_UPDATE_ALWAYS>` :ref:`update_mode<class_ReflectionProbe_property_update_mode>`.
  191. \ **Note:** :ref:`mesh_lod_threshold<class_ReflectionProbe_property_mesh_lod_threshold>` does not affect :ref:`GeometryInstance3D<class_GeometryInstance3D>` visibility ranges (also known as "manual" LOD or hierarchical LOD).
  192. .. rst-class:: classref-item-separator
  193. ----
  194. .. _class_ReflectionProbe_property_origin_offset:
  195. .. rst-class:: classref-property
  196. :ref:`Vector3<class_Vector3>` **origin_offset** = ``Vector3(0, 0, 0)``
  197. .. rst-class:: classref-property-setget
  198. - void **set_origin_offset** **(** :ref:`Vector3<class_Vector3>` value **)**
  199. - :ref:`Vector3<class_Vector3>` **get_origin_offset** **(** **)**
  200. 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 number of objects that "get in the way" of the reflection.
  201. .. rst-class:: classref-item-separator
  202. ----
  203. .. _class_ReflectionProbe_property_update_mode:
  204. .. rst-class:: classref-property
  205. :ref:`UpdateMode<enum_ReflectionProbe_UpdateMode>` **update_mode** = ``0``
  206. .. rst-class:: classref-property-setget
  207. - void **set_update_mode** **(** :ref:`UpdateMode<enum_ReflectionProbe_UpdateMode>` value **)**
  208. - :ref:`UpdateMode<enum_ReflectionProbe_UpdateMode>` **get_update_mode** **(** **)**
  209. 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>`.
  210. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  211. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  212. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  213. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  214. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  215. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`