The Blending Function

Additive blending simply adds the colors of the source and destination fragments, creating a lighter image. We obtain additive blending by writing the following:

gl.blendFunc(gl.ONE, gl.ONE);

This assigns the weights for source and destination fragments sW and dW to 1. The color output will be as follows:

color = S * 1.0 + D * 1.0;
color = S + D;

Since each color channel is in the [0, 1] range, blending will clamp all values over 1. When all channels are 1, this results in a white color.

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

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