Page tree

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Contents

This document outlines aggregate volume controls in the context of rendering clouds.

Volume Settings

Max Path Length

Adjusting the maximum path length of the integrator is critical to getting a cloudlike appearance from a render. When rendering clouds, a relatively high maximum path length is required. The comparison images below show the Moana cloud rendered with path lengths of 1, 4, 16, and 64, respectively.

Notice that in addition to the cloud becoming brighter as the path length increases, the cloud rendered at path length 64 also has a silver lining that contributes to its cloudlike appearance.

However, increasing the path length can also obscure details of the cloud which are in the shadows, shown in this image rendered with path length 256. Notice that the dark areas of the cloud have less visible detail compared to the images above.

In my testing, I found that a path length of 64 was enough to replicate the look provided by increasing the path length further, so all subsequent testing uses a max path length of 64.

MSApprox

The MSApprox settings attempt to mimic the effect of multi-scattering within a volume. There are three controls related to MSApprox (assuming it is enabled on the integrator). The first is the msApprox parameter on the light, which simply scales the effect of MSApprox from the light. I didn't find this parameter particularly useful, so I don't discuss it here. The other two parameters are the bleed (msApproxBleed) and contribution (msApproxContribution), which are controlled on a per-light basis. Although bleed and contribution are both colors, I will be treating them as scalars which are just the value of all three components (i.e. 0.5 is (0.5, 0.5, 0.5)). Both parameters provide an overall brightening effect on a volume, but are different in subtle ways. Balancing the bleed and contribution correctly can help approximate the look of a higher path length, but with a negligible performance impact. In my experience, enabling MSApprox with the settings that mimic higher path lengths requires reducing the brightness of the light source to prevent overexposure of the brighter areas of a volume, and all renders in this section have the light exposure changed from 0 to -1.

Bleed

The bleed parameter is important for controlling the overall brightness of a volume. Its impact is most noticeable in the darker shadows, where it can increase the brightness dramatically, but it also affects bright areas. In the below images, I fixed contribution to 0.9 (a value I found to work well with this dataset and light source), and used bleeds of 0.05, 0.15, and 0.25. In this case, a bleed of 0.15 very closely matches the look of the image above that was rendered with path length 256.

Contribution

The contribution in MSApprox The contribution parameter is particularly useful when rendering clouds because it mainly brightens central areas of a volume, leaving the edges at their original brightness. As such, I found that fairly high values of contribution could be used while still preserving the silver lining. The below images were rendered with bleed set to 0.15, and have contribution set to 0.8, 0.9, and 0.95, respectively.

Tips for MSApprox

The controls for MSApprox can be somewhat annoying, so here are some tips that might be useful for adjusting settings (specifically for clouds):

  • You may have to decrease the brightness of the light when enabling MSApprox.
    • Contribution is the main cause of excessive brightness, so if you are using a low contribution, this is probably unnecessary.
  • Increasing contribution makes central areas brighter but not edges.
    • If you're using a high contribution, adjust in very small increments (like 0.05 or less!).
  • Increasing bleed mainly brightens shadowed areas.
    • I found that higher bleed images needed longer to converge before the image became an accurate representation of the final render.
    • It seems that bleed can be adjusted in fairly large increments without much of a problem.
  • The process I used to match a look with MSApprox was:
    1. Start with high contribution (~0.95) and low bleed (0.1).
    2. Reduce contribution until the balance of edge and center brightness was right.
    3. Increase bleed until the overall cloud brightness looked correct.
  • Both MSApprox controls are highly dependent on each other, so they need to be tuned in tandem.

Density

Density is another control that can significantly impact the look of a volume. It can be controlled by setting the densityMult on a volume. Lower multipliers will make the volume look airier (less dense) while higher values will create a more solid appearance. The following images were rendered with density multipliers of 0.0004, 0.004, and 0.01.

Anisotropy

The anisotropy of the volumes is controlled by the g0, g1, and blend of the shader, and control whether (and how) light is scattered directionally. The visual impact is difficult describe, but , which were rendered with a blend of 1 and g1 values of 0, 0.4, 0.6, and 0.8, respectively. Increasing anisotropy mainly impacts the edges and shadowed areas of the volume.

It is also possible to add a second lobe, which can be used to add some backscattering, which can help bring back detail that might be lost when anisotropy is used. The below image is rendered with a blend of 0.8, g0 set to -0.6, and g1 set to 0.8. Notice how adding the backscattering lobe helps return some of the detail that is lost when the anisotropy is increased.

Scene Setup

This section covers how to set up the scene above in some DCCs.

RfM

Volume Setup

First, create an OpenVDBVisualize object from the RenderMan shelf tab.

Next, select the VDB file you want to use in the OpenVDBRead settings in the attribute editor (the quarter or eighth resolution versions of the Moana cloud are fine for now).

Now, you should be able to see a wireframe of the leaf nodes and tiles in the viewport (you may have to zoom out to see the whole cloud). Next, select the OpenVDBVisualize object in the outliner and open the OpenVDBVisualize settings in the attribute editor. Here, we want to rotate the volume so that the top of the cloud is in the +Z direction. So, add a 90 degree rotation along the X-axis.

The last thing we want to do in the volume settings is add the volume to a volume aggregate. The globalVolumeAggregate is created automatically, so under the OpenVDBVisualizeShape settings, in RenderMan > Volume Aggregate, set the Aggregate Membership to globalVolumeAggregate.

You may also want to disable the visualization of leaf nodes and active tiles, which is under the OpenVDB Visualization Settings.

Volume Shader Settings

In the shader settings, you can also adjust the anisotropy settings under the Anisotropy area. By default, anisotropy is off.

Light Setup

For the light setup, we will use a PxrEnvDayLight. So, the first step in the lighting setup is creating a PxrEnvDayLight from the Renderman tab of the shelf.

Next, you can adjust the light direction under the PxrEnvDayLightShape tab of the attribut editor either using the Month/Day/Year/Hour (the default method in RfM) or using the Direction control by selecting Month > Use Direction. For this tutorial, we use the direction controls and set the direction to 0.8, 1.0, 0.6. I also found it useful to change the "Ground Mode" from "Legacy" to "Horizon Clamping".

The other defaults provide a good starting point so you can leave them unchanged for now. This is also where you will adjust your MSApprox settings (under Multi-Scatter Approx). It can be quite hard to predict how MSApprox will affect the render, so you should wait to adjust these settings until after the render is set up completely.

Render Settings

The last thing we need to tweak before we see our cloud rendered is the Render Settings. So, open the Render Settings and select the RenderMan tab. The first thing you should change is under the "Aggregate Volumes" tab. For "Volume Aggregate Name", enter "globalVolumeAggregate" (this is the volume aggregate we added our cloud to before).

Once you set the volume aggregate name, you should see the cloud if you start a render (either in the viewport or externally in "it"), but it still won't look quite right. To give the cloud the correct appearance, we need to adjust the number of bounces. First, under "Default Ray Depth", adjust both the "Max Specular Depth" and "Max Diffuse Depth" to much higher values (e.g. no less than 32), and under "PxrPathTracer Parameters", set "Max Indirect Bounces" to that same number.

Multi-Scatter Approx

Now that everything is set up, you can start an IPR render from the RenderMan tab to view the cloud so we can adjust the Multi-Scatter Approx settings and see the results as we change them.

To begin with, go to the settings on our PxrEnvDayLight and enable MSApprox by setting "Multi-Scatter Approx" to 1. Now, you can adjust the bleed and contribution as described above. If you find that the cloud is too bright, reducing the value of the MS Approx setting from 1 is an easy way to change the brightness without having to tweak the bleed and contribution too much.

Render

Now that everything is set, you can kick off a render and see the final image, which should look something like this: