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

From Amplify Creations Wiki
(Difference between pages)
Jump to navigation Jump to search
m (1 revision imported)
 
ampwiki>Amplify RnD Rick
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]]


== ATan2 Node ==
== Vertex To Fragment Node ==


The ATan2 node outputs the arctangent of the division [[#paramA|A]]'''/'''[[#paramB|B]]. If (B,A) defines a (x,y) vector then using this operator returns the angle in radians it does with the x-axis <br/>  
The Vertex To Fragment node allows data to be calculated on the vertex function and transferred to the surface/fragment via interpolators.<br/>
'''NOTE:''' ATan2 between multi-channel data types are done per-channel. If ''A'' and ''B'' have different channel amounts a cast is done to match the one with the most amount of channels.
'''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/>
'''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/>


<img class="responsive-img" src="http://wiki.amplify.pt/images/NodeDetail/ATan2Node.jpg">
<img class="responsive-img" src="http://wiki.amplify.pt/images/NodeDetail/VertexToFragmentNode.gif">
<br/><font size="1">Nodes used:  
<font size="1">Nodes used:  
[[Unity_Products:Amplify_Shader_Editor/Texture_Coordinates|Texture Coordinates]],
[[Unity_Products:Amplify_Shader_Editor/World_Normal|Word Normal]],
[[Unity_Products:Amplify_Shader_Editor/ATan2|ATan2]],  
[[Unity_Products:Amplify_Shader_Editor/World_Space_Light_Dir|World Space Light Dir]],  
[[Unity_Products:Amplify_Shader_Editor/Tau|Tau]],  
[[Unity_Products:Amplify_Shader_Editor/Dot|Dot]],
[[Unity_Products:Amplify_Shader_Editor/Divide|Divide]],  
[[Unity_Products:Amplify_Shader_Editor/Float|Float]],
[[Unity_Products:Amplify_Shader_Editor/Float|Float]],  
[[Unity_Products:Amplify_Shader_Editor/Power|Power]],
[[Unity_Products:Amplify_Shader_Editor/Add|Add]],  
[[Unity_Products:Amplify_Shader_Editor/Vertex_To_Fragment|Vertex To Fragment]],
[[Unity_Products:Amplify_Shader_Editor/Vector2|Vector2]],  
[[Unity_Products:Amplify_Shader_Editor/Light_Attenuation|Light Attenuation]],
[[Unity_Products:Amplify_Shader_Editor/HSV_to_RGB|HSV to RGB]],  
[[Unity_Products:Amplify_Shader_Editor/Light_Color|Light Color]],
[[Unity_Products:Amplify_Shader_Editor/Length|Length]],  
[[Unity_Products:Amplify_Shader_Editor/Multiply|Multiply]]
[[Unity_Products:Amplify_Shader_Editor/One_Minus|One Minus]]
</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
| id="paramNoInterpolation" | No Interpolation
|- style="background: #e5e5e5;" |
| 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.  
| id="paramA" | A
| False
|Dividend of the division operation. Only visible if the respective input port is not connected.
| 0
|- style="background: #e5e5e5;" |
| id="paramB" | B
| Divisor of the division operation. Only visible if the respective input port is not connected.
| 0
|}
|}


{| class="wikitable" style="width: 100%;"
{| class="wikitable" style="width: 100%;"
Line 38: Line 33:
! style="width: 10%;" | Input Port !! Description !! style="width: 10%;" | Type
! style="width: 10%;" | Input Port !! Description !! style="width: 10%;" | Type
|-  
|-  
| A
| id="paramVSIn" | (VS) In
| Dividend of the division operation.
| Value to be transferred to surface/fragment function.  
| Float <sup id="ref1">[[#anchor|[1]]]</sup>
|-
| B
| Divisor of the division operation. The outputted result will have its sign given by this parameter.
| 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:Math Operators]]
[[Category:Nodes]][[Category:Miscellaneous]]

Revision as of 15:49, 19 November 2020

Back to Node List

Vertex To Fragment Node

The Vertex To Fragment node allows data to be calculated on the vertex function and transferred to the surface/fragment via interpolators.
NOTE 1: 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.
NOTE 2: 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 ).

Nodes used: Word Normal, World Space Light Dir, Dot, Float, Power, Vertex To Fragment, Light Attenuation, Light Color, Multiply

Node Parameter Description Default Value
No Interpolation 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. False
Input Port Description Type
(VS) In Value to be transferred to surface/fragment function. Float [1]

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


Back to Node List