How to use selective postprocessing with any pass other than BloomPass

Hi, I’m really new to three js and currently I’m trying to extend this awesome example with DotScreenPass instead of UnrealBloomPass.
With UnrealBloomPass everything is working correctly! But when I replace UnrealBloomPass with DotScreenPass, I couldn’t observe any dot-pass effect. If I move scene with the mouse I could see DotScreenPass flickering )
I have no idea what I’m doing wrong ) Any help will be appreciated!
This is my code in sandbox. Thank you )

In addition to my previous message, I’ve found another wierd behavior. In this example I’ve added multiple effect composers and render them using request animation frame. And now all of them are flickering https://codesandbox.io/s/threejs-selective-postprocessing-byeqc?file=/src/index.js
Definetely I’ve missed something and doing something wrong (

So, with the help of one of my coleagues I’ve found solution of the problem:

In the first example we have to add swapBuffers before rendering composer https://codesandbox.io/s/threejs-selective-v4i0x?file=/src/index.js:5336-5365

In the second example we have to swapBuffers for each composer before render

Why should we swap the buffers before rendering?
As far as I could understand the case is something like this

2 Likes