2
0

VisualShaderNode.xml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="VisualShaderNode" inherits="Resource" version="4.0">
  3. <brief_description>
  4. Base class for nodes in a visual shader graph.
  5. </brief_description>
  6. <description>
  7. Visual shader graphs consist of various nodes. Each node in the graph is a separate object and they are represented as a rectangular boxes with title and a set of properties. Each node has also connection ports that allow to connect it to another nodes and control the flow of the shader.
  8. </description>
  9. <tutorials>
  10. <link title="VisualShaders">https://docs.godotengine.org/en/latest/tutorials/shaders/visual_shaders.html</link>
  11. </tutorials>
  12. <methods>
  13. <method name="clear_default_input_values">
  14. <return type="void" />
  15. <description>
  16. Clears the default input ports value.
  17. </description>
  18. </method>
  19. <method name="get_default_input_values" qualifiers="const">
  20. <return type="Array" />
  21. <description>
  22. Returns an [Array] containing default values for all of the input ports of the node in the form [code][index0, value0, index1, value1, ...][/code].
  23. </description>
  24. </method>
  25. <method name="get_input_port_default_value" qualifiers="const">
  26. <return type="Variant" />
  27. <argument index="0" name="port" type="int" />
  28. <description>
  29. Returns the default value of the input [code]port[/code].
  30. </description>
  31. </method>
  32. <method name="remove_input_port_default_value">
  33. <return type="void" />
  34. <argument index="0" name="port" type="int" />
  35. <description>
  36. Removes the default value of the input [code]port[/code].
  37. </description>
  38. </method>
  39. <method name="set_default_input_values">
  40. <return type="void" />
  41. <argument index="0" name="values" type="Array" />
  42. <description>
  43. 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].
  44. </description>
  45. </method>
  46. <method name="set_input_port_default_value">
  47. <return type="void" />
  48. <argument index="0" name="port" type="int" />
  49. <argument index="1" name="value" type="Variant" />
  50. <description>
  51. Sets the default value for the selected input [code]port[/code].
  52. </description>
  53. </method>
  54. </methods>
  55. <members>
  56. <member name="output_port_for_preview" type="int" setter="set_output_port_for_preview" getter="get_output_port_for_preview" default="-1">
  57. Sets the output port index which will be showed for preview. If set to [code]-1[/code] no port will be open for preview.
  58. </member>
  59. </members>
  60. <signals>
  61. <signal name="editor_refresh_request">
  62. <description>
  63. Emitted when the node requests an editor refresh. Currently called only in setter of [member VisualShaderNodeTexture.source], [VisualShaderNodeTexture], and [VisualShaderNodeCubemap] (and their derivatives).
  64. </description>
  65. </signal>
  66. </signals>
  67. <constants>
  68. <constant name="PORT_TYPE_SCALAR" value="0" enum="PortType">
  69. Floating-point scalar. Translated to [code]float[/code] type in shader code.
  70. </constant>
  71. <constant name="PORT_TYPE_SCALAR_INT" value="1" enum="PortType">
  72. Integer scalar. Translated to [code]int[/code] type in shader code.
  73. </constant>
  74. <constant name="PORT_TYPE_VECTOR" value="2" enum="PortType">
  75. 3D vector of floating-point values. Translated to [code]vec3[/code] type in shader code.
  76. </constant>
  77. <constant name="PORT_TYPE_BOOLEAN" value="3" enum="PortType">
  78. Boolean type. Translated to [code]bool[/code] type in shader code.
  79. </constant>
  80. <constant name="PORT_TYPE_TRANSFORM" value="4" enum="PortType">
  81. Transform type. Translated to [code]mat4[/code] type in shader code.
  82. </constant>
  83. <constant name="PORT_TYPE_SAMPLER" value="5" enum="PortType">
  84. Sampler type. Translated to reference of sampler uniform in shader code. Can only be used for input ports in non-uniform nodes.
  85. </constant>
  86. <constant name="PORT_TYPE_MAX" value="6" enum="PortType">
  87. Represents the size of the [enum PortType] enum.
  88. </constant>
  89. </constants>
  90. </class>