VisualShaderNode.xml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="VisualShaderNode" inherits="Resource" version="3.2">
  3. <brief_description>
  4. Base class for nodes in a visual shader graph.
  5. </brief_description>
  6. <description>
  7. </description>
  8. <tutorials>
  9. <link>https://docs.godotengine.org/en/latest/tutorials/shading/visual_shaders.html</link>
  10. </tutorials>
  11. <methods>
  12. <method name="get_default_input_values" qualifiers="const">
  13. <return type="Array">
  14. </return>
  15. <description>
  16. Returns an [Array] containing default values for all of the input ports of the node in the form [code][index0, value0, index1, value1, ...][/code].
  17. </description>
  18. </method>
  19. <method name="get_input_port_default_value" qualifiers="const">
  20. <return type="Variant">
  21. </return>
  22. <argument index="0" name="port" type="int">
  23. </argument>
  24. <description>
  25. Returns the default value of the input [code]port[/code].
  26. </description>
  27. </method>
  28. <method name="set_default_input_values">
  29. <return type="void">
  30. </return>
  31. <argument index="0" name="values" type="Array">
  32. </argument>
  33. <description>
  34. Sets the default input ports values using an [Array] of the form [code][index0, value0, index1, value1, ...][/code]. For example: [code][0, Vector3(0, 0, 0), 1, Vector3(0, 0, 0)][/code].
  35. </description>
  36. </method>
  37. <method name="set_input_port_default_value">
  38. <return type="void">
  39. </return>
  40. <argument index="0" name="port" type="int">
  41. </argument>
  42. <argument index="1" name="value" type="Variant">
  43. </argument>
  44. <description>
  45. Sets the default value for the selected input [code]port[/code].
  46. </description>
  47. </method>
  48. </methods>
  49. <members>
  50. <member name="output_port_for_preview" type="int" setter="set_output_port_for_preview" getter="get_output_port_for_preview" default="-1">
  51. Sets the output port index which will be showed for preview. If set to [code]-1[/code] no port will be open for preview.
  52. </member>
  53. </members>
  54. <signals>
  55. <signal name="editor_refresh_request">
  56. <description>
  57. Emitted when the node requests an editor refresh. Currently called only in setter of [member VisualShaderNodeTexture.source], [VisualShaderNodeTexture], and [VisualShaderNodeCubeMap] (and their derivatives).
  58. </description>
  59. </signal>
  60. </signals>
  61. <constants>
  62. <constant name="PORT_TYPE_SCALAR" value="0" enum="PortType">
  63. Floating-point scalar. Translated to [code]float[/code] type in shader code.
  64. </constant>
  65. <constant name="PORT_TYPE_VECTOR" value="1" enum="PortType">
  66. 3D vector of floating-point values. Translated to [code]vec3[/code] type in shader code.
  67. </constant>
  68. <constant name="PORT_TYPE_BOOLEAN" value="2" enum="PortType">
  69. Boolean type. Translated to [code]bool[/code] type in shader code.
  70. </constant>
  71. <constant name="PORT_TYPE_TRANSFORM" value="3" enum="PortType">
  72. Transform type. Translated to [code]mat4[/code] type in shader code.
  73. </constant>
  74. <constant name="PORT_TYPE_SAMPLER" value="4" enum="PortType">
  75. Sampler type. Translated to reference of sampler uniform in shader code. Can only be used for input ports in non-uniform nodes.
  76. </constant>
  77. <constant name="PORT_TYPE_MAX" value="5" enum="PortType">
  78. Represents the size of the [enum PortType] enum.
  79. </constant>
  80. </constants>
  81. </class>