*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> OpenGL/glstencilfunc (3)              
Title
Content
Arch
Section
 

Contents


glStencilFunc(3G)	       OpenGL Reference		     glStencilFunc(3G)


NAME    [Toc]    [Back]

     glStencilFunc - set function and reference	value for stencil testing

C SPECIFICATION    [Toc]    [Back]

     void glStencilFunc( GLenum	func,
			 GLint ref,
			 GLuint	mask )

PARAMETERS    [Toc]    [Back]

     func  Specifies the test function.	 Eight tokens are valid:  GL_NEVER,
	   GL_LESS, GL_LEQUAL, GL_GREATER, GL_GEQUAL, GL_EQUAL,	GL_NOTEQUAL,
	   and GL_ALWAYS. The initial value is GL_ALWAYS.

     ref   Specifies the reference value for the stencil test.	ref is clamped
			    n
	   to the range	[0,2 -1], where	n is the number	of bitplanes in	the
	   stencil buffer. The initial value is	0.

     mask  Specifies a mask that is ANDed with both the	reference value	and
	   the stored stencil value when the test is done. The initial value
	   is all 1's.

DESCRIPTION    [Toc]    [Back]

     Stenciling, like depth-buffering, enables and disables drawing on a perpixel
 basis.  You draw into the stencil planes using GL drawing
     primitives, then render geometry and images, using	the stencil planes to
     mask out portions of the screen.  Stenciling is typically used in
     multipass rendering algorithms to achieve special effects,	such as
     decals, outlining,	and constructive solid geometry	rendering.

     The stencil test conditionally eliminates a pixel based on	the outcome of
     a comparison between the reference	value and the value in the stencil
     buffer.  To enable	and disable the	test, call glEnable and	glDisable with
     argument GL_STENCIL_TEST.	To specify actions based on the	outcome	of the
     stencil test, call	glStencilOp.

     func is a symbolic	constant that determines the stencil comparison
     function.	It accepts one of eight	values,	shown in the following list.
     ref is an integer reference value that is used in the stencil comparison.
				    n
     It	is clamped to the range	[0,2 -1], where	n is the number	of bitplanes
     in	the stencil buffer.  mask is bitwise ANDed with	both the reference
     value and the stored stencil value, with the ANDed	values participating
     in	the comparison.

     If	stencil	represents the value stored in the corresponding stencil
     buffer location, the following list shows the effect of each comparison
     function that can be specified by func.  Only if the comparison succeeds
     is	the pixel passed through to the	next stage in the rasterization
     process (see glStencilOp).	 All tests treat stencil values	as unsigned
			       n
     integers in the range [0,2	-1], where n is	the number of bitplanes	in the
     stencil buffer.



									Page 1






glStencilFunc(3G)	       OpenGL Reference		     glStencilFunc(3G)



     The following values are accepted by func:

     GL_NEVER	       Always fails.

     GL_LESS	       Passes if ( ref & mask )	< ( stencil & mask ).

     GL_LEQUAL	       Passes if ( ref & mask )	< ( stencil & mask ).

     GL_GREATER	       Passes if ( ref & mask )	> ( stencil & mask ).

     GL_GEQUAL	       Passes if ( ref & mask )	> ( stencil & mask ).

     GL_EQUAL	       Passes if ( ref & mask )	= ( stencil & mask ).

     GL_NOTEQUAL       Passes if ( ref & mask )	/  ( stencil & mask ).

     GL_ALWAYS	       Always passes.

NOTES    [Toc]    [Back]

     Initially,	the stencil test is disabled.  If there	is no stencil buffer,
     no	stencil	modification can occur and it is as if the stencil test	always
     passes.

ERRORS    [Toc]    [Back]

     GL_INVALID_ENUM is	generated if func is not one of	the eight accepted
     values.

     GL_INVALID_OPERATION is generated if glStencilFunc	is executed between
     the execution of glBegin and the corresponding execution of glEnd.

ASSOCIATED GETS    [Toc]    [Back]

     glGet with	argument GL_STENCIL_FUNC
     glGet with	argument GL_STENCIL_VALUE_MASK
     glGet with	argument GL_STENCIL_REF
     glGet with	argument GL_STENCIL_BITS
     glIsEnabled with argument GL_STENCIL_TEST

SEE ALSO    [Toc]    [Back]

      
      
     glAlphaFunc, glBlendFunc, glDepthFunc, glEnable, glIsEnabled, glLogicOp,
     glStencilOp


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
mac_test FreeBSD MAC framework testing policy
gcov FreeBSD coverage testing tool
diskperf IRIX Disk Performance Testing Utility
newer IRIX command for testing modification dates of two files
glstencilop IRIX set stencil test actions
glStencilOp Tru64 set stencil test actions
sclear IRIX clear the stencil planes to a specified value
swritemask IRIX specify which stencil bits can be written
glClearStencil Tru64 specify the clear value for the stencil buffer
glclearstencil IRIX specify the clear value for the stencil buffer
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service