|
@@ -176,15 +176,20 @@ THREE.WebGLState = function ( gl, extensions, paramThreeToGL ) {
|
|
|
|
|
|
this.setBlending = function ( blending, blendEquation, blendSrc, blendDst, blendEquationAlpha, blendSrcAlpha, blendDstAlpha ) {
|
|
|
|
|
|
- if ( blending !== currentBlending ) {
|
|
|
+ if ( blending === THREE.NoBlending ) {
|
|
|
|
|
|
- if ( blending === THREE.NoBlending ) {
|
|
|
+ this.disable( gl.BLEND );
|
|
|
|
|
|
- this.disable( gl.BLEND );
|
|
|
+ } else {
|
|
|
|
|
|
- } else if ( blending === THREE.AdditiveBlending ) {
|
|
|
+ this.enable( gl.BLEND );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if ( blending !== currentBlending ) {
|
|
|
+
|
|
|
+ if ( blending === THREE.AdditiveBlending ) {
|
|
|
|
|
|
- this.enable( gl.BLEND );
|
|
|
gl.blendEquation( gl.FUNC_ADD );
|
|
|
gl.blendFunc( gl.SRC_ALPHA, gl.ONE );
|
|
|
|
|
@@ -192,7 +197,6 @@ THREE.WebGLState = function ( gl, extensions, paramThreeToGL ) {
|
|
|
|
|
|
// TODO: Find blendFuncSeparate() combination
|
|
|
|
|
|
- this.enable( gl.BLEND );
|
|
|
gl.blendEquation( gl.FUNC_ADD );
|
|
|
gl.blendFunc( gl.ZERO, gl.ONE_MINUS_SRC_COLOR );
|
|
|
|
|
@@ -200,17 +204,11 @@ THREE.WebGLState = function ( gl, extensions, paramThreeToGL ) {
|
|
|
|
|
|
// TODO: Find blendFuncSeparate() combination
|
|
|
|
|
|
- this.enable( gl.BLEND );
|
|
|
gl.blendEquation( gl.FUNC_ADD );
|
|
|
gl.blendFunc( gl.ZERO, gl.SRC_COLOR );
|
|
|
|
|
|
- } else if ( blending === THREE.CustomBlending ) {
|
|
|
-
|
|
|
- this.enable( gl.BLEND );
|
|
|
-
|
|
|
} else {
|
|
|
|
|
|
- this.enable( gl.BLEND );
|
|
|
gl.blendEquationSeparate( gl.FUNC_ADD, gl.FUNC_ADD );
|
|
|
gl.blendFuncSeparate( gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA );
|
|
|
|