Unity Products:Amplify Shader Editor/Vector4 and Unity Products:Amplify Shader Editor/Vertex Position: Difference between pages
AmplifyWiki (talk | contribs) m (1 revision imported) |
ampwiki>Amplify Borba No 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 Position Node == | ||
The | The Vertex Position node outputs the vertices position in object space. This data is extracted directly from the mesh and contains the vertex position relative to the object origin, this means the position values don't change whatever transform value your gameobject has. This is usually useful to use in the '''Local Vertex Offset''' output or to create effects that are bound to the object and stay exactly the same even if your gameobject changes position, rotation or size. | ||
<br/>Depending on where this node is being used ( vertex or fragment/surface function ) it will either return a direct value ( on vertex functions ) or an interpolated value between vertices( on fragment/surface functions ). | |||
<img class="responsive-img" src="http://wiki.amplify.pt/images/NodeDetail/ | '''NOTE:''' Do not confuse with [[Unity Products:Amplify Shader Editor/World Position|World Position]] node. | ||
<img class="responsive-img" src="http://wiki.amplify.pt/images/NodeDetail/VertexPositionNode.gif"> | |||
<br/><font size="1">Nodes used: | <br/><font size="1">Nodes used: | ||
[[Unity_Products:Amplify_Shader_Editor/ | [[Unity_Products:Amplify_Shader_Editor/Texture_Sample|Texture Sample]], | ||
[[Unity_Products:Amplify_Shader_Editor/Vertex_Position|Vertex Position]], | |||
[[Unity_Products:Amplify_Shader_Editor/Saturate|Saturate]], | |||
[[Unity_Products:Amplify_Shader_Editor/Lerp|Lerp]] | |||
</font> | </font> | ||
{| class="wikitable" style="width: 100%;" | {| class="wikitable" style="width: 100%;" | ||
|- | |- | ||
! style="width: 10%;" | | ! style="width: 10%;" | Input Port !! Description !! style="width: 10%;" | Type | ||
|- | |- | ||
| id=" | | id="paramsize" | Size | ||
| | | The size of the position vector. | ||
* ''' | * '''XYZ:''' Retrieves the 3 coordinates position. | ||
* ''' | * '''XYZW:''' Retrieves the 3 coordinates position and one more. This is mostly useful to facilitate matrix transformation operations where the W value is needed with the value 1 or if you want to retrieve packed data in the W channel. | ||
| XYZ | |||
| | |||
|} | |} | ||
{| class="wikitable" style="width: 100%;" | {| class="wikitable" style="width: 100%;" | ||
Line 88: | Line 30: | ||
! style="width: 10%;" | Output Port !! Description !! style="width: 10%;" | Type | ! style="width: 10%;" | Output Port !! Description !! style="width: 10%;" | Type | ||
|- | |- | ||
| | | XYZ(W) | ||
| Returns the | | Returns the vertex position in object space | ||
| | | Float3(4) | ||
|- | |- | ||
| X | | X | ||
| Returns only the X component of the | | Returns only the X component of the vertex position | ||
| Float | | Float | ||
|- | |- | ||
| Y | | Y | ||
| Returns only the Y component of the | | Returns only the Y component of the vertex position | ||
| Float | | Float | ||
|- | |- | ||
| Z | | Z | ||
| Returns only the Z component of the | | Returns only the Z component of the vertex position | ||
| Float | | Float | ||
|- | |- style="background: #e5e5e5;" | | ||
| W | | W | ||
| Returns only the W component of the | | Returns only the W component of the vertex position (By default set to 1). Only visible if [[#paramsize|Size]] is set to '''XYZW'''. | ||
| Float | | Float | ||
|} | |} | ||
[[Unity_Products:Amplify_Shader_Editor/Nodes | Back to Node List]] | [[Unity_Products:Amplify_Shader_Editor/Nodes | Back to Node List]] | ||
[[Category:Nodes]][[Category: | [[Category:Nodes]][[Category:Vertex Data]] |
Revision as of 10:50, 9 November 2017
Vertex Position Node
The Vertex Position node outputs the vertices position in object space. This data is extracted directly from the mesh and contains the vertex position relative to the object origin, this means the position values don't change whatever transform value your gameobject has. This is usually useful to use in the Local Vertex Offset output or to create effects that are bound to the object and stay exactly the same even if your gameobject changes position, rotation or size.
Depending on where this node is being used ( vertex or fragment/surface function ) it will either return a direct value ( on vertex functions ) or an interpolated value between vertices( on fragment/surface functions ).
NOTE: Do not confuse with World Position node.
Nodes used:
Texture Sample,
Vertex Position,
Saturate,
Lerp
Input Port | Description | Type |
---|---|---|
Size | The size of the position vector.
|
XYZ |
Output Port | Description | Type |
---|---|---|
XYZ(W) | Returns the vertex position in object space | Float3(4) |
X | Returns only the X component of the vertex position | Float |
Y | Returns only the Y component of the vertex position | Float |
Z | Returns only the Z component of the vertex position | Float |
W | Returns only the W component of the vertex position (By default set to 1). Only visible if Size is set to XYZW. | Float |