class_shadermaterial.rst 4.0 KB

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