Difference between revisions of "Unity Products:Amplify Shader Editor/Smoothstep"

From Amplify Creations Wiki
Jump to: navigation, search
 
Line 6: Line 6:
 
Assuming that ''Max'' value is greater than ''Min'', a value of '''0''' is returned if ''Alpha'' is less than ''Min''. If on the other way ''Alpha'' is greater than ''Max'' than a value of '''1''' is returned.
 
Assuming that ''Max'' value is greater than ''Min'', a value of '''0''' is returned if ''Alpha'' is less than ''Min''. If on the other way ''Alpha'' is greater than ''Max'' than a value of '''1''' is returned.
  
'''NOTE:''' Smoothstep between multi-channel data types are done per-channel. If ''Min'' and ''Max'' have different channel amounts a cast is done to match the one with the most amount of channels.
+
'''NOTE 1:''' Smoothstep between multi-channel data types are done per-channel. If ''Min'' and ''Max'' have different channel amounts a cast is done to match the one with the most amount of channels.<br/>
 +
'''NOTE 2:''' Avoid setting an equal value to both [[#paramMin|Min]]  and [[#paramMax|Max]] as it will throw a division by 0 warning.<br/>
  
 
<img class="responsive-img" src="http://amplify.pt/NodeDetail/SmoothstepGraphicNode.png">
 
<img class="responsive-img" src="http://amplify.pt/NodeDetail/SmoothstepGraphicNode.png">

Latest revision as of 11:12, 20 October 2021

Back to Node List

Smoothstep Node

The Smoothstep node calculates a smooth Hermite interpolation value between 0 and 1, if its Input value is in the range [ Min , Max ] range.
Assuming that Max value is greater than Min, a value of 0 is returned if Alpha is less than Min. If on the other way Alpha is greater than Max than a value of 1 is returned.

NOTE 1: Smoothstep between multi-channel data types are done per-channel. If Min and Max have different channel amounts a cast is done to match the one with the most amount of channels.
NOTE 2: Avoid setting an equal value to both Min and Max as it will throw a division by 0 warning.


Nodes used: Color, Vertex TexCoord, Float, Smoothstep, Lerp

Node Parameter Description Default Value
Input Specify value to be interpolated. Only visible if the respective input port is not connected. 0
Min Specify minimum reference value to start the interpolation. 0 will be outputted for values of Alpha lower that this.

Only visible if the respective input port is not connected.

0
Max Specify maximum reference value to end the interpolation. 1 will be outputted for values of Alpha higher that this.

Only visible if the respective input port is not connected.

0


Input Port Description Type
Input Specify value to be interpolated. Float [1]
Min Specify minimum reference value to start the interpolation. 0 will be outputted for values of Alpha lower that this. Float [1]
Max Specify maximum reference value to end the interpolation. 1 will be outputted for values of Alpha higher that this. Float [1]

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

Back to Node List