class_lightmapgi.rst 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687
  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/LightmapGI.xml.
  6. .. _class_LightmapGI:
  7. LightmapGI
  8. ==========
  9. **Inherits:** :ref:`VisualInstance3D<class_VisualInstance3D>` **<** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. Computes and stores baked lightmaps for fast global illumination.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. 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>` to a value other than :ref:`GENERATE_PROBES_DISABLED<class_LightmapGI_constant_GENERATE_PROBES_DISABLED>`. 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>`.
  15. \ **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>`).
  16. \ **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.
  17. \ **Note:** Due to how lightmaps work, most properties only have a visible effect once lightmaps are baked again.
  18. \ **Note:** Lightmap baking on :ref:`CSGShape3D<class_CSGShape3D>`\ s and :ref:`PrimitiveMesh<class_PrimitiveMesh>`\ es is not supported, as these cannot store UV2 data required for baking.
  19. \ **Note:** If no custom lightmappers are installed, **LightmapGI** can only be baked from devices that support the Forward+ or Mobile rendering backends.
  20. \ **Note:** The **LightmapGI** node only bakes light data for child nodes of its parent. Nodes further up the hierarchy of the scene will not be baked.
  21. .. rst-class:: classref-introduction-group
  22. Tutorials
  23. ---------
  24. - :doc:`Using Lightmap global illumination <../tutorials/3d/global_illumination/using_lightmap_gi>`
  25. .. rst-class:: classref-reftable-group
  26. Properties
  27. ----------
  28. .. table::
  29. :widths: auto
  30. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  31. | :ref:`float<class_float>` | :ref:`bias<class_LightmapGI_property_bias>` | ``0.0005`` |
  32. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  33. | :ref:`float<class_float>` | :ref:`bounce_indirect_energy<class_LightmapGI_property_bounce_indirect_energy>` | ``1.0`` |
  34. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  35. | :ref:`int<class_int>` | :ref:`bounces<class_LightmapGI_property_bounces>` | ``3`` |
  36. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  37. | :ref:`CameraAttributes<class_CameraAttributes>` | :ref:`camera_attributes<class_LightmapGI_property_camera_attributes>` | |
  38. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  39. | :ref:`int<class_int>` | :ref:`denoiser_range<class_LightmapGI_property_denoiser_range>` | ``10`` |
  40. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  41. | :ref:`float<class_float>` | :ref:`denoiser_strength<class_LightmapGI_property_denoiser_strength>` | ``0.1`` |
  42. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  43. | :ref:`bool<class_bool>` | :ref:`directional<class_LightmapGI_property_directional>` | ``false`` |
  44. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  45. | :ref:`Color<class_Color>` | :ref:`environment_custom_color<class_LightmapGI_property_environment_custom_color>` | |
  46. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  47. | :ref:`float<class_float>` | :ref:`environment_custom_energy<class_LightmapGI_property_environment_custom_energy>` | |
  48. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  49. | :ref:`Sky<class_Sky>` | :ref:`environment_custom_sky<class_LightmapGI_property_environment_custom_sky>` | |
  50. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  51. | :ref:`EnvironmentMode<enum_LightmapGI_EnvironmentMode>` | :ref:`environment_mode<class_LightmapGI_property_environment_mode>` | ``1`` |
  52. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  53. | :ref:`GenerateProbes<enum_LightmapGI_GenerateProbes>` | :ref:`generate_probes_subdiv<class_LightmapGI_property_generate_probes_subdiv>` | ``2`` |
  54. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  55. | :ref:`bool<class_bool>` | :ref:`interior<class_LightmapGI_property_interior>` | ``false`` |
  56. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  57. | :ref:`LightmapGIData<class_LightmapGIData>` | :ref:`light_data<class_LightmapGI_property_light_data>` | |
  58. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  59. | :ref:`int<class_int>` | :ref:`max_texture_size<class_LightmapGI_property_max_texture_size>` | ``16384`` |
  60. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  61. | :ref:`BakeQuality<enum_LightmapGI_BakeQuality>` | :ref:`quality<class_LightmapGI_property_quality>` | ``1`` |
  62. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  63. | :ref:`float<class_float>` | :ref:`texel_scale<class_LightmapGI_property_texel_scale>` | ``1.0`` |
  64. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  65. | :ref:`bool<class_bool>` | :ref:`use_denoiser<class_LightmapGI_property_use_denoiser>` | ``true`` |
  66. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  67. | :ref:`bool<class_bool>` | :ref:`use_texture_for_bounces<class_LightmapGI_property_use_texture_for_bounces>` | ``true`` |
  68. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  69. .. rst-class:: classref-section-separator
  70. ----
  71. .. rst-class:: classref-descriptions-group
  72. Enumerations
  73. ------------
  74. .. _enum_LightmapGI_BakeQuality:
  75. .. rst-class:: classref-enumeration
  76. enum **BakeQuality**: :ref:`🔗<enum_LightmapGI_BakeQuality>`
  77. .. _class_LightmapGI_constant_BAKE_QUALITY_LOW:
  78. .. rst-class:: classref-enumeration-constant
  79. :ref:`BakeQuality<enum_LightmapGI_BakeQuality>` **BAKE_QUALITY_LOW** = ``0``
  80. Low bake quality (fastest bake times). The quality of this preset can be adjusted by changing :ref:`ProjectSettings.rendering/lightmapping/bake_quality/low_quality_ray_count<class_ProjectSettings_property_rendering/lightmapping/bake_quality/low_quality_ray_count>` and :ref:`ProjectSettings.rendering/lightmapping/bake_quality/low_quality_probe_ray_count<class_ProjectSettings_property_rendering/lightmapping/bake_quality/low_quality_probe_ray_count>`.
  81. .. _class_LightmapGI_constant_BAKE_QUALITY_MEDIUM:
  82. .. rst-class:: classref-enumeration-constant
  83. :ref:`BakeQuality<enum_LightmapGI_BakeQuality>` **BAKE_QUALITY_MEDIUM** = ``1``
  84. Medium bake quality (fast bake times). The quality of this preset can be adjusted by changing :ref:`ProjectSettings.rendering/lightmapping/bake_quality/medium_quality_ray_count<class_ProjectSettings_property_rendering/lightmapping/bake_quality/medium_quality_ray_count>` and :ref:`ProjectSettings.rendering/lightmapping/bake_quality/medium_quality_probe_ray_count<class_ProjectSettings_property_rendering/lightmapping/bake_quality/medium_quality_probe_ray_count>`.
  85. .. _class_LightmapGI_constant_BAKE_QUALITY_HIGH:
  86. .. rst-class:: classref-enumeration-constant
  87. :ref:`BakeQuality<enum_LightmapGI_BakeQuality>` **BAKE_QUALITY_HIGH** = ``2``
  88. High bake quality (slow bake times). The quality of this preset can be adjusted by changing :ref:`ProjectSettings.rendering/lightmapping/bake_quality/high_quality_ray_count<class_ProjectSettings_property_rendering/lightmapping/bake_quality/high_quality_ray_count>` and :ref:`ProjectSettings.rendering/lightmapping/bake_quality/high_quality_probe_ray_count<class_ProjectSettings_property_rendering/lightmapping/bake_quality/high_quality_probe_ray_count>`.
  89. .. _class_LightmapGI_constant_BAKE_QUALITY_ULTRA:
  90. .. rst-class:: classref-enumeration-constant
  91. :ref:`BakeQuality<enum_LightmapGI_BakeQuality>` **BAKE_QUALITY_ULTRA** = ``3``
  92. Highest bake quality (slowest bake times). The quality of this preset can be adjusted by changing :ref:`ProjectSettings.rendering/lightmapping/bake_quality/ultra_quality_ray_count<class_ProjectSettings_property_rendering/lightmapping/bake_quality/ultra_quality_ray_count>` and :ref:`ProjectSettings.rendering/lightmapping/bake_quality/ultra_quality_probe_ray_count<class_ProjectSettings_property_rendering/lightmapping/bake_quality/ultra_quality_probe_ray_count>`.
  93. .. rst-class:: classref-item-separator
  94. ----
  95. .. _enum_LightmapGI_GenerateProbes:
  96. .. rst-class:: classref-enumeration
  97. enum **GenerateProbes**: :ref:`🔗<enum_LightmapGI_GenerateProbes>`
  98. .. _class_LightmapGI_constant_GENERATE_PROBES_DISABLED:
  99. .. rst-class:: classref-enumeration-constant
  100. :ref:`GenerateProbes<enum_LightmapGI_GenerateProbes>` **GENERATE_PROBES_DISABLED** = ``0``
  101. Don't generate lightmap probes for lighting dynamic objects.
  102. .. _class_LightmapGI_constant_GENERATE_PROBES_SUBDIV_4:
  103. .. rst-class:: classref-enumeration-constant
  104. :ref:`GenerateProbes<enum_LightmapGI_GenerateProbes>` **GENERATE_PROBES_SUBDIV_4** = ``1``
  105. Lowest level of subdivision (fastest bake times, smallest file sizes).
  106. .. _class_LightmapGI_constant_GENERATE_PROBES_SUBDIV_8:
  107. .. rst-class:: classref-enumeration-constant
  108. :ref:`GenerateProbes<enum_LightmapGI_GenerateProbes>` **GENERATE_PROBES_SUBDIV_8** = ``2``
  109. Low level of subdivision (fast bake times, small file sizes).
  110. .. _class_LightmapGI_constant_GENERATE_PROBES_SUBDIV_16:
  111. .. rst-class:: classref-enumeration-constant
  112. :ref:`GenerateProbes<enum_LightmapGI_GenerateProbes>` **GENERATE_PROBES_SUBDIV_16** = ``3``
  113. High level of subdivision (slow bake times, large file sizes).
  114. .. _class_LightmapGI_constant_GENERATE_PROBES_SUBDIV_32:
  115. .. rst-class:: classref-enumeration-constant
  116. :ref:`GenerateProbes<enum_LightmapGI_GenerateProbes>` **GENERATE_PROBES_SUBDIV_32** = ``4``
  117. Highest level of subdivision (slowest bake times, largest file sizes).
  118. .. rst-class:: classref-item-separator
  119. ----
  120. .. _enum_LightmapGI_BakeError:
  121. .. rst-class:: classref-enumeration
  122. enum **BakeError**: :ref:`🔗<enum_LightmapGI_BakeError>`
  123. .. _class_LightmapGI_constant_BAKE_ERROR_OK:
  124. .. rst-class:: classref-enumeration-constant
  125. :ref:`BakeError<enum_LightmapGI_BakeError>` **BAKE_ERROR_OK** = ``0``
  126. Lightmap baking was successful.
  127. .. _class_LightmapGI_constant_BAKE_ERROR_NO_SCENE_ROOT:
  128. .. rst-class:: classref-enumeration-constant
  129. :ref:`BakeError<enum_LightmapGI_BakeError>` **BAKE_ERROR_NO_SCENE_ROOT** = ``1``
  130. Lightmap baking failed because the root node for the edited scene could not be accessed.
  131. .. _class_LightmapGI_constant_BAKE_ERROR_FOREIGN_DATA:
  132. .. rst-class:: classref-enumeration-constant
  133. :ref:`BakeError<enum_LightmapGI_BakeError>` **BAKE_ERROR_FOREIGN_DATA** = ``2``
  134. Lightmap baking failed as the lightmap data resource is embedded in a foreign resource.
  135. .. _class_LightmapGI_constant_BAKE_ERROR_NO_LIGHTMAPPER:
  136. .. rst-class:: classref-enumeration-constant
  137. :ref:`BakeError<enum_LightmapGI_BakeError>` **BAKE_ERROR_NO_LIGHTMAPPER** = ``3``
  138. Lightmap baking failed as there is no lightmapper available in this Godot build.
  139. .. _class_LightmapGI_constant_BAKE_ERROR_NO_SAVE_PATH:
  140. .. rst-class:: classref-enumeration-constant
  141. :ref:`BakeError<enum_LightmapGI_BakeError>` **BAKE_ERROR_NO_SAVE_PATH** = ``4``
  142. Lightmap baking failed as the :ref:`LightmapGIData<class_LightmapGIData>` save path isn't configured in the resource.
  143. .. _class_LightmapGI_constant_BAKE_ERROR_NO_MESHES:
  144. .. rst-class:: classref-enumeration-constant
  145. :ref:`BakeError<enum_LightmapGI_BakeError>` **BAKE_ERROR_NO_MESHES** = ``5``
  146. Lightmap baking failed as there are no meshes whose :ref:`GeometryInstance3D.gi_mode<class_GeometryInstance3D_property_gi_mode>` is :ref:`GeometryInstance3D.GI_MODE_STATIC<class_GeometryInstance3D_constant_GI_MODE_STATIC>` and with valid UV2 mapping in the current scene. You may need to select 3D scenes in the Import dock and change their global illumination mode accordingly.
  147. .. _class_LightmapGI_constant_BAKE_ERROR_MESHES_INVALID:
  148. .. rst-class:: classref-enumeration-constant
  149. :ref:`BakeError<enum_LightmapGI_BakeError>` **BAKE_ERROR_MESHES_INVALID** = ``6``
  150. Lightmap baking failed as the lightmapper failed to analyze some of the meshes marked as static for baking.
  151. .. _class_LightmapGI_constant_BAKE_ERROR_CANT_CREATE_IMAGE:
  152. .. rst-class:: classref-enumeration-constant
  153. :ref:`BakeError<enum_LightmapGI_BakeError>` **BAKE_ERROR_CANT_CREATE_IMAGE** = ``7``
  154. Lightmap baking failed as the resulting image couldn't be saved or imported by Godot after it was saved.
  155. .. _class_LightmapGI_constant_BAKE_ERROR_USER_ABORTED:
  156. .. rst-class:: classref-enumeration-constant
  157. :ref:`BakeError<enum_LightmapGI_BakeError>` **BAKE_ERROR_USER_ABORTED** = ``8``
  158. The user aborted the lightmap baking operation (typically by clicking the **Cancel** button in the progress dialog).
  159. .. _class_LightmapGI_constant_BAKE_ERROR_TEXTURE_SIZE_TOO_SMALL:
  160. .. rst-class:: classref-enumeration-constant
  161. :ref:`BakeError<enum_LightmapGI_BakeError>` **BAKE_ERROR_TEXTURE_SIZE_TOO_SMALL** = ``9``
  162. Lightmap baking failed as the maximum texture size is too small to fit some of the meshes marked for baking.
  163. .. _class_LightmapGI_constant_BAKE_ERROR_LIGHTMAP_TOO_SMALL:
  164. .. rst-class:: classref-enumeration-constant
  165. :ref:`BakeError<enum_LightmapGI_BakeError>` **BAKE_ERROR_LIGHTMAP_TOO_SMALL** = ``10``
  166. Lightmap baking failed as the lightmap is too small.
  167. .. _class_LightmapGI_constant_BAKE_ERROR_ATLAS_TOO_SMALL:
  168. .. rst-class:: classref-enumeration-constant
  169. :ref:`BakeError<enum_LightmapGI_BakeError>` **BAKE_ERROR_ATLAS_TOO_SMALL** = ``11``
  170. Lightmap baking failed as the lightmap was unable to fit into an atlas.
  171. .. rst-class:: classref-item-separator
  172. ----
  173. .. _enum_LightmapGI_EnvironmentMode:
  174. .. rst-class:: classref-enumeration
  175. enum **EnvironmentMode**: :ref:`🔗<enum_LightmapGI_EnvironmentMode>`
  176. .. _class_LightmapGI_constant_ENVIRONMENT_MODE_DISABLED:
  177. .. rst-class:: classref-enumeration-constant
  178. :ref:`EnvironmentMode<enum_LightmapGI_EnvironmentMode>` **ENVIRONMENT_MODE_DISABLED** = ``0``
  179. Ignore environment lighting when baking lightmaps.
  180. .. _class_LightmapGI_constant_ENVIRONMENT_MODE_SCENE:
  181. .. rst-class:: classref-enumeration-constant
  182. :ref:`EnvironmentMode<enum_LightmapGI_EnvironmentMode>` **ENVIRONMENT_MODE_SCENE** = ``1``
  183. Use the scene's environment lighting when baking lightmaps.
  184. \ **Note:** If baking lightmaps in a scene with no :ref:`WorldEnvironment<class_WorldEnvironment>` node, this will act like :ref:`ENVIRONMENT_MODE_DISABLED<class_LightmapGI_constant_ENVIRONMENT_MODE_DISABLED>`. The editor's preview sky and sun is *not* taken into account by **LightmapGI** when baking lightmaps.
  185. .. _class_LightmapGI_constant_ENVIRONMENT_MODE_CUSTOM_SKY:
  186. .. rst-class:: classref-enumeration-constant
  187. :ref:`EnvironmentMode<enum_LightmapGI_EnvironmentMode>` **ENVIRONMENT_MODE_CUSTOM_SKY** = ``2``
  188. Use :ref:`environment_custom_sky<class_LightmapGI_property_environment_custom_sky>` as a source of environment lighting when baking lightmaps.
  189. .. _class_LightmapGI_constant_ENVIRONMENT_MODE_CUSTOM_COLOR:
  190. .. rst-class:: classref-enumeration-constant
  191. :ref:`EnvironmentMode<enum_LightmapGI_EnvironmentMode>` **ENVIRONMENT_MODE_CUSTOM_COLOR** = ``3``
  192. Use :ref:`environment_custom_color<class_LightmapGI_property_environment_custom_color>` multiplied by :ref:`environment_custom_energy<class_LightmapGI_property_environment_custom_energy>` as a constant source of environment lighting when baking lightmaps.
  193. .. rst-class:: classref-section-separator
  194. ----
  195. .. rst-class:: classref-descriptions-group
  196. Property Descriptions
  197. ---------------------
  198. .. _class_LightmapGI_property_bias:
  199. .. rst-class:: classref-property
  200. :ref:`float<class_float>` **bias** = ``0.0005`` :ref:`🔗<class_LightmapGI_property_bias>`
  201. .. rst-class:: classref-property-setget
  202. - |void| **set_bias**\ (\ value\: :ref:`float<class_float>`\ )
  203. - :ref:`float<class_float>` **get_bias**\ (\ )
  204. The bias to use when computing shadows. Increasing :ref:`bias<class_LightmapGI_property_bias>` can fix shadow acne on the resulting baked lightmap, but can introduce peter-panning (shadows not connecting to their casters). Real-time :ref:`Light3D<class_Light3D>` shadows are not affected by this :ref:`bias<class_LightmapGI_property_bias>` property.
  205. .. rst-class:: classref-item-separator
  206. ----
  207. .. _class_LightmapGI_property_bounce_indirect_energy:
  208. .. rst-class:: classref-property
  209. :ref:`float<class_float>` **bounce_indirect_energy** = ``1.0`` :ref:`🔗<class_LightmapGI_property_bounce_indirect_energy>`
  210. .. rst-class:: classref-property-setget
  211. - |void| **set_bounce_indirect_energy**\ (\ value\: :ref:`float<class_float>`\ )
  212. - :ref:`float<class_float>` **get_bounce_indirect_energy**\ (\ )
  213. The energy multiplier for each bounce. Higher values will make indirect lighting brighter. A value of ``1.0`` represents physically accurate behavior, but higher values can be used to make indirect lighting propagate more visibly when using a low number of bounces. This can be used to speed up bake times by lowering the number of :ref:`bounces<class_LightmapGI_property_bounces>` then increasing :ref:`bounce_indirect_energy<class_LightmapGI_property_bounce_indirect_energy>`.
  214. \ **Note:** :ref:`bounce_indirect_energy<class_LightmapGI_property_bounce_indirect_energy>` only has an effect if :ref:`bounces<class_LightmapGI_property_bounces>` is set to a value greater than or equal to ``1``.
  215. .. rst-class:: classref-item-separator
  216. ----
  217. .. _class_LightmapGI_property_bounces:
  218. .. rst-class:: classref-property
  219. :ref:`int<class_int>` **bounces** = ``3`` :ref:`🔗<class_LightmapGI_property_bounces>`
  220. .. rst-class:: classref-property-setget
  221. - |void| **set_bounces**\ (\ value\: :ref:`int<class_int>`\ )
  222. - :ref:`int<class_int>` **get_bounces**\ (\ )
  223. Number of light bounces that are taken into account during baking. Higher values result in brighter, more realistic lighting, at the cost of longer bake times. If set to ``0``, only environment lighting, direct light and emissive lighting is baked.
  224. .. rst-class:: classref-item-separator
  225. ----
  226. .. _class_LightmapGI_property_camera_attributes:
  227. .. rst-class:: classref-property
  228. :ref:`CameraAttributes<class_CameraAttributes>` **camera_attributes** :ref:`🔗<class_LightmapGI_property_camera_attributes>`
  229. .. rst-class:: classref-property-setget
  230. - |void| **set_camera_attributes**\ (\ value\: :ref:`CameraAttributes<class_CameraAttributes>`\ )
  231. - :ref:`CameraAttributes<class_CameraAttributes>` **get_camera_attributes**\ (\ )
  232. The :ref:`CameraAttributes<class_CameraAttributes>` resource that specifies exposure levels to bake at. Auto-exposure and non exposure properties will be ignored. Exposure settings should be used to reduce the dynamic range present when baking. If exposure is too high, the **LightmapGI** will have banding artifacts or may have over-exposure artifacts.
  233. .. rst-class:: classref-item-separator
  234. ----
  235. .. _class_LightmapGI_property_denoiser_range:
  236. .. rst-class:: classref-property
  237. :ref:`int<class_int>` **denoiser_range** = ``10`` :ref:`🔗<class_LightmapGI_property_denoiser_range>`
  238. .. rst-class:: classref-property-setget
  239. - |void| **set_denoiser_range**\ (\ value\: :ref:`int<class_int>`\ )
  240. - :ref:`int<class_int>` **get_denoiser_range**\ (\ )
  241. The distance in pixels from which the denoiser samples. Lower values preserve more details, but may give blotchy results if the lightmap quality is not high enough. Only effective if :ref:`use_denoiser<class_LightmapGI_property_use_denoiser>` is ``true`` and :ref:`ProjectSettings.rendering/lightmapping/denoising/denoiser<class_ProjectSettings_property_rendering/lightmapping/denoising/denoiser>` is set to JNLM.
  242. .. rst-class:: classref-item-separator
  243. ----
  244. .. _class_LightmapGI_property_denoiser_strength:
  245. .. rst-class:: classref-property
  246. :ref:`float<class_float>` **denoiser_strength** = ``0.1`` :ref:`🔗<class_LightmapGI_property_denoiser_strength>`
  247. .. rst-class:: classref-property-setget
  248. - |void| **set_denoiser_strength**\ (\ value\: :ref:`float<class_float>`\ )
  249. - :ref:`float<class_float>` **get_denoiser_strength**\ (\ )
  250. The strength of denoising step applied to the generated lightmaps. Only effective if :ref:`use_denoiser<class_LightmapGI_property_use_denoiser>` is ``true`` and :ref:`ProjectSettings.rendering/lightmapping/denoising/denoiser<class_ProjectSettings_property_rendering/lightmapping/denoising/denoiser>` is set to JNLM.
  251. .. rst-class:: classref-item-separator
  252. ----
  253. .. _class_LightmapGI_property_directional:
  254. .. rst-class:: classref-property
  255. :ref:`bool<class_bool>` **directional** = ``false`` :ref:`🔗<class_LightmapGI_property_directional>`
  256. .. rst-class:: classref-property-setget
  257. - |void| **set_directional**\ (\ value\: :ref:`bool<class_bool>`\ )
  258. - :ref:`bool<class_bool>` **is_directional**\ (\ )
  259. If ``true``, bakes lightmaps to contain directional information as spherical harmonics. This results in more realistic lighting appearance, especially with normal mapped materials and for lights that have their direct light baked (:ref:`Light3D.light_bake_mode<class_Light3D_property_light_bake_mode>` set to :ref:`Light3D.BAKE_STATIC<class_Light3D_constant_BAKE_STATIC>` and with :ref:`Light3D.editor_only<class_Light3D_property_editor_only>` set to ``false``). The directional information is also used to provide rough reflections for static and dynamic objects. This has a small run-time performance cost as the shader has to perform more work to interpret the direction information from the lightmap. Directional lightmaps also take longer to bake and result in larger file sizes.
  260. \ **Note:** The property's name has no relationship with :ref:`DirectionalLight3D<class_DirectionalLight3D>`. :ref:`directional<class_LightmapGI_property_directional>` works with all light types.
  261. .. rst-class:: classref-item-separator
  262. ----
  263. .. _class_LightmapGI_property_environment_custom_color:
  264. .. rst-class:: classref-property
  265. :ref:`Color<class_Color>` **environment_custom_color** :ref:`🔗<class_LightmapGI_property_environment_custom_color>`
  266. .. rst-class:: classref-property-setget
  267. - |void| **set_environment_custom_color**\ (\ value\: :ref:`Color<class_Color>`\ )
  268. - :ref:`Color<class_Color>` **get_environment_custom_color**\ (\ )
  269. The color to use for environment lighting. Only effective if :ref:`environment_mode<class_LightmapGI_property_environment_mode>` is :ref:`ENVIRONMENT_MODE_CUSTOM_COLOR<class_LightmapGI_constant_ENVIRONMENT_MODE_CUSTOM_COLOR>`.
  270. .. rst-class:: classref-item-separator
  271. ----
  272. .. _class_LightmapGI_property_environment_custom_energy:
  273. .. rst-class:: classref-property
  274. :ref:`float<class_float>` **environment_custom_energy** :ref:`🔗<class_LightmapGI_property_environment_custom_energy>`
  275. .. rst-class:: classref-property-setget
  276. - |void| **set_environment_custom_energy**\ (\ value\: :ref:`float<class_float>`\ )
  277. - :ref:`float<class_float>` **get_environment_custom_energy**\ (\ )
  278. The color multiplier to use for environment lighting. Only effective if :ref:`environment_mode<class_LightmapGI_property_environment_mode>` is :ref:`ENVIRONMENT_MODE_CUSTOM_COLOR<class_LightmapGI_constant_ENVIRONMENT_MODE_CUSTOM_COLOR>`.
  279. .. rst-class:: classref-item-separator
  280. ----
  281. .. _class_LightmapGI_property_environment_custom_sky:
  282. .. rst-class:: classref-property
  283. :ref:`Sky<class_Sky>` **environment_custom_sky** :ref:`🔗<class_LightmapGI_property_environment_custom_sky>`
  284. .. rst-class:: classref-property-setget
  285. - |void| **set_environment_custom_sky**\ (\ value\: :ref:`Sky<class_Sky>`\ )
  286. - :ref:`Sky<class_Sky>` **get_environment_custom_sky**\ (\ )
  287. The sky to use as a source of environment lighting. Only effective if :ref:`environment_mode<class_LightmapGI_property_environment_mode>` is :ref:`ENVIRONMENT_MODE_CUSTOM_SKY<class_LightmapGI_constant_ENVIRONMENT_MODE_CUSTOM_SKY>`.
  288. .. rst-class:: classref-item-separator
  289. ----
  290. .. _class_LightmapGI_property_environment_mode:
  291. .. rst-class:: classref-property
  292. :ref:`EnvironmentMode<enum_LightmapGI_EnvironmentMode>` **environment_mode** = ``1`` :ref:`🔗<class_LightmapGI_property_environment_mode>`
  293. .. rst-class:: classref-property-setget
  294. - |void| **set_environment_mode**\ (\ value\: :ref:`EnvironmentMode<enum_LightmapGI_EnvironmentMode>`\ )
  295. - :ref:`EnvironmentMode<enum_LightmapGI_EnvironmentMode>` **get_environment_mode**\ (\ )
  296. The environment mode to use when baking lightmaps.
  297. .. rst-class:: classref-item-separator
  298. ----
  299. .. _class_LightmapGI_property_generate_probes_subdiv:
  300. .. rst-class:: classref-property
  301. :ref:`GenerateProbes<enum_LightmapGI_GenerateProbes>` **generate_probes_subdiv** = ``2`` :ref:`🔗<class_LightmapGI_property_generate_probes_subdiv>`
  302. .. rst-class:: classref-property-setget
  303. - |void| **set_generate_probes**\ (\ value\: :ref:`GenerateProbes<enum_LightmapGI_GenerateProbes>`\ )
  304. - :ref:`GenerateProbes<enum_LightmapGI_GenerateProbes>` **get_generate_probes**\ (\ )
  305. The level of subdivision to use when automatically generating :ref:`LightmapProbe<class_LightmapProbe>`\ s for dynamic object lighting. Higher values result in more accurate indirect lighting on dynamic objects, at the cost of longer bake times and larger file sizes.
  306. \ **Note:** Automatically generated :ref:`LightmapProbe<class_LightmapProbe>`\ s are not visible as nodes in the Scene tree dock, and cannot be modified this way after they are generated.
  307. \ **Note:** Regardless of :ref:`generate_probes_subdiv<class_LightmapGI_property_generate_probes_subdiv>`, direct lighting on dynamic objects is always applied using :ref:`Light3D<class_Light3D>` nodes in real-time.
  308. .. rst-class:: classref-item-separator
  309. ----
  310. .. _class_LightmapGI_property_interior:
  311. .. rst-class:: classref-property
  312. :ref:`bool<class_bool>` **interior** = ``false`` :ref:`🔗<class_LightmapGI_property_interior>`
  313. .. rst-class:: classref-property-setget
  314. - |void| **set_interior**\ (\ value\: :ref:`bool<class_bool>`\ )
  315. - :ref:`bool<class_bool>` **is_interior**\ (\ )
  316. If ``true``, ignore environment lighting when baking lightmaps.
  317. .. rst-class:: classref-item-separator
  318. ----
  319. .. _class_LightmapGI_property_light_data:
  320. .. rst-class:: classref-property
  321. :ref:`LightmapGIData<class_LightmapGIData>` **light_data** :ref:`🔗<class_LightmapGI_property_light_data>`
  322. .. rst-class:: classref-property-setget
  323. - |void| **set_light_data**\ (\ value\: :ref:`LightmapGIData<class_LightmapGIData>`\ )
  324. - :ref:`LightmapGIData<class_LightmapGIData>` **get_light_data**\ (\ )
  325. The :ref:`LightmapGIData<class_LightmapGIData>` associated to this **LightmapGI** node. This resource is automatically created after baking, and is not meant to be created manually.
  326. .. rst-class:: classref-item-separator
  327. ----
  328. .. _class_LightmapGI_property_max_texture_size:
  329. .. rst-class:: classref-property
  330. :ref:`int<class_int>` **max_texture_size** = ``16384`` :ref:`🔗<class_LightmapGI_property_max_texture_size>`
  331. .. rst-class:: classref-property-setget
  332. - |void| **set_max_texture_size**\ (\ value\: :ref:`int<class_int>`\ )
  333. - :ref:`int<class_int>` **get_max_texture_size**\ (\ )
  334. The maximum texture size for the generated texture atlas. Higher values will result in fewer slices being generated, but may not work on all hardware as a result of hardware limitations on texture sizes. Leave :ref:`max_texture_size<class_LightmapGI_property_max_texture_size>` at its default value of ``16384`` if unsure.
  335. .. rst-class:: classref-item-separator
  336. ----
  337. .. _class_LightmapGI_property_quality:
  338. .. rst-class:: classref-property
  339. :ref:`BakeQuality<enum_LightmapGI_BakeQuality>` **quality** = ``1`` :ref:`🔗<class_LightmapGI_property_quality>`
  340. .. rst-class:: classref-property-setget
  341. - |void| **set_bake_quality**\ (\ value\: :ref:`BakeQuality<enum_LightmapGI_BakeQuality>`\ )
  342. - :ref:`BakeQuality<enum_LightmapGI_BakeQuality>` **get_bake_quality**\ (\ )
  343. The quality preset to use when baking lightmaps. This affects bake times, but output file sizes remain mostly identical across quality levels.
  344. To further speed up bake times, decrease :ref:`bounces<class_LightmapGI_property_bounces>`, disable :ref:`use_denoiser<class_LightmapGI_property_use_denoiser>` and increase the lightmap texel size on 3D scenes in the Import dock.
  345. .. rst-class:: classref-item-separator
  346. ----
  347. .. _class_LightmapGI_property_texel_scale:
  348. .. rst-class:: classref-property
  349. :ref:`float<class_float>` **texel_scale** = ``1.0`` :ref:`🔗<class_LightmapGI_property_texel_scale>`
  350. .. rst-class:: classref-property-setget
  351. - |void| **set_texel_scale**\ (\ value\: :ref:`float<class_float>`\ )
  352. - :ref:`float<class_float>` **get_texel_scale**\ (\ )
  353. Scales the lightmap texel density of all meshes for the current bake. This is a multiplier that builds upon the existing lightmap texel size defined in each imported 3D scene, along with the per-mesh density multiplier (which is designed to be used when the same mesh is used at different scales). Lower values will result in faster bake times.
  354. For example, doubling :ref:`texel_scale<class_LightmapGI_property_texel_scale>` doubles the lightmap texture resolution for all objects *on each axis*, so it will *quadruple* the texel count.
  355. .. rst-class:: classref-item-separator
  356. ----
  357. .. _class_LightmapGI_property_use_denoiser:
  358. .. rst-class:: classref-property
  359. :ref:`bool<class_bool>` **use_denoiser** = ``true`` :ref:`🔗<class_LightmapGI_property_use_denoiser>`
  360. .. rst-class:: classref-property-setget
  361. - |void| **set_use_denoiser**\ (\ value\: :ref:`bool<class_bool>`\ )
  362. - :ref:`bool<class_bool>` **is_using_denoiser**\ (\ )
  363. If ``true``, uses a GPU-based denoising algorithm on the generated lightmap. This eliminates most noise within the generated lightmap at the cost of longer bake times. File sizes are generally not impacted significantly by the use of a denoiser, although lossless compression may do a better job at compressing a denoised image.
  364. .. rst-class:: classref-item-separator
  365. ----
  366. .. _class_LightmapGI_property_use_texture_for_bounces:
  367. .. rst-class:: classref-property
  368. :ref:`bool<class_bool>` **use_texture_for_bounces** = ``true`` :ref:`🔗<class_LightmapGI_property_use_texture_for_bounces>`
  369. .. rst-class:: classref-property-setget
  370. - |void| **set_use_texture_for_bounces**\ (\ value\: :ref:`bool<class_bool>`\ )
  371. - :ref:`bool<class_bool>` **is_using_texture_for_bounces**\ (\ )
  372. If ``true``, a texture with the lighting information will be generated to speed up the generation of indirect lighting at the cost of some accuracy. The geometry might exhibit extra light leak artifacts when using low resolution lightmaps or UVs that stretch the lightmap significantly across surfaces. Leave :ref:`use_texture_for_bounces<class_LightmapGI_property_use_texture_for_bounces>` at its default value of ``true`` if unsure.
  373. \ **Note:** :ref:`use_texture_for_bounces<class_LightmapGI_property_use_texture_for_bounces>` only has an effect if :ref:`bounces<class_LightmapGI_property_bounces>` is set to a value greater than or equal to ``1``.
  374. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  375. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  376. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  377. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  378. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  379. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  380. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  381. .. |void| replace:: :abbr:`void (No return value.)`