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.
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>
</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 performing stencil comparisons or 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 stencilZPass]</h3>
<p>
Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
</p>
<h3>[property:Boolean flatShading]</h3>
<h3>[property:Boolean flatShading]</h3>
<p>
<p>
Define whether the material is rendered with flat shading. Default is false.
Define whether the material is rendered with flat shading. Default is false.
@@ -144,6 +153,41 @@ export class Material extends EventDispatcher {
...
@@ -144,6 +153,41 @@ export class Material extends EventDispatcher {
*/
*/
id:number;
id:number;
/**
* Whether rendering this material has any effect on the stencil buffer. Default is *false*.
*/
stencilWrite:boolean;
/**
* The stencil comparison function to use. Default is {@link AlwaysStencilFunc}. See stencil operation constants for all possible values.
*/
stencilFunc:StencilFunc;
/**
* The value to use when performing stencil comparisons or stencil operations. Default is *0*.
*/
stencilRef:number;
/**
* The bit mask to use when comparing against or writing to the stencil buffer. Default is *0xFF*.
*/
stencilMask:number;
/**
* Which stencil operation to perform when the comparison function returns false. Default is {@link KeepStencilOp}. See the stencil operation constants for all possible values.
*/
stencilFail:StencilOp;
/**
* Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is {@link KeepStencilOp}. See the stencil operation constants for all possible values.
*/
stencilZFail:StencilOp;
/**
* Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is {@link KeepStencilOp}. See the stencil operation constants for all possible values.
*/
stencilZPass:StencilOp;
/**
/**
* Used to check whether this or derived classes are materials. Default is true.
* Used to check whether this or derived classes are materials. Default is true.
* You should not change this, as it used internally for optimisation.
* You should not change this, as it used internally for optimisation.