class_giprobe.rst 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  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.5/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/GIProbe.xml.
  6. .. _class_GIProbe:
  7. GIProbe
  8. =======
  9. **Inherits:** :ref:`VisualInstance<class_VisualInstance>` **<** :ref:`CullInstance<class_CullInstance>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. Real-time global illumination (GI) probe.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. **GIProbe**\ s are used to provide high-quality real-time indirect light to scenes. They precompute the effect of objects that emit light and the effect of static geometry to simulate the behavior of complex light in real-time. **GIProbe**\ s need to be baked before using, however, once baked, dynamic objects will receive light from them. Further, lights can be fully dynamic or baked.
  15. Having **GIProbe**\ s in a scene can be expensive, the quality of the probe can be turned down in exchange for better performance in the :ref:`ProjectSettings<class_ProjectSettings>` using :ref:`ProjectSettings.rendering/quality/voxel_cone_tracing/high_quality<class_ProjectSettings_property_rendering/quality/voxel_cone_tracing/high_quality>`.
  16. \ **Procedural generation:** **GIProbe** can be baked in an exported project, which makes it suitable for procedurally generated or user-built levels as long as all the geometry is generated in advance.
  17. \ **Performance:** **GIProbe** is relatively demanding on the GPU and is not suited to low-end hardware such as integrated graphics (consider :ref:`BakedLightmap<class_BakedLightmap>` instead). To provide a fallback for low-end hardware, consider adding an option to disable **GIProbe** in your project's options menus. A **GIProbe** node can be disabled by hiding it.
  18. \ **Note:** Meshes should have sufficiently thick walls to avoid light leaks (avoid one-sided walls). For interior levels, enclose your level geometry in a sufficiently large box and bridge the loops to close the mesh. To further prevent light leaks, you can also strategically place temporary :ref:`MeshInstance<class_MeshInstance>` nodes with :ref:`GeometryInstance.use_in_baked_light<class_GeometryInstance_property_use_in_baked_light>` enabled. These temporary nodes can then be hidden after baking the **GIProbe** node.
  19. \ **Note:** Due to a renderer limitation, emissive :ref:`ShaderMaterial<class_ShaderMaterial>`\ s cannot emit light when used in a **GIProbe**. Only emissive :ref:`SpatialMaterial<class_SpatialMaterial>`\ s can emit light in a **GIProbe**.
  20. .. rst-class:: classref-introduction-group
  21. Tutorials
  22. ---------
  23. - :doc:`GI probes <../tutorials/3d/gi_probes>`
  24. - `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
  25. .. rst-class:: classref-reftable-group
  26. Properties
  27. ----------
  28. .. table::
  29. :widths: auto
  30. +---------------------------------------+------------------------------------------------------------+---------------------------+
  31. | :ref:`float<class_float>` | :ref:`bias<class_GIProbe_property_bias>` | ``1.5`` |
  32. +---------------------------------------+------------------------------------------------------------+---------------------------+
  33. | :ref:`bool<class_bool>` | :ref:`compress<class_GIProbe_property_compress>` | ``false`` |
  34. +---------------------------------------+------------------------------------------------------------+---------------------------+
  35. | :ref:`GIProbeData<class_GIProbeData>` | :ref:`data<class_GIProbe_property_data>` | |
  36. +---------------------------------------+------------------------------------------------------------+---------------------------+
  37. | :ref:`int<class_int>` | :ref:`dynamic_range<class_GIProbe_property_dynamic_range>` | ``4`` |
  38. +---------------------------------------+------------------------------------------------------------+---------------------------+
  39. | :ref:`float<class_float>` | :ref:`energy<class_GIProbe_property_energy>` | ``1.0`` |
  40. +---------------------------------------+------------------------------------------------------------+---------------------------+
  41. | :ref:`Vector3<class_Vector3>` | :ref:`extents<class_GIProbe_property_extents>` | ``Vector3( 10, 10, 10 )`` |
  42. +---------------------------------------+------------------------------------------------------------+---------------------------+
  43. | :ref:`bool<class_bool>` | :ref:`interior<class_GIProbe_property_interior>` | ``false`` |
  44. +---------------------------------------+------------------------------------------------------------+---------------------------+
  45. | :ref:`float<class_float>` | :ref:`normal_bias<class_GIProbe_property_normal_bias>` | ``0.0`` |
  46. +---------------------------------------+------------------------------------------------------------+---------------------------+
  47. | :ref:`float<class_float>` | :ref:`propagation<class_GIProbe_property_propagation>` | ``0.7`` |
  48. +---------------------------------------+------------------------------------------------------------+---------------------------+
  49. | :ref:`Subdiv<enum_GIProbe_Subdiv>` | :ref:`subdiv<class_GIProbe_property_subdiv>` | ``1`` |
  50. +---------------------------------------+------------------------------------------------------------+---------------------------+
  51. .. rst-class:: classref-reftable-group
  52. Methods
  53. -------
  54. .. table::
  55. :widths: auto
  56. +------+----------------------------------------------------------------------------------------------------------------------------------------------+
  57. | void | :ref:`bake<class_GIProbe_method_bake>` **(** :ref:`Node<class_Node>` from_node=null, :ref:`bool<class_bool>` create_visual_debug=false **)** |
  58. +------+----------------------------------------------------------------------------------------------------------------------------------------------+
  59. | void | :ref:`debug_bake<class_GIProbe_method_debug_bake>` **(** **)** |
  60. +------+----------------------------------------------------------------------------------------------------------------------------------------------+
  61. .. rst-class:: classref-section-separator
  62. ----
  63. .. rst-class:: classref-descriptions-group
  64. Enumerations
  65. ------------
  66. .. _enum_GIProbe_Subdiv:
  67. .. rst-class:: classref-enumeration
  68. enum **Subdiv**:
  69. .. _class_GIProbe_constant_SUBDIV_64:
  70. .. rst-class:: classref-enumeration-constant
  71. :ref:`Subdiv<enum_GIProbe_Subdiv>` **SUBDIV_64** = ``0``
  72. Use 64 subdivisions. This is the lowest quality setting, but the fastest. Use it if you can, but especially use it on lower-end hardware.
  73. .. _class_GIProbe_constant_SUBDIV_128:
  74. .. rst-class:: classref-enumeration-constant
  75. :ref:`Subdiv<enum_GIProbe_Subdiv>` **SUBDIV_128** = ``1``
  76. Use 128 subdivisions. This is the default quality setting.
  77. .. _class_GIProbe_constant_SUBDIV_256:
  78. .. rst-class:: classref-enumeration-constant
  79. :ref:`Subdiv<enum_GIProbe_Subdiv>` **SUBDIV_256** = ``2``
  80. Use 256 subdivisions.
  81. .. _class_GIProbe_constant_SUBDIV_512:
  82. .. rst-class:: classref-enumeration-constant
  83. :ref:`Subdiv<enum_GIProbe_Subdiv>` **SUBDIV_512** = ``3``
  84. Use 512 subdivisions. This is the highest quality setting, but the slowest. On lower-end hardware, this could cause the GPU to stall.
  85. .. _class_GIProbe_constant_SUBDIV_MAX:
  86. .. rst-class:: classref-enumeration-constant
  87. :ref:`Subdiv<enum_GIProbe_Subdiv>` **SUBDIV_MAX** = ``4``
  88. Represents the size of the :ref:`Subdiv<enum_GIProbe_Subdiv>` enum.
  89. .. rst-class:: classref-section-separator
  90. ----
  91. .. rst-class:: classref-descriptions-group
  92. Property Descriptions
  93. ---------------------
  94. .. _class_GIProbe_property_bias:
  95. .. rst-class:: classref-property
  96. :ref:`float<class_float>` **bias** = ``1.5``
  97. .. rst-class:: classref-property-setget
  98. - void **set_bias** **(** :ref:`float<class_float>` value **)**
  99. - :ref:`float<class_float>` **get_bias** **(** **)**
  100. Offsets the lookup of the light contribution from the **GIProbe**. This can be used to avoid self-shadowing, but may introduce light leaking at higher values. This and :ref:`normal_bias<class_GIProbe_property_normal_bias>` should be played around with to minimize self-shadowing and light leaking.
  101. \ **Note:** ``bias`` should usually be above 1.0 as that is the size of the voxels.
  102. .. rst-class:: classref-item-separator
  103. ----
  104. .. _class_GIProbe_property_compress:
  105. .. rst-class:: classref-property
  106. :ref:`bool<class_bool>` **compress** = ``false``
  107. .. rst-class:: classref-property-setget
  108. - void **set_compress** **(** :ref:`bool<class_bool>` value **)**
  109. - :ref:`bool<class_bool>` **is_compressed** **(** **)**
  110. *Deprecated.* This property has been deprecated due to known bugs and no longer has any effect when enabled.
  111. .. rst-class:: classref-item-separator
  112. ----
  113. .. _class_GIProbe_property_data:
  114. .. rst-class:: classref-property
  115. :ref:`GIProbeData<class_GIProbeData>` **data**
  116. .. rst-class:: classref-property-setget
  117. - void **set_probe_data** **(** :ref:`GIProbeData<class_GIProbeData>` value **)**
  118. - :ref:`GIProbeData<class_GIProbeData>` **get_probe_data** **(** **)**
  119. The :ref:`GIProbeData<class_GIProbeData>` resource that holds the data for this **GIProbe**.
  120. .. rst-class:: classref-item-separator
  121. ----
  122. .. _class_GIProbe_property_dynamic_range:
  123. .. rst-class:: classref-property
  124. :ref:`int<class_int>` **dynamic_range** = ``4``
  125. .. rst-class:: classref-property-setget
  126. - void **set_dynamic_range** **(** :ref:`int<class_int>` value **)**
  127. - :ref:`int<class_int>` **get_dynamic_range** **(** **)**
  128. The maximum brightness that the **GIProbe** will recognize. Brightness will be scaled within this range.
  129. .. rst-class:: classref-item-separator
  130. ----
  131. .. _class_GIProbe_property_energy:
  132. .. rst-class:: classref-property
  133. :ref:`float<class_float>` **energy** = ``1.0``
  134. .. rst-class:: classref-property-setget
  135. - void **set_energy** **(** :ref:`float<class_float>` value **)**
  136. - :ref:`float<class_float>` **get_energy** **(** **)**
  137. Energy multiplier. Makes the lighting contribution from the **GIProbe** brighter.
  138. .. rst-class:: classref-item-separator
  139. ----
  140. .. _class_GIProbe_property_extents:
  141. .. rst-class:: classref-property
  142. :ref:`Vector3<class_Vector3>` **extents** = ``Vector3( 10, 10, 10 )``
  143. .. rst-class:: classref-property-setget
  144. - void **set_extents** **(** :ref:`Vector3<class_Vector3>` value **)**
  145. - :ref:`Vector3<class_Vector3>` **get_extents** **(** **)**
  146. The size of the area covered by the **GIProbe**. If you make the extents larger without increasing the subdivisions with :ref:`subdiv<class_GIProbe_property_subdiv>`, the size of each cell will increase and result in lower detailed lighting.
  147. .. rst-class:: classref-item-separator
  148. ----
  149. .. _class_GIProbe_property_interior:
  150. .. rst-class:: classref-property
  151. :ref:`bool<class_bool>` **interior** = ``false``
  152. .. rst-class:: classref-property-setget
  153. - void **set_interior** **(** :ref:`bool<class_bool>` value **)**
  154. - :ref:`bool<class_bool>` **is_interior** **(** **)**
  155. If ``true``, ignores the sky contribution when calculating lighting.
  156. .. rst-class:: classref-item-separator
  157. ----
  158. .. _class_GIProbe_property_normal_bias:
  159. .. rst-class:: classref-property
  160. :ref:`float<class_float>` **normal_bias** = ``0.0``
  161. .. rst-class:: classref-property-setget
  162. - void **set_normal_bias** **(** :ref:`float<class_float>` value **)**
  163. - :ref:`float<class_float>` **get_normal_bias** **(** **)**
  164. Offsets the lookup into the **GIProbe** based on the object's normal direction. Can be used to reduce some self-shadowing artifacts.
  165. .. rst-class:: classref-item-separator
  166. ----
  167. .. _class_GIProbe_property_propagation:
  168. .. rst-class:: classref-property
  169. :ref:`float<class_float>` **propagation** = ``0.7``
  170. .. rst-class:: classref-property-setget
  171. - void **set_propagation** **(** :ref:`float<class_float>` value **)**
  172. - :ref:`float<class_float>` **get_propagation** **(** **)**
  173. How much light propagates through the probe internally. A higher value allows light to spread further.
  174. .. rst-class:: classref-item-separator
  175. ----
  176. .. _class_GIProbe_property_subdiv:
  177. .. rst-class:: classref-property
  178. :ref:`Subdiv<enum_GIProbe_Subdiv>` **subdiv** = ``1``
  179. .. rst-class:: classref-property-setget
  180. - void **set_subdiv** **(** :ref:`Subdiv<enum_GIProbe_Subdiv>` value **)**
  181. - :ref:`Subdiv<enum_GIProbe_Subdiv>` **get_subdiv** **(** **)**
  182. Number of times to subdivide the grid that the **GIProbe** operates on. A higher number results in finer detail and thus higher visual quality, while lower numbers result in better performance.
  183. .. rst-class:: classref-section-separator
  184. ----
  185. .. rst-class:: classref-descriptions-group
  186. Method Descriptions
  187. -------------------
  188. .. _class_GIProbe_method_bake:
  189. .. rst-class:: classref-method
  190. void **bake** **(** :ref:`Node<class_Node>` from_node=null, :ref:`bool<class_bool>` create_visual_debug=false **)**
  191. Bakes the effect from all :ref:`GeometryInstance<class_GeometryInstance>`\ s marked with :ref:`GeometryInstance.use_in_baked_light<class_GeometryInstance_property_use_in_baked_light>` and :ref:`Light<class_Light>`\ s marked with either :ref:`Light.BAKE_INDIRECT<class_Light_constant_BAKE_INDIRECT>` or :ref:`Light.BAKE_ALL<class_Light_constant_BAKE_ALL>`. If ``create_visual_debug`` is ``true``, after baking the light, this will generate a :ref:`MultiMesh<class_MultiMesh>` that has a cube representing each solid cell with each cube colored to the cell's albedo color. This can be used to visualize the **GIProbe**'s data and debug any issues that may be occurring.
  192. \ **Note:** :ref:`bake<class_GIProbe_method_bake>` works from the editor and in exported projects. This makes it suitable for procedurally generated or user-built levels. Baking a **GIProbe** generally takes from 5 to 20 seconds in most scenes. Reducing :ref:`subdiv<class_GIProbe_property_subdiv>` can speed up baking.
  193. \ **Note:** :ref:`GeometryInstance<class_GeometryInstance>`\ s and :ref:`Light<class_Light>`\ s must be fully ready before :ref:`bake<class_GIProbe_method_bake>` is called. If you are procedurally creating those and some meshes or lights are missing from your baked **GIProbe**, use ``call_deferred("bake")`` instead of calling :ref:`bake<class_GIProbe_method_bake>` directly.
  194. .. rst-class:: classref-item-separator
  195. ----
  196. .. _class_GIProbe_method_debug_bake:
  197. .. rst-class:: classref-method
  198. void **debug_bake** **(** **)**
  199. Calls :ref:`bake<class_GIProbe_method_bake>` with ``create_visual_debug`` enabled.
  200. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  201. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  202. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  203. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`