Unity Products:Amplify Shader Editor/Grab Screen Position and Unity Products:Amplify Shader Editor/Grayscale: Difference between pages

From Amplify Creations Wiki
(Difference between pages)
Jump to navigation Jump to search
ampwiki>Amplify RnD Rick
 
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]]
== Grab Screen Position Node ==


The Grab Screen Position node outputs a transformed screen position of the current pixel, ready to be directly used on a [[Unity_Products:Amplify_Shader_Editor/Grab_Screen_Color|Grab Screen Color]] node.
== Grayscale Node ==
According to the selected [[#paramType|Type]] parameter the position value can be either in Screen Coordinates, '''[ 0, Screen Width - 1 ]''' for X axis and '''[ 0, Screen Height - 1 ]''' for Y axis, or in a normalized '''[0,1]''' range for both axis.<br/>
'''NOTE:''' This node is similar to [[Unity_Products:Amplify_Shader_Editor/Screen_Position|Screen Position]] but internally does some additional steps to ensure that it takes both VR Single Pass Stereo and vertical orientation API differences ( Screen Space coordinates origin starting on top left corner instead of bottom left corner )  into account. This way when used with [[Unity_Products:Amplify_Shader_Editor/Grab_Screen_Color|Grab Screen Color]] will always fetch the desired color from a Grab Pass.


<img class="responsive-img" src="http://wiki.amplify.pt/images/NodeDetail/GrabScreenPosAndColor.jpg">
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.
 
<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/Grab_Screen_Position|Grab Screen Position]],
[[Unity_Products:Amplify_Shader_Editor/Texture_Sample|Texture Sample]],
[[Unity_Products:Amplify_Shader_Editor/Float|Float]],
[[Unity_Products:Amplify_Shader_Editor/Grayscale|Grayscale]]
[[Unity_Products:Amplify_Shader_Editor/Texture_Sample|Texture Sample]],  
[[Unity_Products:Amplify_Shader_Editor/Add|Add]],
[[Unity_Products:Amplify_Shader_Editor/Grab_Screen_Color|Grab Screen Color]]
</font>
</font>


Line 18: 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="paramType" | Type
| id="paramGrayscaleStyle" | Grayscale Style
| Defines how the screen position value should be presented
| Available styles to calculate a grayscale value from a color.
* '''Normalized:''' Position value is set on a [0,1] range for both x and y axis.
* '''Luminance:''' Uses Unity internal Luminance function ( Dot product between color value and unity_ColorSpaceLuminance)
* '''Screen:''' Position value is set according to actual screen size.
* '''Natural Classic:''' Dot product between color value and vector 0.299,0.587,0.114
| Normalized
* '''Old School:''' Calculates color average value ( sums all channels and divide by 3 )
| Luminance
|}
|}


Line 29: Line 30:
{| class="wikitable" style="width: 100%;"
{| class="wikitable" style="width: 100%;"
|-  
|-  
! style="width: 10%;" | Output Port !! Description !! style="width: 10%;" | Type
! style="width: 10%;" | Input Port !! Description !! style="width: 10%;" | Type
|-
| XYZW
| Returns the Grab Screen Position value
| Float4
|-
| X
| Returns only the X component of the Grab Screen Position
| Float
|-
| Y
| Returns only the Y component of the Grab Screen Position
| Float
|-
| Z
| Returns only the Z component of the Grab Screen Position
| Float
|-  
|-  
| W
| RGB
| Returns only the W component of the Grab Screen Position
| Color value to be converted to grayscale.
| Float
| Vector 3
|}
|}




[[Unity_Products:Amplify_Shader_Editor/Nodes | Back to Node List]]
[[Unity_Products:Amplify_Shader_Editor/Nodes | Back to Node List]]
[[Category:Nodes]][[Category:Camera and Screen]]
[[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