Unity Products:Amplify Shader Editor/Vertex To Fragment and Unity Products:Amplify Shader Editor/Weighted Blend: Difference between pages

From Amplify Creations Wiki
(Difference between pages)
Jump to navigation Jump to search
m (1 revision imported)
 
ampwiki>Kebrus
mNo edit summary
 
Line 1: Line 1:
[[Unity_Products:Amplify_Shader_Editor/Nodes | Back to Node List]]
[[Unity_Products:Amplify_Shader_Editor/Nodes | Back to Node List]]


== Vertex To Fragment Node ==
== Weighted Blend Node ==


The Vertex To Fragment node allows data to be calculated on the vertex function and transferred to the surface/fragment via interpolators.<br/>
The Weighted Blend node outputs the result of an average sum of each one of its [[#paramLayer|Layer]] values multiplied by their respective [[#paramWeights|Weights]]. The amount of available layers is determined by the amount of channels given by the connection data type on the weights input.
'''NOTE 1:''' [[#paramNoInterpolation|No Interpolation]] cannot be used over the '''Standard Surface''' type as we must be able to directly control interpolators registry, which does't happen over this shader type.<br/>
<br/>P.e. a Vector4 is connected to the Weights Input, input ports Layer 1 through 4 will be made available and the resulting value will be ''( Weights.x*Layer1 + Weights.y*Layer2 +Weights.z*Layer3 +Weights.w*Layer4 )/ (Weights.x + Weights.y + Weights.z + Weights.w )''.
'''NOTE 2:''' [[#paramNoInterpolation|No Interpolation]] will not work across all API's and can even throw compilation errors on some of them ( p.e. Metal and GLES 2.0 ).<br/>
<br/>If Layers are of different types and have different channel amounts then a cast is done for each to match the one with the most amount of channels.


<img class="responsive-img" src="http://wiki.amplify.pt/images/NodeDetail/VertexToFragmentNode.gif">
'''NOTE:''' Other types of blending are also available via the [[Unity_Products:Amplify_Shader_Editor/Summed_Blend|Summed Blend]] and [[Unity_Products:Amplify_Shader_Editor/Layered_Blend|Layered Blend]] nodes.
<font size="1">Nodes used:  
 
[[Unity_Products:Amplify_Shader_Editor/World_Normal|Word Normal]],
<img class="responsive-img" src="http://wiki.amplify.pt/images/NodeDetail/WeightedBlendNode.jpg">
[[Unity_Products:Amplify_Shader_Editor/World_Space_Light_Dir|World Space Light Dir]],
<br/><font size="1">Nodes used:  
[[Unity_Products:Amplify_Shader_Editor/Dot|Dot]],
[[Unity_Products:Amplify_Shader_Editor/Vertex_TexCoord|Vertex TexCoord]],
[[Unity_Products:Amplify_Shader_Editor/Float|Float]],
[[Unity_Products:Amplify_Shader_Editor/Texture_Sample|Texture Sample]],
[[Unity_Products:Amplify_Shader_Editor/Power|Power]],
[[Unity_Products:Amplify_Shader_Editor/Weighted_Blend|Weighted Blend]]
[[Unity_Products:Amplify_Shader_Editor/Vertex_To_Fragment|Vertex To Fragment]],
[[Unity_Products:Amplify_Shader_Editor/Light_Attenuation|Light Attenuation]],
[[Unity_Products:Amplify_Shader_Editor/Light_Color|Light Color]],
[[Unity_Products:Amplify_Shader_Editor/Multiply|Multiply]]
</font>
</font>


{| class="wikitable" style="width: 100%;"
{| class="wikitable" style="width: 100%;"
|-  
|-
! style="width: 10%;" | Node Parameter !! Description !! style="width: 10%;" | Default Value
! style="width: 10%;" | Node Parameter !! Description !! style="width: 10%;" | Default Value
|-
|- style="background: #e5e5e5;" |
| id="paramNoInterpolation" | No Interpolation
| id="paramWeights" | Weights
| When active, makes sure it uses an interpolator with the nointerpolation flag used, which prevents the values assigned to it to be interpolated on the rasterization process.  
| Weight values to be applied at each layer. Number of channels on this data type determines the amount of available layers.
| False
Only visible if the respective input port is not connected.
| 0
|- style="background: #e5e5e5;" |
| id="paramLayer" | Layer #
| Layer value to blend. Only visible if the respective input port is not connected.
| 0
|}
|}


Line 33: Line 34:
! style="width: 10%;" | Input Port !! Description !! style="width: 10%;" | Type
! style="width: 10%;" | Input Port !! Description !! style="width: 10%;" | Type
|-  
|-  
| id="paramVSIn" | (VS) In
| Weights
| Value to be transferred to surface/fragment function.  
| Weight values to be applied at each layer. Number of channels on this data type determines the amount of available layers.
| Float <sup id="ref1">[[#anchor|[1]]]</sup>
|-
| Layer #
| Layer value to blend.
| Float <sup id="ref1">[[#anchor|[1]]]</sup>
| Float <sup id="ref1">[[#anchor|[1]]]</sup>
|}
|}
----
----
# <span id="anchor1">'''[[#ref1|^]]'''</span> Port automatically adapts to all connection types except Matrices and [[Unity Products:Amplify Shader Editor/Texture Object|Sampler]] types.
# <span id="anchor1">'''[[#ref1|^]]'''</span> Port automatically adapts to all connection types except Matrices and [[Unity Products:Amplify Shader Editor/Texture Object|Sampler]] types.


[[Unity_Products:Amplify_Shader_Editor/Nodes | Back to Node List]]
[[Unity_Products:Amplify_Shader_Editor/Nodes | Back to Node List]]
[[Category:Nodes]][[Category:Miscellaneous]]
[[Category:Nodes]][[Category:Miscellaneous]]

Revision as of 18:20, 9 November 2017

Back to Node List

Weighted Blend Node

The Weighted Blend node outputs the result of an average sum of each one of its Layer values multiplied by their respective Weights. The amount of available layers is determined by the amount of channels given by the connection data type on the weights input.
P.e. a Vector4 is connected to the Weights Input, input ports Layer 1 through 4 will be made available and the resulting value will be ( Weights.x*Layer1 + Weights.y*Layer2 +Weights.z*Layer3 +Weights.w*Layer4 )/ (Weights.x + Weights.y + Weights.z + Weights.w ).
If Layers are of different types and have different channel amounts then a cast is done for each to match the one with the most amount of channels.

NOTE: Other types of blending are also available via the Summed Blend and Layered Blend nodes.


Nodes used: Vertex TexCoord, Texture Sample, Weighted Blend

Node Parameter Description Default Value
Weights Weight values to be applied at each layer. Number of channels on this data type determines the amount of available layers.

Only visible if the respective input port is not connected.

0
Layer # Layer value to blend. Only visible if the respective input port is not connected. 0
Input Port Description Type
Weights Weight values to be applied at each layer. Number of channels on this data type determines the amount of available layers. Float [1]
Layer # Layer value to blend. Float [1]

  1. ^ Port automatically adapts to all connection types except Matrices and Sampler types.

Back to Node List