Przeglądaj źródła

Merge remote-tracking branch 'kovleouf/dev' into dev

Mr.doob 13 lat temu
rodzic
commit
22419675e6
2 zmienionych plików z 9 dodań i 2 usunięć
  1. 1 0
      src/materials/Material.js
  2. 8 2
      src/renderers/WebGLRenderer.js

+ 1 - 0
src/materials/Material.js

@@ -43,3 +43,4 @@ THREE.AdditiveBlending = 1;
 THREE.SubtractiveBlending = 2;
 THREE.MultiplyBlending = 3;
 THREE.AdditiveAlphaBlending = 4;
+THREE.NoBlending = 5;

+ 8 - 2
src/renderers/WebGLRenderer.js

@@ -5175,8 +5175,13 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 			switch ( blending ) {
 
+				case THREE.NoBlending:
+                    _gl.disable( _gl.BLEND );
+                    break;
+                    
 				case THREE.AdditiveBlending:
 
+                    _gl.enable( _gl.BLEND );
 					_gl.blendEquation( _gl.FUNC_ADD );
 					_gl.blendFunc( _gl.SRC_ALPHA, _gl.ONE );
 
@@ -5185,7 +5190,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 				case THREE.SubtractiveBlending:
 
 					// TODO: Find blendFuncSeparate() combination
-
+                    _gl.enable( _gl.BLEND );
 					_gl.blendEquation( _gl.FUNC_ADD );
 					_gl.blendFunc( _gl.ZERO, _gl.ONE_MINUS_SRC_COLOR );
 
@@ -5194,7 +5199,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 				case THREE.MultiplyBlending:
 
 					// TODO: Find blendFuncSeparate() combination
-
+                    _gl.enable( _gl.BLEND );
 					_gl.blendEquation( _gl.FUNC_ADD );
 					_gl.blendFunc( _gl.ZERO, _gl.SRC_COLOR );
 
@@ -5202,6 +5207,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 				default:
 
+                    _gl.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 );