correctly implements SUBTRACT blend mode

This commit is contained in:
codeanticode
2013-10-03 18:23:04 -04:00
parent 312fb99508
commit eb72df7340

View File

@@ -5690,9 +5690,11 @@ public class PGraphicsOpenGL extends PGraphics {
} else if (blendMode == SUBTRACT) {
if (blendEqSupported) {
pgl.blendEquation(PGL.FUNC_ADD);
pgl.blendEquation(PGL.FUNC_REVERSE_SUBTRACT);
pgl.blendFunc(PGL.ONE, PGL.SRC_ALPHA);
} else {
PGraphics.showWarning(BLEND_DRIVER_ERROR, "SUBTRACT");
}
pgl.blendFunc(PGL.ONE_MINUS_DST_COLOR, PGL.ZERO);
} else if (blendMode == LIGHTEST) {
if (blendEqSupported) {
@@ -5712,11 +5714,9 @@ public class PGraphicsOpenGL extends PGraphics {
} else if (blendMode == DIFFERENCE) {
if (blendEqSupported) {
pgl.blendEquation(PGL.FUNC_REVERSE_SUBTRACT);
pgl.blendFunc(PGL.ONE, PGL.ONE);
} else {
PGraphics.showWarning(BLEND_DRIVER_ERROR, "DIFFERENCE");
pgl.blendEquation(PGL.FUNC_ADD);
}
pgl.blendFunc(PGL.ONE_MINUS_DST_COLOR, PGL.ZERO);
} else if (blendMode == EXCLUSION) {
if (blendEqSupported) {