# Cleaning a WebGLRenderTarget

**URL:** <https://discourse.threejs.org/t/cleaning-a-webglrendertarget/1129>\
**Category:** Questions\
**Tags:** render-target, textures\
**Created:** [November 2, 2017, 8:40am UTC](https://discourse.threejs.org/t/cleaning-a-webglrendertarget/1129 "2017-11-02T08:40:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![edap](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/edap/32/180_2.png) [@edap](https://discourse.threejs.org/u/edap)\
**Post date:** [November 2, 2017, 8:40am UTC](https://discourse.threejs.org/t/cleaning-a-webglrendertarget/1129/1 "2017-11-02T08:40:53Z")

</div>

Hello, I’m making an application that implement a ping pong buffer technique.

https://codepen.io/edapx/embed/preview/LzaOpp?height=300&slug-hash=LzaOpp&default-tabs=js,result&host=https://codepen.io&embed-version=2

I want that a certain moment, for example when I press a certain key, the first buffer (in the sketch, the `textureA`) is cleaned, and for cleaned I mean it becomes black, and it does not contain the image of the feather anymore. At this point the content of the buffer A should be copied in buffer B, and there should be only the feather visible, without the trails

What I’ve tried was to use `textureA.dispose()`, as explained in the doc [https://threejs.org/docs/#api/renderers/WebGLRenderTarget](https://threejs.org/docs/#api/renderers/WebGLRenderTarget), but this did not clear the texture, it simply dispatched a `dispose` event.  
What is the simplest way to clear it? should I draw a black square in the textureA WebGLRenderTarget?

---

<div class="post-metadata">

**Author:** ![edap](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/edap/32/180_2.png) [@edap](https://discourse.threejs.org/u/edap)\
**Post date:** [November 2, 2017, 1:37pm UTC](https://discourse.threejs.org/t/cleaning-a-webglrendertarget/1129/2 "2017-11-02T13:37:45Z")

</div>

Would make sense, to pass a black texture to the webGLRenderTarget?
