This node offers a collection of features in context of the depth logic in the fragment shader. Depending on ViewportDepthNode#scope, it can be used to define a depth value for the current fragment or for depth evaluation purposes.
Constructor
new ViewportDepthNode(scope, valueNode?)| Parameter | Type | Default Value |
|---|---|---|
| scope | "depth" | "depthBase" | "linearDepth" | — |
| valueNode? | null | Node | null |
Constructs a new viewport depth node.
| Accessor | Type | |
|---|---|---|
| get type | string | |
Properties
| Property | Type | Default Value | |
|---|---|---|---|
| scope | "depth" | "depthBase" | "linearDepth" | — | |
| valueNode | null | Node | — | |
| isViewportDepthNode | boolean | — | |
| Method | Type | |
|---|---|---|
| generate | (builder: any) => any | |
| setup | ({ camera }: { camera: any; }) => any | |
Extends
NodeTSL function for converting a viewZ value to an orthographic depth value.
| Parameter | Type | Default Value |
|---|---|---|
| viewZ | Node<float> | — |
| near | Node<float> | — |
| far | Node<float> | — |
Returns
Node<float>TSL function for converting a viewZ value to a reversed orthographic depth value.
| Parameter | Type | Default Value |
|---|---|---|
| viewZ | Node<float> | — |
| near | Node<float> | — |
| far | Node<float> | — |
Returns
Node<float>TSL function for converting an orthographic depth value to a viewZ value.
| Parameter | Type | Default Value |
|---|---|---|
| depth | Node<float> | — |
| near | Node<float> | — |
| far | Node<float> | — |
Returns
Node<float>TSL function for converting a viewZ value to a perspective depth value.
Note: {link https://twitter.com/gonnavis/status/1377183786949959682}.
| Parameter | Type | Default Value |
|---|---|---|
| viewZ | Node<float> | — |
| near | Node<float> | — |
| far | Node<float> | — |
Returns
Node<float>TSL function for converting a viewZ value to a reversed perspective depth value.
| Parameter | Type | Default Value |
|---|---|---|
| viewZ | Node<float> | — |
| near | Node<float> | — |
| far | Node<float> | — |
Returns
Node<float>TSL function for converting a perspective depth value to a viewZ value.
| Parameter | Type | Default Value |
|---|---|---|
| depth | Node<float> | — |
| near | Node<float> | — |
| far | Node<float> | — |
Returns
Node<float>TSL function for converting a viewZ value to a logarithmic depth value.
| Parameter | Type | Default Value |
|---|---|---|
| viewZ | Node<float> | — |
| near | Node<float> | — |
| far | Node<float> | — |
Returns
Node<float>TSL function for converting a logarithmic depth value to a viewZ value.
| Parameter | Type | Default Value |
|---|---|---|
| depth | Node<float> | — |
| near | Node<float> | — |
| far | Node<float> | — |
Returns
Node<float>TSL object that represents the depth value for the current fragment.
Type
ViewportDepthNodeTSL function for converting a perspective depth value to linear depth.
| Parameter | Type | Default Value |
|---|---|---|
| value? | Node<float> | — |
Returns
ViewportDepthNode<float>TSL object that represents the linear (orthographic) depth value of the current fragment
Type
ViewportDepthNode