The purpose of this section is to give users a better understanding of how to render hair efficiently in Arnold. The key parameters that affect hair rendering speed will be explained and illustrated with rendering examples. General optimization tips and tricks will also be covered.
Arnold can render hairs in two different modes: Ribbon and Thick mode, the following image illustrates the difference. In this document, only the Ribbon mode will be used as it is the best mode for rendering thin hair/fur (which is what this tutorial will focus on).
Hairs in ribbon mode (left) and thick mode (right)
These modes, as well as other settings related to hair, are described in more detail here.
The nature of hair or fur is that it is made up of a lot of very fine/thin strands. Typically the smaller something is in screen space the more Anti-Aliasing (AA) samples is required to render it smooth and without flickering in animation, which makes rendering hair challenging. To make fur rendering easier on the sampling Arnold has introduced something called "Min Pixel Width" (MPW).
The concept behind MPW is to make extremely thin hair strands automatically thicker in screen space while at the same time making them transparent. This helps the hair strand to render smoother and with less flickering in animation even at lower AA settings. The MPW transparency will only kick in if the given hair is thinner in screen space than the specified MPW value; for example, if all the hair strands in the frame are more than 1 pixel wide and the MPW value is set to 0.5, no transparency will be used at all. If the camera, for example, starts to zoom out from that point thus making all the hairs thinner in screen space, as soon as they go below 0.5 pixels the MPW system will kick in and automatically keep the hairs 0.5 pixels wide while making them more and more transparent the thinner/farther away they get.
The MPW parameter in the "Arnold Parameters" property
How many layers of hair strands will be made transparent depends on the "Auto Transparency" setting in the render options, as illustrated below adjusting this value has a great impact on both quality and render time. Setting the auto transparency to 0 will always disable MPW on all the hair in the scene.
MPW accuracy depends largely on the auto transparency
Note: MPW only works on hair in Ribbon mode.
Below you will find the same scene rendered with different settings for the "MPW" value and the "Auto Transparency".
In all examples the following sample settings were used:
- AA Samples: 3
- Diffuse Samples: 3
- Specular Samples: 3
- Diffuse/GI Bounces: 1
These first set of images all use an MPW value of 0.1, note how the hair is still rather jaggy even with auto transparency set to 5, with these settings higher AA settings would be required to produce smooth results:
Here we are using an MPW value of 0.25, this is the default in SItoA even when the Arnold Parameters property has not been applied to the hair, note how when auto transparency is increased the hair is a lot smoother than before even with the same AA settings:
Finally we up the MPW value of 0.5, note that even when auto transparency is set to 0 the hairs will always be at least 0.5 pixels thick in screen space though not transparent.
As seen in the examples above making the hairs transparent has a big impact on render times. For optimal rendering speed it is very important to use sensible values.
How smooth/slow hair renders depends on three things:
- Min Pixel Width
- Auto Transparency depth
- Number of Anti-Aliasing Samples
The higher the AA samples, the less you will need to rely on MPW to get smooth hair. If your scene is already using 10 AA samples to get smooth motion blur and DOF you can use a much smaller MPW value than if you were using only for example 4 AA samples.
As mentioned above MPW will have an effect even if auto transparency is set to 0, so it can be useful as a "cap" for how small a hair is allowed to get even if you're not making the hair transparent, looking at the render times above thickening the hairs using MPW can have a positive effect on the render time when auto transparency is set to 0.
The hair shader has a "Diffuse Cache" parameter. This switch makes Arnold to store direct diffuse lighting at hair vertices (technically: segment end points). This cache is filled on-demand on the first lookup. Then GI rays use this cache as an approximation to the direct lighting.
- AA Samples: 5
- Diffuse Samples: 3
- Specular Samples: 3
- Diffuse/GI Bounces: 3