class_bakedlightmap.rst 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the BakedLightmap.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_BakedLightmap:
  6. BakedLightmap
  7. =============
  8. **Inherits:** :ref:`VisualInstance<class_VisualInstance>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Prerendered indirect light map for a scene.
  13. Properties
  14. ----------
  15. +----------------------------------------------------+--------------------------------------------------------------------------+
  16. | :ref:`float<class_float>` | :ref:`bake_cell_size<class_BakedLightmap_property_bake_cell_size>` |
  17. +----------------------------------------------------+--------------------------------------------------------------------------+
  18. | :ref:`float<class_float>` | :ref:`bake_energy<class_BakedLightmap_property_bake_energy>` |
  19. +----------------------------------------------------+--------------------------------------------------------------------------+
  20. | :ref:`Vector3<class_Vector3>` | :ref:`bake_extents<class_BakedLightmap_property_bake_extents>` |
  21. +----------------------------------------------------+--------------------------------------------------------------------------+
  22. | :ref:`bool<class_bool>` | :ref:`bake_hdr<class_BakedLightmap_property_bake_hdr>` |
  23. +----------------------------------------------------+--------------------------------------------------------------------------+
  24. | :ref:`BakeMode<enum_BakedLightmap_BakeMode>` | :ref:`bake_mode<class_BakedLightmap_property_bake_mode>` |
  25. +----------------------------------------------------+--------------------------------------------------------------------------+
  26. | :ref:`float<class_float>` | :ref:`bake_propagation<class_BakedLightmap_property_bake_propagation>` |
  27. +----------------------------------------------------+--------------------------------------------------------------------------+
  28. | :ref:`BakeQuality<enum_BakedLightmap_BakeQuality>` | :ref:`bake_quality<class_BakedLightmap_property_bake_quality>` |
  29. +----------------------------------------------------+--------------------------------------------------------------------------+
  30. | :ref:`float<class_float>` | :ref:`capture_cell_size<class_BakedLightmap_property_capture_cell_size>` |
  31. +----------------------------------------------------+--------------------------------------------------------------------------+
  32. | :ref:`String<class_String>` | :ref:`image_path<class_BakedLightmap_property_image_path>` |
  33. +----------------------------------------------------+--------------------------------------------------------------------------+
  34. | :ref:`BakedLightmapData<class_BakedLightmapData>` | :ref:`light_data<class_BakedLightmap_property_light_data>` |
  35. +----------------------------------------------------+--------------------------------------------------------------------------+
  36. Methods
  37. -------
  38. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`BakeError<enum_BakedLightmap_BakeError>` | :ref:`bake<class_BakedLightmap_method_bake>` **(** :ref:`Node<class_Node>` from_node=null, :ref:`bool<class_bool>` create_visual_debug=false **)** |
  40. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | void | :ref:`debug_bake<class_BakedLightmap_method_debug_bake>` **(** **)** |
  42. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
  43. Enumerations
  44. ------------
  45. .. _enum_BakedLightmap_BakeQuality:
  46. .. _class_BakedLightmap_constant_BAKE_QUALITY_LOW:
  47. .. _class_BakedLightmap_constant_BAKE_QUALITY_MEDIUM:
  48. .. _class_BakedLightmap_constant_BAKE_QUALITY_HIGH:
  49. enum **BakeQuality**:
  50. - **BAKE_QUALITY_LOW** = **0** --- Lowest bake quality mode. Fastest to calculate.
  51. - **BAKE_QUALITY_MEDIUM** = **1** --- Default bake quality mode.
  52. - **BAKE_QUALITY_HIGH** = **2** --- Highest bake quality mode. Takes longer to calculate.
  53. ----
  54. .. _enum_BakedLightmap_BakeMode:
  55. .. _class_BakedLightmap_constant_BAKE_MODE_CONE_TRACE:
  56. .. _class_BakedLightmap_constant_BAKE_MODE_RAY_TRACE:
  57. enum **BakeMode**:
  58. - **BAKE_MODE_CONE_TRACE** = **0** --- Less precise but faster bake mode.
  59. - **BAKE_MODE_RAY_TRACE** = **1** --- More precise bake mode but can take considerably longer to bake.
  60. ----
  61. .. _enum_BakedLightmap_BakeError:
  62. .. _class_BakedLightmap_constant_BAKE_ERROR_OK:
  63. .. _class_BakedLightmap_constant_BAKE_ERROR_NO_SAVE_PATH:
  64. .. _class_BakedLightmap_constant_BAKE_ERROR_NO_MESHES:
  65. .. _class_BakedLightmap_constant_BAKE_ERROR_CANT_CREATE_IMAGE:
  66. .. _class_BakedLightmap_constant_BAKE_ERROR_USER_ABORTED:
  67. enum **BakeError**:
  68. - **BAKE_ERROR_OK** = **0**
  69. - **BAKE_ERROR_NO_SAVE_PATH** = **1**
  70. - **BAKE_ERROR_NO_MESHES** = **2**
  71. - **BAKE_ERROR_CANT_CREATE_IMAGE** = **3**
  72. - **BAKE_ERROR_USER_ABORTED** = **4**
  73. Description
  74. -----------
  75. 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.
  76. Tutorials
  77. ---------
  78. - :doc:`../tutorials/3d/baked_lightmaps`
  79. Property Descriptions
  80. ---------------------
  81. .. _class_BakedLightmap_property_bake_cell_size:
  82. - :ref:`float<class_float>` **bake_cell_size**
  83. +----------+---------------------------+
  84. | *Setter* | set_bake_cell_size(value) |
  85. +----------+---------------------------+
  86. | *Getter* | get_bake_cell_size() |
  87. +----------+---------------------------+
  88. Grid subdivision size for lightmapper calculation. Default value of ``0.25`` will work for most cases. Increase for better lighting on small details or if your scene is very large.
  89. ----
  90. .. _class_BakedLightmap_property_bake_energy:
  91. - :ref:`float<class_float>` **bake_energy**
  92. +----------+-------------------+
  93. | *Setter* | set_energy(value) |
  94. +----------+-------------------+
  95. | *Getter* | get_energy() |
  96. +----------+-------------------+
  97. Multiplies the light sources' intensity by this value. For instance, if the value is set to 2, lights will be twice as bright. If the value is set to 0.5, lights will be half as bright.
  98. ----
  99. .. _class_BakedLightmap_property_bake_extents:
  100. - :ref:`Vector3<class_Vector3>` **bake_extents**
  101. +----------+--------------------+
  102. | *Setter* | set_extents(value) |
  103. +----------+--------------------+
  104. | *Getter* | get_extents() |
  105. +----------+--------------------+
  106. ----
  107. .. _class_BakedLightmap_property_bake_hdr:
  108. - :ref:`bool<class_bool>` **bake_hdr**
  109. +----------+----------------+
  110. | *Setter* | set_hdr(value) |
  111. +----------+----------------+
  112. | *Getter* | is_hdr() |
  113. +----------+----------------+
  114. If ``true``, lightmap can capture light values greater than ``1.0``. Turning this off will result in a smaller lightmap. Default value:``false``.
  115. ----
  116. .. _class_BakedLightmap_property_bake_mode:
  117. - :ref:`BakeMode<enum_BakedLightmap_BakeMode>` **bake_mode**
  118. +----------+----------------------+
  119. | *Setter* | set_bake_mode(value) |
  120. +----------+----------------------+
  121. | *Getter* | get_bake_mode() |
  122. +----------+----------------------+
  123. Lightmapping mode. See :ref:`BakeMode<enum_BakedLightmap_BakeMode>`.
  124. ----
  125. .. _class_BakedLightmap_property_bake_propagation:
  126. - :ref:`float<class_float>` **bake_propagation**
  127. +----------+------------------------+
  128. | *Setter* | set_propagation(value) |
  129. +----------+------------------------+
  130. | *Getter* | get_propagation() |
  131. +----------+------------------------+
  132. Defines how far the light will travel before it is no longer effective. The higher the number, the farther the light will travel. For instance, if the value is set to 2, the light will go twice as far. If the value is set to 0.5, the light will only go half as far.
  133. ----
  134. .. _class_BakedLightmap_property_bake_quality:
  135. - :ref:`BakeQuality<enum_BakedLightmap_BakeQuality>` **bake_quality**
  136. +----------+-------------------------+
  137. | *Setter* | set_bake_quality(value) |
  138. +----------+-------------------------+
  139. | *Getter* | get_bake_quality() |
  140. +----------+-------------------------+
  141. Three quality modes are available. Higher quality requires more rendering time. See :ref:`BakeQuality<enum_BakedLightmap_BakeQuality>`.
  142. ----
  143. .. _class_BakedLightmap_property_capture_cell_size:
  144. - :ref:`float<class_float>` **capture_cell_size**
  145. +----------+------------------------------+
  146. | *Setter* | set_capture_cell_size(value) |
  147. +----------+------------------------------+
  148. | *Getter* | get_capture_cell_size() |
  149. +----------+------------------------------+
  150. Grid size used for real-time capture information on dynamic objects. Cannot be larger than :ref:`bake_cell_size<class_BakedLightmap_property_bake_cell_size>`.
  151. ----
  152. .. _class_BakedLightmap_property_image_path:
  153. - :ref:`String<class_String>` **image_path**
  154. +----------+-----------------------+
  155. | *Setter* | set_image_path(value) |
  156. +----------+-----------------------+
  157. | *Getter* | get_image_path() |
  158. +----------+-----------------------+
  159. Location where lightmaps will be saved.
  160. ----
  161. .. _class_BakedLightmap_property_light_data:
  162. - :ref:`BakedLightmapData<class_BakedLightmapData>` **light_data**
  163. +----------+-----------------------+
  164. | *Setter* | set_light_data(value) |
  165. +----------+-----------------------+
  166. | *Getter* | get_light_data() |
  167. +----------+-----------------------+
  168. The calculated light data.
  169. Method Descriptions
  170. -------------------
  171. .. _class_BakedLightmap_method_bake:
  172. - :ref:`BakeError<enum_BakedLightmap_BakeError>` **bake** **(** :ref:`Node<class_Node>` from_node=null, :ref:`bool<class_bool>` create_visual_debug=false **)**
  173. Bakes the lightmaps within the currently edited scene.
  174. ----
  175. .. _class_BakedLightmap_method_debug_bake:
  176. - void **debug_bake** **(** **)**
  177. Executes a dry run bake of lightmaps within the currently edited scene.