# How do I bind multiple outputs of a shader to multiple textures with Threejs?

**URL:** <https://discourse.threejs.org/t/how-do-i-bind-multiple-outputs-of-a-shader-to-multiple-textures-with-threejs/14518>\
**Category:** Questions\
**Tags:** textures\
**Created:** [April 22, 2020, 6:10am UTC](https://discourse.threejs.org/t/how-do-i-bind-multiple-outputs-of-a-shader-to-multiple-textures-with-threejs/14518 "2020-04-22T06:10:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DengCun](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/dengcun/32/10881_2.png) [@DengCun](https://discourse.threejs.org/u/DengCun)\
**Post date:** [April 22, 2020, 6:10am UTC](https://discourse.threejs.org/t/how-do-i-bind-multiple-outputs-of-a-shader-to-multiple-textures-with-threejs/14518/1 "2020-04-22T06:10:17Z")

</div>

How do I bind multiple outputs of a shader to multiple textures with Threejs? I can not find any code about gl.COLOR\_ATTACHMENT1~16 in Three.js,it seems always only use gl.COLOR\_ATTACHMENT0.

---

<div class="post-metadata">

**Author:** ![looeee](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/looeee/32/59_2.png) [@looeee](https://discourse.threejs.org/u/looeee)\
**Post date:** [April 22, 2020, 6:35am UTC](https://discourse.threejs.org/t/how-do-i-bind-multiple-outputs-of-a-shader-to-multiple-textures-with-threejs/14518/2 "2020-04-22T06:35:46Z")

</div>

This feature is called multiple render targets (MRT).

The reason it’s not used much is due to lack of device support. You need to use the [WEBGL\_draw\_buffers extension](https://www.khronos.org/registry/webgl/extensions/WEBGL_draw_buffers/), which has [around 37% support](https://webglstats.com/webgl/extension/WEBGL_draw_buffers), or WebGL2, which has [around 54% support](https://webglstats.com/webgl2).

There’s a PR to add WebGL2 MRT to three.js:

> <https://github.com/mrdoob/three.js/pull/16390>

It would be nice to add WebGL1 support using draw\_buffers as well. But until the level of support goes up, I guess there’s just not much interest.

---

<div class="post-metadata">

**Author:** ![DengCun](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/dengcun/32/10881_2.png) [@DengCun](https://discourse.threejs.org/u/DengCun)\
**Post date:** [April 22, 2020, 8:21am UTC](https://discourse.threejs.org/t/how-do-i-bind-multiple-outputs-of-a-shader-to-multiple-textures-with-threejs/14518/3 "2020-04-22T08:21:18Z")

</div>

Thank you for answering my question. It was very helpful

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [April 22, 2020, 9:45am UTC](https://discourse.threejs.org/t/how-do-i-bind-multiple-outputs-of-a-shader-to-multiple-textures-with-threejs/14518/4 "2020-04-22T09:45:34Z")

</div>

/cc

> <https://stackoverflow.com/questions/61356853/how-do-i-bind-multiple-outputs-of-a-shader-to-multiple-textures-with-threejs>
