Capítulo 511 de 859

Chapter 511: ViewportDepthNode

Core Idea

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.

Key Concepts

  • isViewportDepthNode : boolean (readonly): This flag can be used for type testing.
  • scope : 'depth' | 'depthBase' | 'linearDepth': The node behaves differently depending on which scope is selected.
  • valueNode : Node: Can be used to define a custom depth value. The property is ignored in the ViewportDepthNode.DEPTH scope.

Reference Tables

Constructor

Signature
`new ViewportDepthNode( scope : 'depth'

Properties

PropertyDescription
.isViewportDepthNode : boolean (readonly)This flag can be used for type testing.
`.scope : 'depth''depthBase'
.valueNode : NodeCan be used to define a custom depth value. The property is ignored in the ViewportDepthNode.DEPTH scope.

Key Takeaways

  1. ViewportDepthNode extends: EventDispatcher → Node
  2. Most relevant properties: isViewportDepthNode, scope, valueNode.

Connects To