|
1 |
| -# Scene Depth Difference |
| 1 | +# Scene Depth Difference node |
2 | 2 |
|
3 |
| -## Description |
4 |
| - |
5 |
| -Provide a difference between a World Space Position and a Depth value for a given UV. |
| 3 | +The Scene Depth Difference node returns the difference in depth between a world space position and a value from the depth buffer. |
6 | 4 |
|
7 | 5 | ## Ports
|
8 | 6 |
|
9 |
| -| Name | Direction | Type | Binding | Description | |
10 |
| -|:-------|:-----------|:------|:--------|:------------| |
11 |
| -| Scene UV | Input | Vector4 | None | UV where to sample the depth. | |
12 |
| -| Position WS | Input | Vector3 | None | The world space position to compare with scene depth. | |
13 |
| -| Out | Output | Float | None | The difference between PositionWS and the depth. The difference is given relative to camera with **Eye** mode, in depth-buffer-value with **Raw** mode and in Linear value remap between 0 and 1 with the **Linear01** Mode. | |
| 7 | +| **Name** | **Direction** | **Type** | **Binding** | **Description** | |
| 8 | +|-|-|-|-|-| |
| 9 | +| **Scene UV** | Input | Vector 4 | None | Sets the normalized coordinates at which to fetch the scene depth from the depth buffer. The default is the normalized x, y coordinates of the fragment in screen space. For more information about the options, refer to the [Screen Position node](Screen-Position-Node.md). | |
| 10 | +| **Position WS** | Input | Vector 3 | None | Sets the world space position to compare the depth value at **Scene UV** to. The default is the x, y, z position of the fragment in world space. | |
| 11 | +| **Out** | Output | Float | None | The difference in depth between **Scene UV** and **Position WS**. The value depends on the **Sampling mode** property. The distance is negative if the depth value from **Scene UV** is closer to the camera than the depth from **Position WS**. | |
14 | 12 |
|
15 |
| -## Controls |
| 13 | +## Sampling modes |
16 | 14 |
|
17 |
| -| Name | Type | Options | Description | |
18 |
| -|:------------ |:-------------|:-----|:---| |
19 |
| -| Mode | Dropdown | Select **Linear01** to have a value between 0 and 1, **Eye** to have a World-Space value comparable to unit used on the scene and **Raw** if it's used with SceneDepthBuffer. | |
| 15 | +| **Name** | **Description** | |
| 16 | +|----------|------------------------------------| |
| 17 | +| **Linear 01** | Returns the distance in linear normalized space. The minimum distance is 0, and the maximum distance is 1. | |
| 18 | +| **Raw** | Returns the distance in the non-linear space the depth buffer uses. The minimum distance is 0, and the maximum distance is 1. | |
| 19 | +| **Eye** | Returns the distance in meters. | |
0 commit comments