ノイズの低減 2.7

~作成中~


ノイズの低減
最終的なレンダリングを実行するときは、可能な限りノイズを減らすことが重要となります。ここでは、適度な時間内にアニメーションをレンダリングするときに特に重要ないくつかの物理の法則を破るトリックについて説明します。 クリックするとサンプル画像が拡大され、ノイズの違いをよく確認できます。

パストレーシング
Cyclesは、次のイベント判断でパストレースを使用します。これは、コースティクスといった、すべてのタイプの光効果をレンダリングするのには適していませんが、他のレンダリングアルゴリズムと比べてより詳細で大きなシーンをレンダリングできるという利点があります。これは、例えばフォトンマップをメモリに、といった記憶をするといった必要がなく、また、双方向パストレースなどと比べ、要求に応じたイメージキャッシュを使用するためにレイを比較的まとめて保つことができるためです。
../../../_images/render_cycles_settings_light-path-rays.png

私たちは、光源からシーンそしてカメラに入るのではなく、現実とは逆にシーン内のカメラから光源に向かって光線をトレースします。これは、カメラで終わらない光線を浪費しないという利点がありますが、寄与する可能性のある多くのライトパスを見つけられないということを意味します。光線は、表面BRDFまたは既知の光源の方向(ランプや、LampのSampleを持つ発光メッシュ)のいずれかに従って放たれます。
詳細は、ライトパス 2.7Sampling 2.7を参照してください。


ノイズはどこから来るか

ノイズがどこから来るのかを理解するには、たとえば以下様なのシーンを用いてください。赤い点上の白い円で示された場所に光線をトレースすると、下の2番目の画像は、拡散シェーダが「見ている」ものの印象を与えます。

Where Noise Comes From
To understand where noise can come from, take for example the scene below. When we trace a light ray into the location marked by the white circle on a red dot, the second image below gives an impression of what the diffuse shader “sees”.

To find the light that is reflected from this surface, we need to find the average color from all these pixels. Note the glossy highlight on the sphere, and the bright spot the lamp casts on the nearby wall. These hotspots are 100x brighter than other parts of the image and will contribute significantly to the lighting of this pixel.

../../../_images/cycles_noise_fisheye_reference.jpg
The Scene.
../../../_images/cycles_noise_fisheye.jpg
What the Shader sees.
../../../_images/cycles_noise_fisheye_hotspot.jpg
The detected Highlights.
The lamp is a known light source, so its location is already known, but the glossy highlight(s) that it causes are a different matter. The best we can do with path tracing is to distribute light rays randomly over the hemisphere, hoping to find all the important bright spots. If for some pixels we miss some bright spot, but we do find it for another, that results in noise. The more samples we take, the higher the probability that we cover all the important sources of light.

With some tricks we can reduce this noise. If we blur the bright spots, they become bigger and less intense, making them easier to find and less noisy. This will not give the same exact result, but often it’s close enough when viewed through a diffuse or soft glossy reflection. Below is an example of using Filter Glossy and Light Falloff.

../../../_images/cycles_noise_fisheye_blur_reference.jpg
Using Glossy Filter & Light Falloff.
../../../_images/cycles_noise_fisheye_blur.jpg
What the Shader sees.
../../../_images/cycles_noise_fisheye_blur_hotspot.jpg
The detected Highlights.
Bounces
In reality light will bounce a huge number of times due to the speed of light being very high. In practice more bounces will introduce more noise, and it might be good to use something like the Limited Global Illumination preset in the Light Paths Section that uses fewer bounces for different shader types. Diffuse surfaces typically can get away with fewer bounces, while glossy surfaces need a few more, and transmission shaders such as glass usually need the most.

../../../_images/cycles_noise_0bounce.jpg
No bounces.
../../../_images/cycles_noise_2bounce.jpg
Two bounces at max.
../../../_images/cycles_noise_4bounce.jpg
Four bounces at max.
Also important is to use shader colors that do not have components of value 1.0 or values near that; try to keep the maximum value to 0.8 or less and make your lights brighter. In reality, surfaces are rarely perfectly reflecting all light, but there are of course exceptions; usually glass will let most light through, which is why we need more bounces there. High values for the color components tend to introduce noise because light intensity then does not decrease much as it bounces off each surface.

Caustics and Filter Glossy
Caustics are a well-known source of noise, causing fireflies. They happen because the renderer has difficulty finding specular highlights viewed through a soft glossy or diffuse reflection. There is a No Caustics option to disable glossy behind a diffuse reflection entirely. Many render engines will typically disable caustics by default.

../../../_images/cycles_noise_reference.jpg
Default Settings.
../../../_images/cycles_noise_no_caustics.jpg
Caustics Disabled.
../../../_images/cycles_noise_filter_glossy.jpg
Filter Glossy greater than zero.
However, using No Caustics will result in missing light, and it still does not cover the case where a sharp glossy reflection is viewed through a soft glossy reflection. There is a Filter Glossy option to reduce the noise from such cases at the cost of accuracy. This will blur the sharp glossy reflection to make it easier to find, by increasing the shader Roughness.

The above images show default settings, no caustics, and filter glossy set to 1.0.

Light Falloff
In reality light in a vacuum will always fall off at a rate of 1/(distance^2). However, as distance goes to zero, this value goes to infinity and we can get very bright spots in the image. These are mostly a problem for indirect lighting, where the probability of hitting such a small but extremely bright spot is low and so happens only rarely. This is a typical recipe for fireflies.

../../../_images/cycles_noise_falloff_hard.jpg
Hard Falloff.
../../../_images/cycles_noise_falloff_soft.jpg
Soft Falloff.
To reduce this problem, the Light Falloff node has a Smooth factor, that can be used to reduce the maximum intensity a light can contribute to nearby surfaces. The images above show default falloff and smooth value 1.0.

Multiple Importance Sampling
Materials with emission shaders can be configured to use Multiple Importance Sampling (Material Settings). This means that they will get rays sent directly towards them, rather than ending up there based on rays randomly bouncing around. For very bright mesh light sources, this can reduce noise significantly. However, when the emission is not particularly bright, this will take samples away from other brighter light sources for which it is important to find them this way.

The optimal setting here is difficult to guess; it may be a matter of trial and error, but often it is clear that a somewhat glowing object may be only contributing light locally, while a mesh light used as a lamp would need this option enabled. Here is an example where the emissive spheres contribute little to the lighting, and the image renders with slightly less noise by disabling Multiple Importance on them.

../../../_images/cycles_noise_sample_lamp.jpg
Multiple Importance off.
../../../_images/cycles_noise_no_sample_lamp.jpg
Multiple Importance on.
The world background also has a Multiple Importance (Settings) option. This is mostly useful for environment maps that have small bright spots in them, rather than being smooth. This option will then, in a preprocess, determine the bright spots, and send light rays directly towards them. Again, enabling this option may take samples away from more important light sources if it is not needed.

Glass and Transparent Shadows
With caustics disabled, glass will miss shadows, and with filter glossy they might be too soft. We can make a glass shader that will use a Glass BSDF when viewed directly, and a Transparent BSDF when viewed indirectly. The Transparent BSDF can be used for transparent shadows to find light sources straight through surfaces, and will give properly-colored shadows, but without the caustics. The Light Path node is used to determine when to use which of the two shaders.

../../../_images/render_cycles_noise_glass_group.png
Optimized glass shader.

Above we can see the node setup used for the glass transparency trick; on the left the render has too much shadow due to missing caustics, and on the right the render with the trick.

../../../_images/cycles_noise_glass_too_much_shadow.jpg
Default Glas BSDF.
../../../_images/cycles_noise_glass_trick.jpg
Optimized Glass Shader.
Light Portals
When rendering a daylight indoor scene where most of the light is coming in through a window or door opening, it is difficult for the integrator to find its way to them. To fix this, use Light Portals, these work by adding a Area Lamp. You then will need to modify its shape to match that of the opening that you are trying to fill.

../../../_images/cycles_portals2.jpg
../../../_images/cycles_portals.jpg
Denoising
Even with all the settings described above there will always end up being some render noise no matter how many samples you use. To fix this there is a post processing technique to cleanup the final bit of noise. To use this enable Denoising in the Render Layers tab of the Properties editor.

Below is an example render by The Pixelary.

../../../_images/render_cycles_settings_scene_render-layers_denoising_example1.jpg
Example render before denoising.
../../../_images/render_cycles_settings_scene_render-layers_denoising_example2.jpg
Example render after denoising.
Clamp Fireflies
Ideally with all the previous tricks, fireflies would be eliminated, but they could still happen. For that, the intensity that any individual light ray sample will contribute to a pixel can be clamped to a maximum value with the integrator Clamp setting.

If set too low this can cause missing highlights in the image, which might be useful to preserve for camera effects such as bloom or glare. To mitigate this conundrum it’s often useful to clamp only indirect bounces, leaving highlights directly visible to the camera untouched.

../../../_images/cycles_noise_noclamp.jpg
No Clamp (0).
../../../_images/cycles_noise_clamp_4.jpg
With Clamp set to 4.
Next Previous

  • 最終更新:2018-04-27 16:34:08

このWIKIを編集するにはパスワード入力が必要です

認証パスワード