# Class: stencilcommand

Stencilcommand allows discarding pixels based on stencil buffer. Here you can define the test and the write operations. l2dflag will ignore twosided stenciling and use front for both, else twosided stenciling is only done when the rfNoCull flag is forced. Other than that we use same operations (front) for front and back faces. Be aware that if system does not support twosided stenciling, we need to multipass, and we cannot guarantee that the result is exactly like with twosided support.

## Hierarchy

    o-+ renderinterface
      o-+ stencilcommand

## Classes that implement this interface:

- l2dflag
- rcmdstencil

## Methods:

scEnabled (stencilcommand,[boolean state,[int side]])
  returns: ([boolean])
  returns or sets if command should be enabled. Which side should be affected can also be set 0 = front, 1 = back, -1 both modes active (needs capability).
scFunction (stencilcommand,[comparemode front,comparemode back,int threshold, int mask])
  returns: ([comparemode front,comparemode back,int threshold, int mask])
  returns or sets how the stencil test should be done, and the binary mask for before writing is done.
scOperation (stencilcommand,int side,[operationmode fail, operationmode zfail, operationmode zpass])
  returns: ([operationmode fail, operationmode zfail, operationmode zpass])
  returns or sets what to do when depth/stencil fails or passes. side 0 = frontface, 1 = backface. It defines how the value is combined with the old stencilbuffer value.

## Inherited Methods: