PDA

View Full Version : alpha blending



pommeC
01-05-2018, 02:51 AM
hello I don't understand how blending works, i have set :


gl.disable(gl.DEPTH_TEST);
gl.enable(gl.BLEND);
gl.blendFunc(gl.SRC_ALPHA,gl.ONE_MINUS_SRC_ALPHA);
gl.blendEquation(gl.FUNC_ADD);
And I get this result :
https://img15.hostingpics.net/pics/981897problem.png

could someone explain me what is happening please ?
thanks in advance.

pommeC
01-05-2018, 04:22 AM
I get what was wrong, gimp save images as premutiplied alpha. I need to use

this.gl.blendFunc(this.gl.ONE, this.gl.ONE_MINUS_SRC_ALPHA);
Solved.