Unity Products:Amplify Shader Editor/If and Unity Products:Amplify Shader Editor/If Community: 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]]


== If Node ==
== If [Community] Node ==


The If node compares two float inputs [[#paramA|A]] and [[#paramB|B]] and outputs a value from on one of its inputs [[#paramA>B|A > B]] , [[#paramA==B|A == B]] or [[#paramA<B|A < B]] according to the comparison result.  
The If [Community] node compares two float inputs [[#paramA|A]] and [[#paramB|B]] and outputs a value from on one of its inputs [[#paramA>B|A > B]] , [[#paramA==B|A == B]] or [[#paramA<B|A < B]] according to the comparison result.  


<img class="responsive-img" src="http://wiki.amplify.pt/images/NodeDetail/IfNode.jpg">
<img class="responsive-img" src="http://wiki.amplify.pt/images/Nodes/IfCommunity.jpg">
<br/><font size="1">Nodes used:
[[Unity_Products:Amplify_Shader_Editor/World_Position|World Position]],
[[Unity_Products:Amplify_Shader_Editor/Float|Float]],
[[Unity_Products:Amplify_Shader_Editor/World_Normal|World Normal]],
[[Unity_Products:Amplify_Shader_Editor/Vertex_TexCoord|Vertex TexCoord]],
[[Unity_Products:Amplify_Shader_Editor/If|If]]
</font>


{| class="wikitable" style="width: 100%;"
{| class="wikitable" style="width: 100%;"
Line 25: Line 18:
| Second value of the comparison operation. Only visible if the respective input port is not connected.
| Second value of the comparison operation. Only visible if the respective input port is not connected.
| 0
| 0
|-
|- style="background: #e5e5e5;" |
|id="paramDynBranch" | Dynamic Branching
|id="paramA>B" | A > B
| Toggle to let the compiler know this conditional operation should be compiled on an actual branch.
| Value to be outputted if value of A is greater than value of B. Only visible if the respective input port is not connected.
| False
| 0
|- style="background: #e5e5e5;" |
|id="paramA==B" | A == B
| Value to be outputted if value of A is equal to value of B. Only visible if the respective input port is not connected.
| 0
|- style="background: #e5e5e5;" |
|id="paramA<B" | A < B
| Value to be outputted if value of A is less than value of B. Only visible if the respective input port is not connected.
| 0
|- style="background: #e5e5e5;" |
| id="paramEqualThreshold" | Equal Threshold
| Value used on the equality test to define a comparison threshold and prevent precision errors. Only visible if the respective input port is not connected.
| 0
|}
|}


{| class="wikitable" style="width: 100%;"
{| class="wikitable" style="width: 100%;"
Line 44: Line 48:
| Float
| Float
|-
|-
| id="paramA>B" | A > B
| A > B
| Value to be outputted if value of A is greater than value of B.
| Value to be outputted if value of A is greater than value of B.
| Float <sup id="ref1">[[#anchor|[1]]]</sup>
| Float <sup id="ref1">[[#anchor|[1]]]</sup>
|-
|-
| id="paramA==B" |A == B
| A == B
| Value to be outputted if value of A is equal to value of B.
| Value to be outputted if value of A is equal to value of B.
| Float <sup id="ref1">[[#anchor|[1]]]</sup>
| Float <sup id="ref1">[[#anchor|[1]]]</sup>
|-
|-
| id="paramA<B" |A < B
| A < B
| Value to be outputted if value of A is less than value of B.  
| Value to be outputted if value of A is less than value of B.  
| Float <sup id="ref1">[[#anchor|[1]]]</sup>
|-
| Equal Threshold
| Value used on the equality test to define a comparison threshold and prevent precision errors.
| Float <sup id="ref1">[[#anchor|[1]]]</sup>
| Float <sup id="ref1">[[#anchor|[1]]]</sup>
|}
|}

Revision as of 11:31, 7 November 2017

Back to Node List

If [Community] Node

The If [Community] node compares two float inputs A and B and outputs a value from on one of its inputs A > B , A == B or A < B according to the comparison result.

Node Parameter Description Default Value
A First value of the comparison operation. Only visible if the respective input port is not connected. 0
B Second value of the comparison operation. Only visible if the respective input port is not connected. 0
A > B Value to be outputted if value of A is greater than value of B. Only visible if the respective input port is not connected. 0
A == B Value to be outputted if value of A is equal to value of B. Only visible if the respective input port is not connected. 0
A < B Value to be outputted if value of A is less than value of B. Only visible if the respective input port is not connected. 0
Equal Threshold Value used on the equality test to define a comparison threshold and prevent precision errors. Only visible if the respective input port is not connected. 0
Input Port Description Type
A First value of the comparison operation. Float
B Second value of the comparison operation. Float
A > B Value to be outputted if value of A is greater than value of B. Float [1]
A == B Value to be outputted if value of A is equal to value of B. Float [1]
A < B Value to be outputted if value of A is less than value of B. Float [1]
Equal Threshold Value used on the equality test to define a comparison threshold and prevent precision errors. Float [1]

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

Back to Node List