Unity Products:Amplify Shader Editor/Grab Screen Position

From Amplify Creations Wiki
Revision as of 16:52, 24 October 2017 by ampwiki>Amplify RnD Rick (→‎Grab Screen Position Node)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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 Grab Screen Color node. According to the selected 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.
NOTE: This node is similar to 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 Grab Screen Color will always fetch the desired color from a Grab Pass.


Nodes used: Grab Screen Position, Float, Texture Sample, Add, Grab Screen Color

Node Parameter Description Default Value
Type Defines how the screen position value should be presented
  • Normalized: Position value is set on a [0,1] range for both x and y axis.
  • Screen: Position value is set according to actual screen size.
Normalized


Output Port Description 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 Returns only the W component of the Grab Screen Position Float


Back to Node List