class_voxelgidata.rst 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  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/VoxelGIData.xml.
  6. .. _class_VoxelGIData:
  7. VoxelGIData
  8. ===========
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Contains baked voxel global illumination data for use in a :ref:`VoxelGI<class_VoxelGI>` node.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. **VoxelGIData** contains baked voxel global illumination for use in a :ref:`VoxelGI<class_VoxelGI>` node. **VoxelGIData** also offers several properties to adjust the final appearance of the global illumination. These properties can be adjusted at run-time without having to bake the :ref:`VoxelGI<class_VoxelGI>` node again.
  15. \ **Note:** To prevent text-based scene files (``.tscn``) from growing too much and becoming slow to load and save, always save **VoxelGIData** to an external binary resource file (``.res``) instead of embedding it within the scene. This can be done by clicking the dropdown arrow next to the **VoxelGIData** resource, choosing **Edit**, clicking the floppy disk icon at the top of the Inspector then choosing **Save As...**.
  16. .. rst-class:: classref-introduction-group
  17. Tutorials
  18. ---------
  19. - `Third Person Shooter (TPS) Demo <https://godotengine.org/asset-library/asset/2710>`__
  20. .. rst-class:: classref-reftable-group
  21. Properties
  22. ----------
  23. .. table::
  24. :widths: auto
  25. +---------------------------+--------------------------------------------------------------------+-----------+
  26. | :ref:`float<class_float>` | :ref:`bias<class_VoxelGIData_property_bias>` | ``1.5`` |
  27. +---------------------------+--------------------------------------------------------------------+-----------+
  28. | :ref:`float<class_float>` | :ref:`dynamic_range<class_VoxelGIData_property_dynamic_range>` | ``2.0`` |
  29. +---------------------------+--------------------------------------------------------------------+-----------+
  30. | :ref:`float<class_float>` | :ref:`energy<class_VoxelGIData_property_energy>` | ``1.0`` |
  31. +---------------------------+--------------------------------------------------------------------+-----------+
  32. | :ref:`bool<class_bool>` | :ref:`interior<class_VoxelGIData_property_interior>` | ``false`` |
  33. +---------------------------+--------------------------------------------------------------------+-----------+
  34. | :ref:`float<class_float>` | :ref:`normal_bias<class_VoxelGIData_property_normal_bias>` | ``0.0`` |
  35. +---------------------------+--------------------------------------------------------------------+-----------+
  36. | :ref:`float<class_float>` | :ref:`propagation<class_VoxelGIData_property_propagation>` | ``0.5`` |
  37. +---------------------------+--------------------------------------------------------------------+-----------+
  38. | :ref:`bool<class_bool>` | :ref:`use_two_bounces<class_VoxelGIData_property_use_two_bounces>` | ``true`` |
  39. +---------------------------+--------------------------------------------------------------------+-----------+
  40. .. rst-class:: classref-reftable-group
  41. Methods
  42. -------
  43. .. table::
  44. :widths: auto
  45. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | |void| | :ref:`allocate<class_VoxelGIData_method_allocate>`\ (\ to_cell_xform\: :ref:`Transform3D<class_Transform3D>`, aabb\: :ref:`AABB<class_AABB>`, octree_size\: :ref:`Vector3<class_Vector3>`, octree_cells\: :ref:`PackedByteArray<class_PackedByteArray>`, data_cells\: :ref:`PackedByteArray<class_PackedByteArray>`, distance_field\: :ref:`PackedByteArray<class_PackedByteArray>`, level_counts\: :ref:`PackedInt32Array<class_PackedInt32Array>`\ ) |
  47. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`AABB<class_AABB>` | :ref:`get_bounds<class_VoxelGIData_method_get_bounds>`\ (\ ) |const| |
  49. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`get_data_cells<class_VoxelGIData_method_get_data_cells>`\ (\ ) |const| |
  51. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_level_counts<class_VoxelGIData_method_get_level_counts>`\ (\ ) |const| |
  53. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`get_octree_cells<class_VoxelGIData_method_get_octree_cells>`\ (\ ) |const| |
  55. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :ref:`Vector3<class_Vector3>` | :ref:`get_octree_size<class_VoxelGIData_method_get_octree_size>`\ (\ ) |const| |
  57. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`Transform3D<class_Transform3D>` | :ref:`get_to_cell_xform<class_VoxelGIData_method_get_to_cell_xform>`\ (\ ) |const| |
  59. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. .. rst-class:: classref-section-separator
  61. ----
  62. .. rst-class:: classref-descriptions-group
  63. Property Descriptions
  64. ---------------------
  65. .. _class_VoxelGIData_property_bias:
  66. .. rst-class:: classref-property
  67. :ref:`float<class_float>` **bias** = ``1.5`` :ref:`🔗<class_VoxelGIData_property_bias>`
  68. .. rst-class:: classref-property-setget
  69. - |void| **set_bias**\ (\ value\: :ref:`float<class_float>`\ )
  70. - :ref:`float<class_float>` **get_bias**\ (\ )
  71. The normal bias to use for indirect lighting and reflections. Higher values reduce self-reflections visible in non-rough materials, at the cost of more visible light leaking and flatter-looking indirect lighting. To prioritize hiding self-reflections over lighting quality, set :ref:`bias<class_VoxelGIData_property_bias>` to ``0.0`` and :ref:`normal_bias<class_VoxelGIData_property_normal_bias>` to a value between ``1.0`` and ``2.0``.
  72. .. rst-class:: classref-item-separator
  73. ----
  74. .. _class_VoxelGIData_property_dynamic_range:
  75. .. rst-class:: classref-property
  76. :ref:`float<class_float>` **dynamic_range** = ``2.0`` :ref:`🔗<class_VoxelGIData_property_dynamic_range>`
  77. .. rst-class:: classref-property-setget
  78. - |void| **set_dynamic_range**\ (\ value\: :ref:`float<class_float>`\ )
  79. - :ref:`float<class_float>` **get_dynamic_range**\ (\ )
  80. The dynamic range to use (``1.0`` represents a low dynamic range scene brightness). Higher values can be used to provide brighter indirect lighting, at the cost of more visible color banding in dark areas (both in indirect lighting and reflections). To avoid color banding, it's recommended to use the lowest value that does not result in visible light clipping.
  81. .. rst-class:: classref-item-separator
  82. ----
  83. .. _class_VoxelGIData_property_energy:
  84. .. rst-class:: classref-property
  85. :ref:`float<class_float>` **energy** = ``1.0`` :ref:`🔗<class_VoxelGIData_property_energy>`
  86. .. rst-class:: classref-property-setget
  87. - |void| **set_energy**\ (\ value\: :ref:`float<class_float>`\ )
  88. - :ref:`float<class_float>` **get_energy**\ (\ )
  89. The energy of the indirect lighting and reflections produced by the :ref:`VoxelGI<class_VoxelGI>` node. Higher values result in brighter indirect lighting. If indirect lighting looks too flat, try decreasing :ref:`propagation<class_VoxelGIData_property_propagation>` while increasing :ref:`energy<class_VoxelGIData_property_energy>` at the same time. See also :ref:`use_two_bounces<class_VoxelGIData_property_use_two_bounces>` which influences the indirect lighting's effective brightness.
  90. .. rst-class:: classref-item-separator
  91. ----
  92. .. _class_VoxelGIData_property_interior:
  93. .. rst-class:: classref-property
  94. :ref:`bool<class_bool>` **interior** = ``false`` :ref:`🔗<class_VoxelGIData_property_interior>`
  95. .. rst-class:: classref-property-setget
  96. - |void| **set_interior**\ (\ value\: :ref:`bool<class_bool>`\ )
  97. - :ref:`bool<class_bool>` **is_interior**\ (\ )
  98. If ``true``, :ref:`Environment<class_Environment>` lighting is ignored by the :ref:`VoxelGI<class_VoxelGI>` node. If ``false``, :ref:`Environment<class_Environment>` lighting is taken into account by the :ref:`VoxelGI<class_VoxelGI>` node. :ref:`Environment<class_Environment>` lighting updates in real-time, which means it can be changed without having to bake the :ref:`VoxelGI<class_VoxelGI>` node again.
  99. .. rst-class:: classref-item-separator
  100. ----
  101. .. _class_VoxelGIData_property_normal_bias:
  102. .. rst-class:: classref-property
  103. :ref:`float<class_float>` **normal_bias** = ``0.0`` :ref:`🔗<class_VoxelGIData_property_normal_bias>`
  104. .. rst-class:: classref-property-setget
  105. - |void| **set_normal_bias**\ (\ value\: :ref:`float<class_float>`\ )
  106. - :ref:`float<class_float>` **get_normal_bias**\ (\ )
  107. The normal bias to use for indirect lighting and reflections. Higher values reduce self-reflections visible in non-rough materials, at the cost of more visible light leaking and flatter-looking indirect lighting. See also :ref:`bias<class_VoxelGIData_property_bias>`. To prioritize hiding self-reflections over lighting quality, set :ref:`bias<class_VoxelGIData_property_bias>` to ``0.0`` and :ref:`normal_bias<class_VoxelGIData_property_normal_bias>` to a value between ``1.0`` and ``2.0``.
  108. .. rst-class:: classref-item-separator
  109. ----
  110. .. _class_VoxelGIData_property_propagation:
  111. .. rst-class:: classref-property
  112. :ref:`float<class_float>` **propagation** = ``0.5`` :ref:`🔗<class_VoxelGIData_property_propagation>`
  113. .. rst-class:: classref-property-setget
  114. - |void| **set_propagation**\ (\ value\: :ref:`float<class_float>`\ )
  115. - :ref:`float<class_float>` **get_propagation**\ (\ )
  116. The multiplier to use when light bounces off a surface. Higher values result in brighter indirect lighting. If indirect lighting looks too flat, try decreasing :ref:`propagation<class_VoxelGIData_property_propagation>` while increasing :ref:`energy<class_VoxelGIData_property_energy>` at the same time. See also :ref:`use_two_bounces<class_VoxelGIData_property_use_two_bounces>` which influences the indirect lighting's effective brightness.
  117. .. rst-class:: classref-item-separator
  118. ----
  119. .. _class_VoxelGIData_property_use_two_bounces:
  120. .. rst-class:: classref-property
  121. :ref:`bool<class_bool>` **use_two_bounces** = ``true`` :ref:`🔗<class_VoxelGIData_property_use_two_bounces>`
  122. .. rst-class:: classref-property-setget
  123. - |void| **set_use_two_bounces**\ (\ value\: :ref:`bool<class_bool>`\ )
  124. - :ref:`bool<class_bool>` **is_using_two_bounces**\ (\ )
  125. If ``true``, performs two bounces of indirect lighting instead of one. This makes indirect lighting look more natural and brighter at a small performance cost. The second bounce is also visible in reflections. If the scene appears too bright after enabling :ref:`use_two_bounces<class_VoxelGIData_property_use_two_bounces>`, adjust :ref:`propagation<class_VoxelGIData_property_propagation>` and :ref:`energy<class_VoxelGIData_property_energy>`.
  126. .. rst-class:: classref-section-separator
  127. ----
  128. .. rst-class:: classref-descriptions-group
  129. Method Descriptions
  130. -------------------
  131. .. _class_VoxelGIData_method_allocate:
  132. .. rst-class:: classref-method
  133. |void| **allocate**\ (\ to_cell_xform\: :ref:`Transform3D<class_Transform3D>`, aabb\: :ref:`AABB<class_AABB>`, octree_size\: :ref:`Vector3<class_Vector3>`, octree_cells\: :ref:`PackedByteArray<class_PackedByteArray>`, data_cells\: :ref:`PackedByteArray<class_PackedByteArray>`, distance_field\: :ref:`PackedByteArray<class_PackedByteArray>`, level_counts\: :ref:`PackedInt32Array<class_PackedInt32Array>`\ ) :ref:`🔗<class_VoxelGIData_method_allocate>`
  134. .. container:: contribute
  135. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  136. .. rst-class:: classref-item-separator
  137. ----
  138. .. _class_VoxelGIData_method_get_bounds:
  139. .. rst-class:: classref-method
  140. :ref:`AABB<class_AABB>` **get_bounds**\ (\ ) |const| :ref:`🔗<class_VoxelGIData_method_get_bounds>`
  141. Returns the bounds of the baked voxel data as an :ref:`AABB<class_AABB>`, which should match :ref:`VoxelGI.size<class_VoxelGI_property_size>` after being baked (which only contains the size as a :ref:`Vector3<class_Vector3>`).
  142. \ **Note:** If the size was modified without baking the VoxelGI data, then the value of :ref:`get_bounds<class_VoxelGIData_method_get_bounds>` and :ref:`VoxelGI.size<class_VoxelGI_property_size>` will not match.
  143. .. rst-class:: classref-item-separator
  144. ----
  145. .. _class_VoxelGIData_method_get_data_cells:
  146. .. rst-class:: classref-method
  147. :ref:`PackedByteArray<class_PackedByteArray>` **get_data_cells**\ (\ ) |const| :ref:`🔗<class_VoxelGIData_method_get_data_cells>`
  148. .. container:: contribute
  149. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  150. .. rst-class:: classref-item-separator
  151. ----
  152. .. _class_VoxelGIData_method_get_level_counts:
  153. .. rst-class:: classref-method
  154. :ref:`PackedInt32Array<class_PackedInt32Array>` **get_level_counts**\ (\ ) |const| :ref:`🔗<class_VoxelGIData_method_get_level_counts>`
  155. .. container:: contribute
  156. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  157. .. rst-class:: classref-item-separator
  158. ----
  159. .. _class_VoxelGIData_method_get_octree_cells:
  160. .. rst-class:: classref-method
  161. :ref:`PackedByteArray<class_PackedByteArray>` **get_octree_cells**\ (\ ) |const| :ref:`🔗<class_VoxelGIData_method_get_octree_cells>`
  162. .. container:: contribute
  163. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  164. .. rst-class:: classref-item-separator
  165. ----
  166. .. _class_VoxelGIData_method_get_octree_size:
  167. .. rst-class:: classref-method
  168. :ref:`Vector3<class_Vector3>` **get_octree_size**\ (\ ) |const| :ref:`🔗<class_VoxelGIData_method_get_octree_size>`
  169. .. container:: contribute
  170. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  171. .. rst-class:: classref-item-separator
  172. ----
  173. .. _class_VoxelGIData_method_get_to_cell_xform:
  174. .. rst-class:: classref-method
  175. :ref:`Transform3D<class_Transform3D>` **get_to_cell_xform**\ (\ ) |const| :ref:`🔗<class_VoxelGIData_method_get_to_cell_xform>`
  176. .. container:: contribute
  177. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  178. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  179. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  180. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  181. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  182. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  183. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  184. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  185. .. |void| replace:: :abbr:`void (No return value.)`