提交 b0403abc 编写于 作者: G Garrett Johnson

update webgl state

上级 156c32a1
......@@ -46,7 +46,7 @@ function Material() {
this.stencilFail = KeepStencilOp;
this.stencilZFail = KeepStencilOp;
this.stencilZPass = KeepStencilOp;
this.stencilWrite = true;
this.stencilWrite = false;
this.clippingPlanes = null;
this.clipIntersection = false;
......
......@@ -677,13 +677,12 @@ function WebGLState( gl, extensions, utils, capabilities ) {
depthBuffer.setMask( material.depthWrite );
colorBuffer.setMask( material.colorWrite );
var stencil = material.stencil;
var useStencil = stencil !== null;
stencilBuffer.setTest( useStencil );
if ( useStencil ) {
var stencilWrite = material.stencilWrite;
stencilBuffer.setTest( stencilWrite );
if ( stencilWrite ) {
stencilBuffer.setFunc( stencil.func, stencil.ref, stencil.mask );
stencilBuffer.setOp( stencil.fail, stencil.zfail, stencil.zpass );
stencilBuffer.setFunc( material.stencilFunc, material.stencilRef, material.stencilMask );
stencilBuffer.setOp( material.stencilFail, material.stencilZFail, material.stencilZPass );
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册