class_lightmapgidata.rst 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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/LightmapGIData.xml.
  6. .. _class_LightmapGIData:
  7. LightmapGIData
  8. ==============
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Contains baked lightmap and dynamic object probe data for :ref:`LightmapGI<class_LightmapGI>`.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. **LightmapGIData** contains baked lightmap and dynamic object probe data for :ref:`LightmapGI<class_LightmapGI>`. It is replaced every time lightmaps are baked in :ref:`LightmapGI<class_LightmapGI>`.
  15. .. rst-class:: classref-reftable-group
  16. Properties
  17. ----------
  18. .. table::
  19. :widths: auto
  20. +--------------------------------------------------------------------------+-------------------------------------------------------------------------------+--------+
  21. | :ref:`TextureLayered<class_TextureLayered>` | :ref:`light_texture<class_LightmapGIData_property_light_texture>` | |
  22. +--------------------------------------------------------------------------+-------------------------------------------------------------------------------+--------+
  23. | :ref:`Array<class_Array>`\[:ref:`TextureLayered<class_TextureLayered>`\] | :ref:`lightmap_textures<class_LightmapGIData_property_lightmap_textures>` | ``[]`` |
  24. +--------------------------------------------------------------------------+-------------------------------------------------------------------------------+--------+
  25. | :ref:`Array<class_Array>`\[:ref:`TextureLayered<class_TextureLayered>`\] | :ref:`shadowmask_textures<class_LightmapGIData_property_shadowmask_textures>` | ``[]`` |
  26. +--------------------------------------------------------------------------+-------------------------------------------------------------------------------+--------+
  27. .. rst-class:: classref-reftable-group
  28. Methods
  29. -------
  30. .. table::
  31. :widths: auto
  32. +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | |void| | :ref:`add_user<class_LightmapGIData_method_add_user>`\ (\ path\: :ref:`NodePath<class_NodePath>`, uv_scale\: :ref:`Rect2<class_Rect2>`, slice_index\: :ref:`int<class_int>`, sub_instance\: :ref:`int<class_int>`\ ) |
  34. +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | |void| | :ref:`clear_users<class_LightmapGIData_method_clear_users>`\ (\ ) |
  36. +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | :ref:`int<class_int>` | :ref:`get_user_count<class_LightmapGIData_method_get_user_count>`\ (\ ) |const| |
  38. +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`NodePath<class_NodePath>` | :ref:`get_user_path<class_LightmapGIData_method_get_user_path>`\ (\ user_idx\: :ref:`int<class_int>`\ ) |const| |
  40. +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | :ref:`bool<class_bool>` | :ref:`is_using_spherical_harmonics<class_LightmapGIData_method_is_using_spherical_harmonics>`\ (\ ) |const| |
  42. +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | |void| | :ref:`set_uses_spherical_harmonics<class_LightmapGIData_method_set_uses_spherical_harmonics>`\ (\ uses_spherical_harmonics\: :ref:`bool<class_bool>`\ ) |
  44. +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. .. rst-class:: classref-section-separator
  46. ----
  47. .. rst-class:: classref-descriptions-group
  48. Enumerations
  49. ------------
  50. .. _enum_LightmapGIData_ShadowmaskMode:
  51. .. rst-class:: classref-enumeration
  52. enum **ShadowmaskMode**: :ref:`🔗<enum_LightmapGIData_ShadowmaskMode>`
  53. .. _class_LightmapGIData_constant_SHADOWMASK_MODE_NONE:
  54. .. rst-class:: classref-enumeration-constant
  55. :ref:`ShadowmaskMode<enum_LightmapGIData_ShadowmaskMode>` **SHADOWMASK_MODE_NONE** = ``0``
  56. Shadowmasking is disabled. No shadowmask texture will be created when baking lightmaps. Existing shadowmask textures will be removed during baking.
  57. .. _class_LightmapGIData_constant_SHADOWMASK_MODE_REPLACE:
  58. .. rst-class:: classref-enumeration-constant
  59. :ref:`ShadowmaskMode<enum_LightmapGIData_ShadowmaskMode>` **SHADOWMASK_MODE_REPLACE** = ``1``
  60. Shadowmasking is enabled. Directional shadows that are outside the :ref:`DirectionalLight3D.directional_shadow_max_distance<class_DirectionalLight3D_property_directional_shadow_max_distance>` will be rendered using the shadowmask texture. Shadows that are inside the range will be rendered using real-time shadows exclusively. This mode allows for more precise real-time shadows up close, without the potential "smearing" effect that can occur when using lightmaps with a high texel size. The downside is that when the camera moves fast, the transition between the real-time light and shadowmask can be obvious. Also, objects that only have shadows baked in the shadowmask (and no real-time shadows) won't display any shadows up close.
  61. .. _class_LightmapGIData_constant_SHADOWMASK_MODE_OVERLAY:
  62. .. rst-class:: classref-enumeration-constant
  63. :ref:`ShadowmaskMode<enum_LightmapGIData_ShadowmaskMode>` **SHADOWMASK_MODE_OVERLAY** = ``2``
  64. Shadowmasking is enabled. Directional shadows will be rendered with real-time shadows overlaid on top of the shadowmask texture. This mode makes for smoother shadow transitions when the camera moves fast, at the cost of a potential smearing effect for directional shadows that are up close (due to the real-time shadow being mixed with a low-resolution shadowmask). Objects that only have shadows baked in the shadowmask (and no real-time shadows) will keep their shadows up close.
  65. .. rst-class:: classref-section-separator
  66. ----
  67. .. rst-class:: classref-descriptions-group
  68. Property Descriptions
  69. ---------------------
  70. .. _class_LightmapGIData_property_light_texture:
  71. .. rst-class:: classref-property
  72. :ref:`TextureLayered<class_TextureLayered>` **light_texture** :ref:`🔗<class_LightmapGIData_property_light_texture>`
  73. .. rst-class:: classref-property-setget
  74. - |void| **set_light_texture**\ (\ value\: :ref:`TextureLayered<class_TextureLayered>`\ )
  75. - :ref:`TextureLayered<class_TextureLayered>` **get_light_texture**\ (\ )
  76. **Deprecated:** The lightmap atlas can now contain multiple textures. See :ref:`lightmap_textures<class_LightmapGIData_property_lightmap_textures>`.
  77. The lightmap atlas texture generated by the lightmapper.
  78. .. rst-class:: classref-item-separator
  79. ----
  80. .. _class_LightmapGIData_property_lightmap_textures:
  81. .. rst-class:: classref-property
  82. :ref:`Array<class_Array>`\[:ref:`TextureLayered<class_TextureLayered>`\] **lightmap_textures** = ``[]`` :ref:`🔗<class_LightmapGIData_property_lightmap_textures>`
  83. .. rst-class:: classref-property-setget
  84. - |void| **set_lightmap_textures**\ (\ value\: :ref:`Array<class_Array>`\[:ref:`TextureLayered<class_TextureLayered>`\]\ )
  85. - :ref:`Array<class_Array>`\[:ref:`TextureLayered<class_TextureLayered>`\] **get_lightmap_textures**\ (\ )
  86. The lightmap atlas textures generated by the lightmapper.
  87. .. rst-class:: classref-item-separator
  88. ----
  89. .. _class_LightmapGIData_property_shadowmask_textures:
  90. .. rst-class:: classref-property
  91. :ref:`Array<class_Array>`\[:ref:`TextureLayered<class_TextureLayered>`\] **shadowmask_textures** = ``[]`` :ref:`🔗<class_LightmapGIData_property_shadowmask_textures>`
  92. .. rst-class:: classref-property-setget
  93. - |void| **set_shadowmask_textures**\ (\ value\: :ref:`Array<class_Array>`\[:ref:`TextureLayered<class_TextureLayered>`\]\ )
  94. - :ref:`Array<class_Array>`\[:ref:`TextureLayered<class_TextureLayered>`\] **get_shadowmask_textures**\ (\ )
  95. The shadowmask atlas textures generated by the lightmapper.
  96. .. rst-class:: classref-section-separator
  97. ----
  98. .. rst-class:: classref-descriptions-group
  99. Method Descriptions
  100. -------------------
  101. .. _class_LightmapGIData_method_add_user:
  102. .. rst-class:: classref-method
  103. |void| **add_user**\ (\ path\: :ref:`NodePath<class_NodePath>`, uv_scale\: :ref:`Rect2<class_Rect2>`, slice_index\: :ref:`int<class_int>`, sub_instance\: :ref:`int<class_int>`\ ) :ref:`🔗<class_LightmapGIData_method_add_user>`
  104. Adds an object that is considered baked within this **LightmapGIData**.
  105. .. rst-class:: classref-item-separator
  106. ----
  107. .. _class_LightmapGIData_method_clear_users:
  108. .. rst-class:: classref-method
  109. |void| **clear_users**\ (\ ) :ref:`🔗<class_LightmapGIData_method_clear_users>`
  110. Clear all objects that are considered baked within this **LightmapGIData**.
  111. .. rst-class:: classref-item-separator
  112. ----
  113. .. _class_LightmapGIData_method_get_user_count:
  114. .. rst-class:: classref-method
  115. :ref:`int<class_int>` **get_user_count**\ (\ ) |const| :ref:`🔗<class_LightmapGIData_method_get_user_count>`
  116. Returns the number of objects that are considered baked within this **LightmapGIData**.
  117. .. rst-class:: classref-item-separator
  118. ----
  119. .. _class_LightmapGIData_method_get_user_path:
  120. .. rst-class:: classref-method
  121. :ref:`NodePath<class_NodePath>` **get_user_path**\ (\ user_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_LightmapGIData_method_get_user_path>`
  122. Returns the :ref:`NodePath<class_NodePath>` of the baked object at index ``user_idx``.
  123. .. rst-class:: classref-item-separator
  124. ----
  125. .. _class_LightmapGIData_method_is_using_spherical_harmonics:
  126. .. rst-class:: classref-method
  127. :ref:`bool<class_bool>` **is_using_spherical_harmonics**\ (\ ) |const| :ref:`🔗<class_LightmapGIData_method_is_using_spherical_harmonics>`
  128. If ``true``, lightmaps were baked with directional information. See also :ref:`LightmapGI.directional<class_LightmapGI_property_directional>`.
  129. .. rst-class:: classref-item-separator
  130. ----
  131. .. _class_LightmapGIData_method_set_uses_spherical_harmonics:
  132. .. rst-class:: classref-method
  133. |void| **set_uses_spherical_harmonics**\ (\ uses_spherical_harmonics\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_LightmapGIData_method_set_uses_spherical_harmonics>`
  134. If ``uses_spherical_harmonics`` is ``true``, tells the engine to treat the lightmap data as if it was baked with directional information.
  135. \ **Note:** Changing this value on already baked lightmaps will not cause them to be baked again. This means the material appearance will look incorrect until lightmaps are baked again, in which case the value set here is discarded as the entire **LightmapGIData** resource is replaced by the lightmapper.
  136. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  137. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  138. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  139. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  140. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  141. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  142. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  143. .. |void| replace:: :abbr:`void (No return value.)`