class_giprobe.rst 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the GIProbe.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_GIProbe:
  6. GIProbe
  7. =======
  8. **Inherits:** :ref:`VisualInstance<class_VisualInstance>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. Real-time global illumination (GI) probe.
  10. Description
  11. -----------
  12. ``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.
  13. 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>`.
  14. Tutorials
  15. ---------
  16. - :doc:`../tutorials/3d/gi_probes`
  17. - `https://godotengine.org/asset-library/asset/678 <https://godotengine.org/asset-library/asset/678>`_
  18. Properties
  19. ----------
  20. +---------------------------------------+------------------------------------------------------------+---------------------------+
  21. | :ref:`float<class_float>` | :ref:`bias<class_GIProbe_property_bias>` | ``1.5`` |
  22. +---------------------------------------+------------------------------------------------------------+---------------------------+
  23. | :ref:`bool<class_bool>` | :ref:`compress<class_GIProbe_property_compress>` | ``false`` |
  24. +---------------------------------------+------------------------------------------------------------+---------------------------+
  25. | :ref:`GIProbeData<class_GIProbeData>` | :ref:`data<class_GIProbe_property_data>` | |
  26. +---------------------------------------+------------------------------------------------------------+---------------------------+
  27. | :ref:`int<class_int>` | :ref:`dynamic_range<class_GIProbe_property_dynamic_range>` | ``4`` |
  28. +---------------------------------------+------------------------------------------------------------+---------------------------+
  29. | :ref:`float<class_float>` | :ref:`energy<class_GIProbe_property_energy>` | ``1.0`` |
  30. +---------------------------------------+------------------------------------------------------------+---------------------------+
  31. | :ref:`Vector3<class_Vector3>` | :ref:`extents<class_GIProbe_property_extents>` | ``Vector3( 10, 10, 10 )`` |
  32. +---------------------------------------+------------------------------------------------------------+---------------------------+
  33. | :ref:`bool<class_bool>` | :ref:`interior<class_GIProbe_property_interior>` | ``false`` |
  34. +---------------------------------------+------------------------------------------------------------+---------------------------+
  35. | :ref:`float<class_float>` | :ref:`normal_bias<class_GIProbe_property_normal_bias>` | ``0.0`` |
  36. +---------------------------------------+------------------------------------------------------------+---------------------------+
  37. | :ref:`float<class_float>` | :ref:`propagation<class_GIProbe_property_propagation>` | ``0.7`` |
  38. +---------------------------------------+------------------------------------------------------------+---------------------------+
  39. | :ref:`Subdiv<enum_GIProbe_Subdiv>` | :ref:`subdiv<class_GIProbe_property_subdiv>` | ``1`` |
  40. +---------------------------------------+------------------------------------------------------------+---------------------------+
  41. Methods
  42. -------
  43. +------+----------------------------------------------------------------------------------------------------------------------------------------------+
  44. | void | :ref:`bake<class_GIProbe_method_bake>` **(** :ref:`Node<class_Node>` from_node=null, :ref:`bool<class_bool>` create_visual_debug=false **)** |
  45. +------+----------------------------------------------------------------------------------------------------------------------------------------------+
  46. | void | :ref:`debug_bake<class_GIProbe_method_debug_bake>` **(** **)** |
  47. +------+----------------------------------------------------------------------------------------------------------------------------------------------+
  48. Enumerations
  49. ------------
  50. .. _enum_GIProbe_Subdiv:
  51. .. _class_GIProbe_constant_SUBDIV_64:
  52. .. _class_GIProbe_constant_SUBDIV_128:
  53. .. _class_GIProbe_constant_SUBDIV_256:
  54. .. _class_GIProbe_constant_SUBDIV_512:
  55. .. _class_GIProbe_constant_SUBDIV_MAX:
  56. enum **Subdiv**:
  57. - **SUBDIV_64** = **0** --- 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.
  58. - **SUBDIV_128** = **1** --- Use 128 subdivisions. This is the default quality setting.
  59. - **SUBDIV_256** = **2** --- Use 256 subdivisions.
  60. - **SUBDIV_512** = **3** --- Use 512 subdivisions. This is the highest quality setting, but the slowest. On lower-end hardware this could cause the GPU to stall.
  61. - **SUBDIV_MAX** = **4** --- Represents the size of the :ref:`Subdiv<enum_GIProbe_Subdiv>` enum.
  62. Property Descriptions
  63. ---------------------
  64. .. _class_GIProbe_property_bias:
  65. - :ref:`float<class_float>` **bias**
  66. +-----------+-----------------+
  67. | *Default* | ``1.5`` |
  68. +-----------+-----------------+
  69. | *Setter* | set_bias(value) |
  70. +-----------+-----------------+
  71. | *Getter* | get_bias() |
  72. +-----------+-----------------+
  73. 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.
  74. **Note:** ``bias`` should usually be above 1.0 as that is the size of the voxels.
  75. ----
  76. .. _class_GIProbe_property_compress:
  77. - :ref:`bool<class_bool>` **compress**
  78. +-----------+---------------------+
  79. | *Default* | ``false`` |
  80. +-----------+---------------------+
  81. | *Setter* | set_compress(value) |
  82. +-----------+---------------------+
  83. | *Getter* | is_compressed() |
  84. +-----------+---------------------+
  85. If ``true``, the data for this ``GIProbe`` will be compressed. Compression saves space, but results in far worse visual quality.
  86. ----
  87. .. _class_GIProbe_property_data:
  88. - :ref:`GIProbeData<class_GIProbeData>` **data**
  89. +----------+-----------------------+
  90. | *Setter* | set_probe_data(value) |
  91. +----------+-----------------------+
  92. | *Getter* | get_probe_data() |
  93. +----------+-----------------------+
  94. The :ref:`GIProbeData<class_GIProbeData>` resource that holds the data for this ``GIProbe``.
  95. ----
  96. .. _class_GIProbe_property_dynamic_range:
  97. - :ref:`int<class_int>` **dynamic_range**
  98. +-----------+--------------------------+
  99. | *Default* | ``4`` |
  100. +-----------+--------------------------+
  101. | *Setter* | set_dynamic_range(value) |
  102. +-----------+--------------------------+
  103. | *Getter* | get_dynamic_range() |
  104. +-----------+--------------------------+
  105. The maximum brightness that the ``GIProbe`` will recognize. Brightness will be scaled within this range.
  106. ----
  107. .. _class_GIProbe_property_energy:
  108. - :ref:`float<class_float>` **energy**
  109. +-----------+-------------------+
  110. | *Default* | ``1.0`` |
  111. +-----------+-------------------+
  112. | *Setter* | set_energy(value) |
  113. +-----------+-------------------+
  114. | *Getter* | get_energy() |
  115. +-----------+-------------------+
  116. Energy multiplier. Makes the lighting contribution from the ``GIProbe`` brighter.
  117. ----
  118. .. _class_GIProbe_property_extents:
  119. - :ref:`Vector3<class_Vector3>` **extents**
  120. +-----------+---------------------------+
  121. | *Default* | ``Vector3( 10, 10, 10 )`` |
  122. +-----------+---------------------------+
  123. | *Setter* | set_extents(value) |
  124. +-----------+---------------------------+
  125. | *Getter* | get_extents() |
  126. +-----------+---------------------------+
  127. 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.
  128. ----
  129. .. _class_GIProbe_property_interior:
  130. - :ref:`bool<class_bool>` **interior**
  131. +-----------+---------------------+
  132. | *Default* | ``false`` |
  133. +-----------+---------------------+
  134. | *Setter* | set_interior(value) |
  135. +-----------+---------------------+
  136. | *Getter* | is_interior() |
  137. +-----------+---------------------+
  138. If ``true``, ignores the sky contribution when calculating lighting.
  139. ----
  140. .. _class_GIProbe_property_normal_bias:
  141. - :ref:`float<class_float>` **normal_bias**
  142. +-----------+------------------------+
  143. | *Default* | ``0.0`` |
  144. +-----------+------------------------+
  145. | *Setter* | set_normal_bias(value) |
  146. +-----------+------------------------+
  147. | *Getter* | get_normal_bias() |
  148. +-----------+------------------------+
  149. Offsets the lookup into the ``GIProbe`` based on the object's normal direction. Can be used to reduce some self-shadowing artifacts.
  150. ----
  151. .. _class_GIProbe_property_propagation:
  152. - :ref:`float<class_float>` **propagation**
  153. +-----------+------------------------+
  154. | *Default* | ``0.7`` |
  155. +-----------+------------------------+
  156. | *Setter* | set_propagation(value) |
  157. +-----------+------------------------+
  158. | *Getter* | get_propagation() |
  159. +-----------+------------------------+
  160. How much light propagates through the probe internally. A higher value allows light to spread further.
  161. ----
  162. .. _class_GIProbe_property_subdiv:
  163. - :ref:`Subdiv<enum_GIProbe_Subdiv>` **subdiv**
  164. +-----------+-------------------+
  165. | *Default* | ``1`` |
  166. +-----------+-------------------+
  167. | *Setter* | set_subdiv(value) |
  168. +-----------+-------------------+
  169. | *Getter* | get_subdiv() |
  170. +-----------+-------------------+
  171. 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.
  172. Method Descriptions
  173. -------------------
  174. .. _class_GIProbe_method_bake:
  175. - void **bake** **(** :ref:`Node<class_Node>` from_node=null, :ref:`bool<class_bool>` create_visual_debug=false **)**
  176. 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.
  177. ----
  178. .. _class_GIProbe_method_debug_bake:
  179. - void **debug_bake** **(** **)**
  180. Calls :ref:`bake<class_GIProbe_method_bake>` with ``create_visual_debug`` enabled.
  181. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  182. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  183. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`