Difference between revisions of "Template:NifSE NiStencilProperty Stencil Functions"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>DragoonWraith
(New page: <noinclude>List of the texture slots used by <tt>NiStencilProperty</tt> blocks. Used by NifSE. </noinclude>== Stencil Functions...)
 
imported>DragoonWraith
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>List of the texture slots used by [[:Category:NifSE (NiStencilProperty)|<tt>NiStencilProperty</tt>]] blocks. Used by [[:Category:NifSE|NifSE]].
<noinclude>List of the stencil functions used by [[:Category:NifSE (NiStencilProperty)|<tt>NiStencilProperty</tt>]] blocks. Used by [[:Category:NifSE|NifSE]].


</noinclude>== Stencil Functions ==
</noinclude>== 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 <tt>StencilFunction([[NiStencilPropertyGetStencilMask|mask]] & buffer value, mask & [[NiStencilPropertyGetStencilRef|ref]])</tt>. Thus, assuming the default mask value of <tt>0xFFFFFFFF</tt>, a StencilFunction value of 1 (i.e. <tt>LESS</tt>) would mean that the stencil property tests <tt>value < ref</tt>, and if true, draws the pixel in question.


The function of each value is equivalent to the OpenGL Stencil function of similar name. These functions compare the Stencil value of each pixel against the <tt>NiStencilProperty</tt>'s [[NiStencilPropertyGetStencilThreshold|Stencil threshold]] before painting it.
* <tt>NEVER = 0</tt>
* <tt>NEVER = 0</tt>
* <tt>LESS = 1</tt>
* <tt>LESS = 1</tt>

Latest revision as of 17:48, 23 January 2011

List of the stencil functions used by NiStencilProperty blocks. Used by NifSE.

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