title: GUI clipping manual
GUI nodes can be used as clipping nodes---masks that control how other nodes are rendered. This manual explains how this feature works.
Box, Text and Pie nodes can be used for clipping. To create a clipping node, add a node in your GUI, then set its properties accordingly:
Clipping Mode : The mode used for clipping.
None renders the node without any clipping taking place.Stencil makes the node writing to the current stencil mask.Clipping Visible : Check to render the content of the node.
Clipping Inverted : Check to write the inversion of the node's shape to the mask.
Then add the node(s) you want to be clipped as children to the clipping node.
{srcset="images/gui-clipping/[email protected] 2x"}
Clipping works by having nodes writing to a stencil buffer. This buffer contains clipping masks: information that that tells the graphics card whether a pixel should be rendered or not.
Stencil will write its shape (or its inverse shape) to an new clipping mask stored in the stencil buffer.
{srcset="images/gui-clipping/[email protected] 2x"}
Here, three nodes are set up in a hierarchy:
Four combinations of normal and inverted clippers are possible for this hierarchy. The green area marks the part of the circle that is rendered. The rest is masked:
{srcset="images/gui-clipping/[email protected] 2x"}
Layers can be used to control rendering order (and batching) of nodes. When using layers and clipping nodes the usual layering order is overridden.
::: sidenote A clipping node and its hierarchy will be drawn first if it has a layer assigned and in the regular order if no layer is assigned. :::
{srcset="images/gui-clipping/[email protected] 2x"}
Here the clipper node "ocular" is set to "layer3" and the "bean" node is set to "layer1". The ocular clipper's texture is therefore rendered on top of the clipped bean.
The node "shield" is set to "layer2", but it has no effect on the node's render order in relation to "ocular" or "bean". To change the render order of "shield", change the node tree index order.