[resolved]Delete the render pipe with THREE.EffectComposer

I only see function like addPass, insertPass, render, reset, setSize, and swapBuffers.But I didn’t see delete in the THREE.EffectComposer, except what did I miss?

I now through the array to the operation of the rendering pipeline to delete, but I do think it does have a serious impact on the performance, after doing this in bloody android machine can not run!

So I’m wondering if there’s a better way to do it, or if you can just add a delete function directly inside this method.

In fact, I would like to add or delete the rendering pipeline dynamically, so that I can change the rendering effect dynamically like the game.

Now I don’t have any good ideas to implement, who can tell me how to solve this problem.

1 Like

If i understand you correctly, you are looking for a removePass() method in EffectComposer? If so, we might want to reopen your issue at github since it’s obviously a feature request.

BTW: “delete the rendering pipeline” makes no sense. The correct wording is probably “remove a post processing pass”.

You’re right. I really need a function like this.

Although I’m just a front-end developer, I don’t really understand a few things about rendering pipes. There is no doubt that the code for the shader is given to the GPU. But if I put a shaderpass into the EffectComposer, I’m just going to change the enabled property of this shaderpass to false, what kind of operation is it for a GPU? Does the GPU ignore the shaderpass or continue to do it, but not the shaderpass effect rendering to the screen?

If you set enabled to false, the composer will just skip the pass and proceed with the next one. The GPU has no additional work since no render operation is triggered. I think if the enabled flag is sufficient for you, there is no need to add an additional removePass() method.

1 Like

Well, that’s enough. Thank you very much.

But I’m still curious to see that switching the enabled property of shaderpass in an android device can cause the rendering to crash. It’s not a crash, but android devices have been slow to react. This scenario can’t be used. FPS only has poor single digits.

1 Like

I suppose you just enable a sophisticated pass that might be too compute-intensive for your mobile device. Just setting and evaluating the enabled flag is a cheap operation.

1 Like

Well, maybe I know how to do it. Thanks again for your help.

EffectComposer.removePass() was added with the following commit and will be available with r123.

1 Like