class_geometryinstance.rst 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  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/GeometryInstance.xml.
  6. .. _class_GeometryInstance:
  7. GeometryInstance
  8. ================
  9. **Inherits:** :ref:`VisualInstance<class_VisualInstance>` **<** :ref:`CullInstance<class_CullInstance>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`CPUParticles<class_CPUParticles>`, :ref:`CSGShape<class_CSGShape>`, :ref:`ImmediateGeometry<class_ImmediateGeometry>`, :ref:`Label3D<class_Label3D>`, :ref:`MeshInstance<class_MeshInstance>`, :ref:`MultiMeshInstance<class_MultiMeshInstance>`, :ref:`Particles<class_Particles>`, :ref:`SpriteBase3D<class_SpriteBase3D>`
  11. Base node for geometry-based visual instances.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. Base node for geometry-based visual instances. Shares some common functionality like visibility and custom materials.
  16. .. rst-class:: classref-reftable-group
  17. Properties
  18. ----------
  19. .. table::
  20. :widths: auto
  21. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------+
  22. | :ref:`ShadowCastingSetting<enum_GeometryInstance_ShadowCastingSetting>` | :ref:`cast_shadow<class_GeometryInstance_property_cast_shadow>` | ``1`` |
  23. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------+
  24. | :ref:`float<class_float>` | :ref:`extra_cull_margin<class_GeometryInstance_property_extra_cull_margin>` | ``0.0`` |
  25. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------+
  26. | :ref:`bool<class_bool>` | :ref:`generate_lightmap<class_GeometryInstance_property_generate_lightmap>` | ``true`` |
  27. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------+
  28. | :ref:`LightmapScale<enum_GeometryInstance_LightmapScale>` | :ref:`lightmap_scale<class_GeometryInstance_property_lightmap_scale>` | ``0`` |
  29. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------+
  30. | :ref:`Material<class_Material>` | :ref:`material_overlay<class_GeometryInstance_property_material_overlay>` | |
  31. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------+
  32. | :ref:`Material<class_Material>` | :ref:`material_override<class_GeometryInstance_property_material_override>` | |
  33. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------+
  34. | :ref:`bool<class_bool>` | :ref:`use_in_baked_light<class_GeometryInstance_property_use_in_baked_light>` | ``false`` |
  35. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------+
  36. .. rst-class:: classref-reftable-group
  37. Methods
  38. -------
  39. .. table::
  40. :widths: auto
  41. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`bool<class_bool>` | :ref:`get_flag<class_GeometryInstance_method_get_flag>` **(** :ref:`Flags<enum_GeometryInstance_Flags>` flag **)** |const| |
  43. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | void | :ref:`set_custom_aabb<class_GeometryInstance_method_set_custom_aabb>` **(** :ref:`AABB<class_AABB>` aabb **)** |
  45. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | void | :ref:`set_flag<class_GeometryInstance_method_set_flag>` **(** :ref:`Flags<enum_GeometryInstance_Flags>` flag, :ref:`bool<class_bool>` value **)** |
  47. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  48. .. rst-class:: classref-section-separator
  49. ----
  50. .. rst-class:: classref-descriptions-group
  51. Enumerations
  52. ------------
  53. .. _enum_GeometryInstance_LightmapScale:
  54. .. rst-class:: classref-enumeration
  55. enum **LightmapScale**:
  56. .. _class_GeometryInstance_constant_LIGHTMAP_SCALE_1X:
  57. .. rst-class:: classref-enumeration-constant
  58. :ref:`LightmapScale<enum_GeometryInstance_LightmapScale>` **LIGHTMAP_SCALE_1X** = ``0``
  59. The generated lightmap texture will have the original size.
  60. .. _class_GeometryInstance_constant_LIGHTMAP_SCALE_2X:
  61. .. rst-class:: classref-enumeration-constant
  62. :ref:`LightmapScale<enum_GeometryInstance_LightmapScale>` **LIGHTMAP_SCALE_2X** = ``1``
  63. The generated lightmap texture will be twice as large, on each axis.
  64. .. _class_GeometryInstance_constant_LIGHTMAP_SCALE_4X:
  65. .. rst-class:: classref-enumeration-constant
  66. :ref:`LightmapScale<enum_GeometryInstance_LightmapScale>` **LIGHTMAP_SCALE_4X** = ``2``
  67. The generated lightmap texture will be 4 times as large, on each axis.
  68. .. _class_GeometryInstance_constant_LIGHTMAP_SCALE_8X:
  69. .. rst-class:: classref-enumeration-constant
  70. :ref:`LightmapScale<enum_GeometryInstance_LightmapScale>` **LIGHTMAP_SCALE_8X** = ``3``
  71. The generated lightmap texture will be 8 times as large, on each axis.
  72. .. _class_GeometryInstance_constant_LIGHTMAP_SCALE_MAX:
  73. .. rst-class:: classref-enumeration-constant
  74. :ref:`LightmapScale<enum_GeometryInstance_LightmapScale>` **LIGHTMAP_SCALE_MAX** = ``4``
  75. .. rst-class:: classref-item-separator
  76. ----
  77. .. _enum_GeometryInstance_ShadowCastingSetting:
  78. .. rst-class:: classref-enumeration
  79. enum **ShadowCastingSetting**:
  80. .. _class_GeometryInstance_constant_SHADOW_CASTING_SETTING_OFF:
  81. .. rst-class:: classref-enumeration-constant
  82. :ref:`ShadowCastingSetting<enum_GeometryInstance_ShadowCastingSetting>` **SHADOW_CASTING_SETTING_OFF** = ``0``
  83. Will not cast any shadows.
  84. .. _class_GeometryInstance_constant_SHADOW_CASTING_SETTING_ON:
  85. .. rst-class:: classref-enumeration-constant
  86. :ref:`ShadowCastingSetting<enum_GeometryInstance_ShadowCastingSetting>` **SHADOW_CASTING_SETTING_ON** = ``1``
  87. Will cast shadows from all visible faces in the GeometryInstance.
  88. Will take culling into account, so faces not being rendered will not be taken into account when shadow casting.
  89. .. _class_GeometryInstance_constant_SHADOW_CASTING_SETTING_DOUBLE_SIDED:
  90. .. rst-class:: classref-enumeration-constant
  91. :ref:`ShadowCastingSetting<enum_GeometryInstance_ShadowCastingSetting>` **SHADOW_CASTING_SETTING_DOUBLE_SIDED** = ``2``
  92. Will cast shadows from all visible faces in the GeometryInstance.
  93. Will not take culling into account, so all faces will be taken into account when shadow casting.
  94. .. _class_GeometryInstance_constant_SHADOW_CASTING_SETTING_SHADOWS_ONLY:
  95. .. rst-class:: classref-enumeration-constant
  96. :ref:`ShadowCastingSetting<enum_GeometryInstance_ShadowCastingSetting>` **SHADOW_CASTING_SETTING_SHADOWS_ONLY** = ``3``
  97. Will only show the shadows casted from this object.
  98. In other words, the actual mesh will not be visible, only the shadows casted from the mesh will be.
  99. .. rst-class:: classref-item-separator
  100. ----
  101. .. _enum_GeometryInstance_Flags:
  102. .. rst-class:: classref-enumeration
  103. enum **Flags**:
  104. .. _class_GeometryInstance_constant_FLAG_USE_BAKED_LIGHT:
  105. .. rst-class:: classref-enumeration-constant
  106. :ref:`Flags<enum_GeometryInstance_Flags>` **FLAG_USE_BAKED_LIGHT** = ``0``
  107. Will allow the GeometryInstance to be used when baking lights using a :ref:`GIProbe<class_GIProbe>` or :ref:`BakedLightmap<class_BakedLightmap>`.
  108. .. _class_GeometryInstance_constant_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE:
  109. .. rst-class:: classref-enumeration-constant
  110. :ref:`Flags<enum_GeometryInstance_Flags>` **FLAG_DRAW_NEXT_FRAME_IF_VISIBLE** = ``1``
  111. Unused in this class, exposed for consistency with :ref:`InstanceFlags<enum_VisualServer_InstanceFlags>`.
  112. .. _class_GeometryInstance_constant_FLAG_MAX:
  113. .. rst-class:: classref-enumeration-constant
  114. :ref:`Flags<enum_GeometryInstance_Flags>` **FLAG_MAX** = ``2``
  115. Represents the size of the :ref:`Flags<enum_GeometryInstance_Flags>` enum.
  116. .. rst-class:: classref-section-separator
  117. ----
  118. .. rst-class:: classref-descriptions-group
  119. Property Descriptions
  120. ---------------------
  121. .. _class_GeometryInstance_property_cast_shadow:
  122. .. rst-class:: classref-property
  123. :ref:`ShadowCastingSetting<enum_GeometryInstance_ShadowCastingSetting>` **cast_shadow** = ``1``
  124. .. rst-class:: classref-property-setget
  125. - void **set_cast_shadows_setting** **(** :ref:`ShadowCastingSetting<enum_GeometryInstance_ShadowCastingSetting>` value **)**
  126. - :ref:`ShadowCastingSetting<enum_GeometryInstance_ShadowCastingSetting>` **get_cast_shadows_setting** **(** **)**
  127. The selected shadow casting flag. See :ref:`ShadowCastingSetting<enum_GeometryInstance_ShadowCastingSetting>` for possible values.
  128. .. rst-class:: classref-item-separator
  129. ----
  130. .. _class_GeometryInstance_property_extra_cull_margin:
  131. .. rst-class:: classref-property
  132. :ref:`float<class_float>` **extra_cull_margin** = ``0.0``
  133. .. rst-class:: classref-property-setget
  134. - void **set_extra_cull_margin** **(** :ref:`float<class_float>` value **)**
  135. - :ref:`float<class_float>` **get_extra_cull_margin** **(** **)**
  136. The extra distance added to the GeometryInstance's bounding box (:ref:`AABB<class_AABB>`) to increase its cull box.
  137. .. rst-class:: classref-item-separator
  138. ----
  139. .. _class_GeometryInstance_property_generate_lightmap:
  140. .. rst-class:: classref-property
  141. :ref:`bool<class_bool>` **generate_lightmap** = ``true``
  142. .. rst-class:: classref-property-setget
  143. - void **set_generate_lightmap** **(** :ref:`bool<class_bool>` value **)**
  144. - :ref:`bool<class_bool>` **get_generate_lightmap** **(** **)**
  145. When disabled, the mesh will be taken into account when computing indirect lighting, but the resulting lightmap will not be saved. Useful for emissive only materials or shadow casters.
  146. .. rst-class:: classref-item-separator
  147. ----
  148. .. _class_GeometryInstance_property_lightmap_scale:
  149. .. rst-class:: classref-property
  150. :ref:`LightmapScale<enum_GeometryInstance_LightmapScale>` **lightmap_scale** = ``0``
  151. .. rst-class:: classref-property-setget
  152. - void **set_lightmap_scale** **(** :ref:`LightmapScale<enum_GeometryInstance_LightmapScale>` value **)**
  153. - :ref:`LightmapScale<enum_GeometryInstance_LightmapScale>` **get_lightmap_scale** **(** **)**
  154. Scale factor for the generated baked lightmap. Useful for adding detail to certain mesh instances.
  155. .. rst-class:: classref-item-separator
  156. ----
  157. .. _class_GeometryInstance_property_material_overlay:
  158. .. rst-class:: classref-property
  159. :ref:`Material<class_Material>` **material_overlay**
  160. .. rst-class:: classref-property-setget
  161. - void **set_material_overlay** **(** :ref:`Material<class_Material>` value **)**
  162. - :ref:`Material<class_Material>` **get_material_overlay** **(** **)**
  163. The material overlay for the whole geometry.
  164. If a material is assigned to this property, it will be rendered on top of any other active material for all the surfaces.
  165. .. rst-class:: classref-item-separator
  166. ----
  167. .. _class_GeometryInstance_property_material_override:
  168. .. rst-class:: classref-property
  169. :ref:`Material<class_Material>` **material_override**
  170. .. rst-class:: classref-property-setget
  171. - void **set_material_override** **(** :ref:`Material<class_Material>` value **)**
  172. - :ref:`Material<class_Material>` **get_material_override** **(** **)**
  173. The material override for the whole geometry.
  174. If a material is assigned to this property, it will be used instead of any material set in any material slot of the mesh.
  175. .. rst-class:: classref-item-separator
  176. ----
  177. .. _class_GeometryInstance_property_use_in_baked_light:
  178. .. rst-class:: classref-property
  179. :ref:`bool<class_bool>` **use_in_baked_light** = ``false``
  180. .. rst-class:: classref-property-setget
  181. - void **set_flag** **(** :ref:`Flags<enum_GeometryInstance_Flags>` flag, :ref:`bool<class_bool>` value **)**
  182. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_GeometryInstance_Flags>` flag **)** |const|
  183. If ``true``, this GeometryInstance will be used when baking lights using a :ref:`GIProbe<class_GIProbe>` or :ref:`BakedLightmap<class_BakedLightmap>`.
  184. .. rst-class:: classref-section-separator
  185. ----
  186. .. rst-class:: classref-descriptions-group
  187. Method Descriptions
  188. -------------------
  189. .. _class_GeometryInstance_method_get_flag:
  190. .. rst-class:: classref-method
  191. :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_GeometryInstance_Flags>` flag **)** |const|
  192. Returns the :ref:`Flags<enum_GeometryInstance_Flags>` that have been set for this object.
  193. .. rst-class:: classref-item-separator
  194. ----
  195. .. _class_GeometryInstance_method_set_custom_aabb:
  196. .. rst-class:: classref-method
  197. void **set_custom_aabb** **(** :ref:`AABB<class_AABB>` aabb **)**
  198. Overrides the bounding box of this node with a custom one. To remove it, set an :ref:`AABB<class_AABB>` with all fields set to zero.
  199. .. rst-class:: classref-item-separator
  200. ----
  201. .. _class_GeometryInstance_method_set_flag:
  202. .. rst-class:: classref-method
  203. void **set_flag** **(** :ref:`Flags<enum_GeometryInstance_Flags>` flag, :ref:`bool<class_bool>` value **)**
  204. Sets the :ref:`Flags<enum_GeometryInstance_Flags>` specified. See :ref:`Flags<enum_GeometryInstance_Flags>` for options.
  205. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  206. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  207. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  208. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`