@@ -510,11 +510,87 @@ var WebGLRenderer = new Class({
510510 this . blendModes . push ( { func : [ gl . ONE , gl . ONE_MINUS_SRC_ALPHA ] , equation : gl . FUNC_ADD } ) ;
511511 }
512512
513+ // ADD
513514 this . blendModes [ 1 ] . func = [ gl . ONE , gl . DST_ALPHA ] ;
515+
516+ // MULTIPLY
514517 this . blendModes [ 2 ] . func = [ gl . DST_COLOR , gl . ONE_MINUS_SRC_ALPHA ] ;
518+
519+ // SCREEN
515520 this . blendModes [ 3 ] . func = [ gl . ONE , gl . ONE_MINUS_SRC_COLOR ] ;
521+
522+ // ERASE
516523 this . blendModes [ 17 ] . func = [ gl . ZERO , gl . ONE_MINUS_SRC_ALPHA ] ;
517524
525+ // This is like an inversed erase! alpha areas go black
526+ // this.blendModes[17].func = [ gl.ONE_MINUS_SRC_ALPHA, gl.SRC_ALPHA, gl.ONE, gl.ONE ];
527+
528+ // src RGB
529+ // dst RGB
530+ // src Alpha
531+ // dst Alpha
532+
533+ // gl.ZERO,
534+ // gl.ONE,
535+ // gl.SRC_COLOR,
536+ // gl.ONE_MINUS_SRC_COLOR,
537+ // gl.DST_COLOR,
538+ // gl.ONE_MINUS_DST_COLOR,
539+ // gl.SRC_ALPHA,
540+ // gl.ONE_MINUS_SRC_ALPHA,
541+ // gl.DST_ALPHA,
542+ // gl.ONE_MINUS_DST_ALPHA,
543+ // gl.CONSTANT_COLOR,
544+ // gl.ONE_MINUS_CONSTANT_COLOR,
545+ // gl.CONSTANT_ALPHA,
546+ // gl.ONE_MINUS_CONSTANT_ALPHA,
547+ // gl.SRC_ALPHA_SATURATE
548+
549+ // BLACK (with ADD)
550+
551+ // this.blendModes[17].func = [
552+ // gl.ZERO,
553+ // gl.ONE_MINUS_SRC_ALPHA,
554+ // gl.ONE,
555+ // gl.ONE
556+ // ];
557+
558+ // this.blendModes[17].func = [
559+ // gl.ONE,
560+ // gl.ZERO,
561+ // gl.ONE,
562+ // gl.ZERO
563+ // ];
564+
565+
566+ // this.blendModes[17].equation = gl.FUNC_ADD;
567+ // this.blendModes[17].equation = gl.FUNC_SUBTRACT;
568+ this . blendModes [ 17 ] . equation = gl . FUNC_REVERSE_SUBTRACT ;
569+
570+ // 0, 1, 2, 3
571+ // blendFuncSeparate(this._srcRGB, this._dstRGB, this._srcAlpha, this._dstAlpha);
572+
573+
574+ // this._srcRGB = this.gl.SRC_ALPHA;
575+ // this._dstRGB = this.gl.ONE;
576+ // this._srcAlpha = this.gl.ONE;
577+ // this._dstAlpha = this.gl.ONE;
578+ // this._modeRGB = this.gl.FUNC_ADD;
579+ // this._modeAlpha = this.gl.FUNC_ADD;
580+
581+
582+
583+
584+ // this._srcRGB = this.gl.SRC_ALPHA;
585+ // this._dstRGB = this.gl.ONE_MINUS_SRC_ALPHA;
586+ // this._srcAlpha = this.gl.ONE;
587+ // this._dstAlpha = this.gl.ONE;
588+ // this._modeRGB = this.gl.FUNC_REVERSE_SUBTRACT;
589+ // this._modeAlpha = this.gl.FUNC_REVERSE_SUBTRACT;
590+
591+ // gl.blendEquationSeparate(this._modeRGB, this._modeAlpha);
592+ // gl.blendFuncSeparate(this._srcRGB, this._dstRGB, this._srcAlpha, this._dstAlpha);
593+
518594 this . glFormats [ 0 ] = gl . BYTE ;
519595 this . glFormats [ 1 ] = gl . SHORT ;
520596 this . glFormats [ 2 ] = gl . UNSIGNED_BYTE ;
@@ -1016,7 +1092,7 @@ var WebGLRenderer = new Class({
10161092 this . flush ( ) ;
10171093
10181094 gl . enable ( gl . BLEND ) ;
1019- gl . blendEquation ( blendMode . equation ) ;
1095+ gl . blendEquation ( blendMode . equation , blendMode . equation ) ;
10201096
10211097 if ( blendMode . func . length > 2 )
10221098 {
0 commit comments