# StencilOp

> Specifies the operation that's performed on the stencil buffer when rendering.

## Definition

* **Type:** Enum
* **Namespace:** [UnityEngine.Rendering](/engine/6000.6/script-reference/unityengine/rendering.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public enum StencilOp
```

## Fields

| Value                                                                                                     | Description                                                                                                                                                           |
| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [DecrementSaturate](/engine/6000.6/script-reference/unityengine/rendering/stencilop/decrementsaturate.md) | Decrements the current stencil buffer value. Clamps to 0.                                                                                                             |
| [DecrementWrap](/engine/6000.6/script-reference/unityengine/rendering/stencilop/decrementwrap.md)         | Decrements the current stencil buffer value. Wraps stencil buffer value to the maximum representable unsigned value when decrementing a stencil buffer value of zero. |
| [IncrementSaturate](/engine/6000.6/script-reference/unityengine/rendering/stencilop/incrementsaturate.md) | Increments the current stencil buffer value. Clamps to the maximum representable unsigned value.                                                                      |
| [IncrementWrap](/engine/6000.6/script-reference/unityengine/rendering/stencilop/incrementwrap.md)         | Increments the current stencil buffer value. Wraps stencil buffer value to zero when incrementing the maximum representable unsigned value.                           |
| [Invert](/engine/6000.6/script-reference/unityengine/rendering/stencilop/invert.md)                       | Bitwise inverts the current stencil buffer value.                                                                                                                     |
| [Keep](/engine/6000.6/script-reference/unityengine/rendering/stencilop/keep.md)                           | Keeps the current stencil value.                                                                                                                                      |
| [Replace](/engine/6000.6/script-reference/unityengine/rendering/stencilop/replace.md)                     | Replace the stencil buffer value with reference value (specified in the shader).                                                                                      |
| [Zero](/engine/6000.6/script-reference/unityengine/rendering/stencilop/zero.md)                           | Sets the stencil buffer value to zero.                                                                                                                                |
