class_material.rst 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/Material.xml.
  6. .. _class_Material:
  7. Material
  8. ========
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`CanvasItemMaterial<class_CanvasItemMaterial>`, :ref:`Material3D<class_Material3D>`, :ref:`ParticlesMaterial<class_ParticlesMaterial>`, :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:`VisualInstance<class_VisualInstance>` 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>` | ``0`` |
  30. +---------------------------------+-----------------------------------------------------------------+-------+
  31. .. rst-class:: classref-section-separator
  32. ----
  33. .. rst-class:: classref-descriptions-group
  34. Constants
  35. ---------
  36. .. _class_Material_constant_RENDER_PRIORITY_MAX:
  37. .. rst-class:: classref-constant
  38. **RENDER_PRIORITY_MAX** = ``127``
  39. Maximum value for the :ref:`render_priority<class_Material_property_render_priority>` parameter.
  40. .. _class_Material_constant_RENDER_PRIORITY_MIN:
  41. .. rst-class:: classref-constant
  42. **RENDER_PRIORITY_MIN** = ``-128``
  43. Minimum value for the :ref:`render_priority<class_Material_property_render_priority>` parameter.
  44. .. rst-class:: classref-section-separator
  45. ----
  46. .. rst-class:: classref-descriptions-group
  47. Property Descriptions
  48. ---------------------
  49. .. _class_Material_property_next_pass:
  50. .. rst-class:: classref-property
  51. :ref:`Material<class_Material>` **next_pass**
  52. .. rst-class:: classref-property-setget
  53. - void **set_next_pass** **(** :ref:`Material<class_Material>` value **)**
  54. - :ref:`Material<class_Material>` **get_next_pass** **(** **)**
  55. Sets the **Material** to be used for the next pass. This renders the object again using a different material.
  56. \ **Note:** This only applies to :ref:`SpatialMaterial<class_SpatialMaterial>`\ s and :ref:`ShaderMaterial<class_ShaderMaterial>`\ s with type "Spatial".
  57. .. rst-class:: classref-item-separator
  58. ----
  59. .. _class_Material_property_render_priority:
  60. .. rst-class:: classref-property
  61. :ref:`int<class_int>` **render_priority** = ``0``
  62. .. rst-class:: classref-property-setget
  63. - void **set_render_priority** **(** :ref:`int<class_int>` value **)**
  64. - :ref:`int<class_int>` **get_render_priority** **(** **)**
  65. Sets the render priority for transparent objects in 3D scenes. Higher priority objects will be sorted in front of lower priority objects.
  66. \ **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).
  67. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  68. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  69. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  70. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`