class_shader.rst 4.1 KB

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