This Tutorial requires some minimal knowledge about Blender, you won’t have fun following it if you’re unfamiliar with using nodes.
So today I found a great Video on Youtube that led me to this article on how to reduce noise in Blender when rendering with Cycles. It shows a handy technique to avoid high sample numbers and thereby long rendering times but still get a clean image without noise. I recommend you give it a read, its very handy information!
Adapting this for my render, as I have a lot of indirect light bouncing around in my scene, creating a very noisy image was pretty straight forward. Here my render with only a few samples (and some compositing that I removed later) without reduction to give you an overview:
The Ignored Settings
Lets start with the settings less often discussed: Light Paths. These allow us to determine how many bounces a ‘virtual photon’ does before it ‘dies’. These are my settings:
I turned off the caustics, because the blue thing you can see in the video above is made of glass and I’m rendering on CPU, because the scene is too complex for the 1GB VRAM I have in my Notebook. Additionally all the surfaces in the scene except the lights have some sort of gloss to them, so I Added a 0.25 blur to the glossy bounces to reduce the noise caused by blurry bounces.
The transparency- and normal-bounces I set to 8, anything below makes it too noisy to work with the image. Diffuse, Glossy, Transmission and Volume I didn’t touch and left ad their default preview values. And last but not least I turned off the Shadows checkbox, to ignore the transparency of shadows and safe render-time.
Tipp: If you render with your GPU instead of your CPU, go to the oerformance section of the render panel and set the tile size to 2^n = 256x256 or 512x512. This speeds you up significantly. If you render with your CPU, try 16x16, 32x32 or 64x64.
Now for the samples.
The samples strongly affect your image quality, they are your image. The more you can afford to wait for your Computer to calculate the better, right? No. Thats why I have to give you some information instead of a step by step tutorial.
At some point increasing the number of samples improves your image only so little, you won’t notice anymore. For Example I tried 100, then 50, then 10, then 20 and then 25 until I had found that at 25 samples the quality improvement slows down too much to be worth the extra render time. This basically is how samples improve your image, more always means better, but at some point you won’t notice anymore:
The same curve btw. holds true for time vs. samples, with the samples on the vertical axis and time on the horizontal axis. With that in mind, here are some sample samples:
The interesting question then is to see at how many samples your scene stalls out improving in render quality. You’ll get a feeling for it, especially if you take an afternoon and play around with all the render settings.
Noise Reduction in Cycles
Now lets move on to the actual noise reduction. We will achieve this by selectively blurring the rendered image. Yes, we will blur the entire image; but doing so we will retain the sharp edges of objects. We’ll achieve this in compositing after the render has finished, but to do so we need a way to know the sharp edges of the objects in our scene. Now we could to this in a fancy way with a normals pass and thereby get a perfect result, but I’ll do the noob and blur the things with the same texture together. If you want more accuracy, use Render Layers or do the entire thing using a normals map and an edge-split like filter you’ll have to device yourself in the compositer. My skills aren’t that fancy yet, I just got started with blender like a week ago…
1. Turn on the Material Index pass. To do so select the Scene Options in the Properties Panel and under “Passes” activate Material Index. I activated the ‘Normal’ as well, so I would have something to explore after this experiment. And the ‘Z’ is turned on, to see if I can use it to add Depth of Field after the render as opposed to how I do it now in the camera’s properties.
2. Go through your materials and add IDs, so the Material Index pass actually has some use.
3. Figure out how many samples are the best for your render. This you’ll have to do through trial and error, I went with 25. Samples are per pixel, so theoretically it shouldn’t need to be changed if you change the resolution.
4. Render one single frame at at least 75% of Full HD. (That is 1920x1080px and 75%) Eat a salad or go for a run, its going to take some time. Mine took 10 Minutes.
This is my render result - still pretty noisy, especially the polished concrete.
I used a pass Index for the Floor-Material, one for the back wall, one for the “tree”, one for the lights and one for the glowy things on the “tree”. This allowed me to use the ‘Mask ID’ Node in the Compositor to mask off the sections I wanted to blur. First, here is the Node-Group I created to blur:
I numbered the nodes in the group.
Switch to the Compositor.
- Automatically createdwhen you group it afterward
- First node I added. Connect the ID Mask Node to the ‘IndexMA’ hook of the Render Layers Node. Do not activate anti alias, we’ll blur it anyways.
- The Blur Node inputs the alpha value of the ID Mask, because we’re going to edit the mask before we’re going to use it. Set the Blur Node to Gaussian or Fast Gaussian, I like percentages and won’t scale it much, so I activated ‘Relative’ to be able to use percent instead of absolute values. If you want to output your render in a significantly different size than the single frame you’ve just rendered, don’t use relative.
- Using the Color Ramp we’re now “growing” the blurred alpha mask by brightening the mid-tones. If you’ve ever used a graphics Program, this is equal to increasing the size of a selection.
- This alpha mask with soft edges is now used as factor in the Mix node to mix solid black with the rendered image. Now we have an image that only shows the parts selected by the alpha mask and otherwise black.
- The Images gets blurred and
- is then cut to have hard edges with a Mix node and an un-blurred ID Mask.
- Automatically created when grouped, this is the connection to the rest of the compositor.
And here is an animated GIF of what we just did:
We repeat this step with every material we added a pass index to and combine them using Mix nodes in ‘Add’ mode. For me this looks like that afterwards (I added some glow to my green lights in the tree):
And there we go, almost no noise to be seen ion those perfectly smooth surfaces without any structure to them. If you use textures and bump-maps, normal maps and interesting lighting, you’ll definitely not get any noise in your images anymore.
Follow me on Twitter or here on Tumblr to see the 2s short clip once its done rendering and uploading.
And if you’re a Blender Guru you might have an idea on how to use a normal map to do this?