VisualShaderNode.xml 3.4 KB

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