virtualx-engine-docs/_sources/classes/class_material.rst.txt
2024-10-23 09:41:33 -07:00

120 lines
4.4 KiB
ReStructuredText

:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/Material.xml.
.. _class_Material:
Material
========
**Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
**Inherited By:** :ref:`CanvasItemMaterial<class_CanvasItemMaterial>`, :ref:`Material3D<class_Material3D>`, :ref:`ParticlesMaterial<class_ParticlesMaterial>`, :ref:`ShaderMaterial<class_ShaderMaterial>`
Abstract base :ref:`Resource<class_Resource>` for coloring and shading geometry.
.. rst-class:: classref-introduction-group
Description
-----------
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.
.. rst-class:: classref-introduction-group
Tutorials
---------
- `3D Material Testers Demo <https://godotengine.org/asset-library/asset/123>`__
- `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
.. rst-class:: classref-reftable-group
Properties
----------
.. table::
:widths: auto
+---------------------------------+-----------------------------------------------------------------+-------+
| :ref:`Material<class_Material>` | :ref:`next_pass<class_Material_property_next_pass>` | |
+---------------------------------+-----------------------------------------------------------------+-------+
| :ref:`int<class_int>` | :ref:`render_priority<class_Material_property_render_priority>` | ``0`` |
+---------------------------------+-----------------------------------------------------------------+-------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Constants
---------
.. _class_Material_constant_RENDER_PRIORITY_MAX:
.. rst-class:: classref-constant
**RENDER_PRIORITY_MAX** = ``127``
Maximum value for the :ref:`render_priority<class_Material_property_render_priority>` parameter.
.. _class_Material_constant_RENDER_PRIORITY_MIN:
.. rst-class:: classref-constant
**RENDER_PRIORITY_MIN** = ``-128``
Minimum value for the :ref:`render_priority<class_Material_property_render_priority>` parameter.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_Material_property_next_pass:
.. rst-class:: classref-property
:ref:`Material<class_Material>` **next_pass**
.. rst-class:: classref-property-setget
- void **set_next_pass** **(** :ref:`Material<class_Material>` value **)**
- :ref:`Material<class_Material>` **get_next_pass** **(** **)**
Sets the **Material** to be used for the next pass. This renders the object again using a different material.
\ **Note:** This only applies to :ref:`SpatialMaterial<class_SpatialMaterial>`\ s and :ref:`ShaderMaterial<class_ShaderMaterial>`\ s with type "Spatial".
.. rst-class:: classref-item-separator
----
.. _class_Material_property_render_priority:
.. rst-class:: classref-property
:ref:`int<class_int>` **render_priority** = ``0``
.. rst-class:: classref-property-setget
- void **set_render_priority** **(** :ref:`int<class_int>` value **)**
- :ref:`int<class_int>` **get_render_priority** **(** **)**
Sets the render priority for transparent objects in 3D scenes. Higher priority objects will be sorted in front of lower priority objects.
\ **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).
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`