class_geometryinstance3d.rst 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  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.0/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.0/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-reftable-group
  17. Properties
  18. ----------
  19. .. table::
  20. :widths: auto
  21. +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+
  22. | :ref:`ShadowCastingSetting<enum_GeometryInstance3D_ShadowCastingSetting>` | :ref:`cast_shadow<class_GeometryInstance3D_property_cast_shadow>` | ``1`` |
  23. +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+
  24. | :ref:`AABB<class_AABB>` | :ref:`custom_aabb<class_GeometryInstance3D_property_custom_aabb>` | ``AABB(0, 0, 0, 0, 0, 0)`` |
  25. +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+
  26. | :ref:`float<class_float>` | :ref:`extra_cull_margin<class_GeometryInstance3D_property_extra_cull_margin>` | ``0.0`` |
  27. +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+
  28. | :ref:`LightmapScale<enum_GeometryInstance3D_LightmapScale>` | :ref:`gi_lightmap_scale<class_GeometryInstance3D_property_gi_lightmap_scale>` | ``0`` |
  29. +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+
  30. | :ref:`GIMode<enum_GeometryInstance3D_GIMode>` | :ref:`gi_mode<class_GeometryInstance3D_property_gi_mode>` | ``1`` |
  31. +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+
  32. | :ref:`bool<class_bool>` | :ref:`ignore_occlusion_culling<class_GeometryInstance3D_property_ignore_occlusion_culling>` | ``false`` |
  33. +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+
  34. | :ref:`float<class_float>` | :ref:`lod_bias<class_GeometryInstance3D_property_lod_bias>` | ``1.0`` |
  35. +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+
  36. | :ref:`Material<class_Material>` | :ref:`material_overlay<class_GeometryInstance3D_property_material_overlay>` | |
  37. +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+
  38. | :ref:`Material<class_Material>` | :ref:`material_override<class_GeometryInstance3D_property_material_override>` | |
  39. +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+
  40. | :ref:`float<class_float>` | :ref:`transparency<class_GeometryInstance3D_property_transparency>` | ``0.0`` |
  41. +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+
  42. | :ref:`float<class_float>` | :ref:`visibility_range_begin<class_GeometryInstance3D_property_visibility_range_begin>` | ``0.0`` |
  43. +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+
  44. | :ref:`float<class_float>` | :ref:`visibility_range_begin_margin<class_GeometryInstance3D_property_visibility_range_begin_margin>` | ``0.0`` |
  45. +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+
  46. | :ref:`float<class_float>` | :ref:`visibility_range_end<class_GeometryInstance3D_property_visibility_range_end>` | ``0.0`` |
  47. +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+
  48. | :ref:`float<class_float>` | :ref:`visibility_range_end_margin<class_GeometryInstance3D_property_visibility_range_end_margin>` | ``0.0`` |
  49. +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+
  50. | :ref:`VisibilityRangeFadeMode<enum_GeometryInstance3D_VisibilityRangeFadeMode>` | :ref:`visibility_range_fade_mode<class_GeometryInstance3D_property_visibility_range_fade_mode>` | ``0`` |
  51. +---------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------------+
  52. .. rst-class:: classref-reftable-group
  53. Methods
  54. -------
  55. .. table::
  56. :widths: auto
  57. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`Variant<class_Variant>` | :ref:`get_instance_shader_parameter<class_GeometryInstance3D_method_get_instance_shader_parameter>` **(** :ref:`StringName<class_StringName>` name **)** |const| |
  59. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | void | :ref:`set_instance_shader_parameter<class_GeometryInstance3D_method_set_instance_shader_parameter>` **(** :ref:`StringName<class_StringName>` name, :ref:`Variant<class_Variant>` value **)** |
  61. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. .. rst-class:: classref-section-separator
  63. ----
  64. .. rst-class:: classref-descriptions-group
  65. Enumerations
  66. ------------
  67. .. _enum_GeometryInstance3D_ShadowCastingSetting:
  68. .. rst-class:: classref-enumeration
  69. enum **ShadowCastingSetting**:
  70. .. _class_GeometryInstance3D_constant_SHADOW_CASTING_SETTING_OFF:
  71. .. rst-class:: classref-enumeration-constant
  72. :ref:`ShadowCastingSetting<enum_GeometryInstance3D_ShadowCastingSetting>` **SHADOW_CASTING_SETTING_OFF** = ``0``
  73. Will not cast any shadows. Use this to improve performance for small geometry that is unlikely to cast noticeable shadows (such as debris).
  74. .. _class_GeometryInstance3D_constant_SHADOW_CASTING_SETTING_ON:
  75. .. rst-class:: classref-enumeration-constant
  76. :ref:`ShadowCastingSetting<enum_GeometryInstance3D_ShadowCastingSetting>` **SHADOW_CASTING_SETTING_ON** = ``1``
  77. Will cast shadows from all visible faces in the GeometryInstance3D.
  78. Will take culling into account, so faces not being rendered will not be taken into account when shadow casting.
  79. .. _class_GeometryInstance3D_constant_SHADOW_CASTING_SETTING_DOUBLE_SIDED:
  80. .. rst-class:: classref-enumeration-constant
  81. :ref:`ShadowCastingSetting<enum_GeometryInstance3D_ShadowCastingSetting>` **SHADOW_CASTING_SETTING_DOUBLE_SIDED** = ``2``
  82. Will cast shadows from all visible faces in the GeometryInstance3D.
  83. Will not take culling into account, so all faces will be taken into account when shadow casting.
  84. .. _class_GeometryInstance3D_constant_SHADOW_CASTING_SETTING_SHADOWS_ONLY:
  85. .. rst-class:: classref-enumeration-constant
  86. :ref:`ShadowCastingSetting<enum_GeometryInstance3D_ShadowCastingSetting>` **SHADOW_CASTING_SETTING_SHADOWS_ONLY** = ``3``
  87. Will only show the shadows casted from this object.
  88. In other words, the actual mesh will not be visible, only the shadows casted from the mesh will be.
  89. .. rst-class:: classref-item-separator
  90. ----
  91. .. _enum_GeometryInstance3D_GIMode:
  92. .. rst-class:: classref-enumeration
  93. enum **GIMode**:
  94. .. _class_GeometryInstance3D_constant_GI_MODE_DISABLED:
  95. .. rst-class:: classref-enumeration-constant
  96. :ref:`GIMode<enum_GeometryInstance3D_GIMode>` **GI_MODE_DISABLED** = ``0``
  97. 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. When using :ref:`LightmapGI<class_LightmapGI>`, the object will receive indirect lighting using lightmap probes instead of using the baked lightmap texture.
  98. .. _class_GeometryInstance3D_constant_GI_MODE_STATIC:
  99. .. rst-class:: classref-enumeration-constant
  100. :ref:`GIMode<enum_GeometryInstance3D_GIMode>` **GI_MODE_STATIC** = ``1``
  101. 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>`.
  102. .. _class_GeometryInstance3D_constant_GI_MODE_DYNAMIC:
  103. .. rst-class:: classref-enumeration-constant
  104. :ref:`GIMode<enum_GeometryInstance3D_GIMode>` **GI_MODE_DYNAMIC** = ``2``
  105. 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>`.
  106. .. rst-class:: classref-item-separator
  107. ----
  108. .. _enum_GeometryInstance3D_LightmapScale:
  109. .. rst-class:: classref-enumeration
  110. enum **LightmapScale**:
  111. .. _class_GeometryInstance3D_constant_LIGHTMAP_SCALE_1X:
  112. .. rst-class:: classref-enumeration-constant
  113. :ref:`LightmapScale<enum_GeometryInstance3D_LightmapScale>` **LIGHTMAP_SCALE_1X** = ``0``
  114. The standard texel density for lightmapping with :ref:`LightmapGI<class_LightmapGI>`.
  115. .. _class_GeometryInstance3D_constant_LIGHTMAP_SCALE_2X:
  116. .. rst-class:: classref-enumeration-constant
  117. :ref:`LightmapScale<enum_GeometryInstance3D_LightmapScale>` **LIGHTMAP_SCALE_2X** = ``1``
  118. 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.
  119. .. _class_GeometryInstance3D_constant_LIGHTMAP_SCALE_4X:
  120. .. rst-class:: classref-enumeration-constant
  121. :ref:`LightmapScale<enum_GeometryInstance3D_LightmapScale>` **LIGHTMAP_SCALE_4X** = ``2``
  122. 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.
  123. .. _class_GeometryInstance3D_constant_LIGHTMAP_SCALE_8X:
  124. .. rst-class:: classref-enumeration-constant
  125. :ref:`LightmapScale<enum_GeometryInstance3D_LightmapScale>` **LIGHTMAP_SCALE_8X** = ``3``
  126. 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.
  127. .. _class_GeometryInstance3D_constant_LIGHTMAP_SCALE_MAX:
  128. .. rst-class:: classref-enumeration-constant
  129. :ref:`LightmapScale<enum_GeometryInstance3D_LightmapScale>` **LIGHTMAP_SCALE_MAX** = ``4``
  130. Represents the size of the :ref:`LightmapScale<enum_GeometryInstance3D_LightmapScale>` enum.
  131. .. rst-class:: classref-item-separator
  132. ----
  133. .. _enum_GeometryInstance3D_VisibilityRangeFadeMode:
  134. .. rst-class:: classref-enumeration
  135. enum **VisibilityRangeFadeMode**:
  136. .. _class_GeometryInstance3D_constant_VISIBILITY_RANGE_FADE_DISABLED:
  137. .. rst-class:: classref-enumeration-constant
  138. :ref:`VisibilityRangeFadeMode<enum_GeometryInstance3D_VisibilityRangeFadeMode>` **VISIBILITY_RANGE_FADE_DISABLED** = ``0``
  139. 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.
  140. .. _class_GeometryInstance3D_constant_VISIBILITY_RANGE_FADE_SELF:
  141. .. rst-class:: classref-enumeration-constant
  142. :ref:`VisibilityRangeFadeMode<enum_GeometryInstance3D_VisibilityRangeFadeMode>` **VISIBILITY_RANGE_FADE_SELF** = ``1``
  143. 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>`.
  144. .. _class_GeometryInstance3D_constant_VISIBILITY_RANGE_FADE_DEPENDENCIES:
  145. .. rst-class:: classref-enumeration-constant
  146. :ref:`VisibilityRangeFadeMode<enum_GeometryInstance3D_VisibilityRangeFadeMode>` **VISIBILITY_RANGE_FADE_DEPENDENCIES** = ``2``
  147. 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>`.
  148. .. rst-class:: classref-section-separator
  149. ----
  150. .. rst-class:: classref-descriptions-group
  151. Property Descriptions
  152. ---------------------
  153. .. _class_GeometryInstance3D_property_cast_shadow:
  154. .. rst-class:: classref-property
  155. :ref:`ShadowCastingSetting<enum_GeometryInstance3D_ShadowCastingSetting>` **cast_shadow** = ``1``
  156. .. rst-class:: classref-property-setget
  157. - void **set_cast_shadows_setting** **(** :ref:`ShadowCastingSetting<enum_GeometryInstance3D_ShadowCastingSetting>` value **)**
  158. - :ref:`ShadowCastingSetting<enum_GeometryInstance3D_ShadowCastingSetting>` **get_cast_shadows_setting** **(** **)**
  159. The selected shadow casting flag. See :ref:`ShadowCastingSetting<enum_GeometryInstance3D_ShadowCastingSetting>` for possible values.
  160. .. rst-class:: classref-item-separator
  161. ----
  162. .. _class_GeometryInstance3D_property_custom_aabb:
  163. .. rst-class:: classref-property
  164. :ref:`AABB<class_AABB>` **custom_aabb** = ``AABB(0, 0, 0, 0, 0, 0)``
  165. .. rst-class:: classref-property-setget
  166. - void **set_custom_aabb** **(** :ref:`AABB<class_AABB>` value **)**
  167. - :ref:`AABB<class_AABB>` **get_custom_aabb** **(** **)**
  168. 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 fine 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>`.
  169. .. rst-class:: classref-item-separator
  170. ----
  171. .. _class_GeometryInstance3D_property_extra_cull_margin:
  172. .. rst-class:: classref-property
  173. :ref:`float<class_float>` **extra_cull_margin** = ``0.0``
  174. .. rst-class:: classref-property-setget
  175. - void **set_extra_cull_margin** **(** :ref:`float<class_float>` value **)**
  176. - :ref:`float<class_float>` **get_extra_cull_margin** **(** **)**
  177. The extra distance added to the GeometryInstance3D's bounding box (:ref:`AABB<class_AABB>`) to increase its cull box.
  178. .. rst-class:: classref-item-separator
  179. ----
  180. .. _class_GeometryInstance3D_property_gi_lightmap_scale:
  181. .. rst-class:: classref-property
  182. :ref:`LightmapScale<enum_GeometryInstance3D_LightmapScale>` **gi_lightmap_scale** = ``0``
  183. .. rst-class:: classref-property-setget
  184. - void **set_lightmap_scale** **(** :ref:`LightmapScale<enum_GeometryInstance3D_LightmapScale>` value **)**
  185. - :ref:`LightmapScale<enum_GeometryInstance3D_LightmapScale>` **get_lightmap_scale** **(** **)**
  186. 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.
  187. .. rst-class:: classref-item-separator
  188. ----
  189. .. _class_GeometryInstance3D_property_gi_mode:
  190. .. rst-class:: classref-property
  191. :ref:`GIMode<enum_GeometryInstance3D_GIMode>` **gi_mode** = ``1``
  192. .. rst-class:: classref-property-setget
  193. - void **set_gi_mode** **(** :ref:`GIMode<enum_GeometryInstance3D_GIMode>` value **)**
  194. - :ref:`GIMode<enum_GeometryInstance3D_GIMode>` **get_gi_mode** **(** **)**
  195. 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).
  196. \ **Note:** Lights' bake mode will also affect the global illumination rendering. See :ref:`Light3D.light_bake_mode<class_Light3D_property_light_bake_mode>`.
  197. .. rst-class:: classref-item-separator
  198. ----
  199. .. _class_GeometryInstance3D_property_ignore_occlusion_culling:
  200. .. rst-class:: classref-property
  201. :ref:`bool<class_bool>` **ignore_occlusion_culling** = ``false``
  202. .. rst-class:: classref-property-setget
  203. - void **set_ignore_occlusion_culling** **(** :ref:`bool<class_bool>` value **)**
  204. - :ref:`bool<class_bool>` **is_ignoring_occlusion_culling** **(** **)**
  205. If ``true``, disables occlusion culling for this instance. Useful for gizmos that must be rendered even when occlusion culling is in use.
  206. \ **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)``.
  207. .. rst-class:: classref-item-separator
  208. ----
  209. .. _class_GeometryInstance3D_property_lod_bias:
  210. .. rst-class:: classref-property
  211. :ref:`float<class_float>` **lod_bias** = ``1.0``
  212. .. rst-class:: classref-property-setget
  213. - void **set_lod_bias** **(** :ref:`float<class_float>` value **)**
  214. - :ref:`float<class_float>` **get_lod_bias** **(** **)**
  215. 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.
  216. Useful for testing level of detail transitions in the editor.
  217. .. rst-class:: classref-item-separator
  218. ----
  219. .. _class_GeometryInstance3D_property_material_overlay:
  220. .. rst-class:: classref-property
  221. :ref:`Material<class_Material>` **material_overlay**
  222. .. rst-class:: classref-property-setget
  223. - void **set_material_overlay** **(** :ref:`Material<class_Material>` value **)**
  224. - :ref:`Material<class_Material>` **get_material_overlay** **(** **)**
  225. The material overlay for the whole geometry.
  226. If a material is assigned to this property, it will be rendered on top of any other active material for all the surfaces.
  227. .. rst-class:: classref-item-separator
  228. ----
  229. .. _class_GeometryInstance3D_property_material_override:
  230. .. rst-class:: classref-property
  231. :ref:`Material<class_Material>` **material_override**
  232. .. rst-class:: classref-property-setget
  233. - void **set_material_override** **(** :ref:`Material<class_Material>` value **)**
  234. - :ref:`Material<class_Material>` **get_material_override** **(** **)**
  235. The material override for the whole geometry.
  236. If a material is assigned to this property, it will be used instead of any material set in any material slot of the mesh.
  237. .. rst-class:: classref-item-separator
  238. ----
  239. .. _class_GeometryInstance3D_property_transparency:
  240. .. rst-class:: classref-property
  241. :ref:`float<class_float>` **transparency** = ``0.0``
  242. .. rst-class:: classref-property-setget
  243. - void **set_transparency** **(** :ref:`float<class_float>` value **)**
  244. - :ref:`float<class_float>` **get_transparency** **(** **)**
  245. 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.
  246. In spatial shaders, ``1.0 - transparency`` is set as the default value of the ``ALPHA`` built-in.
  247. \ **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.
  248. .. rst-class:: classref-item-separator
  249. ----
  250. .. _class_GeometryInstance3D_property_visibility_range_begin:
  251. .. rst-class:: classref-property
  252. :ref:`float<class_float>` **visibility_range_begin** = ``0.0``
  253. .. rst-class:: classref-property-setget
  254. - void **set_visibility_range_begin** **(** :ref:`float<class_float>` value **)**
  255. - :ref:`float<class_float>` **get_visibility_range_begin** **(** **)**
  256. 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.
  257. .. rst-class:: classref-item-separator
  258. ----
  259. .. _class_GeometryInstance3D_property_visibility_range_begin_margin:
  260. .. rst-class:: classref-property
  261. :ref:`float<class_float>` **visibility_range_begin_margin** = ``0.0``
  262. .. rst-class:: classref-property-setget
  263. - void **set_visibility_range_begin_margin** **(** :ref:`float<class_float>` value **)**
  264. - :ref:`float<class_float>` **get_visibility_range_begin_margin** **(** **)**
  265. 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.
  266. 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.
  267. .. rst-class:: classref-item-separator
  268. ----
  269. .. _class_GeometryInstance3D_property_visibility_range_end:
  270. .. rst-class:: classref-property
  271. :ref:`float<class_float>` **visibility_range_end** = ``0.0``
  272. .. rst-class:: classref-property-setget
  273. - void **set_visibility_range_end** **(** :ref:`float<class_float>` value **)**
  274. - :ref:`float<class_float>` **get_visibility_range_end** **(** **)**
  275. 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.
  276. .. rst-class:: classref-item-separator
  277. ----
  278. .. _class_GeometryInstance3D_property_visibility_range_end_margin:
  279. .. rst-class:: classref-property
  280. :ref:`float<class_float>` **visibility_range_end_margin** = ``0.0``
  281. .. rst-class:: classref-property-setget
  282. - void **set_visibility_range_end_margin** **(** :ref:`float<class_float>` value **)**
  283. - :ref:`float<class_float>` **get_visibility_range_end_margin** **(** **)**
  284. 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.
  285. 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.
  286. .. rst-class:: classref-item-separator
  287. ----
  288. .. _class_GeometryInstance3D_property_visibility_range_fade_mode:
  289. .. rst-class:: classref-property
  290. :ref:`VisibilityRangeFadeMode<enum_GeometryInstance3D_VisibilityRangeFadeMode>` **visibility_range_fade_mode** = ``0``
  291. .. rst-class:: classref-property-setget
  292. - void **set_visibility_range_fade_mode** **(** :ref:`VisibilityRangeFadeMode<enum_GeometryInstance3D_VisibilityRangeFadeMode>` value **)**
  293. - :ref:`VisibilityRangeFadeMode<enum_GeometryInstance3D_VisibilityRangeFadeMode>` **get_visibility_range_fade_mode** **(** **)**
  294. Controls which instances will be faded when approaching the limits of the visibility range. See :ref:`VisibilityRangeFadeMode<enum_GeometryInstance3D_VisibilityRangeFadeMode>` for possible values.
  295. .. rst-class:: classref-section-separator
  296. ----
  297. .. rst-class:: classref-descriptions-group
  298. Method Descriptions
  299. -------------------
  300. .. _class_GeometryInstance3D_method_get_instance_shader_parameter:
  301. .. rst-class:: classref-method
  302. :ref:`Variant<class_Variant>` **get_instance_shader_parameter** **(** :ref:`StringName<class_StringName>` name **)** |const|
  303. Get the value of a shader parameter as set on this instance.
  304. .. rst-class:: classref-item-separator
  305. ----
  306. .. _class_GeometryInstance3D_method_set_instance_shader_parameter:
  307. .. rst-class:: classref-method
  308. void **set_instance_shader_parameter** **(** :ref:`StringName<class_StringName>` name, :ref:`Variant<class_Variant>` value **)**
  309. 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>`.
  310. \ **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.
  311. \ **Note:** ``name`` is case-sensitive and must match the name of the uniform in the code exactly (not the capitalized name in the inspector).
  312. \ **Note:** Per-instance shader uniforms are currently only available in 3D, so there is no 2D equivalent of this method.
  313. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  314. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  315. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  316. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  317. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  318. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`