class_geometryinstance3d.rst 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584
  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/4.3/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.3/doc/classes/GeometryInstance3D.xml.
  6. .. _class_GeometryInstance3D:
  7. GeometryInstance3D
  8. ==================
  9. **Inherits:** :ref:`VisualInstance3D<class_VisualInstance3D>` **<** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`CPUParticles3D<class_CPUParticles3D>`, :ref:`CSGShape3D<class_CSGShape3D>`, :ref:`GPUParticles3D<class_GPUParticles3D>`, :ref:`Label3D<class_Label3D>`, :ref:`MeshInstance3D<class_MeshInstance3D>`, :ref:`MultiMeshInstance3D<class_MultiMeshInstance3D>`, :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-introduction-group
  17. Tutorials
  18. ---------
  19. - :doc:`Visibility ranges (HLOD) <../tutorials/3d/visibility_ranges>`
  20. .. rst-class:: classref-reftable-group
  21. Properties
  22. ----------
  23. .. table::
  24. :widths: auto
  25. +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+
  26. | :ref:`ShadowCastingSetting<enum_GeometryInstance3D_ShadowCastingSetting>` | :ref:`cast_shadow<class_GeometryInstance3D_property_cast_shadow>` | ``1`` |
  27. +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+
  28. | :ref:`AABB<class_AABB>` | :ref:`custom_aabb<class_GeometryInstance3D_property_custom_aabb>` | ``AABB(0, 0, 0, 0, 0, 0)`` |
  29. +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+
  30. | :ref:`float<class_float>` | :ref:`extra_cull_margin<class_GeometryInstance3D_property_extra_cull_margin>` | ``0.0`` |
  31. +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+
  32. | :ref:`LightmapScale<enum_GeometryInstance3D_LightmapScale>` | :ref:`gi_lightmap_scale<class_GeometryInstance3D_property_gi_lightmap_scale>` | ``0`` |
  33. +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+
  34. | :ref:`GIMode<enum_GeometryInstance3D_GIMode>` | :ref:`gi_mode<class_GeometryInstance3D_property_gi_mode>` | ``1`` |
  35. +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+
  36. | :ref:`bool<class_bool>` | :ref:`ignore_occlusion_culling<class_GeometryInstance3D_property_ignore_occlusion_culling>` | ``false`` |
  37. +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+
  38. | :ref:`float<class_float>` | :ref:`lod_bias<class_GeometryInstance3D_property_lod_bias>` | ``1.0`` |
  39. +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+
  40. | :ref:`Material<class_Material>` | :ref:`material_overlay<class_GeometryInstance3D_property_material_overlay>` | |
  41. +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+
  42. | :ref:`Material<class_Material>` | :ref:`material_override<class_GeometryInstance3D_property_material_override>` | |
  43. +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+
  44. | :ref:`float<class_float>` | :ref:`transparency<class_GeometryInstance3D_property_transparency>` | ``0.0`` |
  45. +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+
  46. | :ref:`float<class_float>` | :ref:`visibility_range_begin<class_GeometryInstance3D_property_visibility_range_begin>` | ``0.0`` |
  47. +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+
  48. | :ref:`float<class_float>` | :ref:`visibility_range_begin_margin<class_GeometryInstance3D_property_visibility_range_begin_margin>` | ``0.0`` |
  49. +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+
  50. | :ref:`float<class_float>` | :ref:`visibility_range_end<class_GeometryInstance3D_property_visibility_range_end>` | ``0.0`` |
  51. +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+
  52. | :ref:`float<class_float>` | :ref:`visibility_range_end_margin<class_GeometryInstance3D_property_visibility_range_end_margin>` | ``0.0`` |
  53. +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+
  54. | :ref:`VisibilityRangeFadeMode<enum_GeometryInstance3D_VisibilityRangeFadeMode>` | :ref:`visibility_range_fade_mode<class_GeometryInstance3D_property_visibility_range_fade_mode>` | ``0`` |
  55. +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+
  56. .. rst-class:: classref-reftable-group
  57. Methods
  58. -------
  59. .. table::
  60. :widths: auto
  61. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`Variant<class_Variant>` | :ref:`get_instance_shader_parameter<class_GeometryInstance3D_method_get_instance_shader_parameter>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
  63. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | |void| | :ref:`set_instance_shader_parameter<class_GeometryInstance3D_method_set_instance_shader_parameter>`\ (\ name\: :ref:`StringName<class_StringName>`, value\: :ref:`Variant<class_Variant>`\ ) |
  65. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. .. rst-class:: classref-section-separator
  67. ----
  68. .. rst-class:: classref-descriptions-group
  69. Enumerations
  70. ------------
  71. .. _enum_GeometryInstance3D_ShadowCastingSetting:
  72. .. rst-class:: classref-enumeration
  73. enum **ShadowCastingSetting**: :ref:`🔗<enum_GeometryInstance3D_ShadowCastingSetting>`
  74. .. _class_GeometryInstance3D_constant_SHADOW_CASTING_SETTING_OFF:
  75. .. rst-class:: classref-enumeration-constant
  76. :ref:`ShadowCastingSetting<enum_GeometryInstance3D_ShadowCastingSetting>` **SHADOW_CASTING_SETTING_OFF** = ``0``
  77. Will not cast any shadows. Use this to improve performance for small geometry that is unlikely to cast noticeable shadows (such as debris).
  78. .. _class_GeometryInstance3D_constant_SHADOW_CASTING_SETTING_ON:
  79. .. rst-class:: classref-enumeration-constant
  80. :ref:`ShadowCastingSetting<enum_GeometryInstance3D_ShadowCastingSetting>` **SHADOW_CASTING_SETTING_ON** = ``1``
  81. Will cast shadows from all visible faces in the GeometryInstance3D.
  82. Will take culling into account, so faces not being rendered will not be taken into account when shadow casting.
  83. .. _class_GeometryInstance3D_constant_SHADOW_CASTING_SETTING_DOUBLE_SIDED:
  84. .. rst-class:: classref-enumeration-constant
  85. :ref:`ShadowCastingSetting<enum_GeometryInstance3D_ShadowCastingSetting>` **SHADOW_CASTING_SETTING_DOUBLE_SIDED** = ``2``
  86. Will cast shadows from all visible faces in the GeometryInstance3D.
  87. Will not take culling into account, so all faces will be taken into account when shadow casting.
  88. .. _class_GeometryInstance3D_constant_SHADOW_CASTING_SETTING_SHADOWS_ONLY:
  89. .. rst-class:: classref-enumeration-constant
  90. :ref:`ShadowCastingSetting<enum_GeometryInstance3D_ShadowCastingSetting>` **SHADOW_CASTING_SETTING_SHADOWS_ONLY** = ``3``
  91. Will only show the shadows casted from this object.
  92. In other words, the actual mesh will not be visible, only the shadows casted from the mesh will be.
  93. .. rst-class:: classref-item-separator
  94. ----
  95. .. _enum_GeometryInstance3D_GIMode:
  96. .. rst-class:: classref-enumeration
  97. enum **GIMode**: :ref:`🔗<enum_GeometryInstance3D_GIMode>`
  98. .. _class_GeometryInstance3D_constant_GI_MODE_DISABLED:
  99. .. rst-class:: classref-enumeration-constant
  100. :ref:`GIMode<enum_GeometryInstance3D_GIMode>` **GI_MODE_DISABLED** = ``0``
  101. Disabled global illumination mode. Use for dynamic objects that do not contribute to global illumination (such as characters). When using :ref:`VoxelGI<class_VoxelGI>` and SDFGI, the geometry will *receive* indirect lighting and reflections but the geometry will not be considered in GI baking.
  102. .. _class_GeometryInstance3D_constant_GI_MODE_STATIC:
  103. .. rst-class:: classref-enumeration-constant
  104. :ref:`GIMode<enum_GeometryInstance3D_GIMode>` **GI_MODE_STATIC** = ``1``
  105. Baked global illumination mode. Use for static objects that contribute to global illumination (such as level geometry). This GI mode is effective when using :ref:`VoxelGI<class_VoxelGI>`, SDFGI and :ref:`LightmapGI<class_LightmapGI>`.
  106. .. _class_GeometryInstance3D_constant_GI_MODE_DYNAMIC:
  107. .. rst-class:: classref-enumeration-constant
  108. :ref:`GIMode<enum_GeometryInstance3D_GIMode>` **GI_MODE_DYNAMIC** = ``2``
  109. Dynamic global illumination mode. Use for dynamic objects that contribute to global illumination. This GI mode is only effective when using :ref:`VoxelGI<class_VoxelGI>`, but it has a higher performance impact than :ref:`GI_MODE_STATIC<class_GeometryInstance3D_constant_GI_MODE_STATIC>`. When using other GI methods, this will act the same as :ref:`GI_MODE_DISABLED<class_GeometryInstance3D_constant_GI_MODE_DISABLED>`. When using :ref:`LightmapGI<class_LightmapGI>`, the object will receive indirect lighting using lightmap probes instead of using the baked lightmap texture.
  110. .. rst-class:: classref-item-separator
  111. ----
  112. .. _enum_GeometryInstance3D_LightmapScale:
  113. .. rst-class:: classref-enumeration
  114. enum **LightmapScale**: :ref:`🔗<enum_GeometryInstance3D_LightmapScale>`
  115. .. _class_GeometryInstance3D_constant_LIGHTMAP_SCALE_1X:
  116. .. rst-class:: classref-enumeration-constant
  117. :ref:`LightmapScale<enum_GeometryInstance3D_LightmapScale>` **LIGHTMAP_SCALE_1X** = ``0``
  118. The standard texel density for lightmapping with :ref:`LightmapGI<class_LightmapGI>`.
  119. .. _class_GeometryInstance3D_constant_LIGHTMAP_SCALE_2X:
  120. .. rst-class:: classref-enumeration-constant
  121. :ref:`LightmapScale<enum_GeometryInstance3D_LightmapScale>` **LIGHTMAP_SCALE_2X** = ``1``
  122. Multiplies texel density by 2× for lightmapping with :ref:`LightmapGI<class_LightmapGI>`. To ensure consistency in texel density, use this when scaling a mesh by a factor between 1.5 and 3.0.
  123. .. _class_GeometryInstance3D_constant_LIGHTMAP_SCALE_4X:
  124. .. rst-class:: classref-enumeration-constant
  125. :ref:`LightmapScale<enum_GeometryInstance3D_LightmapScale>` **LIGHTMAP_SCALE_4X** = ``2``
  126. Multiplies texel density by 4× for lightmapping with :ref:`LightmapGI<class_LightmapGI>`. To ensure consistency in texel density, use this when scaling a mesh by a factor between 3.0 and 6.0.
  127. .. _class_GeometryInstance3D_constant_LIGHTMAP_SCALE_8X:
  128. .. rst-class:: classref-enumeration-constant
  129. :ref:`LightmapScale<enum_GeometryInstance3D_LightmapScale>` **LIGHTMAP_SCALE_8X** = ``3``
  130. Multiplies texel density by 8× for lightmapping with :ref:`LightmapGI<class_LightmapGI>`. To ensure consistency in texel density, use this when scaling a mesh by a factor greater than 6.0.
  131. .. _class_GeometryInstance3D_constant_LIGHTMAP_SCALE_MAX:
  132. .. rst-class:: classref-enumeration-constant
  133. :ref:`LightmapScale<enum_GeometryInstance3D_LightmapScale>` **LIGHTMAP_SCALE_MAX** = ``4``
  134. Represents the size of the :ref:`LightmapScale<enum_GeometryInstance3D_LightmapScale>` enum.
  135. .. rst-class:: classref-item-separator
  136. ----
  137. .. _enum_GeometryInstance3D_VisibilityRangeFadeMode:
  138. .. rst-class:: classref-enumeration
  139. enum **VisibilityRangeFadeMode**: :ref:`🔗<enum_GeometryInstance3D_VisibilityRangeFadeMode>`
  140. .. _class_GeometryInstance3D_constant_VISIBILITY_RANGE_FADE_DISABLED:
  141. .. rst-class:: classref-enumeration-constant
  142. :ref:`VisibilityRangeFadeMode<enum_GeometryInstance3D_VisibilityRangeFadeMode>` **VISIBILITY_RANGE_FADE_DISABLED** = ``0``
  143. Will not fade itself nor its visibility dependencies, hysteresis will be used instead. This is the fastest approach to manual LOD, but it can result in noticeable LOD transitions depending on how the LOD meshes are authored. See :ref:`visibility_range_begin<class_GeometryInstance3D_property_visibility_range_begin>` and :ref:`Node3D.visibility_parent<class_Node3D_property_visibility_parent>` for more information.
  144. .. _class_GeometryInstance3D_constant_VISIBILITY_RANGE_FADE_SELF:
  145. .. rst-class:: classref-enumeration-constant
  146. :ref:`VisibilityRangeFadeMode<enum_GeometryInstance3D_VisibilityRangeFadeMode>` **VISIBILITY_RANGE_FADE_SELF** = ``1``
  147. Will fade-out itself when reaching the limits of its own visibility range. This is slower than :ref:`VISIBILITY_RANGE_FADE_DISABLED<class_GeometryInstance3D_constant_VISIBILITY_RANGE_FADE_DISABLED>`, but it can provide smoother transitions. The fading range is determined by :ref:`visibility_range_begin_margin<class_GeometryInstance3D_property_visibility_range_begin_margin>` and :ref:`visibility_range_end_margin<class_GeometryInstance3D_property_visibility_range_end_margin>`.
  148. \ **Note:** Only supported when using the Forward+ rendering method. When using the Mobile or Compatibility rendering method, this mode acts like :ref:`VISIBILITY_RANGE_FADE_DISABLED<class_GeometryInstance3D_constant_VISIBILITY_RANGE_FADE_DISABLED>` but with hysteresis disabled.
  149. .. _class_GeometryInstance3D_constant_VISIBILITY_RANGE_FADE_DEPENDENCIES:
  150. .. rst-class:: classref-enumeration-constant
  151. :ref:`VisibilityRangeFadeMode<enum_GeometryInstance3D_VisibilityRangeFadeMode>` **VISIBILITY_RANGE_FADE_DEPENDENCIES** = ``2``
  152. Will fade-in its visibility dependencies (see :ref:`Node3D.visibility_parent<class_Node3D_property_visibility_parent>`) when reaching the limits of its own visibility range. This is slower than :ref:`VISIBILITY_RANGE_FADE_DISABLED<class_GeometryInstance3D_constant_VISIBILITY_RANGE_FADE_DISABLED>`, but it can provide smoother transitions. The fading range is determined by :ref:`visibility_range_begin_margin<class_GeometryInstance3D_property_visibility_range_begin_margin>` and :ref:`visibility_range_end_margin<class_GeometryInstance3D_property_visibility_range_end_margin>`.
  153. \ **Note:** Only supported when using the Forward+ rendering method. When using the Mobile or Compatibility rendering method, this mode acts like :ref:`VISIBILITY_RANGE_FADE_DISABLED<class_GeometryInstance3D_constant_VISIBILITY_RANGE_FADE_DISABLED>` but with hysteresis disabled.
  154. .. rst-class:: classref-section-separator
  155. ----
  156. .. rst-class:: classref-descriptions-group
  157. Property Descriptions
  158. ---------------------
  159. .. _class_GeometryInstance3D_property_cast_shadow:
  160. .. rst-class:: classref-property
  161. :ref:`ShadowCastingSetting<enum_GeometryInstance3D_ShadowCastingSetting>` **cast_shadow** = ``1`` :ref:`🔗<class_GeometryInstance3D_property_cast_shadow>`
  162. .. rst-class:: classref-property-setget
  163. - |void| **set_cast_shadows_setting**\ (\ value\: :ref:`ShadowCastingSetting<enum_GeometryInstance3D_ShadowCastingSetting>`\ )
  164. - :ref:`ShadowCastingSetting<enum_GeometryInstance3D_ShadowCastingSetting>` **get_cast_shadows_setting**\ (\ )
  165. The selected shadow casting flag. See :ref:`ShadowCastingSetting<enum_GeometryInstance3D_ShadowCastingSetting>` for possible values.
  166. .. rst-class:: classref-item-separator
  167. ----
  168. .. _class_GeometryInstance3D_property_custom_aabb:
  169. .. rst-class:: classref-property
  170. :ref:`AABB<class_AABB>` **custom_aabb** = ``AABB(0, 0, 0, 0, 0, 0)`` :ref:`🔗<class_GeometryInstance3D_property_custom_aabb>`
  171. .. rst-class:: classref-property-setget
  172. - |void| **set_custom_aabb**\ (\ value\: :ref:`AABB<class_AABB>`\ )
  173. - :ref:`AABB<class_AABB>` **get_custom_aabb**\ (\ )
  174. Overrides the bounding box of this node with a custom one. This can be used to avoid the expensive :ref:`AABB<class_AABB>` recalculation that happens when a skeleton is used with a :ref:`MeshInstance3D<class_MeshInstance3D>` or to have precise control over the :ref:`MeshInstance3D<class_MeshInstance3D>`'s bounding box. To use the default AABB, set value to an :ref:`AABB<class_AABB>` with all fields set to ``0.0``. To avoid frustum culling, set :ref:`custom_aabb<class_GeometryInstance3D_property_custom_aabb>` to a very large AABB that covers your entire game world such as ``AABB(-10000, -10000, -10000, 20000, 20000, 20000)``. To disable all forms of culling (including occlusion culling), call :ref:`RenderingServer.instance_set_ignore_culling<class_RenderingServer_method_instance_set_ignore_culling>` on the **GeometryInstance3D**'s :ref:`RID<class_RID>`.
  175. .. rst-class:: classref-item-separator
  176. ----
  177. .. _class_GeometryInstance3D_property_extra_cull_margin:
  178. .. rst-class:: classref-property
  179. :ref:`float<class_float>` **extra_cull_margin** = ``0.0`` :ref:`🔗<class_GeometryInstance3D_property_extra_cull_margin>`
  180. .. rst-class:: classref-property-setget
  181. - |void| **set_extra_cull_margin**\ (\ value\: :ref:`float<class_float>`\ )
  182. - :ref:`float<class_float>` **get_extra_cull_margin**\ (\ )
  183. The extra distance added to the GeometryInstance3D's bounding box (:ref:`AABB<class_AABB>`) to increase its cull box.
  184. .. rst-class:: classref-item-separator
  185. ----
  186. .. _class_GeometryInstance3D_property_gi_lightmap_scale:
  187. .. rst-class:: classref-property
  188. :ref:`LightmapScale<enum_GeometryInstance3D_LightmapScale>` **gi_lightmap_scale** = ``0`` :ref:`🔗<class_GeometryInstance3D_property_gi_lightmap_scale>`
  189. .. rst-class:: classref-property-setget
  190. - |void| **set_lightmap_scale**\ (\ value\: :ref:`LightmapScale<enum_GeometryInstance3D_LightmapScale>`\ )
  191. - :ref:`LightmapScale<enum_GeometryInstance3D_LightmapScale>` **get_lightmap_scale**\ (\ )
  192. The texel density to use for lightmapping in :ref:`LightmapGI<class_LightmapGI>`. Greater scale values provide higher resolution in the lightmap, which can result in sharper shadows for lights that have both direct and indirect light baked. However, greater scale values will also increase the space taken by the mesh in the lightmap texture, which increases the memory, storage, and bake time requirements. When using a single mesh at different scales, consider adjusting this value to keep the lightmap texel density consistent across meshes.
  193. .. rst-class:: classref-item-separator
  194. ----
  195. .. _class_GeometryInstance3D_property_gi_mode:
  196. .. rst-class:: classref-property
  197. :ref:`GIMode<enum_GeometryInstance3D_GIMode>` **gi_mode** = ``1`` :ref:`🔗<class_GeometryInstance3D_property_gi_mode>`
  198. .. rst-class:: classref-property-setget
  199. - |void| **set_gi_mode**\ (\ value\: :ref:`GIMode<enum_GeometryInstance3D_GIMode>`\ )
  200. - :ref:`GIMode<enum_GeometryInstance3D_GIMode>` **get_gi_mode**\ (\ )
  201. The global illumination mode to use for the whole geometry. To avoid inconsistent results, use a mode that matches the purpose of the mesh during gameplay (static/dynamic).
  202. \ **Note:** Lights' bake mode will also affect the global illumination rendering. See :ref:`Light3D.light_bake_mode<class_Light3D_property_light_bake_mode>`.
  203. .. rst-class:: classref-item-separator
  204. ----
  205. .. _class_GeometryInstance3D_property_ignore_occlusion_culling:
  206. .. rst-class:: classref-property
  207. :ref:`bool<class_bool>` **ignore_occlusion_culling** = ``false`` :ref:`🔗<class_GeometryInstance3D_property_ignore_occlusion_culling>`
  208. .. rst-class:: classref-property-setget
  209. - |void| **set_ignore_occlusion_culling**\ (\ value\: :ref:`bool<class_bool>`\ )
  210. - :ref:`bool<class_bool>` **is_ignoring_occlusion_culling**\ (\ )
  211. If ``true``, disables occlusion culling for this instance. Useful for gizmos that must be rendered even when occlusion culling is in use.
  212. \ **Note:** :ref:`ignore_occlusion_culling<class_GeometryInstance3D_property_ignore_occlusion_culling>` does not affect frustum culling (which is what happens when an object is not visible given the camera's angle). To avoid frustum culling, set :ref:`custom_aabb<class_GeometryInstance3D_property_custom_aabb>` to a very large AABB that covers your entire game world such as ``AABB(-10000, -10000, -10000, 20000, 20000, 20000)``.
  213. .. rst-class:: classref-item-separator
  214. ----
  215. .. _class_GeometryInstance3D_property_lod_bias:
  216. .. rst-class:: classref-property
  217. :ref:`float<class_float>` **lod_bias** = ``1.0`` :ref:`🔗<class_GeometryInstance3D_property_lod_bias>`
  218. .. rst-class:: classref-property-setget
  219. - |void| **set_lod_bias**\ (\ value\: :ref:`float<class_float>`\ )
  220. - :ref:`float<class_float>` **get_lod_bias**\ (\ )
  221. Changes how quickly the mesh transitions to a lower level of detail. A value of 0 will force the mesh to its lowest level of detail, a value of 1 will use the default settings, and larger values will keep the mesh in a higher level of detail at farther distances.
  222. Useful for testing level of detail transitions in the editor.
  223. .. rst-class:: classref-item-separator
  224. ----
  225. .. _class_GeometryInstance3D_property_material_overlay:
  226. .. rst-class:: classref-property
  227. :ref:`Material<class_Material>` **material_overlay** :ref:`🔗<class_GeometryInstance3D_property_material_overlay>`
  228. .. rst-class:: classref-property-setget
  229. - |void| **set_material_overlay**\ (\ value\: :ref:`Material<class_Material>`\ )
  230. - :ref:`Material<class_Material>` **get_material_overlay**\ (\ )
  231. The material overlay for the whole geometry.
  232. If a material is assigned to this property, it will be rendered on top of any other active material for all the surfaces.
  233. .. rst-class:: classref-item-separator
  234. ----
  235. .. _class_GeometryInstance3D_property_material_override:
  236. .. rst-class:: classref-property
  237. :ref:`Material<class_Material>` **material_override** :ref:`🔗<class_GeometryInstance3D_property_material_override>`
  238. .. rst-class:: classref-property-setget
  239. - |void| **set_material_override**\ (\ value\: :ref:`Material<class_Material>`\ )
  240. - :ref:`Material<class_Material>` **get_material_override**\ (\ )
  241. The material override for the whole geometry.
  242. If a material is assigned to this property, it will be used instead of any material set in any material slot of the mesh.
  243. .. rst-class:: classref-item-separator
  244. ----
  245. .. _class_GeometryInstance3D_property_transparency:
  246. .. rst-class:: classref-property
  247. :ref:`float<class_float>` **transparency** = ``0.0`` :ref:`🔗<class_GeometryInstance3D_property_transparency>`
  248. .. rst-class:: classref-property-setget
  249. - |void| **set_transparency**\ (\ value\: :ref:`float<class_float>`\ )
  250. - :ref:`float<class_float>` **get_transparency**\ (\ )
  251. The transparency applied to the whole geometry (as a multiplier of the materials' existing transparency). ``0.0`` is fully opaque, while ``1.0`` is fully transparent. Values greater than ``0.0`` (exclusive) will force the geometry's materials to go through the transparent pipeline, which is slower to render and can exhibit rendering issues due to incorrect transparency sorting. However, unlike using a transparent material, setting :ref:`transparency<class_GeometryInstance3D_property_transparency>` to a value greater than ``0.0`` (exclusive) will *not* disable shadow rendering.
  252. In spatial shaders, ``1.0 - transparency`` is set as the default value of the ``ALPHA`` built-in.
  253. \ **Note:** :ref:`transparency<class_GeometryInstance3D_property_transparency>` is clamped between ``0.0`` and ``1.0``, so this property cannot be used to make transparent materials more opaque than they originally are.
  254. \ **Note:** Only supported when using the Forward+ rendering method. When using the Mobile or Compatibility rendering method, :ref:`transparency<class_GeometryInstance3D_property_transparency>` is ignored and is considered as always being ``0.0``.
  255. .. rst-class:: classref-item-separator
  256. ----
  257. .. _class_GeometryInstance3D_property_visibility_range_begin:
  258. .. rst-class:: classref-property
  259. :ref:`float<class_float>` **visibility_range_begin** = ``0.0`` :ref:`🔗<class_GeometryInstance3D_property_visibility_range_begin>`
  260. .. rst-class:: classref-property-setget
  261. - |void| **set_visibility_range_begin**\ (\ value\: :ref:`float<class_float>`\ )
  262. - :ref:`float<class_float>` **get_visibility_range_begin**\ (\ )
  263. Starting distance from which the GeometryInstance3D will be visible, taking :ref:`visibility_range_begin_margin<class_GeometryInstance3D_property_visibility_range_begin_margin>` into account as well. The default value of 0 is used to disable the range check.
  264. .. rst-class:: classref-item-separator
  265. ----
  266. .. _class_GeometryInstance3D_property_visibility_range_begin_margin:
  267. .. rst-class:: classref-property
  268. :ref:`float<class_float>` **visibility_range_begin_margin** = ``0.0`` :ref:`🔗<class_GeometryInstance3D_property_visibility_range_begin_margin>`
  269. .. rst-class:: classref-property-setget
  270. - |void| **set_visibility_range_begin_margin**\ (\ value\: :ref:`float<class_float>`\ )
  271. - :ref:`float<class_float>` **get_visibility_range_begin_margin**\ (\ )
  272. Margin for the :ref:`visibility_range_begin<class_GeometryInstance3D_property_visibility_range_begin>` threshold. The GeometryInstance3D will only change its visibility state when it goes over or under the :ref:`visibility_range_begin<class_GeometryInstance3D_property_visibility_range_begin>` threshold by this amount.
  273. If :ref:`visibility_range_fade_mode<class_GeometryInstance3D_property_visibility_range_fade_mode>` is :ref:`VISIBILITY_RANGE_FADE_DISABLED<class_GeometryInstance3D_constant_VISIBILITY_RANGE_FADE_DISABLED>`, this acts as a hysteresis distance. If :ref:`visibility_range_fade_mode<class_GeometryInstance3D_property_visibility_range_fade_mode>` is :ref:`VISIBILITY_RANGE_FADE_SELF<class_GeometryInstance3D_constant_VISIBILITY_RANGE_FADE_SELF>` or :ref:`VISIBILITY_RANGE_FADE_DEPENDENCIES<class_GeometryInstance3D_constant_VISIBILITY_RANGE_FADE_DEPENDENCIES>`, this acts as a fade transition distance and must be set to a value greater than ``0.0`` for the effect to be noticeable.
  274. .. rst-class:: classref-item-separator
  275. ----
  276. .. _class_GeometryInstance3D_property_visibility_range_end:
  277. .. rst-class:: classref-property
  278. :ref:`float<class_float>` **visibility_range_end** = ``0.0`` :ref:`🔗<class_GeometryInstance3D_property_visibility_range_end>`
  279. .. rst-class:: classref-property-setget
  280. - |void| **set_visibility_range_end**\ (\ value\: :ref:`float<class_float>`\ )
  281. - :ref:`float<class_float>` **get_visibility_range_end**\ (\ )
  282. Distance from which the GeometryInstance3D will be hidden, taking :ref:`visibility_range_end_margin<class_GeometryInstance3D_property_visibility_range_end_margin>` into account as well. The default value of 0 is used to disable the range check.
  283. .. rst-class:: classref-item-separator
  284. ----
  285. .. _class_GeometryInstance3D_property_visibility_range_end_margin:
  286. .. rst-class:: classref-property
  287. :ref:`float<class_float>` **visibility_range_end_margin** = ``0.0`` :ref:`🔗<class_GeometryInstance3D_property_visibility_range_end_margin>`
  288. .. rst-class:: classref-property-setget
  289. - |void| **set_visibility_range_end_margin**\ (\ value\: :ref:`float<class_float>`\ )
  290. - :ref:`float<class_float>` **get_visibility_range_end_margin**\ (\ )
  291. Margin for the :ref:`visibility_range_end<class_GeometryInstance3D_property_visibility_range_end>` threshold. The GeometryInstance3D will only change its visibility state when it goes over or under the :ref:`visibility_range_end<class_GeometryInstance3D_property_visibility_range_end>` threshold by this amount.
  292. If :ref:`visibility_range_fade_mode<class_GeometryInstance3D_property_visibility_range_fade_mode>` is :ref:`VISIBILITY_RANGE_FADE_DISABLED<class_GeometryInstance3D_constant_VISIBILITY_RANGE_FADE_DISABLED>`, this acts as a hysteresis distance. If :ref:`visibility_range_fade_mode<class_GeometryInstance3D_property_visibility_range_fade_mode>` is :ref:`VISIBILITY_RANGE_FADE_SELF<class_GeometryInstance3D_constant_VISIBILITY_RANGE_FADE_SELF>` or :ref:`VISIBILITY_RANGE_FADE_DEPENDENCIES<class_GeometryInstance3D_constant_VISIBILITY_RANGE_FADE_DEPENDENCIES>`, this acts as a fade transition distance and must be set to a value greater than ``0.0`` for the effect to be noticeable.
  293. .. rst-class:: classref-item-separator
  294. ----
  295. .. _class_GeometryInstance3D_property_visibility_range_fade_mode:
  296. .. rst-class:: classref-property
  297. :ref:`VisibilityRangeFadeMode<enum_GeometryInstance3D_VisibilityRangeFadeMode>` **visibility_range_fade_mode** = ``0`` :ref:`🔗<class_GeometryInstance3D_property_visibility_range_fade_mode>`
  298. .. rst-class:: classref-property-setget
  299. - |void| **set_visibility_range_fade_mode**\ (\ value\: :ref:`VisibilityRangeFadeMode<enum_GeometryInstance3D_VisibilityRangeFadeMode>`\ )
  300. - :ref:`VisibilityRangeFadeMode<enum_GeometryInstance3D_VisibilityRangeFadeMode>` **get_visibility_range_fade_mode**\ (\ )
  301. Controls which instances will be faded when approaching the limits of the visibility range. See :ref:`VisibilityRangeFadeMode<enum_GeometryInstance3D_VisibilityRangeFadeMode>` for possible values.
  302. .. rst-class:: classref-section-separator
  303. ----
  304. .. rst-class:: classref-descriptions-group
  305. Method Descriptions
  306. -------------------
  307. .. _class_GeometryInstance3D_method_get_instance_shader_parameter:
  308. .. rst-class:: classref-method
  309. :ref:`Variant<class_Variant>` **get_instance_shader_parameter**\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_GeometryInstance3D_method_get_instance_shader_parameter>`
  310. Get the value of a shader parameter as set on this instance.
  311. .. rst-class:: classref-item-separator
  312. ----
  313. .. _class_GeometryInstance3D_method_set_instance_shader_parameter:
  314. .. rst-class:: classref-method
  315. |void| **set_instance_shader_parameter**\ (\ name\: :ref:`StringName<class_StringName>`, value\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_GeometryInstance3D_method_set_instance_shader_parameter>`
  316. Set the value of a shader uniform for this instance only (`per-instance uniform <../tutorials/shaders/shader_reference/shading_language.html#per-instance-uniforms>`__). See also :ref:`ShaderMaterial.set_shader_parameter<class_ShaderMaterial_method_set_shader_parameter>` to assign a uniform on all instances using the same :ref:`ShaderMaterial<class_ShaderMaterial>`.
  317. \ **Note:** For a shader uniform to be assignable on a per-instance basis, it *must* be defined with ``instance uniform ...`` rather than ``uniform ...`` in the shader code.
  318. \ **Note:** ``name`` is case-sensitive and must match the name of the uniform in the code exactly (not the capitalized name in the inspector).
  319. \ **Note:** Per-instance shader uniforms are currently only available in 3D, so there is no 2D equivalent of this method.
  320. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  321. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  322. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  323. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  324. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  325. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  326. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  327. .. |void| replace:: :abbr:`void (No return value.)`