class_lightmapgi.rst 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  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/4.0/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.0/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 when using the Vulkan backend (Forward+ or Mobile), not OpenGL.
  20. .. rst-class:: classref-reftable-group
  21. Properties
  22. ----------
  23. .. table::
  24. :widths: auto
  25. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  26. | :ref:`float<class_float>` | :ref:`bias<class_LightmapGI_property_bias>` | ``0.0005`` |
  27. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  28. | :ref:`int<class_int>` | :ref:`bounces<class_LightmapGI_property_bounces>` | ``3`` |
  29. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  30. | :ref:`CameraAttributes<class_CameraAttributes>` | :ref:`camera_attributes<class_LightmapGI_property_camera_attributes>` | |
  31. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  32. | :ref:`bool<class_bool>` | :ref:`directional<class_LightmapGI_property_directional>` | ``false`` |
  33. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  34. | :ref:`Color<class_Color>` | :ref:`environment_custom_color<class_LightmapGI_property_environment_custom_color>` | |
  35. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  36. | :ref:`float<class_float>` | :ref:`environment_custom_energy<class_LightmapGI_property_environment_custom_energy>` | |
  37. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  38. | :ref:`Sky<class_Sky>` | :ref:`environment_custom_sky<class_LightmapGI_property_environment_custom_sky>` | |
  39. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  40. | :ref:`EnvironmentMode<enum_LightmapGI_EnvironmentMode>` | :ref:`environment_mode<class_LightmapGI_property_environment_mode>` | ``1`` |
  41. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  42. | :ref:`GenerateProbes<enum_LightmapGI_GenerateProbes>` | :ref:`generate_probes_subdiv<class_LightmapGI_property_generate_probes_subdiv>` | ``2`` |
  43. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  44. | :ref:`bool<class_bool>` | :ref:`interior<class_LightmapGI_property_interior>` | ``false`` |
  45. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  46. | :ref:`LightmapGIData<class_LightmapGIData>` | :ref:`light_data<class_LightmapGI_property_light_data>` | |
  47. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  48. | :ref:`int<class_int>` | :ref:`max_texture_size<class_LightmapGI_property_max_texture_size>` | ``16384`` |
  49. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  50. | :ref:`BakeQuality<enum_LightmapGI_BakeQuality>` | :ref:`quality<class_LightmapGI_property_quality>` | ``1`` |
  51. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  52. | :ref:`bool<class_bool>` | :ref:`use_denoiser<class_LightmapGI_property_use_denoiser>` | ``true`` |
  53. +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+
  54. .. rst-class:: classref-section-separator
  55. ----
  56. .. rst-class:: classref-descriptions-group
  57. Enumerations
  58. ------------
  59. .. _enum_LightmapGI_BakeQuality:
  60. .. rst-class:: classref-enumeration
  61. enum **BakeQuality**:
  62. .. _class_LightmapGI_constant_BAKE_QUALITY_LOW:
  63. .. rst-class:: classref-enumeration-constant
  64. :ref:`BakeQuality<enum_LightmapGI_BakeQuality>` **BAKE_QUALITY_LOW** = ``0``
  65. 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>`.
  66. .. _class_LightmapGI_constant_BAKE_QUALITY_MEDIUM:
  67. .. rst-class:: classref-enumeration-constant
  68. :ref:`BakeQuality<enum_LightmapGI_BakeQuality>` **BAKE_QUALITY_MEDIUM** = ``1``
  69. 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>`.
  70. .. _class_LightmapGI_constant_BAKE_QUALITY_HIGH:
  71. .. rst-class:: classref-enumeration-constant
  72. :ref:`BakeQuality<enum_LightmapGI_BakeQuality>` **BAKE_QUALITY_HIGH** = ``2``
  73. 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>`.
  74. .. _class_LightmapGI_constant_BAKE_QUALITY_ULTRA:
  75. .. rst-class:: classref-enumeration-constant
  76. :ref:`BakeQuality<enum_LightmapGI_BakeQuality>` **BAKE_QUALITY_ULTRA** = ``3``
  77. 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>`.
  78. .. rst-class:: classref-item-separator
  79. ----
  80. .. _enum_LightmapGI_GenerateProbes:
  81. .. rst-class:: classref-enumeration
  82. enum **GenerateProbes**:
  83. .. _class_LightmapGI_constant_GENERATE_PROBES_DISABLED:
  84. .. rst-class:: classref-enumeration-constant
  85. :ref:`GenerateProbes<enum_LightmapGI_GenerateProbes>` **GENERATE_PROBES_DISABLED** = ``0``
  86. Don't generate lightmap probes for lighting dynamic objects.
  87. .. _class_LightmapGI_constant_GENERATE_PROBES_SUBDIV_4:
  88. .. rst-class:: classref-enumeration-constant
  89. :ref:`GenerateProbes<enum_LightmapGI_GenerateProbes>` **GENERATE_PROBES_SUBDIV_4** = ``1``
  90. Lowest level of subdivision (fastest bake times, smallest file sizes).
  91. .. _class_LightmapGI_constant_GENERATE_PROBES_SUBDIV_8:
  92. .. rst-class:: classref-enumeration-constant
  93. :ref:`GenerateProbes<enum_LightmapGI_GenerateProbes>` **GENERATE_PROBES_SUBDIV_8** = ``2``
  94. Low level of subdivision (fast bake times, small file sizes).
  95. .. _class_LightmapGI_constant_GENERATE_PROBES_SUBDIV_16:
  96. .. rst-class:: classref-enumeration-constant
  97. :ref:`GenerateProbes<enum_LightmapGI_GenerateProbes>` **GENERATE_PROBES_SUBDIV_16** = ``3``
  98. High level of subdivision (slow bake times, large file sizes).
  99. .. _class_LightmapGI_constant_GENERATE_PROBES_SUBDIV_32:
  100. .. rst-class:: classref-enumeration-constant
  101. :ref:`GenerateProbes<enum_LightmapGI_GenerateProbes>` **GENERATE_PROBES_SUBDIV_32** = ``4``
  102. Highest level of subdivision (slowest bake times, largest file sizes).
  103. .. rst-class:: classref-item-separator
  104. ----
  105. .. _enum_LightmapGI_BakeError:
  106. .. rst-class:: classref-enumeration
  107. enum **BakeError**:
  108. .. _class_LightmapGI_constant_BAKE_ERROR_OK:
  109. .. rst-class:: classref-enumeration-constant
  110. :ref:`BakeError<enum_LightmapGI_BakeError>` **BAKE_ERROR_OK** = ``0``
  111. Lightmap baking was successful.
  112. .. _class_LightmapGI_constant_BAKE_ERROR_NO_SCENE_ROOT:
  113. .. rst-class:: classref-enumeration-constant
  114. :ref:`BakeError<enum_LightmapGI_BakeError>` **BAKE_ERROR_NO_SCENE_ROOT** = ``1``
  115. Lightmap baking failed because the root node for the edited scene could not be accessed.
  116. .. _class_LightmapGI_constant_BAKE_ERROR_FOREIGN_DATA:
  117. .. rst-class:: classref-enumeration-constant
  118. :ref:`BakeError<enum_LightmapGI_BakeError>` **BAKE_ERROR_FOREIGN_DATA** = ``2``
  119. Lightmap baking failed as the lightmap data resource is embedded in a foreign resource.
  120. .. _class_LightmapGI_constant_BAKE_ERROR_NO_LIGHTMAPPER:
  121. .. rst-class:: classref-enumeration-constant
  122. :ref:`BakeError<enum_LightmapGI_BakeError>` **BAKE_ERROR_NO_LIGHTMAPPER** = ``3``
  123. Lightmap baking failed as there is no lightmapper available in this Godot build.
  124. .. _class_LightmapGI_constant_BAKE_ERROR_NO_SAVE_PATH:
  125. .. rst-class:: classref-enumeration-constant
  126. :ref:`BakeError<enum_LightmapGI_BakeError>` **BAKE_ERROR_NO_SAVE_PATH** = ``4``
  127. Lightmap baking failed as the :ref:`LightmapGIData<class_LightmapGIData>` save path isn't configured in the resource.
  128. .. _class_LightmapGI_constant_BAKE_ERROR_NO_MESHES:
  129. .. rst-class:: classref-enumeration-constant
  130. :ref:`BakeError<enum_LightmapGI_BakeError>` **BAKE_ERROR_NO_MESHES** = ``5``
  131. 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.
  132. .. _class_LightmapGI_constant_BAKE_ERROR_MESHES_INVALID:
  133. .. rst-class:: classref-enumeration-constant
  134. :ref:`BakeError<enum_LightmapGI_BakeError>` **BAKE_ERROR_MESHES_INVALID** = ``6``
  135. Lightmap baking failed as the lightmapper failed to analyze some of the meshes marked as static for baking.
  136. .. _class_LightmapGI_constant_BAKE_ERROR_CANT_CREATE_IMAGE:
  137. .. rst-class:: classref-enumeration-constant
  138. :ref:`BakeError<enum_LightmapGI_BakeError>` **BAKE_ERROR_CANT_CREATE_IMAGE** = ``7``
  139. Lightmap baking failed as the resulting image couldn't be saved or imported by Godot after it was saved.
  140. .. _class_LightmapGI_constant_BAKE_ERROR_USER_ABORTED:
  141. .. rst-class:: classref-enumeration-constant
  142. :ref:`BakeError<enum_LightmapGI_BakeError>` **BAKE_ERROR_USER_ABORTED** = ``8``
  143. The user aborted the lightmap baking operation (typically by clicking the **Cancel** button in the progress dialog).
  144. .. rst-class:: classref-item-separator
  145. ----
  146. .. _enum_LightmapGI_EnvironmentMode:
  147. .. rst-class:: classref-enumeration
  148. enum **EnvironmentMode**:
  149. .. _class_LightmapGI_constant_ENVIRONMENT_MODE_DISABLED:
  150. .. rst-class:: classref-enumeration-constant
  151. :ref:`EnvironmentMode<enum_LightmapGI_EnvironmentMode>` **ENVIRONMENT_MODE_DISABLED** = ``0``
  152. Ignore environment lighting when baking lightmaps.
  153. .. _class_LightmapGI_constant_ENVIRONMENT_MODE_SCENE:
  154. .. rst-class:: classref-enumeration-constant
  155. :ref:`EnvironmentMode<enum_LightmapGI_EnvironmentMode>` **ENVIRONMENT_MODE_SCENE** = ``1``
  156. Use the scene's environment lighting when baking lightmaps.
  157. \ **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.
  158. .. _class_LightmapGI_constant_ENVIRONMENT_MODE_CUSTOM_SKY:
  159. .. rst-class:: classref-enumeration-constant
  160. :ref:`EnvironmentMode<enum_LightmapGI_EnvironmentMode>` **ENVIRONMENT_MODE_CUSTOM_SKY** = ``2``
  161. Use :ref:`environment_custom_sky<class_LightmapGI_property_environment_custom_sky>` as a source of environment lighting when baking lightmaps.
  162. .. _class_LightmapGI_constant_ENVIRONMENT_MODE_CUSTOM_COLOR:
  163. .. rst-class:: classref-enumeration-constant
  164. :ref:`EnvironmentMode<enum_LightmapGI_EnvironmentMode>` **ENVIRONMENT_MODE_CUSTOM_COLOR** = ``3``
  165. 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.
  166. .. rst-class:: classref-section-separator
  167. ----
  168. .. rst-class:: classref-descriptions-group
  169. Property Descriptions
  170. ---------------------
  171. .. _class_LightmapGI_property_bias:
  172. .. rst-class:: classref-property
  173. :ref:`float<class_float>` **bias** = ``0.0005``
  174. .. rst-class:: classref-property-setget
  175. - void **set_bias** **(** :ref:`float<class_float>` value **)**
  176. - :ref:`float<class_float>` **get_bias** **(** **)**
  177. 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.
  178. .. rst-class:: classref-item-separator
  179. ----
  180. .. _class_LightmapGI_property_bounces:
  181. .. rst-class:: classref-property
  182. :ref:`int<class_int>` **bounces** = ``3``
  183. .. rst-class:: classref-property-setget
  184. - void **set_bounces** **(** :ref:`int<class_int>` value **)**
  185. - :ref:`int<class_int>` **get_bounces** **(** **)**
  186. 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.
  187. .. rst-class:: classref-item-separator
  188. ----
  189. .. _class_LightmapGI_property_camera_attributes:
  190. .. rst-class:: classref-property
  191. :ref:`CameraAttributes<class_CameraAttributes>` **camera_attributes**
  192. .. rst-class:: classref-property-setget
  193. - void **set_camera_attributes** **(** :ref:`CameraAttributes<class_CameraAttributes>` value **)**
  194. - :ref:`CameraAttributes<class_CameraAttributes>` **get_camera_attributes** **(** **)**
  195. 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.
  196. .. rst-class:: classref-item-separator
  197. ----
  198. .. _class_LightmapGI_property_directional:
  199. .. rst-class:: classref-property
  200. :ref:`bool<class_bool>` **directional** = ``false``
  201. .. rst-class:: classref-property-setget
  202. - void **set_directional** **(** :ref:`bool<class_bool>` value **)**
  203. - :ref:`bool<class_bool>` **is_directional** **(** **)**
  204. 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>`). 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.
  205. \ **Note:** The property's name has no relationship with :ref:`DirectionalLight3D<class_DirectionalLight3D>`. :ref:`directional<class_LightmapGI_property_directional>` works with all light types.
  206. .. rst-class:: classref-item-separator
  207. ----
  208. .. _class_LightmapGI_property_environment_custom_color:
  209. .. rst-class:: classref-property
  210. :ref:`Color<class_Color>` **environment_custom_color**
  211. .. rst-class:: classref-property-setget
  212. - void **set_environment_custom_color** **(** :ref:`Color<class_Color>` value **)**
  213. - :ref:`Color<class_Color>` **get_environment_custom_color** **(** **)**
  214. 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>`.
  215. .. rst-class:: classref-item-separator
  216. ----
  217. .. _class_LightmapGI_property_environment_custom_energy:
  218. .. rst-class:: classref-property
  219. :ref:`float<class_float>` **environment_custom_energy**
  220. .. rst-class:: classref-property-setget
  221. - void **set_environment_custom_energy** **(** :ref:`float<class_float>` value **)**
  222. - :ref:`float<class_float>` **get_environment_custom_energy** **(** **)**
  223. 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>`.
  224. .. rst-class:: classref-item-separator
  225. ----
  226. .. _class_LightmapGI_property_environment_custom_sky:
  227. .. rst-class:: classref-property
  228. :ref:`Sky<class_Sky>` **environment_custom_sky**
  229. .. rst-class:: classref-property-setget
  230. - void **set_environment_custom_sky** **(** :ref:`Sky<class_Sky>` value **)**
  231. - :ref:`Sky<class_Sky>` **get_environment_custom_sky** **(** **)**
  232. 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>`.
  233. .. rst-class:: classref-item-separator
  234. ----
  235. .. _class_LightmapGI_property_environment_mode:
  236. .. rst-class:: classref-property
  237. :ref:`EnvironmentMode<enum_LightmapGI_EnvironmentMode>` **environment_mode** = ``1``
  238. .. rst-class:: classref-property-setget
  239. - void **set_environment_mode** **(** :ref:`EnvironmentMode<enum_LightmapGI_EnvironmentMode>` value **)**
  240. - :ref:`EnvironmentMode<enum_LightmapGI_EnvironmentMode>` **get_environment_mode** **(** **)**
  241. The environment mode to use when baking lightmaps.
  242. .. rst-class:: classref-item-separator
  243. ----
  244. .. _class_LightmapGI_property_generate_probes_subdiv:
  245. .. rst-class:: classref-property
  246. :ref:`GenerateProbes<enum_LightmapGI_GenerateProbes>` **generate_probes_subdiv** = ``2``
  247. .. rst-class:: classref-property-setget
  248. - void **set_generate_probes** **(** :ref:`GenerateProbes<enum_LightmapGI_GenerateProbes>` value **)**
  249. - :ref:`GenerateProbes<enum_LightmapGI_GenerateProbes>` **get_generate_probes** **(** **)**
  250. 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.
  251. \ **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.
  252. \ **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.
  253. .. rst-class:: classref-item-separator
  254. ----
  255. .. _class_LightmapGI_property_interior:
  256. .. rst-class:: classref-property
  257. :ref:`bool<class_bool>` **interior** = ``false``
  258. .. rst-class:: classref-property-setget
  259. - void **set_interior** **(** :ref:`bool<class_bool>` value **)**
  260. - :ref:`bool<class_bool>` **is_interior** **(** **)**
  261. If ``true``, ignore environment lighting when baking lightmaps.
  262. .. rst-class:: classref-item-separator
  263. ----
  264. .. _class_LightmapGI_property_light_data:
  265. .. rst-class:: classref-property
  266. :ref:`LightmapGIData<class_LightmapGIData>` **light_data**
  267. .. rst-class:: classref-property-setget
  268. - void **set_light_data** **(** :ref:`LightmapGIData<class_LightmapGIData>` value **)**
  269. - :ref:`LightmapGIData<class_LightmapGIData>` **get_light_data** **(** **)**
  270. 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.
  271. .. rst-class:: classref-item-separator
  272. ----
  273. .. _class_LightmapGI_property_max_texture_size:
  274. .. rst-class:: classref-property
  275. :ref:`int<class_int>` **max_texture_size** = ``16384``
  276. .. rst-class:: classref-property-setget
  277. - void **set_max_texture_size** **(** :ref:`int<class_int>` value **)**
  278. - :ref:`int<class_int>` **get_max_texture_size** **(** **)**
  279. 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.
  280. .. rst-class:: classref-item-separator
  281. ----
  282. .. _class_LightmapGI_property_quality:
  283. .. rst-class:: classref-property
  284. :ref:`BakeQuality<enum_LightmapGI_BakeQuality>` **quality** = ``1``
  285. .. rst-class:: classref-property-setget
  286. - void **set_bake_quality** **(** :ref:`BakeQuality<enum_LightmapGI_BakeQuality>` value **)**
  287. - :ref:`BakeQuality<enum_LightmapGI_BakeQuality>` **get_bake_quality** **(** **)**
  288. The quality preset to use when baking lightmaps. This affects bake times, but output file sizes remain mostly identical across quality levels.
  289. 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 doc.
  290. .. rst-class:: classref-item-separator
  291. ----
  292. .. _class_LightmapGI_property_use_denoiser:
  293. .. rst-class:: classref-property
  294. :ref:`bool<class_bool>` **use_denoiser** = ``true``
  295. .. rst-class:: classref-property-setget
  296. - void **set_use_denoiser** **(** :ref:`bool<class_bool>` value **)**
  297. - :ref:`bool<class_bool>` **is_using_denoiser** **(** **)**
  298. If ``true``, uses a CPU-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.
  299. \ **Note:** The built-in denoiser (OpenImageDenoise) may crash when denoising lightmaps in large scenes. If you encounter a crash at the end of lightmap baking, try disabling :ref:`use_denoiser<class_LightmapGI_property_use_denoiser>`.
  300. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  301. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  302. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  303. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  304. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  305. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`