Unity Products:Amplify Shader Editor/Weighted Blend and Unity Products:Amplify Shader Editor/World To Object Matrix: Difference between pages

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


== Weighted Blend Node ==
== World To Object Matrix Node ==


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.
The World To Object Matrix node outputs the current inverse model matrix which can be used to transform either a position or direction vector from world space to object/local space.
<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 )''.
<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.


'''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.
'''NOTE:''' We advise using either the [[Unity_Products:Amplify_Shader_Editor/Transform_Position|Transform Position]] or [[Unity_Products:Amplify_Shader_Editor/Transform_Direction|Transform Direction]] as they are easier to use and you wont need to do an explicit multiplication between matrix and position/direction value.


<img class="responsive-img" src="http://wiki.amplify.pt/images/NodeDetail/WeightedBlendNode.jpg">
<img class="responsive-img" src="http://wiki.amplify.pt/images/Nodes/WorldToObjectMatrix.jpg">
<br/><font size="1">Nodes used:
[[Unity_Products:Amplify_Shader_Editor/Vertex_TexCoord|Vertex TexCoord]],
[[Unity_Products:Amplify_Shader_Editor/Texture_Sample|Texture Sample]],
[[Unity_Products:Amplify_Shader_Editor/Weighted_Blend|Weighted Blend]]
</font>


{| class="wikitable" style="width: 100%;"
{| class="wikitable" style="width: 100%;"
|-
! style="width: 10%;" | Node Parameter !! Description !! style="width: 10%;" | Default Value
|- style="background: #e5e5e5;" |
| id="paramWeights" | 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
|- style="background: #e5e5e5;" |
| id="paramLayer" | Layer #
| Layer value to blend. Only visible if the respective input port is not connected.
| 0
|}
{| class="wikitable" style="width: 100%;"
|-
! style="width: 10%;" | Input Port !! Description !! style="width: 10%;" | Type
|-  
|-  
| Weights
! style="width: 10%;" | Output Port !! Description !! style="width: 10%;" | Type
| 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 #
| Out
| Layer value to blend.
| Returns current inverse model matrix value.
| Float <sup id="ref1">[[#anchor|[1]]]</sup>
| Matrix4x4
|}
|}


----
# <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:Matrix Transform]]

Latest revision as of 00:06, 2 December 2023

Back to Node List

World To Object Matrix Node

The World To Object Matrix node outputs the current inverse model matrix which can be used to transform either a position or direction vector from world space to object/local space.

NOTE: We advise using either the Transform Position or Transform Direction as they are easier to use and you wont need to do an explicit multiplication between matrix and position/direction value.

Output Port Description Type
Out Returns current inverse model matrix value. Matrix4x4


Back to Node List