class_shadermaterial.rst 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the ShaderMaterial.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_ShaderMaterial:
  6. ShaderMaterial
  7. ==============
  8. **Inherits:** :ref:`Material<class_Material>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. A material that uses a custom :ref:`Shader<class_Shader>` program.
  13. Properties
  14. ----------
  15. +-----------------------------+-----------------------------------------------------+
  16. | :ref:`Shader<class_Shader>` | :ref:`shader<class_ShaderMaterial_property_shader>` |
  17. +-----------------------------+-----------------------------------------------------+
  18. Methods
  19. -------
  20. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`Variant<class_Variant>` | :ref:`get_shader_param<class_ShaderMaterial_method_get_shader_param>` **(** :ref:`String<class_String>` param **)** const |
  22. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`bool<class_bool>` | :ref:`property_can_revert<class_ShaderMaterial_method_property_can_revert>` **(** :ref:`String<class_String>` name **)** |
  24. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`Variant<class_Variant>` | :ref:`property_get_revert<class_ShaderMaterial_method_property_get_revert>` **(** :ref:`String<class_String>` name **)** |
  26. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | void | :ref:`set_shader_param<class_ShaderMaterial_method_set_shader_param>` **(** :ref:`String<class_String>` param, :ref:`Variant<class_Variant>` value **)** |
  28. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. Description
  30. -----------
  31. 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.
  32. Tutorials
  33. ---------
  34. - :doc:`../tutorials/shading/index`
  35. Property Descriptions
  36. ---------------------
  37. .. _class_ShaderMaterial_property_shader:
  38. - :ref:`Shader<class_Shader>` **shader**
  39. +----------+-------------------+
  40. | *Setter* | set_shader(value) |
  41. +----------+-------------------+
  42. | *Getter* | get_shader() |
  43. +----------+-------------------+
  44. The :ref:`Shader<class_Shader>` program used to render this material.
  45. Method Descriptions
  46. -------------------
  47. .. _class_ShaderMaterial_method_get_shader_param:
  48. - :ref:`Variant<class_Variant>` **get_shader_param** **(** :ref:`String<class_String>` param **)** const
  49. Returns the current value set for this material of a uniform in the shader.
  50. ----
  51. .. _class_ShaderMaterial_method_property_can_revert:
  52. - :ref:`bool<class_bool>` **property_can_revert** **(** :ref:`String<class_String>` name **)**
  53. ----
  54. .. _class_ShaderMaterial_method_property_get_revert:
  55. - :ref:`Variant<class_Variant>` **property_get_revert** **(** :ref:`String<class_String>` name **)**
  56. ----
  57. .. _class_ShaderMaterial_method_set_shader_param:
  58. - void **set_shader_param** **(** :ref:`String<class_String>` param, :ref:`Variant<class_Variant>` value **)**
  59. Changes the value set for this material of a uniform in the shader.