class_material.rst 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  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/Material.xml.
  6. .. _class_Material:
  7. Material
  8. ========
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`BaseMaterial3D<class_BaseMaterial3D>`, :ref:`CanvasItemMaterial<class_CanvasItemMaterial>`, :ref:`FogMaterial<class_FogMaterial>`, :ref:`PanoramaSkyMaterial<class_PanoramaSkyMaterial>`, :ref:`ParticleProcessMaterial<class_ParticleProcessMaterial>`, :ref:`PhysicalSkyMaterial<class_PhysicalSkyMaterial>`, :ref:`PlaceholderMaterial<class_PlaceholderMaterial>`, :ref:`ProceduralSkyMaterial<class_ProceduralSkyMaterial>`, :ref:`ShaderMaterial<class_ShaderMaterial>`
  11. Abstract base :ref:`Resource<class_Resource>` for coloring and shading geometry.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. Material is a base :ref:`Resource<class_Resource>` used for coloring and shading geometry. All materials inherit from it and almost all :ref:`VisualInstance3D<class_VisualInstance3D>` derived nodes carry a Material. A few flags and parameters are shared between all material types and are configured here.
  16. .. rst-class:: classref-introduction-group
  17. Tutorials
  18. ---------
  19. - `3D Material Testers Demo <https://godotengine.org/asset-library/asset/123>`__
  20. - `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
  21. .. rst-class:: classref-reftable-group
  22. Properties
  23. ----------
  24. .. table::
  25. :widths: auto
  26. +---------------------------------+-----------------------------------------------------------------+
  27. | :ref:`Material<class_Material>` | :ref:`next_pass<class_Material_property_next_pass>` |
  28. +---------------------------------+-----------------------------------------------------------------+
  29. | :ref:`int<class_int>` | :ref:`render_priority<class_Material_property_render_priority>` |
  30. +---------------------------------+-----------------------------------------------------------------+
  31. .. rst-class:: classref-reftable-group
  32. Methods
  33. -------
  34. .. table::
  35. :widths: auto
  36. +---------------------------------+---------------------------------------------------------------------------------------------------------------+
  37. | :ref:`bool<class_bool>` | :ref:`_can_do_next_pass<class_Material_method__can_do_next_pass>` **(** **)** |virtual| |const| |
  38. +---------------------------------+---------------------------------------------------------------------------------------------------------------+
  39. | :ref:`bool<class_bool>` | :ref:`_can_use_render_priority<class_Material_method__can_use_render_priority>` **(** **)** |virtual| |const| |
  40. +---------------------------------+---------------------------------------------------------------------------------------------------------------+
  41. | :ref:`Mode<enum_Shader_Mode>` | :ref:`_get_shader_mode<class_Material_method__get_shader_mode>` **(** **)** |virtual| |const| |
  42. +---------------------------------+---------------------------------------------------------------------------------------------------------------+
  43. | :ref:`RID<class_RID>` | :ref:`_get_shader_rid<class_Material_method__get_shader_rid>` **(** **)** |virtual| |const| |
  44. +---------------------------------+---------------------------------------------------------------------------------------------------------------+
  45. | :ref:`Resource<class_Resource>` | :ref:`create_placeholder<class_Material_method_create_placeholder>` **(** **)** |const| |
  46. +---------------------------------+---------------------------------------------------------------------------------------------------------------+
  47. | void | :ref:`inspect_native_shader_code<class_Material_method_inspect_native_shader_code>` **(** **)** |
  48. +---------------------------------+---------------------------------------------------------------------------------------------------------------+
  49. .. rst-class:: classref-section-separator
  50. ----
  51. .. rst-class:: classref-descriptions-group
  52. Constants
  53. ---------
  54. .. _class_Material_constant_RENDER_PRIORITY_MAX:
  55. .. rst-class:: classref-constant
  56. **RENDER_PRIORITY_MAX** = ``127``
  57. Maximum value for the :ref:`render_priority<class_Material_property_render_priority>` parameter.
  58. .. _class_Material_constant_RENDER_PRIORITY_MIN:
  59. .. rst-class:: classref-constant
  60. **RENDER_PRIORITY_MIN** = ``-128``
  61. Minimum value for the :ref:`render_priority<class_Material_property_render_priority>` parameter.
  62. .. rst-class:: classref-section-separator
  63. ----
  64. .. rst-class:: classref-descriptions-group
  65. Property Descriptions
  66. ---------------------
  67. .. _class_Material_property_next_pass:
  68. .. rst-class:: classref-property
  69. :ref:`Material<class_Material>` **next_pass**
  70. .. rst-class:: classref-property-setget
  71. - void **set_next_pass** **(** :ref:`Material<class_Material>` value **)**
  72. - :ref:`Material<class_Material>` **get_next_pass** **(** **)**
  73. Sets the **Material** to be used for the next pass. This renders the object again using a different material.
  74. \ **Note:** This only applies to :ref:`StandardMaterial3D<class_StandardMaterial3D>`\ s and :ref:`ShaderMaterial<class_ShaderMaterial>`\ s with type "Spatial".
  75. .. rst-class:: classref-item-separator
  76. ----
  77. .. _class_Material_property_render_priority:
  78. .. rst-class:: classref-property
  79. :ref:`int<class_int>` **render_priority**
  80. .. rst-class:: classref-property-setget
  81. - void **set_render_priority** **(** :ref:`int<class_int>` value **)**
  82. - :ref:`int<class_int>` **get_render_priority** **(** **)**
  83. Sets the render priority for transparent objects in 3D scenes. Higher priority objects will be sorted in front of lower priority objects.
  84. \ **Note:** This only applies to :ref:`StandardMaterial3D<class_StandardMaterial3D>`\ s and :ref:`ShaderMaterial<class_ShaderMaterial>`\ s with type "Spatial".
  85. \ **Note:** This only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority).
  86. .. rst-class:: classref-section-separator
  87. ----
  88. .. rst-class:: classref-descriptions-group
  89. Method Descriptions
  90. -------------------
  91. .. _class_Material_method__can_do_next_pass:
  92. .. rst-class:: classref-method
  93. :ref:`bool<class_bool>` **_can_do_next_pass** **(** **)** |virtual| |const|
  94. .. container:: contribute
  95. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  96. .. rst-class:: classref-item-separator
  97. ----
  98. .. _class_Material_method__can_use_render_priority:
  99. .. rst-class:: classref-method
  100. :ref:`bool<class_bool>` **_can_use_render_priority** **(** **)** |virtual| |const|
  101. .. container:: contribute
  102. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  103. .. rst-class:: classref-item-separator
  104. ----
  105. .. _class_Material_method__get_shader_mode:
  106. .. rst-class:: classref-method
  107. :ref:`Mode<enum_Shader_Mode>` **_get_shader_mode** **(** **)** |virtual| |const|
  108. .. container:: contribute
  109. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  110. .. rst-class:: classref-item-separator
  111. ----
  112. .. _class_Material_method__get_shader_rid:
  113. .. rst-class:: classref-method
  114. :ref:`RID<class_RID>` **_get_shader_rid** **(** **)** |virtual| |const|
  115. .. container:: contribute
  116. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  117. .. rst-class:: classref-item-separator
  118. ----
  119. .. _class_Material_method_create_placeholder:
  120. .. rst-class:: classref-method
  121. :ref:`Resource<class_Resource>` **create_placeholder** **(** **)** |const|
  122. Creates a placeholder version of this resource (:ref:`PlaceholderMaterial<class_PlaceholderMaterial>`).
  123. .. rst-class:: classref-item-separator
  124. ----
  125. .. _class_Material_method_inspect_native_shader_code:
  126. .. rst-class:: classref-method
  127. void **inspect_native_shader_code** **(** **)**
  128. .. container:: contribute
  129. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  130. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  131. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  132. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  133. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  134. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  135. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`