# Using EffectComposer with shader that has two outputs

**URL:** <https://discourse.threejs.org/t/using-effectcomposer-with-shader-that-has-two-outputs/78655>\
**Category:** Questions\
**Tags:** effect-composer, shaders\
**Created:** [February 25, 2025, 11:24am UTC](https://discourse.threejs.org/t/using-effectcomposer-with-shader-that-has-two-outputs/78655 "2025-02-25T11:24:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hubtub2](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/hubtub2/32/57119_2.png) [@hubtub2](https://discourse.threejs.org/u/hubtub2)\
**Post date:** [February 25, 2025, 11:24am UTC](https://discourse.threejs.org/t/using-effectcomposer-with-shader-that-has-two-outputs/78655/1 "2025-02-25T11:24:45Z")

</div>

Are shaders with two outputs are supported by the EffectComposer (background: i need to pass 5 floats to the second shader).

I create a render target with count set to two:

```
var renderTarget = new WebGLRenderTarget( w, h, { type: FloatType, count:2 } );   

```

The first shader has two outputs declared like this:

```
layout(location = 0) out vec4 gxray;
layout(location = 1) out vec4 gmask;

```

For the ShaderPass I can set only one textureID as input:

```
shaderPass2 = new ShaderPass(shader2, "tInput", null, material2)

```

I tried this without success:

```
shaderPass2.uniforms["tInput"] = renderTarget.textures[0]  
shaderPass2.uniforms["tInput2"] = renderTarget.textures[1]    

```

Is this possible or should I try implementing this without EffectComposer?

The error/warning I always get:

```
GL_INVALID_OPERATION: Active draw buffers with missing fragment shader outputs.

```

---

<div class="post-metadata">

**Author:** ![manthrax](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/manthrax/32/2596_2.png) [@manthrax](https://discourse.threejs.org/u/manthrax)\
**Post date:** [February 27, 2025, 12:48am UTC](https://discourse.threejs.org/t/using-effectcomposer-with-shader-that-has-two-outputs/78655/2 "2025-02-27T00:48:51Z")

</div>

How are you controlling effectcomposer so that it binds your multitarget for output?

it sounds like its trying to output to its regular framebuffer setup.

This sounds complex enough that it might be easier to get it working outside of effectscomposer first, then perhaps convert it, if you can get it to work.
