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


== Clamp Node ==
== Clip Node ==


The Clamp node outputs its [[#paramInput|Input]] value or individual components of vectors clamped between the [ [[#paramMin|Min]] , [[#paramMax|Max]] ] range.
The Clip node conditionally discards a pixel before being outputted. This happens when [[#paramAlpha|Alpha]] value is less than [[#paramThreshold|Threshold]] '''(Alpha - Threshold < 0)'''
* '''Min:''' This value is returned if input value is less than Min
<br/>
* '''''Input:''''' This value is returned if input value is between Min and Max
'''NOTE:''' This node can only be connected to graphs attached to Output node's fragment input ports.
* '''Max:''' This value is returned if input value greater than Max


'''NOTE:''' If each input port have different channel amounts a cast is done to match the one with the most amount of channels.
<img class="responsive-img" src="http://wiki.amplify.pt/images/NodeDetail/ClipNode.gif">
 
<img class="responsive-img" src="http://wiki.amplify.pt/images/NodeDetail/ClampNode.gif">
<br/><font size="1">Nodes used:  
<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/Sin_Time|Sin Time]],
[[Unity_Products:Amplify_Shader_Editor/Float|Float]],
[[Unity_Products:Amplify_Shader_Editor/Float|Float]],
[[Unity_Products:Amplify_Shader_Editor/Clamp|Clamp]],  
[[Unity_Products:Amplify_Shader_Editor/Scale_And_Offset|Scale And Offset]],
[[Unity_Products:Amplify_Shader_Editor/Texture_Sample|Texture Sample]]
[[Unity_Products:Amplify_Shader_Editor/Clip|Clip]]
</font>
</font>


Line 22: Line 20:
! 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;" |
|- style="background: #e5e5e5;" |
| id="paramInput" | ''Input''
| id="paramAlpha" | Alpha
| Value to be clamped between the [ Min , Max ] range. Only visible if the respective input port is not connected.
| First value of the clip operation. Only visible if the respective input port is not connected.
| 0
| 0
|- style="background: #e5e5e5;" |
|- style="background: #e5e5e5;" |
| id="paramMin" | Min
| id="paramThreshold" | Threshold
| Minimum value of the clamp operation, if value is less than Min than this is the returned value. Only visible if the respective input port is not connected.
| Second value of the clip operation. Only visible if the respective input port is not connected.
| 0
| 0
|- style="background: #e5e5e5;" |
 
|id="paramMax" | Max 
| Maximum value of the clamp operation, if value is greater than Max than this is the returned value. Only visible if the respective input port is not connected.
| 1
|}
|}




Line 41: Line 35:
! style="width: 10%;" | Input Port !! Description !! style="width: 10%;" | Type
! style="width: 10%;" | Input Port !! Description !! style="width: 10%;" | Type
|-  
|-  
| ''Input''
| Input
| Value to be clamped between the [ Min , Max ] range. Fully outputted when ''Alpha = 0''.
| Value connected here is directly relayed to output port.
| Float <sup id="ref1">[[#anchor|[1]]]</sup>
| Float <sup id="ref1">[[#anchor|[1]]]</sup>
|-  
|-  
| Min
| Alpha
| Minimum value of the clamp operation, if value is less than Min than this is the returned value.
| First value of the clip operation.
| Float <sup id="ref1">[[#anchor|[1]]]</sup>
| Float <sup id="ref1">[[#anchor|[1]]]</sup>
|-
|-
| Max
| Threshold
| Maximum value of the clamp operation, if value is greater than Max than this is the returned value.
| Second value of the clip operation.
| Float <sup id="ref1">[[#anchor|[1]]]</sup>
| Float <sup id="ref1">[[#anchor|[1]]]</sup>
|}
|}
Line 56: Line 50:
----
----
# <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.
----
{| style="width: 100%; horizontal-align: right;"
|
Math Operators - Max/Min/Clamp
|{{#evt:
service=youtube
|id=https://youtu.be/R0yyoqgpdg8
|alignment=right
}}
|}


[[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 16:48, 5 December 2018

Back to Node List

Clip Node

The Clip node conditionally discards a pixel before being outputted. This happens when Alpha value is less than Threshold (Alpha - Threshold < 0).
NOTE: This node can only be connected to graphs attached to Output node's fragment input ports.


Nodes used: Texture Sample, Sin Time, Float, Scale And Offset, Clip

Node Parameter Description Default Value
Alpha First value of the clip operation. Only visible if the respective input port is not connected. 0
Threshold Second value of the clip operation. Only visible if the respective input port is not connected. 0


Input Port Description Type
Input Value connected here is directly relayed to output port. Float [1]
Alpha First value of the clip operation. Float [1]
Threshold Second value of the clip operation. Float [1]

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

Back to Node List