What is the best way to exclude certain objects or (ideally) a layer of objects from post-processing?
For example, I want to have a complex background scene rendered out with various post-process effects (SSAO, tilt-shift, etc) and then overlay another layer of 3D objects without the post-processing effects on them.
I was thinking that I could have 2 completely different WebGL renderers on top of each other (with transparent backgrounds) but I want the 2 layers to be integrated with each other, so it looks like the non-processed layer objects are integrated / on top of the processed layer objects.
If it helps, I’m not so fussed about the tilt-shift effecting the second layer – I’m most interested in making sure the second layer doesn’t have SSAO applied.
I hope this makes at least some sense. I wanted to ask here before I go down too deep of a rabbit hole when there’s likely a perfect approach that I don’t know about. 🙂
I’m assuming you use
THREE.EffectComposerfor the post-processing. Take a look at the advanced post-processing example and how it uses aMaskPass(which utilizes the stencil buffer) in theEffectComposerto limit certain post-processing (blur) to the background. You also need to have your background objects and foreground objects in separate scenes.