class_visualshadernodecolorfunc.rst 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/VisualShaderNodeColorFunc.xml.
  6. .. _class_VisualShaderNodeColorFunc:
  7. VisualShaderNodeColorFunc
  8. =========================
  9. **Inherits:** :ref:`VisualShaderNode<class_VisualShaderNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  10. A :ref:`Color<class_Color>` function to be used within the visual shader graph.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Accept a :ref:`Color<class_Color>` to the input port and transform it according to :ref:`function<class_VisualShaderNodeColorFunc_property_function>`.
  15. .. rst-class:: classref-reftable-group
  16. Properties
  17. ----------
  18. .. table::
  19. :widths: auto
  20. +----------------------------------------------------------+--------------------------------------------------------------------+-------+
  21. | :ref:`Function<enum_VisualShaderNodeColorFunc_Function>` | :ref:`function<class_VisualShaderNodeColorFunc_property_function>` | ``0`` |
  22. +----------------------------------------------------------+--------------------------------------------------------------------+-------+
  23. .. rst-class:: classref-section-separator
  24. ----
  25. .. rst-class:: classref-descriptions-group
  26. Enumerations
  27. ------------
  28. .. _enum_VisualShaderNodeColorFunc_Function:
  29. .. rst-class:: classref-enumeration
  30. enum **Function**:
  31. .. _class_VisualShaderNodeColorFunc_constant_FUNC_GRAYSCALE:
  32. .. rst-class:: classref-enumeration-constant
  33. :ref:`Function<enum_VisualShaderNodeColorFunc_Function>` **FUNC_GRAYSCALE** = ``0``
  34. Converts the color to grayscale using the following formula:
  35. ::
  36. vec3 c = input;
  37. float max1 = max(c.r, c.g);
  38. float max2 = max(max1, c.b);
  39. float max3 = max(max1, max2);
  40. return vec3(max3, max3, max3);
  41. .. _class_VisualShaderNodeColorFunc_constant_FUNC_SEPIA:
  42. .. rst-class:: classref-enumeration-constant
  43. :ref:`Function<enum_VisualShaderNodeColorFunc_Function>` **FUNC_SEPIA** = ``1``
  44. Applies sepia tone effect using the following formula:
  45. ::
  46. vec3 c = input;
  47. float r = (c.r * 0.393) + (c.g * 0.769) + (c.b * 0.189);
  48. float g = (c.r * 0.349) + (c.g * 0.686) + (c.b * 0.168);
  49. float b = (c.r * 0.272) + (c.g * 0.534) + (c.b * 0.131);
  50. return vec3(r, g, b);
  51. .. rst-class:: classref-section-separator
  52. ----
  53. .. rst-class:: classref-descriptions-group
  54. Property Descriptions
  55. ---------------------
  56. .. _class_VisualShaderNodeColorFunc_property_function:
  57. .. rst-class:: classref-property
  58. :ref:`Function<enum_VisualShaderNodeColorFunc_Function>` **function** = ``0``
  59. .. rst-class:: classref-property-setget
  60. - void **set_function** **(** :ref:`Function<enum_VisualShaderNodeColorFunc_Function>` value **)**
  61. - :ref:`Function<enum_VisualShaderNodeColorFunc_Function>` **get_function** **(** **)**
  62. A function to be applied to the input color. See :ref:`Function<enum_VisualShaderNodeColorFunc_Function>` for options.
  63. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  64. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  65. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  66. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`