# noErase() is not working in WEBGL

**URL:** <https://discourse.processing.org/t/noerase-is-not-working-in-webgl/20920>\
**Category:** Coding Questions\
**Created:** [May 15, 2020, 6:08pm UTC](https://discourse.processing.org/t/noerase-is-not-working-in-webgl/20920 "2020-05-15T18:08:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vheun](https://avatars.discourse-cdn.com/v4/letter/v/51bf81/32.png) [@vheun](https://discourse.processing.org/u/vheun)\
**Post date:** [May 15, 2020, 6:08pm UTC](https://discourse.processing.org/t/noerase-is-not-working-in-webgl/20920/1 "2020-05-15T18:08:31Z")

</div>

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](https://p5js.org/reference/#/p5/erase)

---

<div class="post-metadata">

**Author:** ![vheun](https://avatars.discourse-cdn.com/v4/letter/v/51bf81/32.png) [@vheun](https://discourse.processing.org/u/vheun)\
**Post date:** [May 15, 2020, 6:29pm UTC](https://discourse.processing.org/t/noerase-is-not-working-in-webgl/20920/2 "2020-05-15T18:29:09Z")

</div>

I think I might found the bug.

```auto
 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.

---

<div class="post-metadata">

**Author:** ![vheun](https://avatars.discourse-cdn.com/v4/letter/v/51bf81/32.png) [@vheun](https://discourse.processing.org/u/vheun)\
**Post date:** [May 15, 2020, 7:58pm UTC](https://discourse.processing.org/t/noerase-is-not-working-in-webgl/20920/3 "2020-05-15T19:58:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Sven](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/sven/32/8293_2.png) [@Sven](https://discourse.processing.org/u/Sven)\
**Post date:** [May 16, 2020, 11:00am UTC](https://discourse.processing.org/t/noerase-is-not-working-in-webgl/20920/4 "2020-05-16T11:00:31Z")

</div>

Hello @vheun, and welcome to the forum!

> [@vheun](#):
>
> The following example does not work the way it should.

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

---

<div class="post-metadata">

**Author:** ![vheun](https://avatars.discourse-cdn.com/v4/letter/v/51bf81/32.png) [@vheun](https://discourse.processing.org/u/vheun)\
**Post date:** [May 16, 2020, 1:50pm UTC](https://discourse.processing.org/t/noerase-is-not-working-in-webgl/20920/5 "2020-05-16T13:50:25Z")

</div>

The last one. WebGL.
