Subtractive Blending

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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.254.231