:github_url: hide .. Generated automatically by doc/tools/make_rst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the ShaderMaterial.xml source instead. .. The source is found in doc/classes or modules//doc_classes. .. _class_ShaderMaterial: ShaderMaterial ============== **Inherits:** :ref:`Material` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` A material that uses a custom :ref:`Shader` program. Description ----------- A material that uses a custom :ref:`Shader` program to render either items to screen or process particles. You can create multiple materials for the same shader but configure different values for the uniforms defined in the shader. Tutorials --------- - :doc:`Shaders documentation index <../tutorials/shaders/index>` Properties ---------- +-----------------------------+-----------------------------------------------------+ | :ref:`Shader` | :ref:`shader` | +-----------------------------+-----------------------------------------------------+ Methods ------- +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`get_shader_param` **(** :ref:`StringName` param **)** |const| | +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`property_can_revert` **(** :ref:`String` name **)** | +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`property_get_revert` **(** :ref:`String` name **)** | +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_shader_param` **(** :ref:`StringName` param, :ref:`Variant` value **)** | +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Property Descriptions --------------------- .. _class_ShaderMaterial_property_shader: - :ref:`Shader` **shader** +----------+-------------------+ | *Setter* | set_shader(value) | +----------+-------------------+ | *Getter* | get_shader() | +----------+-------------------+ The :ref:`Shader` program used to render this material. Method Descriptions ------------------- .. _class_ShaderMaterial_method_get_shader_param: - :ref:`Variant` **get_shader_param** **(** :ref:`StringName` param **)** |const| Returns the current value set for this material of a uniform in the shader. ---- .. _class_ShaderMaterial_method_property_can_revert: - :ref:`bool` **property_can_revert** **(** :ref:`String` name **)** Returns ``true`` if the property identified by ``name`` can be reverted to a default value. ---- .. _class_ShaderMaterial_method_property_get_revert: - :ref:`Variant` **property_get_revert** **(** :ref:`String` name **)** Returns the default value of the material property with given ``name``. ---- .. _class_ShaderMaterial_method_set_shader_param: - void **set_shader_param** **(** :ref:`StringName` param, :ref:`Variant` value **)** Changes the value set for this material of a uniform in the shader. \ **Note:** ``param`` must match the name of the uniform in the code exactly. .. |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.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`