Unity Products:Amplify Shader Editor/Get Local Var and Unity Products:Amplify Shader Editor/Grayscale: Difference between pages

From Amplify Creations Wiki
(Difference between pages)
Jump to navigation Jump to search
m (1 revision imported)
 
m (1 revision imported)
 
Line 1: Line 1:
[[Unity_Products:Amplify_Shader_Editor/Nodes | Back to Node List]]
[[Unity_Products:Amplify_Shader_Editor/Nodes | Back to Node List]]


== Get Local Var Node ==
== Grayscale Node ==


The Get Local Var node ''( shortcut: G key )'' allows access to local values created via a [[Unity Products:Amplify Shader Editor/Register Local Var|Register Local Var]] node. This can be done by selecting a local variable through its [[#paramReference|Reference]] property available at the Node Properties window or upper left corner of the node body.
The Grayscale node outputs a grayscale float value from the color value specified on its [[#paramRGB|RGB]] property. Several styles can be selected via the [[#paramGrayscaleStyle|Grayscale Style]] property to achieve different results.
<br/>'''NOTE:''' Using this node is similar to directly connect the '''Register Local Var''' output to where the value is needed.


<img class="responsive-img" src="http://wiki.amplify.pt/images/NodeDetail/RegisterGetLocalVar.jpg">  
<img class="responsive-img" src="http://wiki.amplify.pt/images/NodeDetail/GrayscaleNode.jpg">
<br/><font size="1">Nodes used:  
<br/><font size="1">Nodes used:  
[[Unity_Products:Amplify_Shader_Editor/World_Normal|World Normal]],
[[Unity_Products:Amplify_Shader_Editor/Texture_Sample|Texture Sample]],
[[Unity_Products:Amplify_Shader_Editor/World_Space_Light_Dir|World Space Light Dir]],
[[Unity_Products:Amplify_Shader_Editor/Grayscale|Grayscale]]
[[Unity_Products:Amplify_Shader_Editor/Dot|Dot]],
[[Unity_Products:Amplify_Shader_Editor/Register_Local_Var|Register Local Var]],
[[Unity_Products:Amplify_Shader_Editor/Get_Local_Var|Get Local Var]],
[[Unity_Products:Amplify_Shader_Editor/Scale_And_Offset|Scale And Offset]],
[[Unity_Products:Amplify_Shader_Editor/Float|Float]],
[[Unity_Products:Amplify_Shader_Editor/Texture_Sample|Texture Sample]]
</font>
</font>


Line 21: Line 14:
|-
|-
! 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;" |
| id="paramRGB" | RGB
| Color value to be converted to grayscale. Only visible if the respective input port is not connected.
| 0,0,0
|-
|-
| id="paramReference" | Reference
| id="paramGrayscaleStyle" | Grayscale Style
| Lists all available local variables. Select one to be used by the node.
| Available styles to calculate a grayscale value from a color.
| None
* '''Luminance:''' Uses Unity internal Luminance function ( Dot product between color value and unity_ColorSpaceLuminance)
* '''Natural Classic:''' Dot product between color value and vector 0.299,0.587,0.114
* '''Old School:''' Calculates color average value ( sums all channels and divide by 3 )
| Luminance
|}
|}




[[Unity_Products:Amplify_Shader_Editor/Nodes | Back to Node List ]]
{| class="wikitable" style="width: 100%;"
[[Category:Nodes]][[Category:Miscellaneous]]
|-
! style="width: 10%;" | Input Port !! Description !! style="width: 10%;" | Type
|-
| RGB
| Color value to be converted to grayscale.
| Vector 3
|}
 
 
[[Unity_Products:Amplify_Shader_Editor/Nodes | Back to Node List]]
[[Category:Nodes]][[Category:Image Effects]]

Latest revision as of 00:06, 2 December 2023

Back to Node List

Grayscale Node

The Grayscale node outputs a grayscale float value from the color value specified on its RGB property. Several styles can be selected via the Grayscale Style property to achieve different results.


Nodes used: Texture Sample, Grayscale

Node Parameter Description Default Value
RGB Color value to be converted to grayscale. Only visible if the respective input port is not connected. 0,0,0
Grayscale Style Available styles to calculate a grayscale value from a color.
  • Luminance: Uses Unity internal Luminance function ( Dot product between color value and unity_ColorSpaceLuminance)
  • Natural Classic: Dot product between color value and vector 0.299,0.587,0.114
  • Old School: Calculates color average value ( sums all channels and divide by 3 )
Luminance


Input Port Description Type
RGB Color value to be converted to grayscale. Vector 3


Back to Node List