DMC Sampler or Speed vs Quality in V-Ray 1.5

Nov 18, 2020 Update
Illustration for tutorial on V-Ray speed vs quality controls with just a few settings of DMC Sampler.
Advertisements

Introduction

Hello everyone!

It is obviously that, that most of 3D rendering artists have to deal with setting up a rendering engine. The first thing everyone wants to know is how to set up a beautiful and photorealistic visualization, at the same time, to get a final results as quickly as possible. Ironically, after the first trial setup, everyone comes to the conclusion that "there ain't no such thing as a free lunch".

To put it concretely, clear, beautiful images are possible only at fairly high rendering settings. Fortunately, there are tradeoffs while working with V-Ray. After all, we measure the quality of each rendering by eye, not by some absolute scale or technical measurement. The specific situation with each individual scene is also important here. For example, noise is usually an unwanted rendering artifact, but sometimes it can give an extra cinematic look for the rendering.

But your really hit a snag, to go further, by spending an hours on locally adjusting a quality. In the materials, in the light sources, when each of them has only a small effect on the overall appearance of the final results and the overall rendering speed of the whole scene.

Being an flexible program, V-Ray's renderer has special tools that make it easy to control the global quality of rendering. In particular, we can use them to control the quality vs speed, by adjusting the precision of V-Ray renderer calculations globally. These especially concerned of blurry effects, from glossy reflections to soft shadows from light sources, which are vital for the photorealism of rendered images. The key to this global quality control in V-Ray is in the DMC Sampler, the settings of which we will learn in this tutorial.

DMC Sampler Features

Many people understandably try to crack the mystery of the DMC Sampler. The "DMC" abbreviation alone can confuse many rendering artists, especially novices, because of the involuntary association with something very complex and incomprehensible.

The DMC Sampler is nonetheless a very important tool in the arsenal of any experienced 3D rendering artist, from both practical and theoretical points of view. Despite its apparent complexity during first acquaintance, it is quite logical and unmysterious.

The samples related calculations, carried out by V-Ray, are based on a special algorithm, called Monte Carlo, which is used for the simulation of mathematical and physical systems in science. The essence of the Monte Carlo algorithm is that it performs repeated random sampling to determine the final result. V-Ray uses a modified algorithm, the Deterministic Monte Carlo (DMC) sampling. The DMC, in contrast to the classic Monte Carlo, makes not random, but deterministic sampling, which allows us to obtain results that do not change from render to render. In practice, DMC lets us to load the scene, render an image, close it, open it again, run the rendering, and get the exact same image.

The DMC Sampler embodies the main feature of V-Ray, its ability to adapt to the conditions of a particular scene. It is based on the principle of determining the insignificant areas on the final image and reducing the accuracy of their calculation.

Backbone of V-Ray Adoptability

Rendering of blurry effects by the DMC Sampler involves several key factors:

  • Original number of samples, set for any effect
  • Importance of this exact effect in a particular image area
  • Amount of algorithm adaptability
  • Allowable samples difference threshold

Based on these core data and two additional factors, the DMC Sampler decides how many samples are enough to render a particular effect.

From this, it follows that a number of samples established by the Subdivs parameter for any particular effect will not necessarily be the exact number of samples used in rendering. For ease of understanding, we can consider the set number of samples for any particular blurred effect only as an "order" to the sampler of how many samples this effect want to "consume". If we tune some material, such as VRayMtl, and set 25 Subdivs for reflection glossiness, then we can think that we have ordered 252, or 625, samples for the calculation of this effect. However, V-Ray can reduce this number during rendering. To learn why and how this happens, read further.

When rendering, the special algorithm comes into action and takes into account the different conditions. It estimates the degree of importance of the image area by itself. If this algorithm considers any zone of render unimportant, it automatically provides less samples than was ordered. It takes into consideration such parameters as material color, strength of the blurry effect, illumination of the object, and distance from the light source. This is the adaptability backbone of the V-Ray DMC Sampler.

DMC Sampler Controls

Controls of the DMC Sampler are located in V-Ray:: DMC Sampler rollout of the Settings tab in Render Scene (F10) dialog.

The Adaptive amount: is the first parameter that controls the work of an adaptive algorithm. It determines the degree of adaptive sampling techniques to be applied. This parameter is crucial in determining the initial maximum number of samples sufficient to render effects. In our example, the Adaptive amount: is the degree of "trust" in the self-reliant adaptability algorithm. In other words, the value set here determines how much we trust the automatic determination of zones of little importance and thus serves as an automatic samples reduction. By setting the value of 1 (one), we tell the sampler that we have full confidence in its determination of unimportant areas and that it has the right to reduce the number of ordered samples to the extent it sees sufficient. A value of 0 (zero) indicates that we do not trust this function of the sampler, and therefore zero equals a total absence of adaptability. Intermediate values ​​allow us to choose a mean, allowing the sufficient adaptability with a significant savings of computational resources while allowing us to get rid of the inevitable inaccuracies inherent in almost any automation. In the optimal V-Ray configuration, the default value of the Adaptive amount: equal to 0.85 should be left unchanged.

Let us continue to follow our example of set 625 samples to reflection glossiness. Suppose, based on the importance of the zone where this effect takes place and the degree of our trust in the adaptive algorithm, the DMC Sampler considered the ordered 625 samples excessive under these exact conditions, and so reduced the maximum. At this stage of our calculation of the blurry effect, we are left with a maximum of 500 samples.

Noise threshold: is the second key factor that controls the behavior of the rendering engine. This parameter specifies when to use the so-called early termination technique. In other words, the Noise threshold: determines when to stop the repeating samples calculating. As the previous Adaptive amount: option predetermines the maximum number of samples required for a satisfactory rendering, the Noise threshold: decides during calculating each new sample when it already has enough samples. It is important to note that the Noise threshold: works according to factual data. It examines the dynamics of change in the results with each new sample. If, for example, the 145th sample of the previously defined 500 has not made sufficient changes in the effect’s resulting value, the DMC Sampler believes that further "clarification" is unreasonable and stops rendering, despite having the 500 samples set as the maximum. So here is one more way to save computing time.

We specify the Noise threshold: in relative units. The higher the Noise threshold: value, the more severe will be the difference considered as the basis for early termination of calculation, and, consequently, fewer samples will be used for rendering blurry effects. A high Noise threshold: value will appear as noise in the rendering, regardless of the importance of its zones. Conversely, a low Noise threshold: value will allow the DMC Sampler to start early termination only when the newly received "clarification" is quite insignificant. The default Noise threshold: value is 0.01, and we recommend leaving it as is.

So, after the entrusted estimation of importance and the early termination technique do their work, our effect was calculated using only 145 samples instead of 625.

The Adaptive amount: and Noise threshold:, along with the originally set Subdivs parameter to a blurry effect, allow us to control the adaptability and hence the speed and quality of rendering. In addition to these parameters, the DMC Sampler contains a few extra settings that allow us to control its work further.

Additional DMC Sampler Parameters

A number of next parameters of the V-Ray:: DMC Sampler rollout are not that important in everyday practice, but can have a significant impact on the quality and rendering speed configuration in some situations.

The Min samples: parameter sets the minimum number of samples for each blurry effect in the scene. This parameter tells the renderer that, regardless of the circumstances, it does not have permission to allocate the number of samples below this minimum. It does not matter how many samples the adaptive DMC Sampler assesses for any effect or if the noise threshold were reached. The effect will be rendered with the minimum of samples specified in this parameter. For the optimal V-Ray settings, the Min samples: value of 8 samples is sufficient if the DMC Sampler tends to use few samples to cut down the time.

The Global subdivs multiplier: is the parameter globally affecting all the Subdivs in the scene. This option is literally a global Subdivs factor. If you set the value of the Global subdivs multiplier: to 2, the locally installed 25 Subdivs for reflection glossiness, in our example material, will be 25 × 2 = 50 Subdivs during the rendering.

This is the simplest and most intuitive option of the V-Ray:: DMC Sampler rollout, but it can cause confusion because, despite its global name, it only affects Subdivs some effects.

The Global subdivs multiplier: is a multiplier for the following blurry effects:

  • Glossy reflections/refractions
  • Irradiance map
  • Brute force
  • Area lights
  • Area shadows
  • DOF
  • Motion blur

However, Global subdivs multiplier: does not affect Subdivs of following entities:

  • Antialiasing
  • Light Cache
  • Photon map
  • Caustics

Remember, in the universal V-Ray settings, the Global subdivs multiplier: factor must be equal to 1 (one).

The Time independent parameter is useful for animation rendering. Essentially, it enables rigorous, independent from the camera position, deterministic sampling that allows us to have constant noise from frame to frame. This saves the animation from the effects of flicker. This setting does not significantly affect the performance of the renderer. In the Best V-Ray settings, the Time independent parameter should be kept activated.

The final configuration of the V-Ray:: DMC Sampler rollout is the Path sampler: dropdown list, in which V-Ray gives us a selection of the samples generation method: Legacy, Latin super cube, and Schlick sampling. These methods have their own mathematical properties in obtaining samples. We do not need to go deeply into these without the necessity. By default, the Schlick sampling is best, and it should be used in universal V-Ray settings.

Practical Adjustment of Rendering Speed & Quality

Once we have reviewed all the settings of the V-Ray:: DMC Sampler, we can return to our main subject of how to adjust the speed and rendering quality globally by using the DMC Sampler tools.

The default values are pretty great for most cases of photo-realistic 3d visualization. With them, the quality and realism of the generated images is rather determined by a local scene Subdivs setups.

You rarely need to a settings of DMC Sampler settings in order to adjust its adaptability. Sometimes it is useful to raise the Global subdivs multiplier: because it is easier than spin-up Subdivs at each light source or the material of the scene. This is especially true if scene is large with lots of Subdivs holders (different materials, lights).

Draft Render Setup

The test or draft rendering can be discussed separately. When creating thumbnails and draft renderings, the DMC Sampler settings are indispensable. In such cases, you should sacrifice image quality to speed up visualization and get intermediate or draft results as quickly as possible. We can reasonably consider a playing with each local Subdivs for test of draft purposes as a waste of working time. It is much easier just to use only four DMC Sampler parameters to make scene draft and back.

As you can guess, for the draft visualization purposes, it is enough to increase a values of Adaptive amount: & Noise threshold:, and decrease values of Min samples: & Global subdivs multiplier:. And that's it.

Conclusion

In this tutorial, we learned about the adaptability of DMC Sampler, as well as how to globally control the speed and quality of V-Ray renderer, with just four simple settings.

We sincerely hope that by reading this tutorial, you will be much closer to understanding how to implement a fine tuning of V-Ray engine, and will be able to save a lot of your valuable time with draft renderings.

See you in the next chapters of this tutorials series!

Advertisements
Comments
Geka
Sep 5, 2011
The long-awaited quality versus speed setting. Thanks!
Gray
Sep 5, 2011
Finally, this aspect becomes clearer... Thank you!
MorPfius
Sep 8, 2011
IMHO, but I think that 'Adaptive amount' - 0,85 and 'Noise threshold' - 0,01 are very weak for quality rendering, it is better to use 'Adaptive amount' - 0,5-0,7 and 'Noise threshold' - 0,005-0,008.
Anton (RenderStuff)
Sep 8, 2011
Hi MorPfius,

it depends on the situation, the values ​​of 0.85 and 0.01 are a great starting point. Of course, if you have noise in your scene, you need to increase them, but on the other hand, it will be a huge waste of time if you use 0.5 and 0.005 as the default values. Not every scene requires such an accurate calculation. The settings in these tutorials are the initial recommendation, they are not constants. You can set any other values ​​if the situation requires it.

Victor Skea
Nov 1, 2011
Is it possible not to touch subdiv in materials at all and solve everything only with DMC sampler setup?
Victor Skea
Nov 1, 2011
I read it more carefully again and have already found the answer. Thanks!
Anton (RenderStuff)
Nov 1, 2011
We are glad that you already understood the answer yourself. Well done!

But, I will still answer, in case others have not yet found the right answer.

Yes, you can control the quality of the visualization with DMC Sampler only.

But, imagine the situation, then you have 10 materials in the scene. All these materials have glossy reflections. Nine of them have very weakly blurred reflections (RGlossines 0.9) and only one has high glossy reflection (RGlossines 0.6). On visualization, all nine materials will have small reflections with a very concentrated glare, on which almost no noise will be visible, and only one material will have a huge blurred glare, with obviously distributed noise on over the surface. To reduce this noise, you will increase parameters of the DMC sampler until the noise on this single material disappears.

During scene calculation, the nine low-gloss materials will be calculated with the same accuracy as the only high-gloss material for which everything was started. This means that in order to improve the quality of one, you will spend a lot of computing time on the other nine materials. So, the overuse of computing resources will be almost tenfold.

Therefore, in such a situation, it is better to locally increase subdivisions for this single material, instead of globally wasting rendering time on all ten.

Victor Skea
Nov 1, 2011
Hello, Anton. Thanks for the detailed explanation. Another thing I want to know is what hardware you need to perform fast rendering. Because many people write in the description under their work, how long it took them to render, but do not write anything about on which processor and RAM it was done. I have 2 computers with Core i7 2600 3.7 GHz. But I don't feel that's enough for me. Probably because my visualization skills are not good enough to achieve fast visualization with excellent quality results.
Anton (RenderStuff)
Nov 3, 2011
The number of render nodes matters. The more nodes, the faster the visualization. From my own experience, I would say that 4x Core i7 2600 / Phenom II X6 1100T level nodes are enough to render still (static, not animated) images and to feel comfortable, not waiting for days when cameras from one scene will be rendered. So, I'm trying to convey that 2x i7 nodes isn't as much as you think.
DomoVoi
May 10, 2017
Unfortunately, this article refers to an older version of V-Ray (6 years old). Version 3.40.x looks different. But still, many thanks to the author. If this article is adapted to modern realities, it will not only not lose its value, but also acquire new one.
Anton (RenderStuff)
May 10, 2017
Hi DomoVoi,

Thats right, article was written many years ago based on V-Ray 1+. During this time V-Ray interface undergone many changes, but mainly it is just chsndes of interface changes. The basic theoretical conceptions of 3d rendering software remain the same.

In V-Ray 3.4, the 'DMC Sampler' now called 'Global DMC'. A 'Global subdivs multiplier' is disabled by default. If you want to apply some default values for all subdivs in scene, place checkmark in front of 'Use local subdivs' and everything will be as it was in previous releases. It’s just the usability changes. For example, the V-Ray developers are removed image sampling algorithms called 'Fixed' and 'Adaptive subdivision' from V-ray. They left only 'Adaptive subdivision' which now called 'Bucket' image sampler, since now it is the only algorithm what do Bucket-rendering (gradually rendered whole image as rectangular groups of pixels). So, nothing strange that the buckets size controls developers are added to the Bucket image sampler rollout (moved from System). Cosmetic changes, but not a conceptual.

Of course it means that all Old V-Ray based articles on RenderStuff must be updated, but it also meant that you don't have to wait until it's happens. You may understand all basic V-Ray concepts right now by reading articles in the condition in which they are now.

Anyway, if you have any specific questions about Image Sampler please feel free to ask.

DomoVoi
May 11, 2017
Yes, I have a question. But first - thank you very much for your thoughtful and persistent work. After shoveling a huge number of tutors and forums, I came to the conclusion that your approach to explanations is perfect. From the bottom of my heart, I recommend collecting all the works and lessons and publishing a BOOK IN PAPER.

Now the question. Why when I try to render an region, it does not match to the corresponding area on the full render that was rendered whole at once? I emphasize - under the same lighting conditions, camera angle and renderer settings, the result of a region is different from the corresponding region on full rendered image!
Anton (RenderStuff)
May 23, 2017
Hello DomoVoi,

This mainly happen due to the Irradiance map. It uses interpolation, that is, it reproduces the colors of some samples, mixing them with the color of other, surrounding samples. When you do the area-render, there are no those surrounding samples that are exists on full render, as a result the IM samples colors of the same area are different, mostly darker. To get results similar to full rendering, you need to either pre-save the IM on a drive and then load it during area-rendering, or make the area a little bigger than the one you really need in order to get a little more surrounding pixels.

Vincent
Jun 22, 2017
Thank you for your work! Are you going to update tutorials to suit new version of V-Ray?
Alex
Jul 20, 2017
Thanks for the tutorial!
This discussion has been closed.