Noise reduction on only one layer To reduce render times I want to apply some noise reduction on a simple scene using Cycles.

I don't want to apply it to all scene because it blurs a bit the first plane (A), so my idea is to separate layers and apply the denoise in the background layers, where the shadows are falling (B) and composite them.



How can I apply denoise to only one layer?
I have listed down the steps and attached the implemented blender file here.


Move the red circular object to layer 2
Give a material index to red object. I have given it a value of 1. We do this to have a mask for this object, which will be helpful during compositing.




3.Setup render layers as follows. Notice denoising is checked in render layer with shadow. Also 'material index' pass is checked for red object layer, which we will use in compositing.






In the compositor, set up the nodes as shown below.Basically, the material Id mask cuts out just the red object from the second render layer. We then add this to the other render layer with shadow. 




Done! Checkout the attached blend file, where I implemented the above steps.