Postprocessing for selected grids

In three.js, can post-processing effects be applied only to selected grids?

For example, to have a cube with a grainy effect, while the rest of the scene does not have it. Thanks!

+6
source share
2 answers

Yes. There is an example of three.js that shows how to apply post-processing to selected grids using masking.

I think this example can be improved for clarity, but you can modify the example as follows:

composer4 = new THREE.EffectComposer( renderer, new THREE.WebGLRenderTarget( rtWidth, rtHeight, rtParameters ) ); composer4.addPass( renderScene ); composer4.addPass( renderMask ); composer4.addPass( effectDotScreen ); composer4.addPass( clearMask ); composer4.addPass( effectVignette ); 

You will get the following output:

post processing to the selected grid

This is a complex example, so you have to study it carefully.

three.js.r.77

+3
source

Yes, if you put your subject in another scene. But you will have a problem with rendering dept, some object will always be on top. It depends on the situation of your scene.

+5
source

All Articles