VisualShaderNode.xml 3.1 KB

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