class_material.rst 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the Material.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_Material:
  6. Material
  7. ========
  8. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  9. **Inherited By:** :ref:`BaseMaterial3D<class_BaseMaterial3D>`, :ref:`CanvasItemMaterial<class_CanvasItemMaterial>`, :ref:`FogMaterial<class_FogMaterial>`, :ref:`PanoramaSkyMaterial<class_PanoramaSkyMaterial>`, :ref:`ParticlesMaterial<class_ParticlesMaterial>`, :ref:`PhysicalSkyMaterial<class_PhysicalSkyMaterial>`, :ref:`ProceduralSkyMaterial<class_ProceduralSkyMaterial>`, :ref:`ShaderMaterial<class_ShaderMaterial>`
  10. Abstract base :ref:`Resource<class_Resource>` for coloring and shading geometry.
  11. Description
  12. -----------
  13. 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.
  14. Tutorials
  15. ---------
  16. - `3D Material Testers Demo <https://godotengine.org/asset-library/asset/123>`__
  17. - `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
  18. Properties
  19. ----------
  20. +---------------------------------+-----------------------------------------------------------------+
  21. | :ref:`Material<class_Material>` | :ref:`next_pass<class_Material_property_next_pass>` |
  22. +---------------------------------+-----------------------------------------------------------------+
  23. | :ref:`int<class_int>` | :ref:`render_priority<class_Material_property_render_priority>` |
  24. +---------------------------------+-----------------------------------------------------------------+
  25. Methods
  26. -------
  27. +-------------------------------+---------------------------------------------------------------------------------------------------------------+
  28. | :ref:`bool<class_bool>` | :ref:`_can_do_next_pass<class_Material_method__can_do_next_pass>` **(** **)** |virtual| |const| |
  29. +-------------------------------+---------------------------------------------------------------------------------------------------------------+
  30. | :ref:`bool<class_bool>` | :ref:`_can_use_render_priority<class_Material_method__can_use_render_priority>` **(** **)** |virtual| |const| |
  31. +-------------------------------+---------------------------------------------------------------------------------------------------------------+
  32. | :ref:`Mode<enum_Shader_Mode>` | :ref:`_get_shader_mode<class_Material_method__get_shader_mode>` **(** **)** |virtual| |const| |
  33. +-------------------------------+---------------------------------------------------------------------------------------------------------------+
  34. | :ref:`RID<class_RID>` | :ref:`_get_shader_rid<class_Material_method__get_shader_rid>` **(** **)** |virtual| |const| |
  35. +-------------------------------+---------------------------------------------------------------------------------------------------------------+
  36. | void | :ref:`inspect_native_shader_code<class_Material_method_inspect_native_shader_code>` **(** **)** |
  37. +-------------------------------+---------------------------------------------------------------------------------------------------------------+
  38. Constants
  39. ---------
  40. .. _class_Material_constant_RENDER_PRIORITY_MAX:
  41. .. _class_Material_constant_RENDER_PRIORITY_MIN:
  42. - **RENDER_PRIORITY_MAX** = **127** --- Maximum value for the :ref:`render_priority<class_Material_property_render_priority>` parameter.
  43. - **RENDER_PRIORITY_MIN** = **-128** --- Minimum value for the :ref:`render_priority<class_Material_property_render_priority>` parameter.
  44. Property Descriptions
  45. ---------------------
  46. .. _class_Material_property_next_pass:
  47. - :ref:`Material<class_Material>` **next_pass**
  48. +----------+----------------------+
  49. | *Setter* | set_next_pass(value) |
  50. +----------+----------------------+
  51. | *Getter* | get_next_pass() |
  52. +----------+----------------------+
  53. Sets the ``Material`` to be used for the next pass. This renders the object again using a different material.
  54. \ **Note:** This only applies to :ref:`StandardMaterial3D<class_StandardMaterial3D>`\ s and :ref:`ShaderMaterial<class_ShaderMaterial>`\ s with type "Spatial".
  55. ----
  56. .. _class_Material_property_render_priority:
  57. - :ref:`int<class_int>` **render_priority**
  58. +----------+----------------------------+
  59. | *Setter* | set_render_priority(value) |
  60. +----------+----------------------------+
  61. | *Getter* | get_render_priority() |
  62. +----------+----------------------------+
  63. Sets the render priority for transparent objects in 3D scenes. Higher priority objects will be sorted in front of lower priority objects.
  64. \ **Note:** This only applies to :ref:`StandardMaterial3D<class_StandardMaterial3D>`\ s and :ref:`ShaderMaterial<class_ShaderMaterial>`\ s with type "Spatial".
  65. \ **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).
  66. Method Descriptions
  67. -------------------
  68. .. _class_Material_method__can_do_next_pass:
  69. - :ref:`bool<class_bool>` **_can_do_next_pass** **(** **)** |virtual| |const|
  70. ----
  71. .. _class_Material_method__can_use_render_priority:
  72. - :ref:`bool<class_bool>` **_can_use_render_priority** **(** **)** |virtual| |const|
  73. ----
  74. .. _class_Material_method__get_shader_mode:
  75. - :ref:`Mode<enum_Shader_Mode>` **_get_shader_mode** **(** **)** |virtual| |const|
  76. ----
  77. .. _class_Material_method__get_shader_rid:
  78. - :ref:`RID<class_RID>` **_get_shader_rid** **(** **)** |virtual| |const|
  79. ----
  80. .. _class_Material_method_inspect_native_shader_code:
  81. - void **inspect_native_shader_code** **(** **)**
  82. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  83. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  84. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  85. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  86. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  87. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`