EN
Este conteúdo não está disponível em seu idioma, mas aqui está a versão em inglês.

stencilFuncSeparate method

Sets the front and/or back function and reference value for stencil testing.

IE11

 

Syntax

WebGLRenderingContext.stencilFuncSeparate(face, func, ref, mask);

Parameters

face [in]

Type: number

Specifies whether front and/or back stencil state is updated.

func [in]

Type: number

Specifies the test function. The initial value is ALWAYS

ref [in]

Type: number

Specifies the reference value for the stencil test. ref is clamped to the range [0, 2(n - 1)], where n is the number of stencil bits for both the front and back-facing stencil bits. The stencil reference values for the front and back-facing stencil buffers (respectively STENCIL_REF and STENCIL_BACK_REF) default to 0.

mask [in]

Type: number

Specifies a mask that is bit-wise ANDed with both the reference value and the stored stencil value when the test is done. The initial value is composed entirely of 1's.

Return value

This method does not return a value.

Remarks

Write operations on the front-facing stencil buffer do not affect the contents of the back-facing stencil buffer (and vice-versa).

You can set the same stencil function on both the front and back-facing stencil buffers by calling stencilFuncSeparate with face set to FRONT_AND_BACK.

Calling stencilFuncSeparate with an invalid face enumeration value generates the INVALID_ENUM error code.

Calling stencilFuncSeparate with an invalid func enumeration value generates the INVALID_ENUMerror code and doesn’t affect any previously set parameter value on either the front or back-facing stencil buffers.

Different stencil reference and mask values can be set on the front and back-facing stencil buffers without generating an error, but attempting to render generates the INVALID_OPERATION error and does not affect the contents of the WebGL viewport.

See also

WebGLRenderingContext
stencilFunc

 

 

Mostrar:
© 2014 Microsoft