B.Render.StencilState()

Represent a stencil rendering state.

To get the object use pass.state(B.Render.State.STENCIL).

TYPES:

Op

Describes stencil operations.

{B.Render.StencilOp} failStencil

the action when the stencil test fails

{B.Render.StencilOp} failDepth

the action when the stencil test passes, but the depth test fails

{B.Render.StencilOp} passAll

the action when both the stencil test and the depth test pass, or when the stencil test passes and either there is no depth buffer or depth testing is not enabled

METHODS:

pass()

Returns linked pass.

RETURNS:

default()

Resets to default values.

// equivalent to
state.test(false);
state.ref(0);
state.mask(1);
state.op(B.Render.StencilOp.KEEP, B.Render.StencilOp.KEEP, B.Render.StencilOp.KEEP);
state.write(1);

RETURNS:

test(func)

Sets stencil test compare function.

PARAMETERS:

{B.Render.CmpFunc} func

pass false to disable stencil test

RETURNS:

test()

Returns stencil test compare function.

RETURNS:

{false | B.Render.CmpFunc}

false if stencil test is disabled

ref(value)

Sets stencil test reference value.

PARAMETERS:

{number} value

RETURNS:

ref()

Gets stencil test reference value.

RETURNS:

{number}

mask(value)

Sets stencil test mask.

PARAMETERS:

{number} value

the mask is ANDed with both the reference value and the stored stencil value

RETURNS:

mask()

Gets stencil test mask.

RETURNS:

{number}

op(value)

Sets stencil operations.

PARAMETERS:

RETURNS:

op(failStencil, failDepth, passAll)

Sets stencil operations parameters.

PARAMETERS:

{B.Render.StencilOp} failStencil

the action when the stencil test fails

{B.Render.StencilOp} failDepth

the action when the stencil test passes, but the depth test fails

{B.Render.StencilOp} passAll

the action when both the stencil test and the depth test pass, or when the stencil test passes and either there is no depth buffer or depth testing is not enabled

RETURNS:

op()

Gets stencil operations.

write(mask)

Sets stencil write mask.

PARAMETERS:

{number} mask

RETURNS:

write()

Gets stencil write mask.

RETURNS:

{number}

TYPES:

METHODS: