class_lightmapgi.rst 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the LightmapGI.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_LightmapGI:
  6. LightmapGI
  7. ==========
  8. **Inherits:** :ref:`VisualInstance3D<class_VisualInstance3D>` **<** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. Computes and stores baked lightmaps for fast global illumination.
  10. Description
  11. -----------
  12. The ``LightmapGI`` node is used to compute and store baked lightmaps. Lightmaps are used to provide high-quality indirect lighting with very little light leaking. ``LightmapGI`` can also provide rough reflections using spherical harmonics if :ref:`directional<class_LightmapGI_property_directional>` is enabled. Dynamic objects can receive indirect lighting thanks to *light probes*, which can be automatically placed by setting :ref:`generate_probes_subdiv<class_LightmapGI_property_generate_probes_subdiv>`. Additional lightmap probes can also be added by creating :ref:`LightmapProbe<class_LightmapProbe>` nodes. The downside is that lightmaps are fully static and cannot be baked in an exported project. Baking a ``LightmapGI`` node is also slower compared to :ref:`VoxelGI<class_VoxelGI>`.
  13. \ **Procedural generation:** Lightmap baking functionality is only available in the editor. This means ``LightmapGI`` is not suited to procedurally generated or user-built levels. For procedurally generated or user-built levels, use :ref:`VoxelGI<class_VoxelGI>` or SDFGI instead (see :ref:`Environment.sdfgi_enabled<class_Environment_property_sdfgi_enabled>`).
  14. \ **Performance:** ``LightmapGI`` provides the best possible run-time performance for global illumination. It is suitable for low-end hardware including integrated graphics and mobile devices.
  15. Properties
  16. ----------
  17. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  18. | :ref:`float<class_float>` | :ref:`bias<class_LightmapGI_property_bias>` | ``0.0005`` |
  19. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  20. | :ref:`int<class_int>` | :ref:`bounces<class_LightmapGI_property_bounces>` | ``1`` |
  21. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  22. | :ref:`bool<class_bool>` | :ref:`directional<class_LightmapGI_property_directional>` | ``false`` |
  23. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  24. | :ref:`Color<class_Color>` | :ref:`environment_custom_color<class_LightmapGI_property_environment_custom_color>` | |
  25. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  26. | :ref:`float<class_float>` | :ref:`environment_custom_energy<class_LightmapGI_property_environment_custom_energy>` | |
  27. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  28. | :ref:`Sky<class_Sky>` | :ref:`environment_custom_sky<class_LightmapGI_property_environment_custom_sky>` | |
  29. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  30. | :ref:`EnvironmentMode<enum_LightmapGI_EnvironmentMode>` | :ref:`environment_mode<class_LightmapGI_property_environment_mode>` | ``0`` |
  31. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  32. | :ref:`GenerateProbes<enum_LightmapGI_GenerateProbes>` | :ref:`generate_probes_subdiv<class_LightmapGI_property_generate_probes_subdiv>` | ``0`` |
  33. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  34. | :ref:`bool<class_bool>` | :ref:`interior<class_LightmapGI_property_interior>` | ``false`` |
  35. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  36. | :ref:`LightmapGIData<class_LightmapGIData>` | :ref:`light_data<class_LightmapGI_property_light_data>` | |
  37. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  38. | :ref:`int<class_int>` | :ref:`max_texture_size<class_LightmapGI_property_max_texture_size>` | ``16384`` |
  39. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  40. | :ref:`BakeQuality<enum_LightmapGI_BakeQuality>` | :ref:`quality<class_LightmapGI_property_quality>` | ``1`` |
  41. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  42. | :ref:`bool<class_bool>` | :ref:`use_denoiser<class_LightmapGI_property_use_denoiser>` | ``true`` |
  43. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  44. Enumerations
  45. ------------
  46. .. _enum_LightmapGI_BakeQuality:
  47. .. _class_LightmapGI_constant_BAKE_QUALITY_LOW:
  48. .. _class_LightmapGI_constant_BAKE_QUALITY_MEDIUM:
  49. .. _class_LightmapGI_constant_BAKE_QUALITY_HIGH:
  50. .. _class_LightmapGI_constant_BAKE_QUALITY_ULTRA:
  51. enum **BakeQuality**:
  52. - **BAKE_QUALITY_LOW** = **0**
  53. - **BAKE_QUALITY_MEDIUM** = **1**
  54. - **BAKE_QUALITY_HIGH** = **2**
  55. - **BAKE_QUALITY_ULTRA** = **3**
  56. ----
  57. .. _enum_LightmapGI_GenerateProbes:
  58. .. _class_LightmapGI_constant_GENERATE_PROBES_DISABLED:
  59. .. _class_LightmapGI_constant_GENERATE_PROBES_SUBDIV_4:
  60. .. _class_LightmapGI_constant_GENERATE_PROBES_SUBDIV_8:
  61. .. _class_LightmapGI_constant_GENERATE_PROBES_SUBDIV_16:
  62. .. _class_LightmapGI_constant_GENERATE_PROBES_SUBDIV_32:
  63. enum **GenerateProbes**:
  64. - **GENERATE_PROBES_DISABLED** = **0**
  65. - **GENERATE_PROBES_SUBDIV_4** = **1**
  66. - **GENERATE_PROBES_SUBDIV_8** = **2**
  67. - **GENERATE_PROBES_SUBDIV_16** = **3**
  68. - **GENERATE_PROBES_SUBDIV_32** = **4**
  69. ----
  70. .. _enum_LightmapGI_BakeError:
  71. .. _class_LightmapGI_constant_BAKE_ERROR_OK:
  72. .. _class_LightmapGI_constant_BAKE_ERROR_NO_LIGHTMAPPER:
  73. .. _class_LightmapGI_constant_BAKE_ERROR_NO_SAVE_PATH:
  74. .. _class_LightmapGI_constant_BAKE_ERROR_NO_MESHES:
  75. .. _class_LightmapGI_constant_BAKE_ERROR_MESHES_INVALID:
  76. .. _class_LightmapGI_constant_BAKE_ERROR_CANT_CREATE_IMAGE:
  77. .. _class_LightmapGI_constant_BAKE_ERROR_USER_ABORTED:
  78. enum **BakeError**:
  79. - **BAKE_ERROR_OK** = **0**
  80. - **BAKE_ERROR_NO_LIGHTMAPPER** = **1**
  81. - **BAKE_ERROR_NO_SAVE_PATH** = **2**
  82. - **BAKE_ERROR_NO_MESHES** = **3**
  83. - **BAKE_ERROR_MESHES_INVALID** = **4**
  84. - **BAKE_ERROR_CANT_CREATE_IMAGE** = **5**
  85. - **BAKE_ERROR_USER_ABORTED** = **6**
  86. ----
  87. .. _enum_LightmapGI_EnvironmentMode:
  88. .. _class_LightmapGI_constant_ENVIRONMENT_MODE_DISABLED:
  89. .. _class_LightmapGI_constant_ENVIRONMENT_MODE_SCENE:
  90. .. _class_LightmapGI_constant_ENVIRONMENT_MODE_CUSTOM_SKY:
  91. .. _class_LightmapGI_constant_ENVIRONMENT_MODE_CUSTOM_COLOR:
  92. enum **EnvironmentMode**:
  93. - **ENVIRONMENT_MODE_DISABLED** = **0**
  94. - **ENVIRONMENT_MODE_SCENE** = **1**
  95. - **ENVIRONMENT_MODE_CUSTOM_SKY** = **2**
  96. - **ENVIRONMENT_MODE_CUSTOM_COLOR** = **3**
  97. Property Descriptions
  98. ---------------------
  99. .. _class_LightmapGI_property_bias:
  100. - :ref:`float<class_float>` **bias**
  101. +-----------+-----------------+
  102. | *Default* | ``0.0005`` |
  103. +-----------+-----------------+
  104. | *Setter* | set_bias(value) |
  105. +-----------+-----------------+
  106. | *Getter* | get_bias() |
  107. +-----------+-----------------+
  108. ----
  109. .. _class_LightmapGI_property_bounces:
  110. - :ref:`int<class_int>` **bounces**
  111. +-----------+--------------------+
  112. | *Default* | ``1`` |
  113. +-----------+--------------------+
  114. | *Setter* | set_bounces(value) |
  115. +-----------+--------------------+
  116. | *Getter* | get_bounces() |
  117. +-----------+--------------------+
  118. ----
  119. .. _class_LightmapGI_property_directional:
  120. - :ref:`bool<class_bool>` **directional**
  121. +-----------+------------------------+
  122. | *Default* | ``false`` |
  123. +-----------+------------------------+
  124. | *Setter* | set_directional(value) |
  125. +-----------+------------------------+
  126. | *Getter* | is_directional() |
  127. +-----------+------------------------+
  128. ----
  129. .. _class_LightmapGI_property_environment_custom_color:
  130. - :ref:`Color<class_Color>` **environment_custom_color**
  131. +----------+-------------------------------------+
  132. | *Setter* | set_environment_custom_color(value) |
  133. +----------+-------------------------------------+
  134. | *Getter* | get_environment_custom_color() |
  135. +----------+-------------------------------------+
  136. ----
  137. .. _class_LightmapGI_property_environment_custom_energy:
  138. - :ref:`float<class_float>` **environment_custom_energy**
  139. +----------+--------------------------------------+
  140. | *Setter* | set_environment_custom_energy(value) |
  141. +----------+--------------------------------------+
  142. | *Getter* | get_environment_custom_energy() |
  143. +----------+--------------------------------------+
  144. ----
  145. .. _class_LightmapGI_property_environment_custom_sky:
  146. - :ref:`Sky<class_Sky>` **environment_custom_sky**
  147. +----------+-----------------------------------+
  148. | *Setter* | set_environment_custom_sky(value) |
  149. +----------+-----------------------------------+
  150. | *Getter* | get_environment_custom_sky() |
  151. +----------+-----------------------------------+
  152. ----
  153. .. _class_LightmapGI_property_environment_mode:
  154. - :ref:`EnvironmentMode<enum_LightmapGI_EnvironmentMode>` **environment_mode**
  155. +-----------+-----------------------------+
  156. | *Default* | ``0`` |
  157. +-----------+-----------------------------+
  158. | *Setter* | set_environment_mode(value) |
  159. +-----------+-----------------------------+
  160. | *Getter* | get_environment_mode() |
  161. +-----------+-----------------------------+
  162. ----
  163. .. _class_LightmapGI_property_generate_probes_subdiv:
  164. - :ref:`GenerateProbes<enum_LightmapGI_GenerateProbes>` **generate_probes_subdiv**
  165. +-----------+----------------------------+
  166. | *Default* | ``0`` |
  167. +-----------+----------------------------+
  168. | *Setter* | set_generate_probes(value) |
  169. +-----------+----------------------------+
  170. | *Getter* | get_generate_probes() |
  171. +-----------+----------------------------+
  172. ----
  173. .. _class_LightmapGI_property_interior:
  174. - :ref:`bool<class_bool>` **interior**
  175. +-----------+---------------------+
  176. | *Default* | ``false`` |
  177. +-----------+---------------------+
  178. | *Setter* | set_interior(value) |
  179. +-----------+---------------------+
  180. | *Getter* | is_interior() |
  181. +-----------+---------------------+
  182. ----
  183. .. _class_LightmapGI_property_light_data:
  184. - :ref:`LightmapGIData<class_LightmapGIData>` **light_data**
  185. +----------+-----------------------+
  186. | *Setter* | set_light_data(value) |
  187. +----------+-----------------------+
  188. | *Getter* | get_light_data() |
  189. +----------+-----------------------+
  190. ----
  191. .. _class_LightmapGI_property_max_texture_size:
  192. - :ref:`int<class_int>` **max_texture_size**
  193. +-----------+-----------------------------+
  194. | *Default* | ``16384`` |
  195. +-----------+-----------------------------+
  196. | *Setter* | set_max_texture_size(value) |
  197. +-----------+-----------------------------+
  198. | *Getter* | get_max_texture_size() |
  199. +-----------+-----------------------------+
  200. ----
  201. .. _class_LightmapGI_property_quality:
  202. - :ref:`BakeQuality<enum_LightmapGI_BakeQuality>` **quality**
  203. +-----------+-------------------------+
  204. | *Default* | ``1`` |
  205. +-----------+-------------------------+
  206. | *Setter* | set_bake_quality(value) |
  207. +-----------+-------------------------+
  208. | *Getter* | get_bake_quality() |
  209. +-----------+-------------------------+
  210. ----
  211. .. _class_LightmapGI_property_use_denoiser:
  212. - :ref:`bool<class_bool>` **use_denoiser**
  213. +-----------+-------------------------+
  214. | *Default* | ``true`` |
  215. +-----------+-------------------------+
  216. | *Setter* | set_use_denoiser(value) |
  217. +-----------+-------------------------+
  218. | *Getter* | is_using_denoiser() |
  219. +-----------+-------------------------+
  220. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  221. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  222. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  223. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  224. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  225. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`