class_shader.rst 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the Shader.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_Shader:
  5. Shader
  6. ======
  7. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  8. **Inherited By:** :ref:`VisualShader<class_VisualShader>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. A custom shader program.
  13. Properties
  14. ----------
  15. +-----------------------------+-----------------------------------------+
  16. | :ref:`String<class_String>` | :ref:`code<class_Shader_property_code>` |
  17. +-----------------------------+-----------------------------------------+
  18. Methods
  19. -------
  20. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`Texture<class_Texture>` | :ref:`get_default_texture_param<class_Shader_method_get_default_texture_param>` **(** :ref:`String<class_String>` param **)** const |
  22. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`Mode<enum_Shader_Mode>` | :ref:`get_mode<class_Shader_method_get_mode>` **(** **)** const |
  24. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`bool<class_bool>` | :ref:`has_param<class_Shader_method_has_param>` **(** :ref:`String<class_String>` name **)** const |
  26. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | void | :ref:`set_default_texture_param<class_Shader_method_set_default_texture_param>` **(** :ref:`String<class_String>` param, :ref:`Texture<class_Texture>` texture **)** |
  28. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. Enumerations
  30. ------------
  31. .. _enum_Shader_Mode:
  32. .. _class_Shader_constant_MODE_SPATIAL:
  33. .. _class_Shader_constant_MODE_CANVAS_ITEM:
  34. .. _class_Shader_constant_MODE_PARTICLES:
  35. enum **Mode**:
  36. - **MODE_SPATIAL** = **0**
  37. - **MODE_CANVAS_ITEM** = **1**
  38. - **MODE_PARTICLES** = **2**
  39. Description
  40. -----------
  41. This class allows you to define a custom shader program that can be used for various materials to render objects.
  42. Tutorials
  43. ---------
  44. - :doc:`../tutorials/shading/index`
  45. Property Descriptions
  46. ---------------------
  47. .. _class_Shader_property_code:
  48. - :ref:`String<class_String>` **code**
  49. +----------+-----------------+
  50. | *Setter* | set_code(value) |
  51. +----------+-----------------+
  52. | *Getter* | get_code() |
  53. +----------+-----------------+
  54. Method Descriptions
  55. -------------------
  56. .. _class_Shader_method_get_default_texture_param:
  57. - :ref:`Texture<class_Texture>` **get_default_texture_param** **(** :ref:`String<class_String>` param **)** const
  58. .. _class_Shader_method_get_mode:
  59. - :ref:`Mode<enum_Shader_Mode>` **get_mode** **(** **)** const
  60. Returns the shader mode for the shader, either ``MODE_CANVAS_ITEM``, ``MODE_SPATIAL`` or ``MODE_PARTICLES``
  61. .. _class_Shader_method_has_param:
  62. - :ref:`bool<class_bool>` **has_param** **(** :ref:`String<class_String>` name **)** const
  63. .. _class_Shader_method_set_default_texture_param:
  64. - void **set_default_texture_param** **(** :ref:`String<class_String>` param, :ref:`Texture<class_Texture>` texture **)**