NiStencilPropertyGetStencilFunction

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search

This is a command from NifSE.

Syntax

(short:stencilFunc) NiStencilPropertyGetStencilFunction short:nifID short:blockID
(short:stencilFunc) NiStencilPropGetFunc short:nifID short:blockID

Returns the integer ID for the function used by the NiStencilProperty specified by blockID. The possible values and their meanings are indicated below.

Returns -1 if the function fails for any reason.

The default value of blockID, 0, indicates the NIF's root, a NiNode. NiNode blocks are not derived from NiStencilProperty, so this function will always require an explicit blockID.

Stencil Functions

This function determines whether a particular pixel will be drawn based on the contents of the stencil buffer at that location. The formula is StencilFunction(mask & buffer value, mask & ref). Thus, assuming the default mask value of 0xFFFFFFFF, a StencilFunction value of 1 (i.e. LESS) would mean that the stencil property tests value < ref, and if true, draws the pixel in question.

  • NEVER = 0
  • LESS = 1
  • EQUAL = 2
  • LEQUAL = 3
  • GREATER = 4
  • NOT_EQUAL = 5
  • GEQUAL = 6
  • ALWAYS = 7

See Also[edit | edit source]