class_decal.rst 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501
  1. :github_url: hide
  2. .. meta::
  3. :keywords: stain
  4. .. DO NOT EDIT THIS FILE!!!
  5. .. Generated automatically from Godot engine sources.
  6. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  7. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/Decal.xml.
  8. .. _class_Decal:
  9. Decal
  10. =====
  11. **Inherits:** :ref:`VisualInstance3D<class_VisualInstance3D>` **<** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  12. Node that projects a texture onto a :ref:`MeshInstance3D<class_MeshInstance3D>`.
  13. .. rst-class:: classref-introduction-group
  14. Description
  15. -----------
  16. **Decal**\ s are used to project a texture onto a :ref:`Mesh<class_Mesh>` in the scene. Use Decals to add detail to a scene without affecting the underlying :ref:`Mesh<class_Mesh>`. They are often used to add weathering to building, add dirt or mud to the ground, or add variety to props. Decals can be moved at any time, making them suitable for things like blob shadows or laser sight dots.
  17. They are made of an :ref:`AABB<class_AABB>` and a group of :ref:`Texture2D<class_Texture2D>`\ s specifying :ref:`Color<class_Color>`, normal, ORM (ambient occlusion, roughness, metallic), and emission. Decals are projected within their :ref:`AABB<class_AABB>` so altering the orientation of the Decal affects the direction in which they are projected. By default, Decals are projected down (i.e. from positive Y to negative Y).
  18. The :ref:`Texture2D<class_Texture2D>`\ s associated with the Decal are automatically stored in a texture atlas which is used for drawing the decals so all decals can be drawn at once. Godot uses clustered decals, meaning they are stored in cluster data and drawn when the mesh is drawn, they are not drawn as a post-processing effect after.
  19. \ **Note:** Decals cannot affect an underlying material's transparency, regardless of its transparency mode (alpha blend, alpha scissor, alpha hash, opaque pre-pass). This means translucent or transparent areas of a material will remain translucent or transparent even if an opaque decal is applied on them.
  20. \ **Note:** Decals are only supported in the Forward+ and Mobile rendering methods, not Compatibility. When using the Mobile rendering method, only 8 decals can be displayed on each mesh resource. Attempting to display more than 8 decals on a single mesh resource will result in decals flickering in and out as the camera moves.
  21. \ **Note:** When using the Mobile rendering method, decals will only correctly affect meshes whose visibility AABB intersects with the decal's AABB. If using a shader to deform the mesh in a way that makes it go outside its AABB, :ref:`GeometryInstance3D.extra_cull_margin<class_GeometryInstance3D_property_extra_cull_margin>` must be increased on the mesh. Otherwise, the decal may not be visible on the mesh.
  22. .. rst-class:: classref-reftable-group
  23. Properties
  24. ----------
  25. .. table::
  26. :widths: auto
  27. +-----------------------------------+--------------------------------------------------------------------------+-----------------------+
  28. | :ref:`float<class_float>` | :ref:`albedo_mix<class_Decal_property_albedo_mix>` | ``1.0`` |
  29. +-----------------------------------+--------------------------------------------------------------------------+-----------------------+
  30. | :ref:`int<class_int>` | :ref:`cull_mask<class_Decal_property_cull_mask>` | ``1048575`` |
  31. +-----------------------------------+--------------------------------------------------------------------------+-----------------------+
  32. | :ref:`float<class_float>` | :ref:`distance_fade_begin<class_Decal_property_distance_fade_begin>` | ``40.0`` |
  33. +-----------------------------------+--------------------------------------------------------------------------+-----------------------+
  34. | :ref:`bool<class_bool>` | :ref:`distance_fade_enabled<class_Decal_property_distance_fade_enabled>` | ``false`` |
  35. +-----------------------------------+--------------------------------------------------------------------------+-----------------------+
  36. | :ref:`float<class_float>` | :ref:`distance_fade_length<class_Decal_property_distance_fade_length>` | ``10.0`` |
  37. +-----------------------------------+--------------------------------------------------------------------------+-----------------------+
  38. | :ref:`float<class_float>` | :ref:`emission_energy<class_Decal_property_emission_energy>` | ``1.0`` |
  39. +-----------------------------------+--------------------------------------------------------------------------+-----------------------+
  40. | :ref:`float<class_float>` | :ref:`lower_fade<class_Decal_property_lower_fade>` | ``0.3`` |
  41. +-----------------------------------+--------------------------------------------------------------------------+-----------------------+
  42. | :ref:`Color<class_Color>` | :ref:`modulate<class_Decal_property_modulate>` | ``Color(1, 1, 1, 1)`` |
  43. +-----------------------------------+--------------------------------------------------------------------------+-----------------------+
  44. | :ref:`float<class_float>` | :ref:`normal_fade<class_Decal_property_normal_fade>` | ``0.0`` |
  45. +-----------------------------------+--------------------------------------------------------------------------+-----------------------+
  46. | :ref:`Vector3<class_Vector3>` | :ref:`size<class_Decal_property_size>` | ``Vector3(2, 2, 2)`` |
  47. +-----------------------------------+--------------------------------------------------------------------------+-----------------------+
  48. | :ref:`Texture2D<class_Texture2D>` | :ref:`texture_albedo<class_Decal_property_texture_albedo>` | |
  49. +-----------------------------------+--------------------------------------------------------------------------+-----------------------+
  50. | :ref:`Texture2D<class_Texture2D>` | :ref:`texture_emission<class_Decal_property_texture_emission>` | |
  51. +-----------------------------------+--------------------------------------------------------------------------+-----------------------+
  52. | :ref:`Texture2D<class_Texture2D>` | :ref:`texture_normal<class_Decal_property_texture_normal>` | |
  53. +-----------------------------------+--------------------------------------------------------------------------+-----------------------+
  54. | :ref:`Texture2D<class_Texture2D>` | :ref:`texture_orm<class_Decal_property_texture_orm>` | |
  55. +-----------------------------------+--------------------------------------------------------------------------+-----------------------+
  56. | :ref:`float<class_float>` | :ref:`upper_fade<class_Decal_property_upper_fade>` | ``0.3`` |
  57. +-----------------------------------+--------------------------------------------------------------------------+-----------------------+
  58. .. rst-class:: classref-reftable-group
  59. Methods
  60. -------
  61. .. table::
  62. :widths: auto
  63. +-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`Texture2D<class_Texture2D>` | :ref:`get_texture<class_Decal_method_get_texture>`\ (\ type\: :ref:`DecalTexture<enum_Decal_DecalTexture>`\ ) |const| |
  65. +-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | |void| | :ref:`set_texture<class_Decal_method_set_texture>`\ (\ type\: :ref:`DecalTexture<enum_Decal_DecalTexture>`, texture\: :ref:`Texture2D<class_Texture2D>`\ ) |
  67. +-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. .. rst-class:: classref-section-separator
  69. ----
  70. .. rst-class:: classref-descriptions-group
  71. Enumerations
  72. ------------
  73. .. _enum_Decal_DecalTexture:
  74. .. rst-class:: classref-enumeration
  75. enum **DecalTexture**: :ref:`🔗<enum_Decal_DecalTexture>`
  76. .. _class_Decal_constant_TEXTURE_ALBEDO:
  77. .. rst-class:: classref-enumeration-constant
  78. :ref:`DecalTexture<enum_Decal_DecalTexture>` **TEXTURE_ALBEDO** = ``0``
  79. :ref:`Texture2D<class_Texture2D>` corresponding to :ref:`texture_albedo<class_Decal_property_texture_albedo>`.
  80. .. _class_Decal_constant_TEXTURE_NORMAL:
  81. .. rst-class:: classref-enumeration-constant
  82. :ref:`DecalTexture<enum_Decal_DecalTexture>` **TEXTURE_NORMAL** = ``1``
  83. :ref:`Texture2D<class_Texture2D>` corresponding to :ref:`texture_normal<class_Decal_property_texture_normal>`.
  84. .. _class_Decal_constant_TEXTURE_ORM:
  85. .. rst-class:: classref-enumeration-constant
  86. :ref:`DecalTexture<enum_Decal_DecalTexture>` **TEXTURE_ORM** = ``2``
  87. :ref:`Texture2D<class_Texture2D>` corresponding to :ref:`texture_orm<class_Decal_property_texture_orm>`.
  88. .. _class_Decal_constant_TEXTURE_EMISSION:
  89. .. rst-class:: classref-enumeration-constant
  90. :ref:`DecalTexture<enum_Decal_DecalTexture>` **TEXTURE_EMISSION** = ``3``
  91. :ref:`Texture2D<class_Texture2D>` corresponding to :ref:`texture_emission<class_Decal_property_texture_emission>`.
  92. .. _class_Decal_constant_TEXTURE_MAX:
  93. .. rst-class:: classref-enumeration-constant
  94. :ref:`DecalTexture<enum_Decal_DecalTexture>` **TEXTURE_MAX** = ``4``
  95. Max size of :ref:`DecalTexture<enum_Decal_DecalTexture>` enum.
  96. .. rst-class:: classref-section-separator
  97. ----
  98. .. rst-class:: classref-descriptions-group
  99. Property Descriptions
  100. ---------------------
  101. .. _class_Decal_property_albedo_mix:
  102. .. rst-class:: classref-property
  103. :ref:`float<class_float>` **albedo_mix** = ``1.0`` :ref:`🔗<class_Decal_property_albedo_mix>`
  104. .. rst-class:: classref-property-setget
  105. - |void| **set_albedo_mix**\ (\ value\: :ref:`float<class_float>`\ )
  106. - :ref:`float<class_float>` **get_albedo_mix**\ (\ )
  107. Blends the albedo :ref:`Color<class_Color>` of the decal with albedo :ref:`Color<class_Color>` of the underlying mesh. This can be set to ``0.0`` to create a decal that only affects normal or ORM. In this case, an albedo texture is still required as its alpha channel will determine where the normal and ORM will be overridden. See also :ref:`modulate<class_Decal_property_modulate>`.
  108. .. rst-class:: classref-item-separator
  109. ----
  110. .. _class_Decal_property_cull_mask:
  111. .. rst-class:: classref-property
  112. :ref:`int<class_int>` **cull_mask** = ``1048575`` :ref:`🔗<class_Decal_property_cull_mask>`
  113. .. rst-class:: classref-property-setget
  114. - |void| **set_cull_mask**\ (\ value\: :ref:`int<class_int>`\ )
  115. - :ref:`int<class_int>` **get_cull_mask**\ (\ )
  116. Specifies which :ref:`VisualInstance3D.layers<class_VisualInstance3D_property_layers>` this decal will project on. By default, Decals affect all layers. This is used so you can specify which types of objects receive the Decal and which do not. This is especially useful so you can ensure that dynamic objects don't accidentally receive a Decal intended for the terrain under them.
  117. .. rst-class:: classref-item-separator
  118. ----
  119. .. _class_Decal_property_distance_fade_begin:
  120. .. rst-class:: classref-property
  121. :ref:`float<class_float>` **distance_fade_begin** = ``40.0`` :ref:`🔗<class_Decal_property_distance_fade_begin>`
  122. .. rst-class:: classref-property-setget
  123. - |void| **set_distance_fade_begin**\ (\ value\: :ref:`float<class_float>`\ )
  124. - :ref:`float<class_float>` **get_distance_fade_begin**\ (\ )
  125. The distance from the camera at which the Decal begins to fade away (in 3D units).
  126. .. rst-class:: classref-item-separator
  127. ----
  128. .. _class_Decal_property_distance_fade_enabled:
  129. .. rst-class:: classref-property
  130. :ref:`bool<class_bool>` **distance_fade_enabled** = ``false`` :ref:`🔗<class_Decal_property_distance_fade_enabled>`
  131. .. rst-class:: classref-property-setget
  132. - |void| **set_enable_distance_fade**\ (\ value\: :ref:`bool<class_bool>`\ )
  133. - :ref:`bool<class_bool>` **is_distance_fade_enabled**\ (\ )
  134. If ``true``, decals will smoothly fade away when far from the active :ref:`Camera3D<class_Camera3D>` starting at :ref:`distance_fade_begin<class_Decal_property_distance_fade_begin>`. The Decal will fade out over :ref:`distance_fade_begin<class_Decal_property_distance_fade_begin>` + :ref:`distance_fade_length<class_Decal_property_distance_fade_length>`, after which it will be culled and not sent to the shader at all. Use this to reduce the number of active Decals in a scene and thus improve performance.
  135. .. rst-class:: classref-item-separator
  136. ----
  137. .. _class_Decal_property_distance_fade_length:
  138. .. rst-class:: classref-property
  139. :ref:`float<class_float>` **distance_fade_length** = ``10.0`` :ref:`🔗<class_Decal_property_distance_fade_length>`
  140. .. rst-class:: classref-property-setget
  141. - |void| **set_distance_fade_length**\ (\ value\: :ref:`float<class_float>`\ )
  142. - :ref:`float<class_float>` **get_distance_fade_length**\ (\ )
  143. The distance over which the Decal fades (in 3D units). The Decal becomes slowly more transparent over this distance and is completely invisible at the end. Higher values result in a smoother fade-out transition, which is more suited when the camera moves fast.
  144. .. rst-class:: classref-item-separator
  145. ----
  146. .. _class_Decal_property_emission_energy:
  147. .. rst-class:: classref-property
  148. :ref:`float<class_float>` **emission_energy** = ``1.0`` :ref:`🔗<class_Decal_property_emission_energy>`
  149. .. rst-class:: classref-property-setget
  150. - |void| **set_emission_energy**\ (\ value\: :ref:`float<class_float>`\ )
  151. - :ref:`float<class_float>` **get_emission_energy**\ (\ )
  152. Energy multiplier for the emission texture. This will make the decal emit light at a higher or lower intensity, independently of the albedo color. See also :ref:`modulate<class_Decal_property_modulate>`.
  153. .. rst-class:: classref-item-separator
  154. ----
  155. .. _class_Decal_property_lower_fade:
  156. .. rst-class:: classref-property
  157. :ref:`float<class_float>` **lower_fade** = ``0.3`` :ref:`🔗<class_Decal_property_lower_fade>`
  158. .. rst-class:: classref-property-setget
  159. - |void| **set_lower_fade**\ (\ value\: :ref:`float<class_float>`\ )
  160. - :ref:`float<class_float>` **get_lower_fade**\ (\ )
  161. Sets the curve over which the decal will fade as the surface gets further from the center of the :ref:`AABB<class_AABB>`. Only positive values are valid (negative values will be clamped to ``0.0``). See also :ref:`upper_fade<class_Decal_property_upper_fade>`.
  162. .. rst-class:: classref-item-separator
  163. ----
  164. .. _class_Decal_property_modulate:
  165. .. rst-class:: classref-property
  166. :ref:`Color<class_Color>` **modulate** = ``Color(1, 1, 1, 1)`` :ref:`🔗<class_Decal_property_modulate>`
  167. .. rst-class:: classref-property-setget
  168. - |void| **set_modulate**\ (\ value\: :ref:`Color<class_Color>`\ )
  169. - :ref:`Color<class_Color>` **get_modulate**\ (\ )
  170. Changes the :ref:`Color<class_Color>` of the Decal by multiplying the albedo and emission colors with this value. The alpha component is only taken into account when multiplying the albedo color, not the emission color. See also :ref:`emission_energy<class_Decal_property_emission_energy>` and :ref:`albedo_mix<class_Decal_property_albedo_mix>` to change the emission and albedo intensity independently of each other.
  171. .. rst-class:: classref-item-separator
  172. ----
  173. .. _class_Decal_property_normal_fade:
  174. .. rst-class:: classref-property
  175. :ref:`float<class_float>` **normal_fade** = ``0.0`` :ref:`🔗<class_Decal_property_normal_fade>`
  176. .. rst-class:: classref-property-setget
  177. - |void| **set_normal_fade**\ (\ value\: :ref:`float<class_float>`\ )
  178. - :ref:`float<class_float>` **get_normal_fade**\ (\ )
  179. Fades the Decal if the angle between the Decal's :ref:`AABB<class_AABB>` and the target surface becomes too large. A value of ``0`` projects the Decal regardless of angle, a value of ``1`` limits the Decal to surfaces that are nearly perpendicular.
  180. \ **Note:** Setting :ref:`normal_fade<class_Decal_property_normal_fade>` to a value greater than ``0.0`` has a small performance cost due to the added normal angle computations.
  181. .. rst-class:: classref-item-separator
  182. ----
  183. .. _class_Decal_property_size:
  184. .. rst-class:: classref-property
  185. :ref:`Vector3<class_Vector3>` **size** = ``Vector3(2, 2, 2)`` :ref:`🔗<class_Decal_property_size>`
  186. .. rst-class:: classref-property-setget
  187. - |void| **set_size**\ (\ value\: :ref:`Vector3<class_Vector3>`\ )
  188. - :ref:`Vector3<class_Vector3>` **get_size**\ (\ )
  189. Sets the size of the :ref:`AABB<class_AABB>` used by the decal. All dimensions must be set to a value greater than zero (they will be clamped to ``0.001`` if this is not the case). The AABB goes from ``-size/2`` to ``size/2``.
  190. \ **Note:** To improve culling efficiency of "hard surface" decals, set their :ref:`upper_fade<class_Decal_property_upper_fade>` and :ref:`lower_fade<class_Decal_property_lower_fade>` to ``0.0`` and set the Y component of the :ref:`size<class_Decal_property_size>` as low as possible. This will reduce the decals' AABB size without affecting their appearance.
  191. .. rst-class:: classref-item-separator
  192. ----
  193. .. _class_Decal_property_texture_albedo:
  194. .. rst-class:: classref-property
  195. :ref:`Texture2D<class_Texture2D>` **texture_albedo** :ref:`🔗<class_Decal_property_texture_albedo>`
  196. .. rst-class:: classref-property-setget
  197. - |void| **set_texture**\ (\ type\: :ref:`DecalTexture<enum_Decal_DecalTexture>`, texture\: :ref:`Texture2D<class_Texture2D>`\ )
  198. - :ref:`Texture2D<class_Texture2D>` **get_texture**\ (\ type\: :ref:`DecalTexture<enum_Decal_DecalTexture>`\ ) |const|
  199. :ref:`Texture2D<class_Texture2D>` with the base :ref:`Color<class_Color>` of the Decal. Either this or the :ref:`texture_emission<class_Decal_property_texture_emission>` must be set for the Decal to be visible. Use the alpha channel like a mask to smoothly blend the edges of the decal with the underlying object.
  200. \ **Note:** Unlike :ref:`BaseMaterial3D<class_BaseMaterial3D>` whose filter mode can be adjusted on a per-material basis, the filter mode for **Decal** textures is set globally with :ref:`ProjectSettings.rendering/textures/decals/filter<class_ProjectSettings_property_rendering/textures/decals/filter>`.
  201. .. rst-class:: classref-item-separator
  202. ----
  203. .. _class_Decal_property_texture_emission:
  204. .. rst-class:: classref-property
  205. :ref:`Texture2D<class_Texture2D>` **texture_emission** :ref:`🔗<class_Decal_property_texture_emission>`
  206. .. rst-class:: classref-property-setget
  207. - |void| **set_texture**\ (\ type\: :ref:`DecalTexture<enum_Decal_DecalTexture>`, texture\: :ref:`Texture2D<class_Texture2D>`\ )
  208. - :ref:`Texture2D<class_Texture2D>` **get_texture**\ (\ type\: :ref:`DecalTexture<enum_Decal_DecalTexture>`\ ) |const|
  209. :ref:`Texture2D<class_Texture2D>` with the emission :ref:`Color<class_Color>` of the Decal. Either this or the :ref:`texture_albedo<class_Decal_property_texture_albedo>` must be set for the Decal to be visible. Use the alpha channel like a mask to smoothly blend the edges of the decal with the underlying object.
  210. \ **Note:** Unlike :ref:`BaseMaterial3D<class_BaseMaterial3D>` whose filter mode can be adjusted on a per-material basis, the filter mode for **Decal** textures is set globally with :ref:`ProjectSettings.rendering/textures/decals/filter<class_ProjectSettings_property_rendering/textures/decals/filter>`.
  211. .. rst-class:: classref-item-separator
  212. ----
  213. .. _class_Decal_property_texture_normal:
  214. .. rst-class:: classref-property
  215. :ref:`Texture2D<class_Texture2D>` **texture_normal** :ref:`🔗<class_Decal_property_texture_normal>`
  216. .. rst-class:: classref-property-setget
  217. - |void| **set_texture**\ (\ type\: :ref:`DecalTexture<enum_Decal_DecalTexture>`, texture\: :ref:`Texture2D<class_Texture2D>`\ )
  218. - :ref:`Texture2D<class_Texture2D>` **get_texture**\ (\ type\: :ref:`DecalTexture<enum_Decal_DecalTexture>`\ ) |const|
  219. :ref:`Texture2D<class_Texture2D>` with the per-pixel normal map for the decal. Use this to add extra detail to decals.
  220. \ **Note:** Unlike :ref:`BaseMaterial3D<class_BaseMaterial3D>` whose filter mode can be adjusted on a per-material basis, the filter mode for **Decal** textures is set globally with :ref:`ProjectSettings.rendering/textures/decals/filter<class_ProjectSettings_property_rendering/textures/decals/filter>`.
  221. \ **Note:** Setting this texture alone will not result in a visible decal, as :ref:`texture_albedo<class_Decal_property_texture_albedo>` must also be set. To create a normal-only decal, load an albedo texture into :ref:`texture_albedo<class_Decal_property_texture_albedo>` and set :ref:`albedo_mix<class_Decal_property_albedo_mix>` to ``0.0``. The albedo texture's alpha channel will be used to determine where the underlying surface's normal map should be overridden (and its intensity).
  222. .. rst-class:: classref-item-separator
  223. ----
  224. .. _class_Decal_property_texture_orm:
  225. .. rst-class:: classref-property
  226. :ref:`Texture2D<class_Texture2D>` **texture_orm** :ref:`🔗<class_Decal_property_texture_orm>`
  227. .. rst-class:: classref-property-setget
  228. - |void| **set_texture**\ (\ type\: :ref:`DecalTexture<enum_Decal_DecalTexture>`, texture\: :ref:`Texture2D<class_Texture2D>`\ )
  229. - :ref:`Texture2D<class_Texture2D>` **get_texture**\ (\ type\: :ref:`DecalTexture<enum_Decal_DecalTexture>`\ ) |const|
  230. :ref:`Texture2D<class_Texture2D>` storing ambient occlusion, roughness, and metallic for the decal. Use this to add extra detail to decals.
  231. \ **Note:** Unlike :ref:`BaseMaterial3D<class_BaseMaterial3D>` whose filter mode can be adjusted on a per-material basis, the filter mode for **Decal** textures is set globally with :ref:`ProjectSettings.rendering/textures/decals/filter<class_ProjectSettings_property_rendering/textures/decals/filter>`.
  232. \ **Note:** Setting this texture alone will not result in a visible decal, as :ref:`texture_albedo<class_Decal_property_texture_albedo>` must also be set. To create an ORM-only decal, load an albedo texture into :ref:`texture_albedo<class_Decal_property_texture_albedo>` and set :ref:`albedo_mix<class_Decal_property_albedo_mix>` to ``0.0``. The albedo texture's alpha channel will be used to determine where the underlying surface's ORM map should be overridden (and its intensity).
  233. .. rst-class:: classref-item-separator
  234. ----
  235. .. _class_Decal_property_upper_fade:
  236. .. rst-class:: classref-property
  237. :ref:`float<class_float>` **upper_fade** = ``0.3`` :ref:`🔗<class_Decal_property_upper_fade>`
  238. .. rst-class:: classref-property-setget
  239. - |void| **set_upper_fade**\ (\ value\: :ref:`float<class_float>`\ )
  240. - :ref:`float<class_float>` **get_upper_fade**\ (\ )
  241. Sets the curve over which the decal will fade as the surface gets further from the center of the :ref:`AABB<class_AABB>`. Only positive values are valid (negative values will be clamped to ``0.0``). See also :ref:`lower_fade<class_Decal_property_lower_fade>`.
  242. .. rst-class:: classref-section-separator
  243. ----
  244. .. rst-class:: classref-descriptions-group
  245. Method Descriptions
  246. -------------------
  247. .. _class_Decal_method_get_texture:
  248. .. rst-class:: classref-method
  249. :ref:`Texture2D<class_Texture2D>` **get_texture**\ (\ type\: :ref:`DecalTexture<enum_Decal_DecalTexture>`\ ) |const| :ref:`🔗<class_Decal_method_get_texture>`
  250. Returns the :ref:`Texture2D<class_Texture2D>` associated with the specified :ref:`DecalTexture<enum_Decal_DecalTexture>`. This is a convenience method, in most cases you should access the texture directly.
  251. For example, instead of ``albedo_tex = $Decal.get_texture(Decal.TEXTURE_ALBEDO)``, use ``albedo_tex = $Decal.texture_albedo``.
  252. One case where this is better than accessing the texture directly is when you want to copy one Decal's textures to another. For example:
  253. .. tabs::
  254. .. code-tab:: gdscript
  255. for i in Decal.TEXTURE_MAX:
  256. $NewDecal.set_texture(i, $OldDecal.get_texture(i))
  257. .. code-tab:: csharp
  258. for (int i = 0; i < (int)Decal.DecalTexture.Max; i++)
  259. {
  260. GetNode<Decal>("NewDecal").SetTexture(i, GetNode<Decal>("OldDecal").GetTexture(i));
  261. }
  262. .. rst-class:: classref-item-separator
  263. ----
  264. .. _class_Decal_method_set_texture:
  265. .. rst-class:: classref-method
  266. |void| **set_texture**\ (\ type\: :ref:`DecalTexture<enum_Decal_DecalTexture>`, texture\: :ref:`Texture2D<class_Texture2D>`\ ) :ref:`🔗<class_Decal_method_set_texture>`
  267. Sets the :ref:`Texture2D<class_Texture2D>` associated with the specified :ref:`DecalTexture<enum_Decal_DecalTexture>`. This is a convenience method, in most cases you should access the texture directly.
  268. For example, instead of ``$Decal.set_texture(Decal.TEXTURE_ALBEDO, albedo_tex)``, use ``$Decal.texture_albedo = albedo_tex``.
  269. One case where this is better than accessing the texture directly is when you want to copy one Decal's textures to another. For example:
  270. .. tabs::
  271. .. code-tab:: gdscript
  272. for i in Decal.TEXTURE_MAX:
  273. $NewDecal.set_texture(i, $OldDecal.get_texture(i))
  274. .. code-tab:: csharp
  275. for (int i = 0; i < (int)Decal.DecalTexture.Max; i++)
  276. {
  277. GetNode<Decal>("NewDecal").SetTexture(i, GetNode<Decal>("OldDecal").GetTexture(i));
  278. }
  279. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  280. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  281. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  282. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  283. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  284. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  285. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  286. .. |void| replace:: :abbr:`void (No return value.)`