2
0

class_bakedlightmap.rst 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696
  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/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/BakedLightmap.xml.
  6. .. _class_BakedLightmap:
  7. BakedLightmap
  8. =============
  9. **Inherits:** :ref:`VisualInstance<class_VisualInstance>` **<** :ref:`CullInstance<class_CullInstance>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. Prerendered indirect light map for a scene.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Baked lightmaps are an alternative workflow for adding indirect (or baked) lighting to a scene. Unlike the :ref:`GIProbe<class_GIProbe>` approach, baked lightmaps work fine on low-end PCs and mobile devices as they consume almost no resources in run-time.
  15. \ **Procedural generation:** Lightmap baking functionality is only available in the editor. This means **BakedLightmap** is not suited to procedurally generated or user-built levels. For procedurally generated or user-built levels, use :ref:`GIProbe<class_GIProbe>` instead.
  16. \ **Note:** Due to how lightmaps work, most properties only have a visible effect once lightmaps are baked again.
  17. .. rst-class:: classref-introduction-group
  18. Tutorials
  19. ---------
  20. - :doc:`../tutorials/3d/baked_lightmaps`
  21. .. rst-class:: classref-reftable-group
  22. Properties
  23. ----------
  24. .. table::
  25. :widths: auto
  26. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
  27. | :ref:`bool<class_bool>` | :ref:`atlas_generate<class_BakedLightmap_property_atlas_generate>` | ``true`` |
  28. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
  29. | :ref:`int<class_int>` | :ref:`atlas_max_size<class_BakedLightmap_property_atlas_max_size>` | ``4096`` |
  30. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
  31. | :ref:`float<class_float>` | :ref:`bias<class_BakedLightmap_property_bias>` | ``0.005`` |
  32. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
  33. | :ref:`float<class_float>` | :ref:`bounce_indirect_energy<class_BakedLightmap_property_bounce_indirect_energy>` | ``1.0`` |
  34. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
  35. | :ref:`int<class_int>` | :ref:`bounces<class_BakedLightmap_property_bounces>` | ``3`` |
  36. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
  37. | :ref:`float<class_float>` | :ref:`capture_cell_size<class_BakedLightmap_property_capture_cell_size>` | ``0.5`` |
  38. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
  39. | :ref:`bool<class_bool>` | :ref:`capture_enabled<class_BakedLightmap_property_capture_enabled>` | ``true`` |
  40. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
  41. | :ref:`float<class_float>` | :ref:`capture_propagation<class_BakedLightmap_property_capture_propagation>` | ``1.0`` |
  42. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
  43. | :ref:`BakeQuality<enum_BakedLightmap_BakeQuality>` | :ref:`capture_quality<class_BakedLightmap_property_capture_quality>` | ``1`` |
  44. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
  45. | :ref:`float<class_float>` | :ref:`default_texels_per_unit<class_BakedLightmap_property_default_texels_per_unit>` | ``16.0`` |
  46. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
  47. | :ref:`Color<class_Color>` | :ref:`environment_custom_color<class_BakedLightmap_property_environment_custom_color>` | |
  48. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
  49. | :ref:`float<class_float>` | :ref:`environment_custom_energy<class_BakedLightmap_property_environment_custom_energy>` | |
  50. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
  51. | :ref:`Sky<class_Sky>` | :ref:`environment_custom_sky<class_BakedLightmap_property_environment_custom_sky>` | |
  52. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
  53. | :ref:`Vector3<class_Vector3>` | :ref:`environment_custom_sky_rotation_degrees<class_BakedLightmap_property_environment_custom_sky_rotation_degrees>` | |
  54. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
  55. | :ref:`Color<class_Color>` | :ref:`environment_min_light<class_BakedLightmap_property_environment_min_light>` | ``Color( 0, 0, 0, 1 )`` |
  56. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
  57. | :ref:`EnvironmentMode<enum_BakedLightmap_EnvironmentMode>` | :ref:`environment_mode<class_BakedLightmap_property_environment_mode>` | ``0`` |
  58. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
  59. | :ref:`Vector3<class_Vector3>` | :ref:`extents<class_BakedLightmap_property_extents>` | ``Vector3( 10, 10, 10 )`` |
  60. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
  61. | :ref:`String<class_String>` | :ref:`image_path<class_BakedLightmap_property_image_path>` | |
  62. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
  63. | :ref:`BakedLightmapData<class_BakedLightmapData>` | :ref:`light_data<class_BakedLightmap_property_light_data>` | |
  64. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
  65. | :ref:`BakeQuality<enum_BakedLightmap_BakeQuality>` | :ref:`quality<class_BakedLightmap_property_quality>` | ``1`` |
  66. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
  67. | :ref:`bool<class_bool>` | :ref:`use_color<class_BakedLightmap_property_use_color>` | ``true`` |
  68. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
  69. | :ref:`bool<class_bool>` | :ref:`use_denoiser<class_BakedLightmap_property_use_denoiser>` | ``true`` |
  70. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
  71. | :ref:`bool<class_bool>` | :ref:`use_hdr<class_BakedLightmap_property_use_hdr>` | ``true`` |
  72. +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
  73. .. rst-class:: classref-reftable-group
  74. Methods
  75. -------
  76. .. table::
  77. :widths: auto
  78. +------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | :ref:`BakeError<enum_BakedLightmap_BakeError>` | :ref:`bake<class_BakedLightmap_method_bake>` **(** :ref:`Node<class_Node>` from_node=null, :ref:`String<class_String>` data_save_path="" **)** |
  80. +------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
  81. .. rst-class:: classref-section-separator
  82. ----
  83. .. rst-class:: classref-descriptions-group
  84. Enumerations
  85. ------------
  86. .. _enum_BakedLightmap_BakeQuality:
  87. .. rst-class:: classref-enumeration
  88. enum **BakeQuality**:
  89. .. _class_BakedLightmap_constant_BAKE_QUALITY_LOW:
  90. .. rst-class:: classref-enumeration-constant
  91. :ref:`BakeQuality<enum_BakedLightmap_BakeQuality>` **BAKE_QUALITY_LOW** = ``0``
  92. The lowest bake quality mode. Fastest to calculate.
  93. .. _class_BakedLightmap_constant_BAKE_QUALITY_MEDIUM:
  94. .. rst-class:: classref-enumeration-constant
  95. :ref:`BakeQuality<enum_BakedLightmap_BakeQuality>` **BAKE_QUALITY_MEDIUM** = ``1``
  96. The default bake quality mode.
  97. .. _class_BakedLightmap_constant_BAKE_QUALITY_HIGH:
  98. .. rst-class:: classref-enumeration-constant
  99. :ref:`BakeQuality<enum_BakedLightmap_BakeQuality>` **BAKE_QUALITY_HIGH** = ``2``
  100. A higher bake quality mode. Takes longer to calculate.
  101. .. _class_BakedLightmap_constant_BAKE_QUALITY_ULTRA:
  102. .. rst-class:: classref-enumeration-constant
  103. :ref:`BakeQuality<enum_BakedLightmap_BakeQuality>` **BAKE_QUALITY_ULTRA** = ``3``
  104. The highest bake quality mode. Takes the longest to calculate.
  105. .. rst-class:: classref-item-separator
  106. ----
  107. .. _enum_BakedLightmap_BakeError:
  108. .. rst-class:: classref-enumeration
  109. enum **BakeError**:
  110. .. _class_BakedLightmap_constant_BAKE_ERROR_OK:
  111. .. rst-class:: classref-enumeration-constant
  112. :ref:`BakeError<enum_BakedLightmap_BakeError>` **BAKE_ERROR_OK** = ``0``
  113. Baking was successful.
  114. .. _class_BakedLightmap_constant_BAKE_ERROR_NO_SAVE_PATH:
  115. .. rst-class:: classref-enumeration-constant
  116. :ref:`BakeError<enum_BakedLightmap_BakeError>` **BAKE_ERROR_NO_SAVE_PATH** = ``1``
  117. Returns if no viable save path is found. This can happen where an :ref:`image_path<class_BakedLightmap_property_image_path>` is not specified or when the save location is invalid.
  118. .. _class_BakedLightmap_constant_BAKE_ERROR_NO_MESHES:
  119. .. rst-class:: classref-enumeration-constant
  120. :ref:`BakeError<enum_BakedLightmap_BakeError>` **BAKE_ERROR_NO_MESHES** = ``2``
  121. Currently unused.
  122. .. _class_BakedLightmap_constant_BAKE_ERROR_CANT_CREATE_IMAGE:
  123. .. rst-class:: classref-enumeration-constant
  124. :ref:`BakeError<enum_BakedLightmap_BakeError>` **BAKE_ERROR_CANT_CREATE_IMAGE** = ``3``
  125. Returns when the baker cannot save per-mesh textures to file.
  126. .. _class_BakedLightmap_constant_BAKE_ERROR_LIGHTMAP_SIZE:
  127. .. rst-class:: classref-enumeration-constant
  128. :ref:`BakeError<enum_BakedLightmap_BakeError>` **BAKE_ERROR_LIGHTMAP_SIZE** = ``4``
  129. The size of the generated lightmaps is too large.
  130. .. _class_BakedLightmap_constant_BAKE_ERROR_INVALID_MESH:
  131. .. rst-class:: classref-enumeration-constant
  132. :ref:`BakeError<enum_BakedLightmap_BakeError>` **BAKE_ERROR_INVALID_MESH** = ``5``
  133. Some mesh contains UV2 values outside the ``[0,1]`` range.
  134. .. _class_BakedLightmap_constant_BAKE_ERROR_USER_ABORTED:
  135. .. rst-class:: classref-enumeration-constant
  136. :ref:`BakeError<enum_BakedLightmap_BakeError>` **BAKE_ERROR_USER_ABORTED** = ``6``
  137. Returns if user cancels baking.
  138. .. _class_BakedLightmap_constant_BAKE_ERROR_NO_LIGHTMAPPER:
  139. .. rst-class:: classref-enumeration-constant
  140. :ref:`BakeError<enum_BakedLightmap_BakeError>` **BAKE_ERROR_NO_LIGHTMAPPER** = ``7``
  141. Returns if lightmapper can't be created. Unless you are using a custom lightmapper, please report this as bug.
  142. .. _class_BakedLightmap_constant_BAKE_ERROR_NO_ROOT:
  143. .. rst-class:: classref-enumeration-constant
  144. :ref:`BakeError<enum_BakedLightmap_BakeError>` **BAKE_ERROR_NO_ROOT** = ``8``
  145. There is no root node to start baking from. Either provide ``from_node`` argument or attach this node to a parent that should be used as root.
  146. .. rst-class:: classref-item-separator
  147. ----
  148. .. _enum_BakedLightmap_EnvironmentMode:
  149. .. rst-class:: classref-enumeration
  150. enum **EnvironmentMode**:
  151. .. _class_BakedLightmap_constant_ENVIRONMENT_MODE_DISABLED:
  152. .. rst-class:: classref-enumeration-constant
  153. :ref:`EnvironmentMode<enum_BakedLightmap_EnvironmentMode>` **ENVIRONMENT_MODE_DISABLED** = ``0``
  154. No environment is used during baking.
  155. .. _class_BakedLightmap_constant_ENVIRONMENT_MODE_SCENE:
  156. .. rst-class:: classref-enumeration-constant
  157. :ref:`EnvironmentMode<enum_BakedLightmap_EnvironmentMode>` **ENVIRONMENT_MODE_SCENE** = ``1``
  158. The baked environment is automatically picked from the current scene.
  159. .. _class_BakedLightmap_constant_ENVIRONMENT_MODE_CUSTOM_SKY:
  160. .. rst-class:: classref-enumeration-constant
  161. :ref:`EnvironmentMode<enum_BakedLightmap_EnvironmentMode>` **ENVIRONMENT_MODE_CUSTOM_SKY** = ``2``
  162. A custom sky is used as environment during baking.
  163. .. _class_BakedLightmap_constant_ENVIRONMENT_MODE_CUSTOM_COLOR:
  164. .. rst-class:: classref-enumeration-constant
  165. :ref:`EnvironmentMode<enum_BakedLightmap_EnvironmentMode>` **ENVIRONMENT_MODE_CUSTOM_COLOR** = ``3``
  166. A custom solid color is used as environment during baking.
  167. .. rst-class:: classref-section-separator
  168. ----
  169. .. rst-class:: classref-descriptions-group
  170. Property Descriptions
  171. ---------------------
  172. .. _class_BakedLightmap_property_atlas_generate:
  173. .. rst-class:: classref-property
  174. :ref:`bool<class_bool>` **atlas_generate** = ``true``
  175. .. rst-class:: classref-property-setget
  176. - void **set_generate_atlas** **(** :ref:`bool<class_bool>` value **)**
  177. - :ref:`bool<class_bool>` **is_generate_atlas_enabled** **(** **)**
  178. If ``true``, the lightmapper will merge the textures for all meshes into one or several large layered textures. If ``false``, every mesh will get its own lightmap texture, which is less efficient.
  179. \ **Note:** Atlas lightmap rendering is only supported in GLES3, *not* GLES2. Non-atlas lightmap rendering is supported by both GLES3 and GLES2. If :ref:`ProjectSettings.rendering/quality/driver/fallback_to_gles2<class_ProjectSettings_property_rendering/quality/driver/fallback_to_gles2>` is ``true``, consider baking lightmaps with :ref:`atlas_generate<class_BakedLightmap_property_atlas_generate>` set to ``false`` so that the resulting lightmap is visible in both GLES3 and GLES2.
  180. .. rst-class:: classref-item-separator
  181. ----
  182. .. _class_BakedLightmap_property_atlas_max_size:
  183. .. rst-class:: classref-property
  184. :ref:`int<class_int>` **atlas_max_size** = ``4096``
  185. .. rst-class:: classref-property-setget
  186. - void **set_max_atlas_size** **(** :ref:`int<class_int>` value **)**
  187. - :ref:`int<class_int>` **get_max_atlas_size** **(** **)**
  188. Maximum size of each lightmap layer, only used when :ref:`atlas_generate<class_BakedLightmap_property_atlas_generate>` is enabled.
  189. .. rst-class:: classref-item-separator
  190. ----
  191. .. _class_BakedLightmap_property_bias:
  192. .. rst-class:: classref-property
  193. :ref:`float<class_float>` **bias** = ``0.005``
  194. .. rst-class:: classref-property-setget
  195. - void **set_bias** **(** :ref:`float<class_float>` value **)**
  196. - :ref:`float<class_float>` **get_bias** **(** **)**
  197. Raycasting bias used during baking to avoid floating point precision issues.
  198. .. rst-class:: classref-item-separator
  199. ----
  200. .. _class_BakedLightmap_property_bounce_indirect_energy:
  201. .. rst-class:: classref-property
  202. :ref:`float<class_float>` **bounce_indirect_energy** = ``1.0``
  203. .. rst-class:: classref-property-setget
  204. - void **set_bounce_indirect_energy** **(** :ref:`float<class_float>` value **)**
  205. - :ref:`float<class_float>` **get_bounce_indirect_energy** **(** **)**
  206. 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_BakedLightmap_property_bounces>` then increasing :ref:`bounce_indirect_energy<class_BakedLightmap_property_bounce_indirect_energy>`. Unlike :ref:`BakedLightmapData.energy<class_BakedLightmapData_property_energy>`, this property does not affect direct lighting emitted by light nodes, emissive materials and the environment.
  207. \ **Note:** :ref:`bounce_indirect_energy<class_BakedLightmap_property_bounce_indirect_energy>` only has an effect if :ref:`bounces<class_BakedLightmap_property_bounces>` is set to a value greater than or equal to ``1``.
  208. .. rst-class:: classref-item-separator
  209. ----
  210. .. _class_BakedLightmap_property_bounces:
  211. .. rst-class:: classref-property
  212. :ref:`int<class_int>` **bounces** = ``3``
  213. .. rst-class:: classref-property-setget
  214. - void **set_bounces** **(** :ref:`int<class_int>` value **)**
  215. - :ref:`int<class_int>` **get_bounces** **(** **)**
  216. Number of light bounces that are taken into account during baking. See also :ref:`bounce_indirect_energy<class_BakedLightmap_property_bounce_indirect_energy>`.
  217. .. rst-class:: classref-item-separator
  218. ----
  219. .. _class_BakedLightmap_property_capture_cell_size:
  220. .. rst-class:: classref-property
  221. :ref:`float<class_float>` **capture_cell_size** = ``0.5``
  222. .. rst-class:: classref-property-setget
  223. - void **set_capture_cell_size** **(** :ref:`float<class_float>` value **)**
  224. - :ref:`float<class_float>` **get_capture_cell_size** **(** **)**
  225. Grid size used for real-time capture information on dynamic objects.
  226. .. rst-class:: classref-item-separator
  227. ----
  228. .. _class_BakedLightmap_property_capture_enabled:
  229. .. rst-class:: classref-property
  230. :ref:`bool<class_bool>` **capture_enabled** = ``true``
  231. .. rst-class:: classref-property-setget
  232. - void **set_capture_enabled** **(** :ref:`bool<class_bool>` value **)**
  233. - :ref:`bool<class_bool>` **get_capture_enabled** **(** **)**
  234. When enabled, an octree containing the scene's lighting information will be computed. This octree will then be used to light dynamic objects in the scene.
  235. .. rst-class:: classref-item-separator
  236. ----
  237. .. _class_BakedLightmap_property_capture_propagation:
  238. .. rst-class:: classref-property
  239. :ref:`float<class_float>` **capture_propagation** = ``1.0``
  240. .. rst-class:: classref-property-setget
  241. - void **set_capture_propagation** **(** :ref:`float<class_float>` value **)**
  242. - :ref:`float<class_float>` **get_capture_propagation** **(** **)**
  243. Bias value to reduce the amount of light propagation in the captured octree.
  244. .. rst-class:: classref-item-separator
  245. ----
  246. .. _class_BakedLightmap_property_capture_quality:
  247. .. rst-class:: classref-property
  248. :ref:`BakeQuality<enum_BakedLightmap_BakeQuality>` **capture_quality** = ``1``
  249. .. rst-class:: classref-property-setget
  250. - void **set_capture_quality** **(** :ref:`BakeQuality<enum_BakedLightmap_BakeQuality>` value **)**
  251. - :ref:`BakeQuality<enum_BakedLightmap_BakeQuality>` **get_capture_quality** **(** **)**
  252. Bake quality of the capture data.
  253. .. rst-class:: classref-item-separator
  254. ----
  255. .. _class_BakedLightmap_property_default_texels_per_unit:
  256. .. rst-class:: classref-property
  257. :ref:`float<class_float>` **default_texels_per_unit** = ``16.0``
  258. .. rst-class:: classref-property-setget
  259. - void **set_default_texels_per_unit** **(** :ref:`float<class_float>` value **)**
  260. - :ref:`float<class_float>` **get_default_texels_per_unit** **(** **)**
  261. If a baked mesh doesn't have a UV2 size hint, this value will be used to roughly compute a suitable lightmap size.
  262. .. rst-class:: classref-item-separator
  263. ----
  264. .. _class_BakedLightmap_property_environment_custom_color:
  265. .. rst-class:: classref-property
  266. :ref:`Color<class_Color>` **environment_custom_color**
  267. .. rst-class:: classref-property-setget
  268. - void **set_environment_custom_color** **(** :ref:`Color<class_Color>` value **)**
  269. - :ref:`Color<class_Color>` **get_environment_custom_color** **(** **)**
  270. The environment color when :ref:`environment_mode<class_BakedLightmap_property_environment_mode>` is set to :ref:`ENVIRONMENT_MODE_CUSTOM_COLOR<class_BakedLightmap_constant_ENVIRONMENT_MODE_CUSTOM_COLOR>`.
  271. .. rst-class:: classref-item-separator
  272. ----
  273. .. _class_BakedLightmap_property_environment_custom_energy:
  274. .. rst-class:: classref-property
  275. :ref:`float<class_float>` **environment_custom_energy**
  276. .. rst-class:: classref-property-setget
  277. - void **set_environment_custom_energy** **(** :ref:`float<class_float>` value **)**
  278. - :ref:`float<class_float>` **get_environment_custom_energy** **(** **)**
  279. The energy scaling factor when when :ref:`environment_mode<class_BakedLightmap_property_environment_mode>` is set to :ref:`ENVIRONMENT_MODE_CUSTOM_COLOR<class_BakedLightmap_constant_ENVIRONMENT_MODE_CUSTOM_COLOR>` or :ref:`ENVIRONMENT_MODE_CUSTOM_SKY<class_BakedLightmap_constant_ENVIRONMENT_MODE_CUSTOM_SKY>`.
  280. .. rst-class:: classref-item-separator
  281. ----
  282. .. _class_BakedLightmap_property_environment_custom_sky:
  283. .. rst-class:: classref-property
  284. :ref:`Sky<class_Sky>` **environment_custom_sky**
  285. .. rst-class:: classref-property-setget
  286. - void **set_environment_custom_sky** **(** :ref:`Sky<class_Sky>` value **)**
  287. - :ref:`Sky<class_Sky>` **get_environment_custom_sky** **(** **)**
  288. The :ref:`Sky<class_Sky>` resource to use when :ref:`environment_mode<class_BakedLightmap_property_environment_mode>` is set o :ref:`ENVIRONMENT_MODE_CUSTOM_SKY<class_BakedLightmap_constant_ENVIRONMENT_MODE_CUSTOM_SKY>`.
  289. .. rst-class:: classref-item-separator
  290. ----
  291. .. _class_BakedLightmap_property_environment_custom_sky_rotation_degrees:
  292. .. rst-class:: classref-property
  293. :ref:`Vector3<class_Vector3>` **environment_custom_sky_rotation_degrees**
  294. .. rst-class:: classref-property-setget
  295. - void **set_environment_custom_sky_rotation_degrees** **(** :ref:`Vector3<class_Vector3>` value **)**
  296. - :ref:`Vector3<class_Vector3>` **get_environment_custom_sky_rotation_degrees** **(** **)**
  297. The rotation of the baked custom sky.
  298. .. rst-class:: classref-item-separator
  299. ----
  300. .. _class_BakedLightmap_property_environment_min_light:
  301. .. rst-class:: classref-property
  302. :ref:`Color<class_Color>` **environment_min_light** = ``Color( 0, 0, 0, 1 )``
  303. .. rst-class:: classref-property-setget
  304. - void **set_environment_min_light** **(** :ref:`Color<class_Color>` value **)**
  305. - :ref:`Color<class_Color>` **get_environment_min_light** **(** **)**
  306. Minimum ambient light for all the lightmap texels. This doesn't take into account any occlusion from the scene's geometry, it simply ensures a minimum amount of light on all the lightmap texels. Can be used for artistic control on shadow color.
  307. .. rst-class:: classref-item-separator
  308. ----
  309. .. _class_BakedLightmap_property_environment_mode:
  310. .. rst-class:: classref-property
  311. :ref:`EnvironmentMode<enum_BakedLightmap_EnvironmentMode>` **environment_mode** = ``0``
  312. .. rst-class:: classref-property-setget
  313. - void **set_environment_mode** **(** :ref:`EnvironmentMode<enum_BakedLightmap_EnvironmentMode>` value **)**
  314. - :ref:`EnvironmentMode<enum_BakedLightmap_EnvironmentMode>` **get_environment_mode** **(** **)**
  315. Decides which environment to use during baking.
  316. .. rst-class:: classref-item-separator
  317. ----
  318. .. _class_BakedLightmap_property_extents:
  319. .. rst-class:: classref-property
  320. :ref:`Vector3<class_Vector3>` **extents** = ``Vector3( 10, 10, 10 )``
  321. .. rst-class:: classref-property-setget
  322. - void **set_extents** **(** :ref:`Vector3<class_Vector3>` value **)**
  323. - :ref:`Vector3<class_Vector3>` **get_extents** **(** **)**
  324. Size of the baked lightmap. Only meshes inside this region will be included in the baked lightmap, also used as the bounds of the captured region for dynamic lighting.
  325. .. rst-class:: classref-item-separator
  326. ----
  327. .. _class_BakedLightmap_property_image_path:
  328. .. rst-class:: classref-property
  329. :ref:`String<class_String>` **image_path**
  330. .. rst-class:: classref-property-setget
  331. - void **set_image_path** **(** :ref:`String<class_String>` value **)**
  332. - :ref:`String<class_String>` **get_image_path** **(** **)**
  333. Deprecated, in previous versions it determined the location where lightmaps were be saved.
  334. .. rst-class:: classref-item-separator
  335. ----
  336. .. _class_BakedLightmap_property_light_data:
  337. .. rst-class:: classref-property
  338. :ref:`BakedLightmapData<class_BakedLightmapData>` **light_data**
  339. .. rst-class:: classref-property-setget
  340. - void **set_light_data** **(** :ref:`BakedLightmapData<class_BakedLightmapData>` value **)**
  341. - :ref:`BakedLightmapData<class_BakedLightmapData>` **get_light_data** **(** **)**
  342. The calculated light data.
  343. .. rst-class:: classref-item-separator
  344. ----
  345. .. _class_BakedLightmap_property_quality:
  346. .. rst-class:: classref-property
  347. :ref:`BakeQuality<enum_BakedLightmap_BakeQuality>` **quality** = ``1``
  348. .. rst-class:: classref-property-setget
  349. - void **set_bake_quality** **(** :ref:`BakeQuality<enum_BakedLightmap_BakeQuality>` value **)**
  350. - :ref:`BakeQuality<enum_BakedLightmap_BakeQuality>` **get_bake_quality** **(** **)**
  351. Determines the amount of samples per texel used in indirect light baking. The amount of samples for each quality level can be configured in the project settings.
  352. .. rst-class:: classref-item-separator
  353. ----
  354. .. _class_BakedLightmap_property_use_color:
  355. .. rst-class:: classref-property
  356. :ref:`bool<class_bool>` **use_color** = ``true``
  357. .. rst-class:: classref-property-setget
  358. - void **set_use_color** **(** :ref:`bool<class_bool>` value **)**
  359. - :ref:`bool<class_bool>` **is_using_color** **(** **)**
  360. Store full color values in the lightmap textures. When disabled, lightmap textures will store a single brightness channel. Can be disabled to reduce disk usage if the scene contains only white lights or you don't mind losing color information in indirect lighting.
  361. .. rst-class:: classref-item-separator
  362. ----
  363. .. _class_BakedLightmap_property_use_denoiser:
  364. .. rst-class:: classref-property
  365. :ref:`bool<class_bool>` **use_denoiser** = ``true``
  366. .. rst-class:: classref-property-setget
  367. - void **set_use_denoiser** **(** :ref:`bool<class_bool>` value **)**
  368. - :ref:`bool<class_bool>` **is_using_denoiser** **(** **)**
  369. When enabled, a lightmap denoiser will be used to reduce the noise inherent to Monte Carlo based global illumination.
  370. .. rst-class:: classref-item-separator
  371. ----
  372. .. _class_BakedLightmap_property_use_hdr:
  373. .. rst-class:: classref-property
  374. :ref:`bool<class_bool>` **use_hdr** = ``true``
  375. .. rst-class:: classref-property-setget
  376. - void **set_use_hdr** **(** :ref:`bool<class_bool>` value **)**
  377. - :ref:`bool<class_bool>` **is_using_hdr** **(** **)**
  378. If ``true``, stores the lightmap textures in a high dynamic range format (EXR). If ``false``, stores the lightmap texture in a low dynamic range PNG image. This can be set to ``false`` to reduce disk usage, but light values over 1.0 will be clamped and you may see banding caused by the reduced precision.
  379. \ **Note:** Setting :ref:`use_hdr<class_BakedLightmap_property_use_hdr>` to ``true`` will decrease lightmap banding even when using the GLES2 backend or if :ref:`ProjectSettings.rendering/quality/depth/hdr<class_ProjectSettings_property_rendering/quality/depth/hdr>` is ``false``.
  380. .. rst-class:: classref-section-separator
  381. ----
  382. .. rst-class:: classref-descriptions-group
  383. Method Descriptions
  384. -------------------
  385. .. _class_BakedLightmap_method_bake:
  386. .. rst-class:: classref-method
  387. :ref:`BakeError<enum_BakedLightmap_BakeError>` **bake** **(** :ref:`Node<class_Node>` from_node=null, :ref:`String<class_String>` data_save_path="" **)**
  388. Bakes the lightmap, scanning from the given ``from_node`` root and saves the resulting :ref:`BakedLightmapData<class_BakedLightmapData>` in ``data_save_path``. If no root node is provided, parent of this node will be used as root instead. If no save path is provided it will try to match the path from the current :ref:`light_data<class_BakedLightmap_property_light_data>`.
  389. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  390. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  391. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  392. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`