class_shadermaterial.rst 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/ShaderMaterial.xml.
  6. .. _class_ShaderMaterial:
  7. ShaderMaterial
  8. ==============
  9. **Inherits:** :ref:`Material<class_Material>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. A material that uses a custom :ref:`Shader<class_Shader>` program.
  11. Description
  12. -----------
  13. A material that uses a custom :ref:`Shader<class_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.
  14. Tutorials
  15. ---------
  16. - :doc:`Shaders documentation index <../tutorials/shaders/index>`
  17. Properties
  18. ----------
  19. +-----------------------------+-----------------------------------------------------+
  20. | :ref:`Shader<class_Shader>` | :ref:`shader<class_ShaderMaterial_property_shader>` |
  21. +-----------------------------+-----------------------------------------------------+
  22. Methods
  23. -------
  24. +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`Variant<class_Variant>` | :ref:`get_shader_param<class_ShaderMaterial_method_get_shader_param>` **(** :ref:`StringName<class_StringName>` param **)** |const| |
  26. +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`bool<class_bool>` | :ref:`property_can_revert<class_ShaderMaterial_method_property_can_revert>` **(** :ref:`String<class_String>` name **)** |
  28. +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`Variant<class_Variant>` | :ref:`property_get_revert<class_ShaderMaterial_method_property_get_revert>` **(** :ref:`String<class_String>` name **)** |
  30. +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | void | :ref:`set_shader_param<class_ShaderMaterial_method_set_shader_param>` **(** :ref:`StringName<class_StringName>` param, :ref:`Variant<class_Variant>` value **)** |
  32. +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. Property Descriptions
  34. ---------------------
  35. .. _class_ShaderMaterial_property_shader:
  36. - :ref:`Shader<class_Shader>` **shader**
  37. +----------+-------------------+
  38. | *Setter* | set_shader(value) |
  39. +----------+-------------------+
  40. | *Getter* | get_shader() |
  41. +----------+-------------------+
  42. The :ref:`Shader<class_Shader>` program used to render this material.
  43. Method Descriptions
  44. -------------------
  45. .. _class_ShaderMaterial_method_get_shader_param:
  46. - :ref:`Variant<class_Variant>` **get_shader_param** **(** :ref:`StringName<class_StringName>` param **)** |const|
  47. Returns the current value set for this material of a uniform in the shader.
  48. ----
  49. .. _class_ShaderMaterial_method_property_can_revert:
  50. - :ref:`bool<class_bool>` **property_can_revert** **(** :ref:`String<class_String>` name **)**
  51. Returns ``true`` if the property identified by ``name`` can be reverted to a default value.
  52. ----
  53. .. _class_ShaderMaterial_method_property_get_revert:
  54. - :ref:`Variant<class_Variant>` **property_get_revert** **(** :ref:`String<class_String>` name **)**
  55. Returns the default value of the material property with given ``name``.
  56. ----
  57. .. _class_ShaderMaterial_method_set_shader_param:
  58. - void **set_shader_param** **(** :ref:`StringName<class_StringName>` param, :ref:`Variant<class_Variant>` value **)**
  59. Changes the value set for this material of a uniform in the shader.
  60. \ **Note:** ``param`` must match the name of the uniform in the code exactly.
  61. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  62. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  63. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  64. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  65. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  66. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`