Unity Products:Amplify Shader Editor/Surface Depth

From Amplify Creations Wiki
Revision as of 00:06, 2 December 2023 by AmplifyWiki (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Back to Node List

Surface Depth Node

The Surface Depth node outputs the distance between the object surface and the camera. It can be set in a [0,1] range or use its real value directly in View Space range by changing the View Space parameter.
NOTE: The distance value is obtained by transforming each vertex position into view space and returning its Z value thus it's not dependent on the Depth buffer.


Nodes used: Surface Depth

Node Parameter Description Default Value
View Space Defines how the distance value between camera and surface is to be presented
  • Eye Space: Real distance value between camera and surface
  • 0-1 Space: Distance value in a linear [0,1] range
Eye Space
Input Port Description Type
Vertex Position If set, returns surface depth for the specified vertex position. Useful when applying a vertex offset to shader and need to get the offsetted surface depth. Float3


Back to Node List