浏览代码

Add docs for stencil operations

Garrett Johnson 6 年之前
父节点
当前提交
fd6f38dc3b
共有 2 个文件被更改,包括 75 次插入0 次删除
  1. 45 0
      docs/api/en/constants/Materials.html
  2. 30 0
      docs/api/en/materials/Material.html

+ 45 - 0
docs/api/en/constants/Materials.html

@@ -92,7 +92,52 @@
 		[page:Constant MixOperation] uses reflectivity to blend between the two colors.<br />
 		[page:Constant AddOperation] adds the two colors.
 		</p>
+		
+		<h2>Stencil Functions</h2>
+		<code>
+		THREE.NeverStencilFunc
+		THREE.LessStencilFunc
+		THREE.EqualStencilFunc
+		THREE.LessEqualStencilFunc
+		THREE.GreaterStencilFunc
+		THREE.NotEqualStencilFunc
+		THREE.GreaterEqualStencilFunc
+		THREE.AlwaysStencilFunc
+		</code>
+		<p>
+		Which stencil function the material uses to determine whether or not to perform a stencil operation.<br />
+		[page:Materials NeverStencilFunc] will never return true.<br />
+		[page:Materials LessStencilFunc] will return true if the stencil reference value is less than the current stencil value.<br />
+		[page:Materials EqualStencilFunc] will return true if the stencil reference value is equal to the current stencil value.<br />
+		[page:Materials LessEqualStencilFunc] will return true if the stencil reference value is less than or equal to the current stencil value.<br />
+		[page:Materials GreaterStencilFunc] will return true if the stencil reference value is greater than the current stencil value.<br />
+		[page:Materials NotEqualStencilFunc] will return true if the stencil reference value is not equal to the current stencil value.<br />
+		[page:Materials GreaterEqualStencilFunc] will return true if the stencil reference value is greater than or equal to the current stencil value.<br />
+		[page:Materials AlwaysStencilFunc] will always return true.<br />
+		</p>
 
+		<h2>Stencil Operations</h2>
+		<code>
+		THREE.ZeroStencilOp
+		THREE.KeepStencilOp
+		THREE.ReplaceStencilOp
+		THREE.IncrementStencilOp
+		THREE.DecrementStencilOp
+		THREE.IncrementWrapStencilOp
+		THREE.DecrementWrapStencilOp
+		THREE.InvertStencilOp
+		</code>
+		<p>
+		Which stencil operation the material will perform on the stencil buffer pixel if the provided stencil function passes.<br />
+		[page:Materials ZeroStencilOp] will set the stencil value to 0.<br />
+		[page:Materials KeepStencilOp] will not change the current stencil value.<br />
+		[page:Materials ReplaceStencilOp] will replace the stencil value with the specified stencil reference value.<br />
+		[page:Materials IncrementStencilOp] will increment the current stencil value by 1.<br />
+		[page:Materials DecrementStencilOp] will decrement the current stencil value by 1.<br />
+		[page:Materials IncrementWrapStencilOp] will increment the current stencil value by 1. If the value increments past 255 it will be set to 0.<br />
+		[page:Materials DecrementWrapStencilOp] will increment the current stencil value by 1. If the value decrements past 0 it will be set to 255.<br />
+		[page:Materials InvertStencilOp] will perform a bitwise iversion of the current stencil value.<br />
+		</p>
 
 		<h2>Source</h2>
 

+ 30 - 0
docs/api/en/materials/Material.html

@@ -123,6 +123,36 @@
 		When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
 		</p>
 
+		<h3>[property:Boolean stencilWrite]</h3>
+		<p>
+		Whether rendering this material has any effect on the stencil buffer. Default is *false*.
+		</p>
+
+		<h3>[property:Boolean stencilFunc]</h3>
+		<p>
+		The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
+		</p>
+
+		<h3>[property:Integer stencilRef]</h3>
+		<p>
+		The value to use when using stencil functions comparisons or performing stencil operations. Default is *0*.
+		</p>
+
+		<h3>[property:Boolean stencilMask]</h3>
+		<p>
+		The bit mask to use when comparing against or writing to the stencil buffer. Default is *0xFF*.
+		</p>
+
+		<h3>[property:Integer stencilFail]</h3>
+		<p>
+		Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
+		</p>
+
+		<h3>[property:Boolean stencilZFail]</h3>
+		<p>
+			Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
+		</p>
+
 		<h3>[property:Boolean flatShading]</h3>
 		<p>
 		Define whether the material is rendered with flat shading. Default is false.