From 766d1ef276044cb1a277e2283c14b7e0fa6bbc43 Mon Sep 17 00:00:00 2001 From: Yuri Roubinsky Date: Mon, 27 Jan 2020 18:14:10 +0300 Subject: [PATCH] Docs for some nodes in visual shader(part 2) --- doc/classes/VisualShaderNode.xml | 1 + doc/classes/VisualShaderNodeCubeMap.xml | 10 ++++++++ .../VisualShaderNodeCubeMapUniform.xml | 2 ++ doc/classes/VisualShaderNodeDeterminant.xml | 2 ++ doc/classes/VisualShaderNodeDotProduct.xml | 2 ++ doc/classes/VisualShaderNodeExpression.xml | 4 ++++ doc/classes/VisualShaderNodeFaceForward.xml | 2 ++ doc/classes/VisualShaderNodeFresnel.xml | 2 ++ .../VisualShaderNodeGlobalExpression.xml | 2 ++ doc/classes/VisualShaderNodeGroupBase.xml | 24 +++++++++++++++++++ 10 files changed, 51 insertions(+) diff --git a/doc/classes/VisualShaderNode.xml b/doc/classes/VisualShaderNode.xml index 8bad6412d3b..14176e009bb 100644 --- a/doc/classes/VisualShaderNode.xml +++ b/doc/classes/VisualShaderNode.xml @@ -5,6 +5,7 @@ + https://docs.godotengine.org/en/latest/tutorials/shading/visual_shaders.html diff --git a/doc/classes/VisualShaderNodeCubeMap.xml b/doc/classes/VisualShaderNodeCubeMap.xml index e90edd94206..fbc97b41a31 100644 --- a/doc/classes/VisualShaderNodeCubeMap.xml +++ b/doc/classes/VisualShaderNodeCubeMap.xml @@ -1,8 +1,10 @@ + A [CubeMap] sampling node to be used within the visual shader graph. + Translated to [code]texture(cubemap, vec3)[/code] in the shader language. Returns a color vector and alpha channel as scalar. @@ -10,22 +12,30 @@ + The [CubeMap] texture to sample when using [constant SOURCE_TEXTURE] as [member source]. + Defines which source should be used for the sampling. See [enum Source] for options. + Defines the type of data provided by the source texture. See [enum TextureType] for options. + Use the [CubeMap] set via [member cube_map]. If this is set to [member source], the [code]samplerCube[/code] port is ignored. + 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. + No hints are added to the uniform declaration. + Adds [code]hint_albedo[/code] as hint to the uniform declaration for proper sRGB to linear conversion. + Adds [code]hint_normal[/code] as hint to the uniform declaration, which internally converts the texture for proper usage as normal map. diff --git a/doc/classes/VisualShaderNodeCubeMapUniform.xml b/doc/classes/VisualShaderNodeCubeMapUniform.xml index 357385c2f59..0e17b6032df 100644 --- a/doc/classes/VisualShaderNodeCubeMapUniform.xml +++ b/doc/classes/VisualShaderNodeCubeMapUniform.xml @@ -1,8 +1,10 @@ + A [CubeMap] uniform node to be used within the visual shader graph. + Translated to [code]uniform samplerCube[/code] in the shader language. The output value can be used as port for [VisualShaderNodeCubeMap]. diff --git a/doc/classes/VisualShaderNodeDeterminant.xml b/doc/classes/VisualShaderNodeDeterminant.xml index d73d7a34eb6..5acd08ebd9a 100644 --- a/doc/classes/VisualShaderNodeDeterminant.xml +++ b/doc/classes/VisualShaderNodeDeterminant.xml @@ -1,8 +1,10 @@ + Calculates the determinant of a [Transform] within the visual shader graph. + Translates to [code]deteminant(x)[/code] in the shader language. diff --git a/doc/classes/VisualShaderNodeDotProduct.xml b/doc/classes/VisualShaderNodeDotProduct.xml index e0855c4d3f8..ef5b5b9f7f9 100644 --- a/doc/classes/VisualShaderNodeDotProduct.xml +++ b/doc/classes/VisualShaderNodeDotProduct.xml @@ -1,8 +1,10 @@ + Calculates a dot product of two vectors within the visual shader graph. + Translates to [code]dot(a, b)[/code] in the shader language. diff --git a/doc/classes/VisualShaderNodeExpression.xml b/doc/classes/VisualShaderNodeExpression.xml index 9ed590eb2fb..e1ba1f0b20c 100644 --- a/doc/classes/VisualShaderNodeExpression.xml +++ b/doc/classes/VisualShaderNodeExpression.xml @@ -1,8 +1,11 @@ + A custom visual shader graph expression written in Godot Shading Language. + 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. @@ -10,6 +13,7 @@ + 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. diff --git a/doc/classes/VisualShaderNodeFaceForward.xml b/doc/classes/VisualShaderNodeFaceForward.xml index 74143366cbe..59eef17e24c 100644 --- a/doc/classes/VisualShaderNodeFaceForward.xml +++ b/doc/classes/VisualShaderNodeFaceForward.xml @@ -1,8 +1,10 @@ + Returns the vector that points in the same direction as a reference vector within the visual shader graph. + 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. diff --git a/doc/classes/VisualShaderNodeFresnel.xml b/doc/classes/VisualShaderNodeFresnel.xml index 1906c237678..c0451d75cb3 100644 --- a/doc/classes/VisualShaderNodeFresnel.xml +++ b/doc/classes/VisualShaderNodeFresnel.xml @@ -1,8 +1,10 @@ + A Fresnel effect to be used within the visual shader graph. + Returns falloff based on the dot product of surface normal and view direction of camera (pass associated inputs to it). diff --git a/doc/classes/VisualShaderNodeGlobalExpression.xml b/doc/classes/VisualShaderNodeGlobalExpression.xml index c0d2188c0ed..d9ceffe15f6 100644 --- a/doc/classes/VisualShaderNodeGlobalExpression.xml +++ b/doc/classes/VisualShaderNodeGlobalExpression.xml @@ -1,8 +1,10 @@ + A custom global visual shader graph expression written in Godot Shading Language. + 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. diff --git a/doc/classes/VisualShaderNodeGroupBase.xml b/doc/classes/VisualShaderNodeGroupBase.xml index ea8a4032be2..b20e8fe4ea9 100644 --- a/doc/classes/VisualShaderNodeGroupBase.xml +++ b/doc/classes/VisualShaderNodeGroupBase.xml @@ -1,8 +1,10 @@ + Base class for a family of nodes with variable amount of input and output ports within the visual shader graph. + Currently, has no direct usage, use the derived classes instead. @@ -17,6 +19,7 @@ + Adds an input port with the specified [code]type[/code] (see [enum VisualShaderNode.PortType]) and [code]name[/code]. @@ -29,54 +32,63 @@ + Adds an output port with the specified [code]type[/code] (see [enum VisualShaderNode.PortType]) and [code]name[/code]. + Removes all previously specified input ports. + Removes all previously specified output ports. + Returns a free input port ID which can be used in [method add_input_port]. + Returns a free output port ID which can be used in [method add_output_port]. + Returns the number of input ports in use. Alternative for [method get_free_input_port_id]. + 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]). + Returns the number of output ports in use. Alternative for [method get_free_output_port_id]. + 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]). @@ -85,6 +97,7 @@ + Returns [code]true[/code] if the specified input port exists. @@ -93,6 +106,7 @@ + Returns [code]true[/code] if the specified output port exists. @@ -101,6 +115,7 @@ + Returns [code]true[/code] if the specified port name does not override an existed port name and is valid within the shader. @@ -109,6 +124,7 @@ + Removes the specified input port. @@ -117,6 +133,7 @@ + Removes the specified output port. @@ -127,6 +144,7 @@ + Renames the specified input port. @@ -137,6 +155,7 @@ + Sets the specified input port's type (see [enum VisualShaderNode.PortType]). @@ -145,6 +164,7 @@ + Defines all input ports using a [String] formatted as a colon-separated list: [code]id,type,name;[/code] (see [method add_input_port]). @@ -155,6 +175,7 @@ + Renames the specified output port. @@ -165,6 +186,7 @@ + Sets the specified output port's type (see [enum VisualShaderNode.PortType]). @@ -173,11 +195,13 @@ + Defines all output ports using a [String] formatted as a colon-separated list: [code]id,type,name;[/code] (see [method add_output_port]). + The size of the node in the visual shader graph.