Merge pull request #57504 from Chaosus/vs_vector2

This commit is contained in:
Yuri Roubinsky 2022-02-02 21:12:45 +03:00 committed by GitHub
commit ca42bfb2a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 1969 additions and 659 deletions

View file

@ -47,6 +47,7 @@
<return type="void" />
<argument index="0" name="port" type="int" />
<argument index="1" name="value" type="Variant" />
<argument index="2" name="prev_value" type="Variant" default="null" />
<description>
Sets the default value for the selected input [code]port[/code].
</description>
@ -71,19 +72,22 @@
<constant name="PORT_TYPE_SCALAR_INT" value="1" enum="PortType">
Integer scalar. Translated to [code]int[/code] type in shader code.
</constant>
<constant name="PORT_TYPE_VECTOR" value="2" enum="PortType">
<constant name="PORT_TYPE_VECTOR_2D" value="2" enum="PortType">
2D vector of floating-point values. Translated to [code]vec2[/code] type in shader code.
</constant>
<constant name="PORT_TYPE_VECTOR" value="3" enum="PortType">
3D vector of floating-point values. Translated to [code]vec3[/code] type in shader code.
</constant>
<constant name="PORT_TYPE_BOOLEAN" value="3" enum="PortType">
<constant name="PORT_TYPE_BOOLEAN" value="4" enum="PortType">
Boolean type. Translated to [code]bool[/code] type in shader code.
</constant>
<constant name="PORT_TYPE_TRANSFORM" value="4" enum="PortType">
<constant name="PORT_TYPE_TRANSFORM" value="5" enum="PortType">
Transform type. Translated to [code]mat4[/code] type in shader code.
</constant>
<constant name="PORT_TYPE_SAMPLER" value="5" enum="PortType">
<constant name="PORT_TYPE_SAMPLER" value="6" enum="PortType">
Sampler type. Translated to reference of sampler uniform in shader code. Can only be used for input ports in non-uniform nodes.
</constant>
<constant name="PORT_TYPE_MAX" value="6" enum="PortType">
<constant name="PORT_TYPE_MAX" value="7" enum="PortType">
Represents the size of the [enum PortType] enum.
</constant>
</constants>

View file

@ -20,10 +20,13 @@
<constant name="OP_TYPE_INT" value="1" enum="OpType">
An integer scalar.
</constant>
<constant name="OP_TYPE_VECTOR" value="2" enum="OpType">
A vector type.
<constant name="OP_TYPE_VECTOR_2D" value="2" enum="OpType">
A 2D vector type.
</constant>
<constant name="OP_TYPE_MAX" value="3" enum="OpType">
<constant name="OP_TYPE_VECTOR_3D" value="3" enum="OpType">
A 3D vector type.
</constant>
<constant name="OP_TYPE_MAX" value="4" enum="OpType">
Represents the size of the [enum OpType] enum.
</constant>
</constants>

View file

@ -10,7 +10,7 @@
</tutorials>
<members>
<member name="condition" type="int" setter="set_condition" getter="get_condition" enum="VisualShaderNodeCompare.Condition" default="0">
Extra condition which is applied if [member type] is set to [constant CTYPE_VECTOR].
Extra condition which is applied if [member type] is set to [constant CTYPE_VECTOR_3D].
</member>
<member name="function" type="int" setter="set_function" getter="get_function" enum="VisualShaderNodeCompare.Function" default="0">
A comparison function. See [enum Function] for options.
@ -26,16 +26,19 @@
<constant name="CTYPE_SCALAR_INT" value="1" enum="ComparisonType">
An integer scalar.
</constant>
<constant name="CTYPE_VECTOR" value="2" enum="ComparisonType">
<constant name="CTYPE_VECTOR_2D" value="2" enum="ComparisonType">
A 2D vector type.
</constant>
<constant name="CTYPE_VECTOR_3D" value="3" enum="ComparisonType">
A 3D vector type.
</constant>
<constant name="CTYPE_BOOLEAN" value="3" enum="ComparisonType">
<constant name="CTYPE_BOOLEAN" value="4" enum="ComparisonType">
A boolean type.
</constant>
<constant name="CTYPE_TRANSFORM" value="4" enum="ComparisonType">
<constant name="CTYPE_TRANSFORM" value="5" enum="ComparisonType">
A transform ([code]mat4[/code]) type.
</constant>
<constant name="CTYPE_MAX" value="5" enum="ComparisonType">
<constant name="CTYPE_MAX" value="6" enum="ComparisonType">
Represents the size of the [enum ComparisonType] enum.
</constant>
<constant name="FUNC_EQUAL" value="0" enum="Function">

View file

@ -20,10 +20,13 @@
<constant name="OP_TYPE_SCALAR" value="0" enum="OpType">
A floating-point scalar.
</constant>
<constant name="OP_TYPE_VECTOR" value="1" enum="OpType">
<constant name="OP_TYPE_VECTOR_2D" value="1" enum="OpType">
A 2D vector type.
</constant>
<constant name="OP_TYPE_VECTOR_3D" value="2" enum="OpType">
A 3D vector type.
</constant>
<constant name="OP_TYPE_MAX" value="2" enum="OpType">
<constant name="OP_TYPE_MAX" value="3" enum="OpType">
Represents the size of the [enum OpType] enum.
</constant>
<constant name="FUNC_SUM" value="0" enum="Function">

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeFaceForward" inherits="VisualShaderNode" version="4.0">
<class name="VisualShaderNodeFaceForward" inherits="VisualShaderNodeVectorBase" version="4.0">
<brief_description>
Returns the vector that points in the same direction as a reference vector within the visual shader graph.
</brief_description>

View file

@ -15,15 +15,21 @@
</members>
<constants>
<constant name="OP_TYPE_SCALAR" value="0" enum="OpType">
A scalar type.
A floating-point scalar.
</constant>
<constant name="OP_TYPE_VECTOR" value="1" enum="OpType">
A vector type.
<constant name="OP_TYPE_VECTOR_2D" value="1" enum="OpType">
A 2D vector type.
</constant>
<constant name="OP_TYPE_VECTOR_SCALAR" value="2" enum="OpType">
A vector type. [code]weight[/code] port is using a scalar type.
<constant name="OP_TYPE_VECTOR_2D_SCALAR" value="2" enum="OpType">
The [code]a[/code] and [code]b[/code] ports use a 2D vector type. The [code]weight[/code] port uses a scalar type.
</constant>
<constant name="OP_TYPE_MAX" value="3" enum="OpType">
<constant name="OP_TYPE_VECTOR_3D" value="3" enum="OpType">
A 3D vector type.
</constant>
<constant name="OP_TYPE_VECTOR_3D_SCALAR" value="4" enum="OpType">
The [code]a[/code] and [code]b[/code] ports use a 3D vector type. The [code]weight[/code] port uses a scalar type.
</constant>
<constant name="OP_TYPE_MAX" value="5" enum="OpType">
Represents the size of the [enum OpType] enum.
</constant>
</constants>

View file

@ -15,12 +15,15 @@
</members>
<constants>
<constant name="OP_TYPE_SCALAR" value="0" enum="OpType">
A scalar type.
A floating-point scalar type.
</constant>
<constant name="OP_TYPE_VECTOR" value="1" enum="OpType">
A vector type.
<constant name="OP_TYPE_VECTOR_2D" value="1" enum="OpType">
A 2D vector type.
</constant>
<constant name="OP_TYPE_MAX" value="2" enum="OpType">
<constant name="OP_TYPE_VECTOR_3D" value="2" enum="OpType">
A 3D vector type.
</constant>
<constant name="OP_TYPE_MAX" value="3" enum="OpType">
Represents the size of the [enum OpType] enum.
</constant>
</constants>

View file

@ -16,15 +16,21 @@
</members>
<constants>
<constant name="OP_TYPE_SCALAR" value="0" enum="OpType">
A scalar type.
A floating-point scalar type.
</constant>
<constant name="OP_TYPE_VECTOR" value="1" enum="OpType">
A vector type.
<constant name="OP_TYPE_VECTOR_2D" value="1" enum="OpType">
A 2D vector type.
</constant>
<constant name="OP_TYPE_VECTOR_SCALAR" value="2" enum="OpType">
A vector type. [code]edge0[/code] and [code]edge1[/code] are using a scalar type.
<constant name="OP_TYPE_VECTOR_2D_SCALAR" value="2" enum="OpType">
The [code]x[/code] port uses a 2D vector type. The first two ports use a floating-point scalar type.
</constant>
<constant name="OP_TYPE_MAX" value="3" enum="OpType">
<constant name="OP_TYPE_VECTOR_3D" value="3" enum="OpType">
A 3D vector type.
</constant>
<constant name="OP_TYPE_VECTOR_3D_SCALAR" value="4" enum="OpType">
The [code]x[/code] port uses a 3D vector type. The first two ports use a floating-point scalar type.
</constant>
<constant name="OP_TYPE_MAX" value="5" enum="OpType">
Represents the size of the [enum OpType] enum.
</constant>
</constants>

View file

@ -16,15 +16,21 @@
</members>
<constants>
<constant name="OP_TYPE_SCALAR" value="0" enum="OpType">
A scalar type.
A floating-point scalar type.
</constant>
<constant name="OP_TYPE_VECTOR" value="1" enum="OpType">
A vector type.
<constant name="OP_TYPE_VECTOR_2D" value="1" enum="OpType">
A 2D vector type.
</constant>
<constant name="OP_TYPE_VECTOR_SCALAR" value="2" enum="OpType">
A vector type. [code]edge[/code] port is using a scalar type.
<constant name="OP_TYPE_VECTOR_2D_SCALAR" value="2" enum="OpType">
The [code]x[/code] port uses a 2D vector type, while the [code]edge[/code] port uses a floating-point scalar type.
</constant>
<constant name="OP_TYPE_MAX" value="3" enum="OpType">
<constant name="OP_TYPE_VECTOR_3D" value="3" enum="OpType">
A 3D vector type.
</constant>
<constant name="OP_TYPE_VECTOR_3D_SCALAR" value="4" enum="OpType">
The [code]x[/code] port uses a 3D vector type, while the [code]edge[/code] port uses a floating-point scalar type.
</constant>
<constant name="OP_TYPE_MAX" value="5" enum="OpType">
Represents the size of the [enum OpType] enum.
</constant>
</constants>

View file

@ -20,16 +20,19 @@
<constant name="OP_TYPE_INT" value="1" enum="OpType">
An integer scalar.
</constant>
<constant name="OP_TYPE_VECTOR" value="2" enum="OpType">
A vector type.
<constant name="OP_TYPE_VECTOR_2D" value="2" enum="OpType">
A 2D vector type.
</constant>
<constant name="OP_TYPE_BOOLEAN" value="3" enum="OpType">
<constant name="OP_TYPE_VECTOR_3D" value="3" enum="OpType">
A 3D vector type.
</constant>
<constant name="OP_TYPE_BOOLEAN" value="4" enum="OpType">
A boolean type.
</constant>
<constant name="OP_TYPE_TRANSFORM" value="4" enum="OpType">
<constant name="OP_TYPE_TRANSFORM" value="5" enum="OpType">
A transform type.
</constant>
<constant name="OP_TYPE_MAX" value="5" enum="OpType">
<constant name="OP_TYPE_MAX" value="6" enum="OpType">
Represents the size of the [enum OpType] enum.
</constant>
</constants>

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeVec2Constant" inherits="VisualShaderNodeConstant" version="4.0">
<brief_description>
A [Vector2] constant to be used within the visual shader graph.
</brief_description>
<description>
A constant [Vector2], which can be used as an input node.
</description>
<tutorials>
</tutorials>
<members>
<member name="constant" type="Vector2" setter="set_constant" getter="get_constant" default="Vector2(0, 0)">
A [Vector2] constant which represents the state of this node.
</member>
</members>
</class>

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeVec2Uniform" inherits="VisualShaderNodeUniform" version="4.0">
<brief_description>
A [Vector2] uniform to be used within the visual shader graph.
</brief_description>
<description>
Translated to [code]uniform vec2[/code] in the shader language.
</description>
<tutorials>
</tutorials>
<members>
<member name="default_value" type="Vector2" setter="set_default_value" getter="get_default_value" default="Vector2(0, 0)">
A default value to be assigned within the shader.
</member>
<member name="default_value_enabled" type="bool" setter="set_default_value_enabled" getter="is_default_value_enabled" default="false">
Enables usage of the [member default_value].
</member>
</members>
</class>

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeVectorBase" inherits="VisualShaderNode" version="4.0">
<brief_description>
A base type for the nodes using different vector types within the visual shader graph.
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<members>
<member name="op_type" type="int" setter="set_op_type" getter="get_op_type" enum="VisualShaderNodeVectorBase.OpType" default="1">
A base type.
</member>
</members>
<constants>
<constant name="OP_TYPE_VECTOR_2D" value="0" enum="OpType">
A 2D vector type.
</constant>
<constant name="OP_TYPE_VECTOR_3D" value="1" enum="OpType">
A 3D vector type.
</constant>
<constant name="OP_TYPE_MAX" value="2" enum="OpType">
Represents the size of the [enum OpType] enum.
</constant>
</constants>
</class>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeVectorCompose" inherits="VisualShaderNode" version="4.0">
<class name="VisualShaderNodeVectorCompose" inherits="VisualShaderNodeVectorBase" version="4.0">
<brief_description>
Composes a [Vector3] from three scalars within the visual shader graph.
</brief_description>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeVectorDecompose" inherits="VisualShaderNode" version="4.0">
<class name="VisualShaderNodeVectorDecompose" inherits="VisualShaderNodeVectorBase" version="4.0">
<brief_description>
Decomposes a [Vector3] into three scalars within the visual shader graph.
</brief_description>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeVectorDistance" inherits="VisualShaderNode" version="4.0">
<class name="VisualShaderNodeVectorDistance" inherits="VisualShaderNodeVectorBase" version="4.0">
<brief_description>
Returns the distance between two points. To be used within the visual shader graph.
</brief_description>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeVectorFunc" inherits="VisualShaderNode" version="4.0">
<class name="VisualShaderNodeVectorFunc" inherits="VisualShaderNodeVectorBase" version="4.0">
<brief_description>
A vector function to be used within the visual shader graph.
</brief_description>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeVectorLen" inherits="VisualShaderNode" version="4.0">
<class name="VisualShaderNodeVectorLen" inherits="VisualShaderNodeVectorBase" version="4.0">
<brief_description>
Returns the length of a [Vector3] within the visual shader graph.
</brief_description>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeVectorOp" inherits="VisualShaderNode" version="4.0">
<class name="VisualShaderNodeVectorOp" inherits="VisualShaderNodeVectorBase" version="4.0">
<brief_description>
A vector operator to be used within the visual shader graph.
</brief_description>