|
@@ -325,19 +325,26 @@ class Material extends EventDispatcher {
|
|
|
if ( this.opacity < 1 ) data.opacity = this.opacity;
|
|
|
if ( this.transparent === true ) data.transparent = true;
|
|
|
|
|
|
- data.depthFunc = this.depthFunc;
|
|
|
- data.depthTest = this.depthTest;
|
|
|
- data.depthWrite = this.depthWrite;
|
|
|
- data.colorWrite = this.colorWrite;
|
|
|
-
|
|
|
- data.stencilWrite = this.stencilWrite;
|
|
|
- data.stencilWriteMask = this.stencilWriteMask;
|
|
|
- data.stencilFunc = this.stencilFunc;
|
|
|
- data.stencilRef = this.stencilRef;
|
|
|
- data.stencilFuncMask = this.stencilFuncMask;
|
|
|
- data.stencilFail = this.stencilFail;
|
|
|
- data.stencilZFail = this.stencilZFail;
|
|
|
- data.stencilZPass = this.stencilZPass;
|
|
|
+ if ( this.blendSrc !== SrcAlphaFactor ) data.blendSrc = this.blendSrc;
|
|
|
+ if ( this.blendDst !== OneMinusSrcAlphaFactor ) data.blendDst = this.blendDst;
|
|
|
+ if ( this.blendEquation !== AddEquation ) data.blendEquation = this.blendEquation;
|
|
|
+ if ( this.blendSrcAlpha !== null ) data.blendSrcAlpha = this.blendSrcAlpha;
|
|
|
+ if ( this.blendDstAlpha !== null ) data.blendDstAlpha = this.blendDstAlpha;
|
|
|
+ if ( this.blendEquationAlpha !== null ) data.blendEquationAlpha = this.blendEquationAlpha;
|
|
|
+
|
|
|
+ if ( this.depthFunc !== LessEqualDepth ) data.depthFunc = this.depthFunc;
|
|
|
+ if ( this.depthTest === false ) data.depthTest = this.depthTest;
|
|
|
+ if ( this.depthWrite === false ) data.depthWrite = this.depthWrite;
|
|
|
+ if ( this.colorWrite === false ) data.colorWrite = this.colorWrite;
|
|
|
+
|
|
|
+ if ( this.stencilWriteMask !== 0xff ) data.stencilWriteMask = this.stencilWriteMask;
|
|
|
+ if ( this.stencilFunc !== AlwaysStencilFunc ) data.stencilFunc = this.stencilFunc;
|
|
|
+ if ( this.stencilRef !== 0 ) data.stencilRef = this.stencilRef;
|
|
|
+ if ( this.stencilFuncMask !== 0xff ) data.stencilFuncMask = this.stencilFuncMask;
|
|
|
+ if ( this.stencilFail !== KeepStencilOp ) data.stencilFail = this.stencilFail;
|
|
|
+ if ( this.stencilZFail !== KeepStencilOp ) data.stencilZFail = this.stencilZFail;
|
|
|
+ if ( this.stencilZPass !== KeepStencilOp ) data.stencilZPass = this.stencilZPass;
|
|
|
+ if ( this.stencilWrite === true ) data.stencilWrite = this.stencilWrite;
|
|
|
|
|
|
// rotation (SpriteMaterial)
|
|
|
if ( this.rotation !== undefined && this.rotation !== 0 ) data.rotation = this.rotation;
|