Docs for some nodes in visual shader(part 2)

This commit is contained in:
Yuri Roubinsky 2020-01-27 18:14:10 +03:00 committed by Chaosus
parent cab55bbb9d
commit 766d1ef276
10 changed files with 51 additions and 0 deletions

View file

@ -5,6 +5,7 @@
<description> <description>
</description> </description>
<tutorials> <tutorials>
<link>https://docs.godotengine.org/en/latest/tutorials/shading/visual_shaders.html</link>
</tutorials> </tutorials>
<methods> <methods>
<method name="get_default_input_values" qualifiers="const"> <method name="get_default_input_values" qualifiers="const">

View file

@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeCubeMap" inherits="VisualShaderNode" version="3.2"> <class name="VisualShaderNodeCubeMap" inherits="VisualShaderNode" version="3.2">
<brief_description> <brief_description>
A [CubeMap] sampling node to be used within the visual shader graph.
</brief_description> </brief_description>
<description> <description>
Translated to [code]texture(cubemap, vec3)[/code] in the shader language. Returns a color vector and alpha channel as scalar.
</description> </description>
<tutorials> <tutorials>
</tutorials> </tutorials>
@ -10,22 +12,30 @@
</methods> </methods>
<members> <members>
<member name="cube_map" type="CubeMap" setter="set_cube_map" getter="get_cube_map"> <member name="cube_map" type="CubeMap" setter="set_cube_map" getter="get_cube_map">
The [CubeMap] texture to sample when using [constant SOURCE_TEXTURE] as [member source].
</member> </member>
<member name="source" type="int" setter="set_source" getter="get_source" enum="VisualShaderNodeCubeMap.Source" default="0"> <member name="source" type="int" setter="set_source" getter="get_source" enum="VisualShaderNodeCubeMap.Source" default="0">
Defines which source should be used for the sampling. See [enum Source] for options.
</member> </member>
<member name="texture_type" type="int" setter="set_texture_type" getter="get_texture_type" enum="VisualShaderNodeCubeMap.TextureType" default="0"> <member name="texture_type" type="int" setter="set_texture_type" getter="get_texture_type" enum="VisualShaderNodeCubeMap.TextureType" default="0">
Defines the type of data provided by the source texture. See [enum TextureType] for options.
</member> </member>
</members> </members>
<constants> <constants>
<constant name="SOURCE_TEXTURE" value="0" enum="Source"> <constant name="SOURCE_TEXTURE" value="0" enum="Source">
Use the [CubeMap] set via [member cube_map]. If this is set to [member source], the [code]samplerCube[/code] port is ignored.
</constant> </constant>
<constant name="SOURCE_PORT" value="1" enum="Source"> <constant name="SOURCE_PORT" value="1" enum="Source">
Use the [CubeMap] sampler reference passed via the [code]samplerCube[/code] port. If this is set to [member source], the [member cube_map] texture is ignored.
</constant> </constant>
<constant name="TYPE_DATA" value="0" enum="TextureType"> <constant name="TYPE_DATA" value="0" enum="TextureType">
No hints are added to the uniform declaration.
</constant> </constant>
<constant name="TYPE_COLOR" value="1" enum="TextureType"> <constant name="TYPE_COLOR" value="1" enum="TextureType">
Adds [code]hint_albedo[/code] as hint to the uniform declaration for proper sRGB to linear conversion.
</constant> </constant>
<constant name="TYPE_NORMALMAP" value="2" enum="TextureType"> <constant name="TYPE_NORMALMAP" value="2" enum="TextureType">
Adds [code]hint_normal[/code] as hint to the uniform declaration, which internally converts the texture for proper usage as normal map.
</constant> </constant>
</constants> </constants>
</class> </class>

View file

@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeCubeMapUniform" inherits="VisualShaderNodeTextureUniform" version="3.2"> <class name="VisualShaderNodeCubeMapUniform" inherits="VisualShaderNodeTextureUniform" version="3.2">
<brief_description> <brief_description>
A [CubeMap] uniform node to be used within the visual shader graph.
</brief_description> </brief_description>
<description> <description>
Translated to [code]uniform samplerCube[/code] in the shader language. The output value can be used as port for [VisualShaderNodeCubeMap].
</description> </description>
<tutorials> <tutorials>
</tutorials> </tutorials>

View file

@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeDeterminant" inherits="VisualShaderNode" version="3.2"> <class name="VisualShaderNodeDeterminant" inherits="VisualShaderNode" version="3.2">
<brief_description> <brief_description>
Calculates the determinant of a [Transform] within the visual shader graph.
</brief_description> </brief_description>
<description> <description>
Translates to [code]deteminant(x)[/code] in the shader language.
</description> </description>
<tutorials> <tutorials>
</tutorials> </tutorials>

View file

@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeDotProduct" inherits="VisualShaderNode" version="3.2"> <class name="VisualShaderNodeDotProduct" inherits="VisualShaderNode" version="3.2">
<brief_description> <brief_description>
Calculates a dot product of two vectors within the visual shader graph.
</brief_description> </brief_description>
<description> <description>
Translates to [code]dot(a, b)[/code] in the shader language.
</description> </description>
<tutorials> <tutorials>
</tutorials> </tutorials>

View file

@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeExpression" inherits="VisualShaderNodeGroupBase" version="3.2"> <class name="VisualShaderNodeExpression" inherits="VisualShaderNodeGroupBase" version="3.2">
<brief_description> <brief_description>
A custom visual shader graph expression written in Godot Shading Language.
</brief_description> </brief_description>
<description> <description>
Custom Godot Shading Language expression, with a custom amount of input and output ports.
The provided code is directly injected into the graph's matching shader function ([code]vertex[/code], [code]fragment[/code], or [code]light[/code]), so it cannot be used to to declare functions, varyings, uniforms, or global constants. See [VisualShaderNodeGlobalExpression] for such global definitions.
</description> </description>
<tutorials> <tutorials>
</tutorials> </tutorials>
@ -10,6 +13,7 @@
</methods> </methods>
<members> <members>
<member name="expression" type="String" setter="set_expression" getter="get_expression" default="&quot;&quot;"> <member name="expression" type="String" setter="set_expression" getter="get_expression" default="&quot;&quot;">
An expression in Godot Shading Language, which will be injected at the start of the graph's matching shader function ([code]vertex[/code], [code]fragment[/code], or [code]light[/code]), and thus cannot be used to declare functions, varyings, uniforms, or global constants.
</member> </member>
</members> </members>
<constants> <constants>

View file

@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeFaceForward" inherits="VisualShaderNode" version="3.2"> <class name="VisualShaderNodeFaceForward" inherits="VisualShaderNode" version="3.2">
<brief_description> <brief_description>
Returns the vector that points in the same direction as a reference vector within the visual shader graph.
</brief_description> </brief_description>
<description> <description>
Translates to [code]faceforward(N, I, Nref)[/code] in the shader language. The function has three vector parameters: [code]N[/code], the vector to orient, [code]I[/code], the incident vector, and [code]Nref[/code], the reference vector. If the dot product of [code]I[/code] and [code]Nref[/code] is smaller than zero the return value is [code]N[/code]. Otherwise [code]-N[/code] is returned.
</description> </description>
<tutorials> <tutorials>
</tutorials> </tutorials>

View file

@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeFresnel" inherits="VisualShaderNode" version="3.2"> <class name="VisualShaderNodeFresnel" inherits="VisualShaderNode" version="3.2">
<brief_description> <brief_description>
A Fresnel effect to be used within the visual shader graph.
</brief_description> </brief_description>
<description> <description>
Returns falloff based on the dot product of surface normal and view direction of camera (pass associated inputs to it).
</description> </description>
<tutorials> <tutorials>
</tutorials> </tutorials>

View file

@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeGlobalExpression" inherits="VisualShaderNodeExpression" version="3.2"> <class name="VisualShaderNodeGlobalExpression" inherits="VisualShaderNodeExpression" version="3.2">
<brief_description> <brief_description>
A custom global visual shader graph expression written in Godot Shading Language.
</brief_description> </brief_description>
<description> <description>
Custom Godot Shader Language expression, which is placed on top of the generated shader. You can place various function definitions inside to call later in [VisualShaderNodeExpression]s (which are injected in the main shader functions). You can also declare varyings, uniforms and global constants.
</description> </description>
<tutorials> <tutorials>
</tutorials> </tutorials>

View file

@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeGroupBase" inherits="VisualShaderNode" version="3.2"> <class name="VisualShaderNodeGroupBase" inherits="VisualShaderNode" version="3.2">
<brief_description> <brief_description>
Base class for a family of nodes with variable amount of input and output ports within the visual shader graph.
</brief_description> </brief_description>
<description> <description>
Currently, has no direct usage, use the derived classes instead.
</description> </description>
<tutorials> <tutorials>
</tutorials> </tutorials>
@ -17,6 +19,7 @@
<argument index="2" name="name" type="String"> <argument index="2" name="name" type="String">
</argument> </argument>
<description> <description>
Adds an input port with the specified [code]type[/code] (see [enum VisualShaderNode.PortType]) and [code]name[/code].
</description> </description>
</method> </method>
<method name="add_output_port"> <method name="add_output_port">
@ -29,54 +32,63 @@
<argument index="2" name="name" type="String"> <argument index="2" name="name" type="String">
</argument> </argument>
<description> <description>
Adds an output port with the specified [code]type[/code] (see [enum VisualShaderNode.PortType]) and [code]name[/code].
</description> </description>
</method> </method>
<method name="clear_input_ports"> <method name="clear_input_ports">
<return type="void"> <return type="void">
</return> </return>
<description> <description>
Removes all previously specified input ports.
</description> </description>
</method> </method>
<method name="clear_output_ports"> <method name="clear_output_ports">
<return type="void"> <return type="void">
</return> </return>
<description> <description>
Removes all previously specified output ports.
</description> </description>
</method> </method>
<method name="get_free_input_port_id" qualifiers="const"> <method name="get_free_input_port_id" qualifiers="const">
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Returns a free input port ID which can be used in [method add_input_port].
</description> </description>
</method> </method>
<method name="get_free_output_port_id" qualifiers="const"> <method name="get_free_output_port_id" qualifiers="const">
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Returns a free output port ID which can be used in [method add_output_port].
</description> </description>
</method> </method>
<method name="get_input_port_count" qualifiers="const"> <method name="get_input_port_count" qualifiers="const">
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Returns the number of input ports in use. Alternative for [method get_free_input_port_id].
</description> </description>
</method> </method>
<method name="get_inputs" qualifiers="const"> <method name="get_inputs" qualifiers="const">
<return type="String"> <return type="String">
</return> </return>
<description> <description>
Returns a [String] description of the input ports as as colon-separated list using the format [code]id,type,name;[/code] (see [method add_input_port]).
</description> </description>
</method> </method>
<method name="get_output_port_count" qualifiers="const"> <method name="get_output_port_count" qualifiers="const">
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Returns the number of output ports in use. Alternative for [method get_free_output_port_id].
</description> </description>
</method> </method>
<method name="get_outputs" qualifiers="const"> <method name="get_outputs" qualifiers="const">
<return type="String"> <return type="String">
</return> </return>
<description> <description>
Returns a [String] description of the output ports as as colon-separated list using the format [code]id,type,name;[/code] (see [method add_output_port]).
</description> </description>
</method> </method>
<method name="has_input_port" qualifiers="const"> <method name="has_input_port" qualifiers="const">
@ -85,6 +97,7 @@
<argument index="0" name="id" type="int"> <argument index="0" name="id" type="int">
</argument> </argument>
<description> <description>
Returns [code]true[/code] if the specified input port exists.
</description> </description>
</method> </method>
<method name="has_output_port" qualifiers="const"> <method name="has_output_port" qualifiers="const">
@ -93,6 +106,7 @@
<argument index="0" name="id" type="int"> <argument index="0" name="id" type="int">
</argument> </argument>
<description> <description>
Returns [code]true[/code] if the specified output port exists.
</description> </description>
</method> </method>
<method name="is_valid_port_name" qualifiers="const"> <method name="is_valid_port_name" qualifiers="const">
@ -101,6 +115,7 @@
<argument index="0" name="name" type="String"> <argument index="0" name="name" type="String">
</argument> </argument>
<description> <description>
Returns [code]true[/code] if the specified port name does not override an existed port name and is valid within the shader.
</description> </description>
</method> </method>
<method name="remove_input_port"> <method name="remove_input_port">
@ -109,6 +124,7 @@
<argument index="0" name="id" type="int"> <argument index="0" name="id" type="int">
</argument> </argument>
<description> <description>
Removes the specified input port.
</description> </description>
</method> </method>
<method name="remove_output_port"> <method name="remove_output_port">
@ -117,6 +133,7 @@
<argument index="0" name="id" type="int"> <argument index="0" name="id" type="int">
</argument> </argument>
<description> <description>
Removes the specified output port.
</description> </description>
</method> </method>
<method name="set_input_port_name"> <method name="set_input_port_name">
@ -127,6 +144,7 @@
<argument index="1" name="name" type="String"> <argument index="1" name="name" type="String">
</argument> </argument>
<description> <description>
Renames the specified input port.
</description> </description>
</method> </method>
<method name="set_input_port_type"> <method name="set_input_port_type">
@ -137,6 +155,7 @@
<argument index="1" name="type" type="int"> <argument index="1" name="type" type="int">
</argument> </argument>
<description> <description>
Sets the specified input port's type (see [enum VisualShaderNode.PortType]).
</description> </description>
</method> </method>
<method name="set_inputs"> <method name="set_inputs">
@ -145,6 +164,7 @@
<argument index="0" name="inputs" type="String"> <argument index="0" name="inputs" type="String">
</argument> </argument>
<description> <description>
Defines all input ports using a [String] formatted as a colon-separated list: [code]id,type,name;[/code] (see [method add_input_port]).
</description> </description>
</method> </method>
<method name="set_output_port_name"> <method name="set_output_port_name">
@ -155,6 +175,7 @@
<argument index="1" name="name" type="String"> <argument index="1" name="name" type="String">
</argument> </argument>
<description> <description>
Renames the specified output port.
</description> </description>
</method> </method>
<method name="set_output_port_type"> <method name="set_output_port_type">
@ -165,6 +186,7 @@
<argument index="1" name="type" type="int"> <argument index="1" name="type" type="int">
</argument> </argument>
<description> <description>
Sets the specified output port's type (see [enum VisualShaderNode.PortType]).
</description> </description>
</method> </method>
<method name="set_outputs"> <method name="set_outputs">
@ -173,11 +195,13 @@
<argument index="0" name="outputs" type="String"> <argument index="0" name="outputs" type="String">
</argument> </argument>
<description> <description>
Defines all output ports using a [String] formatted as a colon-separated list: [code]id,type,name;[/code] (see [method add_output_port]).
</description> </description>
</method> </method>
</methods> </methods>
<members> <members>
<member name="size" type="Vector2" setter="set_size" getter="get_size" default="Vector2( 0, 0 )"> <member name="size" type="Vector2" setter="set_size" getter="get_size" default="Vector2( 0, 0 )">
The size of the node in the visual shader graph.
</member> </member>
</members> </members>
<constants> <constants>