BakedLightmap.xml 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="BakedLightmap" inherits="VisualInstance" version="3.4">
  3. <brief_description>
  4. Prerendered indirect light map for a scene.
  5. </brief_description>
  6. <description>
  7. Baked lightmaps are an alternative workflow for adding indirect (or baked) lighting to a scene. Unlike the [GIProbe] approach, baked lightmaps work fine on low-end PCs and mobile devices as they consume almost no resources in run-time.
  8. </description>
  9. <tutorials>
  10. <link>https://docs.godotengine.org/en/3.3/tutorials/3d/baked_lightmaps.html</link>
  11. </tutorials>
  12. <methods>
  13. <method name="bake">
  14. <return type="int" enum="BakedLightmap.BakeError">
  15. </return>
  16. <argument index="0" name="from_node" type="Node" default="null">
  17. </argument>
  18. <argument index="1" name="data_save_path" type="String" default="&quot;&quot;">
  19. </argument>
  20. <description>
  21. Bakes the lightmap, scanning from the given [code]from_node[/code] root and saves the resulting [BakedLightmapData] in [code]data_save_path[/code]. If no save path is provided it will try to match the path from the current [member light_data].
  22. </description>
  23. </method>
  24. </methods>
  25. <members>
  26. <member name="atlas_generate" type="bool" setter="set_generate_atlas" getter="is_generate_atlas_enabled" default="true">
  27. When enabled, the lightmapper will merge the textures for all meshes into a single large layered texture. Not supported in GLES2.
  28. </member>
  29. <member name="atlas_max_size" type="int" setter="set_max_atlas_size" getter="get_max_atlas_size" default="4096">
  30. Maximum size of each lightmap layer, only used when [member atlas_generate] is enabled.
  31. </member>
  32. <member name="bias" type="float" setter="set_bias" getter="get_bias" default="0.005">
  33. Raycasting bias used during baking to avoid floating point precission issues.
  34. </member>
  35. <member name="bounces" type="int" setter="set_bounces" getter="get_bounces" default="3">
  36. Number of light bounces that are taken into account during baking.
  37. </member>
  38. <member name="capture_cell_size" type="float" setter="set_capture_cell_size" getter="get_capture_cell_size" default="0.5">
  39. Grid size used for real-time capture information on dynamic objects.
  40. </member>
  41. <member name="capture_enabled" type="bool" setter="set_capture_enabled" getter="get_capture_enabled" default="true">
  42. 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.
  43. </member>
  44. <member name="capture_propagation" type="float" setter="set_capture_propagation" getter="get_capture_propagation" default="1.0">
  45. Bias value to reduce the amount of light proagation in the captured octree.
  46. </member>
  47. <member name="capture_quality" type="int" setter="set_capture_quality" getter="get_capture_quality" enum="BakedLightmap.BakeQuality" default="1">
  48. Bake quality of the capture data.
  49. </member>
  50. <member name="default_texels_per_unit" type="float" setter="set_default_texels_per_unit" getter="get_default_texels_per_unit" default="16.0">
  51. If a baked mesh doesn't have a UV2 size hint, this value will be used to roughly compute a suitable lightmap size.
  52. </member>
  53. <member name="environment_custom_color" type="Color" setter="set_environment_custom_color" getter="get_environment_custom_color">
  54. The environment color when [member environment_mode] is set to [constant ENVIRONMENT_MODE_CUSTOM_COLOR].
  55. </member>
  56. <member name="environment_custom_energy" type="float" setter="set_environment_custom_energy" getter="get_environment_custom_energy">
  57. The energy scaling factor when when [member environment_mode] is set to [constant ENVIRONMENT_MODE_CUSTOM_COLOR] or [constant ENVIRONMENT_MODE_CUSTOM_SKY].
  58. </member>
  59. <member name="environment_custom_sky" type="Sky" setter="set_environment_custom_sky" getter="get_environment_custom_sky">
  60. The [Sky] resource to use when [member environment_mode] is set o [constant ENVIRONMENT_MODE_CUSTOM_SKY].
  61. </member>
  62. <member name="environment_custom_sky_rotation_degrees" type="Vector3" setter="set_environment_custom_sky_rotation_degrees" getter="get_environment_custom_sky_rotation_degrees">
  63. The rotation of the baked custom sky.
  64. </member>
  65. <member name="environment_min_light" type="Color" setter="set_environment_min_light" getter="get_environment_min_light" default="Color( 0, 0, 0, 1 )">
  66. 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.
  67. </member>
  68. <member name="environment_mode" type="int" setter="set_environment_mode" getter="get_environment_mode" enum="BakedLightmap.EnvironmentMode" default="0">
  69. Decides which environment to use during baking.
  70. </member>
  71. <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3( 10, 10, 10 )">
  72. 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.
  73. </member>
  74. <member name="image_path" type="String" setter="set_image_path" getter="get_image_path">
  75. Deprecated, in previous versions it determined the location where lightmaps were be saved.
  76. </member>
  77. <member name="light_data" type="BakedLightmapData" setter="set_light_data" getter="get_light_data">
  78. The calculated light data.
  79. </member>
  80. <member name="quality" type="int" setter="set_bake_quality" getter="get_bake_quality" enum="BakedLightmap.BakeQuality" default="1">
  81. Determines the amount of samples per texel used in indrect light baking. The amount of samples for each quality level can be configured in the project settings.
  82. </member>
  83. <member name="use_color" type="bool" setter="set_use_color" getter="is_using_color" default="true">
  84. 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.
  85. </member>
  86. <member name="use_denoiser" type="bool" setter="set_use_denoiser" getter="is_using_denoiser" default="true">
  87. When enabled, a lightmap denoiser will be used to reduce the noise inherent to Monte Carlo based global illumination.
  88. </member>
  89. <member name="use_hdr" type="bool" setter="set_use_hdr" getter="is_using_hdr" default="true">
  90. If [code]true[/code], stores the lightmap textures in a high dynamic range format (EXR). If [code]false[/code], stores the lightmap texture in a low dynamic range PNG image. This can be set to [code]false[/code] to reduce disk usage, but light values over 1.0 will be clamped and you may see banding caused by the reduced precision.
  91. [b]Note:[/b] Setting [member use_hdr] to [code]true[/code] will decrease lightmap banding even when using the GLES2 backend or if [member ProjectSettings.rendering/quality/depth/hdr] is [code]false[/code].
  92. </member>
  93. </members>
  94. <constants>
  95. <constant name="BAKE_QUALITY_LOW" value="0" enum="BakeQuality">
  96. The lowest bake quality mode. Fastest to calculate.
  97. </constant>
  98. <constant name="BAKE_QUALITY_MEDIUM" value="1" enum="BakeQuality">
  99. The default bake quality mode.
  100. </constant>
  101. <constant name="BAKE_QUALITY_HIGH" value="2" enum="BakeQuality">
  102. A higher bake quality mode. Takes longer to calculate.
  103. </constant>
  104. <constant name="BAKE_QUALITY_ULTRA" value="3" enum="BakeQuality">
  105. The highest bake quality mode. Takes the longest to calculate.
  106. </constant>
  107. <constant name="BAKE_ERROR_OK" value="0" enum="BakeError">
  108. Baking was successful.
  109. </constant>
  110. <constant name="BAKE_ERROR_NO_SAVE_PATH" value="1" enum="BakeError">
  111. Returns if no viable save path is found. This can happen where an [member image_path] is not specified or when the save location is invalid.
  112. </constant>
  113. <constant name="BAKE_ERROR_NO_MESHES" value="2" enum="BakeError">
  114. Currently unused.
  115. </constant>
  116. <constant name="BAKE_ERROR_CANT_CREATE_IMAGE" value="3" enum="BakeError">
  117. Returns when the baker cannot save per-mesh textures to file.
  118. </constant>
  119. <constant name="BAKE_ERROR_LIGHTMAP_SIZE" value="4" enum="BakeError">
  120. The size of the generated lightmaps is too large.
  121. </constant>
  122. <constant name="BAKE_ERROR_INVALID_MESH" value="5" enum="BakeError">
  123. Some mesh contains UV2 values outside the [code][0,1][/code] range.
  124. </constant>
  125. <constant name="BAKE_ERROR_USER_ABORTED" value="6" enum="BakeError">
  126. Returns if user cancels baking.
  127. </constant>
  128. <constant name="BAKE_ERROR_NO_LIGHTMAPPER" value="7" enum="BakeError">
  129. </constant>
  130. <constant name="ENVIRONMENT_MODE_DISABLED" value="0" enum="EnvironmentMode">
  131. No environment is used during baking.
  132. </constant>
  133. <constant name="ENVIRONMENT_MODE_SCENE" value="1" enum="EnvironmentMode">
  134. The baked environment is automatically picked from the current scene.
  135. </constant>
  136. <constant name="ENVIRONMENT_MODE_CUSTOM_SKY" value="2" enum="EnvironmentMode">
  137. A custom sky is used as environment during baking.
  138. </constant>
  139. <constant name="ENVIRONMENT_MODE_CUSTOM_COLOR" value="3" enum="EnvironmentMode">
  140. A custom solid color is used as environment during baking.
  141. </constant>
  142. </constants>
  143. </class>