noErase() is not working in WEBGL

The following example does not work the way it should. Once erase() is called it just erases everything. noErase() is not stopping the mode.

https://p5js.org/reference/#/p5/erase

I think I might found the bug.

 switch (this.curBlendMode) {
              case constants.BLEND:
              case constants.ADD:
                gl.blendEquation(gl.FUNC_ADD);
                gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
                break;

The case constants.BLEND is empty and since its the default noErase() does not reset back to what it should be.

Workaround:
Call blendMode(ADD) right after noErase();

Hello @vheun, and welcome to the forum!

The link you provide contains three examples. Which one doesn’t work as it should?

The last one. WebGL.

1 Like