⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fglstencilop.html

📁 计算机图形学~想必是很多人需要的~在此共享一下
💻 HTML
字号:
<HTML><BODY><PRE>     <STRONG>NAME</STRONG>	  <STRONG>fglStencilOp</STRONG> - set stencil test actions     <STRONG>FORTRAN</STRONG> <STRONG>SPECIFICATION</STRONG>	  SUBROUTINE <STRONG>fglStencilOp</STRONG>( INTEGER*4 <EM>fail</EM>,				   INTEGER*4 <EM>zfail</EM>,				   INTEGER*4 <EM>zpass</EM> )     <STRONG>PARAMETERS</STRONG>	  <EM>fail</EM>	 Specifies the action to take when the stencil test		 fails.	 Six symbolic constants	are accepted:		 <STRONG>GL_KEEP</STRONG>, <STRONG>GL_ZERO</STRONG>, <STRONG>GL_REPLACE</STRONG>, <STRONG>GL_INCR</STRONG>,	<STRONG>GL_DECR</STRONG>, and		 <STRONG>GL_INVERT</STRONG>. The	initial	value is <STRONG>GL_KEEP</STRONG>.	  <EM>zfail</EM>	 Specifies the stencil action when the stencil test		 passes, but the depth test fails.  <EM>zfail</EM> accepts the		 same symbolic constants as <EM>fail</EM>. The initial value is		 <STRONG>GL_KEEP</STRONG>.	  <EM>zpass</EM>	 Specifies the stencil 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.	<EM>zpass</EM> accepts the same		 symbolic constants as <EM>fail</EM>. The initial value is		 <STRONG>GL_KEEP</STRONG>.     <STRONG>DESCRIPTION</STRONG>	  Stenciling, like depth-buffering, enables and	disables	  drawing on a per-pixel 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 value	in the stencil	  buffer and a reference value.	To enable and disable the	  test,	call <STRONG>fglEnable</STRONG> and <STRONG>fglDisable</STRONG> with argument	  <STRONG>GL_STENCIL_TEST</STRONG>; to control it, call <STRONG>fglStencilFunc</STRONG>.	  <STRONG>fglStencilOp</STRONG> takes three arguments that indicate what	  happens to the stored	stencil	value while stenciling is	  enabled.  If the stencil test	fails, no change is made to	  the pixel's color or depth buffers, and <EM>fail</EM> specifies what	  happens to the stencil buffer	contents.  The following six	  actions are possible.	  <STRONG>GL_KEEP</STRONG>	  Keeps	the current value.	  <STRONG>GL_ZERO</STRONG>	  Sets the stencil buffer value	to 0.	  <STRONG>GL_REPLACE</STRONG>	  Sets the stencil buffer value	to <EM>ref</EM>,	as			  specified by <STRONG>fglStencilFunc</STRONG>.	  <STRONG>GL_INCR</STRONG>	  Increments the current stencil buffer	value.			  Clamps to the	maximum	representable unsigned			  value.	  <STRONG>GL_DECR</STRONG>	  Decrements the current stencil buffer	value.			  Clamps to 0.	  <STRONG>GL_INVERT</STRONG>	  Bitwise inverts the current stencil buffer			  value.	  Stencil buffer values	are treated as unsigned	integers.	  When incremented and decremented, values are clamped to 0	  and 2n-1, where n is the value returned by querying	  <STRONG>GL_STENCIL_BITS</STRONG>.	  The other two	arguments to <STRONG>fglStencilOp</STRONG> specify stencil	  buffer actions that depend on	whether	subsequent depth	  buffer tests succeed (<EM>zpass</EM>) or fail (<EM>zfail</EM>) (see	  <STRONG>fglDepthFunc</STRONG>).  The actions are specified using the same six	  symbolic constants as	<EM>fail</EM>.  Note that <EM>zfail</EM> is ignored when	  there	is no depth buffer, or when the	depth buffer is	not	  enabled.  In these cases, <EM>fail</EM> and <EM>zpass</EM> specify stencil	  action when the stencil test fails and passes, respectively.     <STRONG>NOTES</STRONG>	  Initially the	stencil	test is	disabled.  If there is no	  stencil buffer, no stencil modification can occur and	it is	  as if	the stencil tests always pass, regardless of any call	  to <STRONG>fglStencilOp</STRONG>.     <STRONG>ERRORS</STRONG>	  <STRONG>GL_INVALID_ENUM</STRONG> is generated if <EM>fail</EM>,	<EM>zfail</EM>, or <EM>zpass</EM>	is any	  value	other than the six defined constant values.	  <STRONG>GL_INVALID_OPERATION</STRONG> is generated if <STRONG>fglStencilOp</STRONG> is	  executed between the execution of <STRONG>fglBegin</STRONG> and the	  corresponding	execution of <STRONG>fglEnd</STRONG>.     <STRONG>ASSOCIATED</STRONG>	<STRONG>GETS</STRONG>	  <STRONG>fglGet</STRONG> with argument <STRONG>GL_STENCIL_FAIL</STRONG>	  <STRONG>fglGet</STRONG> with argument <STRONG>GL_STENCIL_PASS_DEPTH_PASS</STRONG>	  <STRONG>fglGet</STRONG> with argument <STRONG>GL_STENCIL_PASS_DEPTH_FAIL</STRONG>	  <STRONG>fglGet</STRONG> with argument <STRONG>GL_STENCIL_BITS</STRONG>	  <STRONG>fglIsEnabled</STRONG> with argument <STRONG>GL_STENCIL_TEST</STRONG>     <STRONG>SEE</STRONG> <STRONG>ALSO</STRONG>	  <STRONG>fglAlphaFunc</STRONG>,	<STRONG>fglBlendFunc</STRONG>, <STRONG>fglDepthFunc</STRONG>, <STRONG>fglEnable</STRONG>,	  <STRONG>fglLogicOp</STRONG>, <STRONG>fglStencilFunc</STRONG></PRE></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -