Most of you have probably downloaded the 2.70 RC by now and probably started playing around with volumetrics in cycles. Immediately you probably noticed how slow it renders, although that was probably expected. Here are the results of a little test I did to find out exactly how to speed up volume rendering for the world up so that it’s actually usable.
The very first and foremost thing you need to know about volumetrics is the difference between Homogeneous and Heterogeneous volumes. Basically, a volume where the density is driven by some texture is a heterogeneous one, and a volume with consistent density is a homogeneous one. The difference in render time and quality is… well, quite drastic:
Homogeneous (2m 40s, 512 samples) vs Heterogeneous (1h 4m 55s, 128 samples)
Yep, you read that right. Under 3 minutes for homogeneous volume and over an hour for a quarter of the samples in the heterogeneous volume. The heterogeneous render seems to have a less dense volume, and I guess it does since it was driven by a noise texture where I couldn’t easily control the density and honestly couldn’t be bothered to wait long enough to give it a decent try.
Strangely enough, homogeneous is off by default – so make sure you change it:
In all the next examples the volumes are homogeneous, rendered at 512×512 with 512 samples (a coincidence) and use the Path Tracing integrator
The next thing to note is the difference between a mesh light and regular lamps:
Mesh with Emission shader (1m 15s) vs Point Lamp (1m 8s)
Not only do regular lamps produce a much cleaner render, but they also respect the Homogeneous Sampling method in the render settings:
Distance vs Equi-angular
View the renders full size and you’ll notice that the Equi-angular mode is much cleaner in general, but especially closer to the light source. The render times were basically the same, 1m 8s for the Distance mode, and 1m 19s for Equi-angular. One thing I noticed though is that volumes in regular materials (not the world) render much cleaner using the Distance mode, the other way around, and sometimes spot lights are more noisy with an equi-angular world volume – so you’ll just have to try both.
By default, volume bounces are set to 1. This is a decent trade-off between render times and accuracy, but if you want to accentuate the light rays or give the scene a bit more contrast, reducing the volume bounces to 0 will speed it up quite a bit. Then naturally, increasing the bounces slows it down a lot:
0 bounces (1m 19s), 1 bounce (2m 26s), 2 bounces (3m 26s), 10 bounces (9m 22s)
Bounces and rendertime scale linearly it seems
No only do more bounces mean a slower render, but a noiser one as well. If you want an image that lacks contrast like the 10 bounce render, I’d suggest using only one bounce and just adding a large fill-light behind the camera. Or just reducing the contrast in comp.
Finally, you’ll have noticed the abundance of fireflies in the renders with more than 0 volume bounces. To cure this, we simply need to call our old friend the Clamp property:
2.70 now has separate clamp options for direct and indirect light, so we can preserve the brightness of the highlights and still reduce fireflies by clamping only the indirect rays (rays that bounced off something and then light something else). Here the Indirect clamp was set to 5, and only increased the 3m 26s render by another 10 seconds.
Hope this saves you some frustration! But still go and do your own testing as well, you’ll probably learn a whole lot more, and then share it with the rest of us!
I’m particularly curious about making some procedural mist or fog with variable density, but still rendering it efficiently somehow.
PS: Heterogeneous is a funny word I hope I never have to spell so many times again.