diff --git a/core/src/processing/opengl/PGraphicsOpenGL.java b/core/src/processing/opengl/PGraphicsOpenGL.java index 7e25eacd4..e685772d3 100644 --- a/core/src/processing/opengl/PGraphicsOpenGL.java +++ b/core/src/processing/opengl/PGraphicsOpenGL.java @@ -6012,55 +6012,73 @@ public class PGraphicsOpenGL extends PGraphics { } else if (blendMode == BLEND) { if (blendEqSupported) { - pgl.blendEquation(PGL.FUNC_ADD); + pgl.blendEquationSeparate(PGL.FUNC_ADD, + PGL.FUNC_ADD); } - pgl.blendFunc(PGL.SRC_ALPHA, PGL.ONE_MINUS_SRC_ALPHA); + pgl.blendFuncSeparate(PGL.SRC_ALPHA, PGL.ONE_MINUS_SRC_ALPHA, + PGL.ONE, PGL.ONE); } else if (blendMode == ADD) { if (blendEqSupported) { - pgl.blendEquation(PGL.FUNC_ADD); + pgl.blendEquationSeparate(PGL.FUNC_ADD, + PGL.FUNC_ADD); } - pgl.blendFunc(PGL.SRC_ALPHA, PGL.ONE); + pgl.blendFuncSeparate(PGL.SRC_ALPHA, PGL.ONE, + PGL.ONE, PGL.ONE); } else if (blendMode == SUBTRACT) { if (blendEqSupported) { - pgl.blendEquation(PGL.FUNC_REVERSE_SUBTRACT); - pgl.blendFunc(PGL.SRC_ALPHA, PGL.ONE); + pgl.blendEquationSeparate(PGL.FUNC_REVERSE_SUBTRACT, + PGL.FUNC_ADD); + pgl.blendFuncSeparate(PGL.SRC_ALPHA, PGL.ONE, + PGL.ONE, PGL.ONE); } else { PGraphics.showWarning(BLEND_DRIVER_ERROR, "SUBTRACT"); } } else if (blendMode == LIGHTEST) { if (blendEqSupported) { - pgl.blendEquation(PGL.FUNC_MAX); + pgl.blendEquationSeparate(PGL.FUNC_MAX, + PGL.FUNC_ADD); + pgl.blendFuncSeparate(PGL.ONE, PGL.ONE, + PGL.ONE, PGL.ONE); } else { PGraphics.showWarning(BLEND_DRIVER_ERROR, "LIGHTEST"); } } else if (blendMode == DARKEST) { if (blendEqSupported) { - pgl.blendEquation(PGL.FUNC_MIN); + pgl.blendEquationSeparate(PGL.FUNC_MIN, + PGL.FUNC_ADD); + pgl.blendFuncSeparate(PGL.ONE, PGL.ONE, + PGL.ONE, PGL.ONE); } else { PGraphics.showWarning(BLEND_DRIVER_ERROR, "DARKEST"); } } else if (blendMode == EXCLUSION) { if (blendEqSupported) { - pgl.blendEquation(PGL.FUNC_ADD); + pgl.blendEquationSeparate(PGL.FUNC_ADD, + PGL.FUNC_ADD); } - pgl.blendFunc(PGL.ONE_MINUS_DST_COLOR, PGL.ONE_MINUS_SRC_COLOR); + pgl.blendFuncSeparate(PGL.ONE_MINUS_DST_COLOR, PGL.ONE_MINUS_SRC_COLOR, + PGL.ONE, PGL.ONE); } else if (blendMode == MULTIPLY) { if (blendEqSupported) { - pgl.blendEquation(PGL.FUNC_ADD); + pgl.blendEquationSeparate(PGL.FUNC_ADD, + PGL.FUNC_ADD); } - pgl.blendFunc(PGL.ZERO, PGL.SRC_COLOR); + pgl.blendFuncSeparate(PGL.ZERO, PGL.SRC_COLOR, + PGL.ONE, PGL.ONE); } else if (blendMode == SCREEN) { if (blendEqSupported) { - pgl.blendEquation(PGL.FUNC_ADD); + pgl.blendEquationSeparate(PGL.FUNC_ADD, + PGL.FUNC_ADD); } - pgl.blendFunc(PGL.ONE_MINUS_DST_COLOR, PGL.ONE); + pgl.blendFuncSeparate(PGL.ONE_MINUS_DST_COLOR, PGL.ONE, + PGL.ONE, PGL.ONE); } else if (blendMode == DIFFERENCE) { PGraphics.showWarning(BLEND_RENDERER_ERROR, "DIFFERENCE");