Similarly, we can obtain subtractive blending by writing the following:
gl.blendEquation(gl.FUNC_SUBTRACT);
gl.blendFunc(gl.ONE, gl.ONE);
This will change the blending equation to the following:
color = S * 1.0 - D * 1.0;
color = S - D;
All negative values will be set to 0. When all channels are negative, the result is black.