Unity Products:Amplify Shader Editor/Surface Depth
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 |
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 |