VRay for 3ds Max Tutorials
Progressive path tracing with V-Ray
PPT, Light Cache
In this tutorial we will discuss an alternative method for computing the
final image with V-Ray called progressive path tracing.
Typically, computing the image goes through several separate tasks - for
example, caustics calculations, light cache computation, irradiance cache
computation, and final image sampling. While the user receives visual
feedback through some of these stages, the final image is completed only at
the end of the last stage - the intermediate results cannot be used.
Progressive path tracing, on the other hand, is a method for incremental
computation of the whole image at once. The user can stop the calculation at
any time and use the intermediate results, if they are good enough. In
addition, with path tracing, the user has only a few controls to worry about
and it is very easy for set up.
V-Ray builds upon the foundation of the
light cache algorithm to perform progressive path tracing. This has the
advantage of using the light cache for noise reduction during the path
tracing process for cleaner results and faster light propagation. Using the
light cache ensures that the number of light bounces is not limited and that
the result converges to the correct lighting solution for the scene. In
addition, the light cache from a path traced image can be saved and re-used
later on for a normal rendering.
Step 1: Initial setup.
Setting up progressive path tracing is fairly easy:
1.1. Open the starting scene, which can be found
1.2. Set V-Ray as the current rendering engine.
1.3. Check the Override mtl option in the
Global switches rollout, click the button next to it and select a
default VRayMtl material.
1.4. Turn Indirect illumination
on and set both the primary and the secondary GI
1.5. Set the light cache mode to Progressive path
1.6. Optionally, you can turn on the Frame stamp
to print the render time on the image.
1.7. Check the Enable built-in frame buffer
option in the
virtual frame buffer rollout. This is not necessary, but allows you to
safely zoom and pan through the rendered image during the rendering process.
Using the 3dsmax VFB may cause 3dsmax to crash if you zoom/pan during
1.8. Render the scene. You should see the image being gradually sampled,
more noisy at first, but getting better as more samples are added:
Step 2: Adjusting the noise level
The image above is fairly noisy, although it is computed quite quickly
and can be used for previews. However, for final renderings, we would like
to reduce the noise. This is done by adjusting the light cache
3.1. Set the light cache Subdivs to
3.2. Render. Rendering now takes more time, as V-Ray computes more
samples. Since we increased the Subdivs
twice, render time will approximately quadruple:
3.3. If you want to reduce noise even further, increase the
Subdivs even more. For rendering stills, you
can set this to a very high value and wait for as long as you like before
cancelling the render and using the result. Here is a render with
20000 subdivs which was cancelled after one hour:
Step 4: Adjusting the bias of the GI solution
For the images above, we used the default settings for the light cache
(except for the Subdivs parameter). The
default settings use the light cache as an aid during GI calculations. This
helps to reduce noise in the final image, at the cost of introducing bias to
the GI solution. This bias may show up as light leaks under thin walls or
splotchy secondary GI. In most cases however, the difference between a
biased and an unbiased solution is minimal.
You can use the light cache Sample size
parameter to control bias. Larger values will use larger light cache samples
and will increase the bias. Smaller values will decrease bias but may use
more memory. A value of 0.0 will not use any
caching at all and will produce an unbiased solution. Here are three
renderings with different values for the Sample size
and with the same Subdivs value (1000).
There isn't much of a difference in this simple scene, but in more
complicated situations, the noise reduction can be significant.
Sample size =
Sample size =
Sample size =
0.0 (unbiased solution)
Step 1: Rendering with materials
1.1. Turn off the Override mtl option from
Global switches rollout.
1.2. For faster previews, return the Subdivs
for the light cache to 1000.
At this point, you can adjust material settings etc, while getting
relatively fast feedback.
Step 2: Better quality with materials.
Since the noise level is determined by the
Subdivs parameter, we only have to increase that. Individual
Subdivs for materials (f.e. glossy
reflections/refractions) do not matter.
2.1. Increase the Subdivs parameter to
2000 and render. Rendering now takes more time,
but the noise is reduced:
By default, V-Ray does not compute reflective GI caustics, since these
tend to add noise to the image. Sometimes however, they are important for
the final result.
2.2. Turn Reflective GI caustics on from
the Indirect illumination rollout.
2.3. Render the image. Reflective caustics can be seen on the green patch
and the sphere, as well as a general brightening of the scene. Notice that
the image is also noisier in places where there are caustics:
2.4. To reduce the noise in the image, we will need more
Subdivs for the light cache, for example,
4000. Since we increased the value twice, render
time will again approximately quadruple:
Note that you cannot obtain GI caustics from perfectly specular surfaces
with point light sources. Either the light source must be an area source, or
the material must be glossy, or both. You can also use photon mapping to
generate the caustics through the settings in the
Caustics rollout. This method is not as precise as the GI caustics, but
can handle point light sources with perfect specular surfaces.
The only thing to remember when changing the image size is that larger
images are noisier compared to smaller ones for the same light cache
Subdivs value. This is because the samples
are distributed over more pixels, and so each pixel gets fewer samples. To
compensate for this, you will need to increase the
Subdivs value. Increasing the resolution twice means that you will
also have to increase the Subdivs twice to
get the same quality (and it means that the render time will again
quadruple). Here is the last image rendered at 800x600 with 8000 Subdivs
(click for the full version):
image sampler type (Fixed,
Adaptive DMC, Adaptive
subdivision) is ignored in this mode, since the path tracing
algorithm does pixel supersampling automatically. After the image is
complete, V-Ray will print the minimum and maximum paths that were traced
for the pixels in the image.
- The antialiasing filter however, is taken into consideration. Note that
sharpening filters (Mitchell-Netravali,
Catmull-Rom) may introduce noise and will require
more samples to produce a smooth image. Larger filters like
Blend may also take more time to converge.
Turning the antialiasing filter off produces the
- Subdivs parameters in materials,
textures, lights, camera settings etc. are ignored in this mode. Noise and
quality is controled entirely through the light cache
- The only parameters of the
sampler that are taken into consideration are
Adaptive amount and Time-independent.
Never set the Adaptive amount parameter to
0.0 when using path tracing, since this will
bring the rendering to a halt.
- At present, only the RGBA channel is generated by the path tracing
algorithm. Any additional GBuffer channels are ignored.
- The light cache has no limitation on the number of diffuse light bounces
in the scene. The number of specular bounces (through
reflections/refractions) is controlled either per material, or globally from
the Global switches rollout.
- At present, the path tracing mode does not work properly when rendering
- At present, the path tracing mode does not work with matte
- At present, V-Ray can only generate 2^32 unique light paths internally.
The light cache Subdivs spinner is limited to
60,000, which gives 60,000^2 = 3,600,000,000 unique paths. Since these are
distributed across the entire image, for very large images it may be
impossible to get enough samples per pixel for a smooth result. For example,
a 2000x2000 image can be computed with at most 900 paths per pixel - which
may be inadequate for a smooth result. In that case, using a traditional
sampling method (brute force GI) may prove a better solution.