class_giprobe.rst 12 KB

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