Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

For each value that must be sampled adaptively, there is a certain minimum number of samples that V-Ray always computes, a maximum number of samples, and a noise threshold that controls how many samples between the minimum and the maximum would be actually computed. The minimum number of samples are needed because, like every adaptive algorithm, V-Ray's DMC sampler needs to gather a bit of information about the particular value that is being sampled before it can make any assumptions about it.

 


For image sampling, the three values - minimum samples, maximum samples and noise threshold - are directly specified by the user. The VRaySampleRate render element can show how many samples were actually performed, as a percentage of the maximum. However, for shading effects like glossy reflections, area lights, GI, it would be too cumbersome to have to specify the three values for each effect separately. To simplify the setup, V-Ray allows the user to specify the maximum number of samples using the various subdivs parameters for lights, materials and so on (although importance sampling may modify this maximum number depending on the expected contribution of the value). The noise threshold is specified globally for all values with the DMC noise threshold. What remains then, is to figure out the number of minimum samples that must be taken for a given value: 


Fancy Bullets
  • The minimum number of samples may be specified directly with a fixed number. This is not a bad approach, however, it means that increasing the subdivs value for a shading effect might not always lead to improved quality, contrary to what users typically expect.
  • The minimum number of samples could be specified as a percentage of the maximum number of samples. This approach ensures that increasing the subdivs value always results in better quality, but if the maximum number of samples are too low to begin with, it may mean that there is not enough information in those samples for the adaptive algorithm to work reliably.

...


The V-Ray DMC sampler combines both strategies and takes the bigger value to determine the actual minimum number of samples. Those strategies are controlled by the DMC min. samples parameter and the DMC adaptive amount parameter respectively. Once the minimum number of samples are taken, the DMC sampler continues taking more samples either until the noise threshold is reached, or the maximum number of samples are taken.

...

In the past V-Ray used to have a few "subdivs" parameters in various Settings plugins. Now it automatically calculates the rest of them from the main "subdivs" parameter in the Antialiasing settings. Increasing it increases the total render time, but produces higher-quality sampling. The setting is located in the the SettingsImageSampler plugin.

We generally have generally four types of image samplers in V-Ray - fixed rate, adaptive, adaptive subdivision and progressive. The fixed one renders the image in buckets. Progressive renders the entire image progressively in passes. Adaptive is actually the same as fixed (used in previous versions of V-Ray), but with two parameters added -   max. subdivs and noise threshold. Disabling them results in the same behaviour behavior as the fixed one. The type of the sampler is controlled by the the type parameter of SettingsImageSampler with the following values:

...

The following diagram shows visually the way V-Ray is placing samples when using the Adaptive sampler. The black squares represent the pixels of the image while the dots represent the individual samples. In the first pass, V-Ray always places the minimum number of samples determined by the Min subdivs parameter. Then, the color of samples is compared and more are added where needed in the following passes.

 


2 - adaptive subdivision

This sampler is deprecated.

...

Fancy Bullets
  • Setting Image Sampler Type to Bucket is the same as the Adaptive Type in previous versions of V-Ray.
  • With the Bucket type, disabling Max. Subdivs will also disable the Noise threshold and will match the Fixed sample behavior in earlier versions of V-Ray.
  • Progressive is useful when it is necessary to see overall results quickly (like when placing light, building shaders, or general Look Development work) because it generates the whole image at once and progressively cleans up the noise in it. Additionally, the render can be stopped at any time before resolving completely.
  • Progressive is also helpful when a set amount of time to spend per render is needed. This can also be useful when rendering test animations, where the entire sequence must be rendered within a certain time frame.
  • Combining the VRayDenoiser with Progressive renders can help with cleaning up render noise. If the Denoiser's Update button is used when manually cancelling a render, the noise levels will be adequate enough to use the denoiser to avoid splotches and/or other unwanted effects. Also note that in 3ds max 2017, there is a Stop button in addition to the Cancel button in the progress window. After clicking Stop, V-Ray will begin denoising the render.
  • Using Bucket when running Distributed Renders can be helpful for cutting down on network traffic and reducing the loss of information if work is not completed by one or more DR machines.

...


Examples: Image Sampler Comparisons

Here are some examples demonstrating the quality vs. speed of the image samplers. All the samplers were set to produce approximately the same image quality. The first example is a normal smooth image (no blurry effects), click the images for a larger view:

Image Modified

Both the adaptive and the adaptive subdivision samplers are substantially faster than the fixed rate sampler.

...

UI Text Box
typenote
The Sponza Atrium model was created by Marko Dabrovic (http://www.rna.hr) and was one of the models for the CGTechniques Radiosity competition. The Athene model was a free model from the DeEspona Infografica model bank.

Image Modified

In this case, the Adaptive sampler performed best, and the Adaptive subdivision method performed the worst. Why is that? Here is the non-antialiased image, to give an idea of what the image samplers had to deal with.

Image Modified

Some parts of the image are quite "noisy" because of the fine bump map. Lots of image samples were required to smooth this out. Furthermore, each image sample was quite costly to compute - there is an irradiance map and an area light, which (especially the area light) need a lot of computations. With the Fixed and Adaptive samplers, V-Ray knows in advance how many image samples will be taken for a pixel; therefore, it can optimize the computation of some values (the area light for example) so that the final image result is similar, while actually those values are computed with lower accuracy (i.e. tracing fewer shadow rays) for the individual image samples. This cannot be done for the Adaptive subdivision sampler - it does not know in advance how many samples will be computed for a pixel; therefore it needs to maintain a constant (high) accuracy. Constant accuracy is also required in order for the sampler to adapt correctly to the image. This is why, in this example, the Adaptive subdivision sampler performed worse than the other two methods.

UI Text Box
typenote
The dragon model is from one of the example scene files from 3ds Max 4. The third example is an image with direct GI and motion blur.


Image Modified


Example

One of the purposes functions of image sampling is to improve anti-aliasing, which is the reduction of jagged edges in a rendering. The following example shows the basic difference between an image with anti-aliasing, and one without:

Image Removed

.

If only one sample is taken for the each of the pixels around the In the image with anti-aliasing, the edge of the sphere appears smoother than in the image without anti-aliasing. In the second set of images, the pixels at the edge of the sphere have a color between the gray of the sphere and the blue of the background, giving the edge of the sphere a smoother appearance.

V-Ray performs anti-aliasing by sampling colors in areas where one color meets another, as with the edge of the brown sphere meeting the blue background above. The choice of image sampler and the parameter settings determine the effectiveness of anti-aliasing for any particular scene.

Anti-aliasing within a material can also be affected by filters.

Image Removed

The above picture is rendered using the scenes from the bundle. Make sure to open them and see the commented sections. You can also comment/uncomment different sets of settings for image sampling quality and shading quality.

Parameters

Fixed (bucket) image sampler

Fancy Bullets
  • fixed_subdivs - Subdivs value for the fixed sampler
  • fixed_per_pixel_filtering - True to enable per-pixel filtering for the fixed sampler

...

Fancy Bullets
  • dmc_minSubdivs - Min. subdivs value for the adaptive DMC image sampler
  • dmc_maxSubdivs - Max. subdivs value for the adaptive DMC image sampler
  • dmc_threshold - Color threshold for the adaptive DMC image sampler
  • dmc_adaptive_method - Switches between legacy and new adaptive sampling
  • dmc_per_pixel_filtering - True to enable per-pixel filtering for the adaptive DMC image sampler

...

Fancy Bullets
  • progressive_minSubdivs - Min. subdivs value for the progressive image sampler
  • progressive_maxSubdivs - Max. subdivs value for the progressive image sampler
  • progressive_threshold - Noise threshold for the progressive image sampler
  • progressive_maxTime - Max. render time for the progressive image sampler
  • progressive_bundleSize - Bundle size for the progressive image sampler
  • progressive_showMask - If true, the AA mask will be rendered
  • progressive_progNoiseThreshold - Progressive noise threshold active pixels percent at which the threshold is reduced.

...

Fancy Bullets
  • render_mask_mode - Sets the mode for the render mask. The mode controls which render_mask_* parameter will be used to generate the mask from. Possible values are: 0 - Disable, 1 - Texture, 2 - Objects, 3 - ObjectIDs
  • render_mask_texture - Texture used for render mask when render_mask_mode=Texture.This accepts float textures, where a value of <=1e-6, means that V-Ray won't render in this pixel
  • render_mask_objects - List of Node/GeomGen plugins which will be used for render mask when render_mask_mode=Objects
  • render_mask_object_ids - List of integers object ids, which will be used for render mask when render_mask_mode=ObjectIDs

 

You can see a good default values for these parameters in

 

Align
aligncenter
HTML
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/tKaKvWqTFlw?rel=0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

DMC Sampler Overview

Monte Carlo (MC) sampling is a method for evaluating "blurry" values (anitaliasing, depth of field, indirect illumination, area lights, glossy reflections/refractions, translucency, motion blur, etc). V-Ray uses a variant of Monte Carlo sampling called Deterministic Monte Carlo (DMC).

The difference between pure Monte Carlo sampling and Deterministic Monte Carlo is that the first uses pseudo-random numbers which are different for each and every evaluation (and so re-rendering a single image will always produce slightly different results in the noise), while Deterministic Monte Carlo uses a pre-defined set of samples (possibly optimized to reduce the noise), which allows re-rendering an image to always produce the exact same result. By default, the Deterministic Monte Carlo method used by V-Ray is a modification of Schlick sampling, introduced by Christophe Schlick in C. Schlick, "An Adaptive Sampling Technique for Multidimensional Integration by Ray Tracing", in Second Eurographics Workshop on Rendering (Spain), 1991, pp. 48-56.

Instead of having separate sampling methods for each of the blurry values, V-Ray has a single unified framework that determines how many and which exact samples are to be taken for a particular value, depending on the context in which that value is required. This framework is called the DMC sampler.

Parameters for DMC

Another plugin which controls the DMC method itself is the SettingsDMCSampler plugin. It's parameters are:

Fancy Bullets
  • time_dependent - If this is true, the sample pattern will vary from frame to frame.
  • adaptive_amount - Amount of adaptive sampling; 1.0 means full adaptation; 0.0 means no adaptation.
  • adaptive_threshold - Noise threshold that determines when to stop sampling. Lower values reduce noise, but may take longer to render.
  • adaptive_min_samples - Minimum amount of samples to take.
  • subdivs_mult - A global subdivs multiplier. Handy for reducing overall quality for draft renders.
  • path_sampler_type - int
  • div_shade_subdivs - Allow VRay to divide the number of samples for lights, materials etc by the number of AA samples in order to achieve roughly the same quality and number of rays when changing AA settings.
  • random_seed - If non-zero, a random seed for the DMC sampler.
  • use_local_subdivs - true if shading subdivs in materials/lights/GI should be used, and false to determine subdivs automatically.

Effects

Anti-Aliasing for soft shadows

Shadows are calculated by secondary (shadow) rays in our scene. The best way to get V-Ray to shoot more shadow rays is to increase the Min Shading Rate. The AA Quality helps reduce the noise seen in the shadows. For each Primary Ray ( controlled by the AA Quality) V-Ray shoots additional secondary(shadow) rays that is why AA Quality also affects the quality of the shadows. The Threshold value is a big factor in how much noise we are okay with in our renders. In the following example pictures the term "Shading quaility" refers to a preset for Image Sampler’s Min Subdivs, Max Subdivs, and Noise Threshold.

Image Removed

Image Removed

Anti-Aliasing for Reflections

A higher Min Shading Rate will allow more secondary ray calculations for glossy reflections. If a scene has little to no reflections, a lower Min Shading value will keep render times fast. Increasing the Shading Quality (Min Shading Rate) will increase the secondary effects (like blurry reflections). Increasing the AA Quality will increase the Anti-Aliasing on the geometry in the scene.

Image Removed

Image Removed

, the choice of pixel color is limited to the dark gray at the edge of the object, or the (white) background. Using one of these colors (i.e. taking only one sample) makes the image look jagged. This is the equivalent of no anti-aliasing at all.

If two or more samples are taken in each pixel, the colors are averaged, and pixels at the edge of the object end up being a color in between the dark gray of the sphere and the background. These in-between colors make the object appear smoother in the final rendering.


Section
Column
width20%


Column
width60%
Align
aligncenter
Image_comparison_slider
AddButtonsfalse
LabelBefore1
width80%
LabelAfter24
AttachmentImageBeforeAA_Subdivs_Lock1.png
AttachmentImageAfterAA_Default_24.png
height80%
Column
width20%



In the image with anti-aliasing, the edges appear smoother than in the image without anti-aliasing. 

V-Ray performs anti-aliasing by sampling colors in areas where one color meets another, as with the edges touching the background. The choice of image sampler and the parameter settings determines the effectiveness of anti-aliasing for any particular scene. 

Anti-aliasing within a material can also be affected by filters.

Image Added

The above picture is rendered using the scenes from the bundle. Make sure to open them and see the commented sections. You can also comment/uncomment different sets of settings for image sampling quality and shading quality.

Parameters

Fixed (bucket) image sampler

Fancy Bullets
  • fixed_subdivs - Subdivs value for the fixed sampler
  • fixed_per_pixel_filtering - True to enable per-pixel filtering for the fixed sampler


Adaptive (bucket) image sampler

Fancy Bullets
  • dmc_minSubdivs - Min. subdivs value for the adaptive DMC image sampler
  • dmc_maxSubdivs - Max. subdivs value for the adaptive DMC image sampler
  • dmc_threshold - Color threshold for the adaptive DMC image sampler
  • dmc_adaptive_method - Switches between legacy and new adaptive sampling
  • dmc_per_pixel_filtering - True to enable per-pixel filtering for the adaptive DMC image sampler


Progressive image sampler

Fancy Bullets
  • progressive_minSubdivs - Min. subdivs value for the progressive image sampler
  • progressive_maxSubdivs - Max. subdivs value for the progressive image sampler
  • progressive_threshold - Noise threshold for the progressive image sampler
  • progressive_maxTime - Max. render time for the progressive image sampler
  • progressive_bundleSize - Bundle size for the progressive image sampler
  • progressive_showMask - If true, the AA mask will be rendered
  • progressive_progNoiseThreshold - Progressive noise threshold active pixels percent at which the threshold is reduced.


Others

Fancy Bullets
  • render_mask_mode - Sets the mode for the render mask. The mode controls which render_mask_* parameter will be used to generate the mask from. Possible values are: 0 - Disable, 1 - Texture, 2 - Objects, 3 - ObjectIDs
  • render_mask_texture - Texture used for render mask when render_mask_mode=Texture.This accepts float textures, where a value of <=1e-6, means that V-Ray won't render in this pixel
  • render_mask_objects - List of Node/GeomGen plugins which will be used for render mask when render_mask_mode=Objects
  • render_mask_object_ids - List of integers object ids, which will be used for render mask when render_mask_mode=ObjectIDs


You can see a good default values for these parameters in


Align
aligncenter
HTML
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/tKaKvWqTFlw?rel=0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

DMC Sampler Overview

Monte Carlo (MC) sampling is a method for evaluating "blurry" values (anitaliasing, depth of field, indirect illumination, area lights, glossy reflections/refractions, translucency, motion blur, etc). V-Ray uses a variant of Monte Carlo sampling called Deterministic Monte Carlo (DMC).

The difference between pure Monte Carlo sampling and Deterministic Monte Carlo is that the first uses pseudo-random numbers which are different for each and every evaluation (and so re-rendering a single image will always produce slightly different results in the noise), while Deterministic Monte Carlo uses a pre-defined set of samples (possibly optimized to reduce the noise), which allows re-rendering an image to always produce the exact same result. By default, the Deterministic Monte Carlo method used by V-Ray is a modification of Schlick sampling, introduced by Christophe Schlick in C. Schlick, "An Adaptive Sampling Technique for Multidimensional Integration by Ray Tracing", in Second Eurographics Workshop on Rendering (Spain), 1991, pp. 48-56.

Instead of having separate sampling methods for each of the blurry values, V-Ray has a single unified framework that determines how many and which exact samples are to be taken for a particular value, depending on the context in which that value is required. This framework is called the DMC sampler.

Parameters for DMC

Another plugin which controls the DMC method itself is the SettingsDMCSampler plugin. It's parameters are:

Fancy Bullets
  • time_dependent - If this is true, the sample pattern will vary from frame to frame.
  • adaptive_amount - Amount of adaptive sampling; 1.0 means full adaptation; 0.0 means no adaptation.
  • adaptive_threshold - Noise threshold that determines when to stop sampling. Lower values reduce noise, but may take longer to render.
  • adaptive_min_samples - Minimum amount of samples to take.
  • subdivs_mult - A global subdivs multiplier. Handy for reducing overall quality for draft renders.
  • path_sampler_type - int
  • div_shade_subdivs - Allow VRay to divide the number of samples for lights, materials etc by the number of AA samples in order to achieve roughly the same quality and number of rays when changing AA settings.
  • random_seed - If non-zero, a random seed for the DMC sampler.
  • use_local_subdivs - true if shading subdivs in materials/lights/GI should be used, and false to determine subdivs automatically.


Effects


Anti-Aliasing for soft shadows

Shadows are calculated by secondary (shadow) rays in our scene. The best way to get V-Ray to shoot more shadow rays is to increase the Min Shading Rate. The AA Quality helps reduce the noise seen in the shadows. For each Primary Ray ( controlled by the AA Quality) V-Ray shoots additional secondary(shadow) rays that is why AA Quality also affects the quality of the shadows. The Threshold value is a big factor in how much noise we are okay with in our renders. In the following example pictures the term "Shading quaility" refers to a preset for Image Sampler’s Min Subdivs, Max Subdivs, and Noise Threshold.


Section
Column
width10%


Column
width40%

Image Added

Shading Quality: 3%   Min Shading Rate: 2
AA Quality: 1-8   Threshold: 0.005

Column
width40%

Image Added

Shading Quality: 37%   Min Shading Rate: 24
AA Quality: 1-8   Threshold: 0.005

Column
width10%

Section
Column
width10%


Column
width40%

Image Added

Shading Quality: 25%
AA Quality: 1-1 Threshold: 0.05

Column
width40%

Image Added

Shading Quality: 25%
AA Quality: 1-8 Threshold: 0.005

Column
width10%


Anti-Aliasing for Reflections

A higher Min Shading Rate will allow more secondary ray calculations for glossy reflections. If a scene has little to no reflections, a lower Min Shading value will keep render times fast. Increasing the Shading Quality (Min Shading Rate) will increase the secondary effects (like blurry reflections). Increasing the AA Quality will increase the Anti-Aliasing on the geometry in the scene.


Section
Column
width10%


Column
width40%

Image Added

Min Shading Rate: 2
AA Quality: 1-4 Threshold: 0.02

Column
width40%

Image Added

Min Shading Rate: 16
AA Quality: 1-4 Threshold: 0.02

Column
width10%

Section
Column
width10%


Column
width40%

Image Added

Shading Quality: 35%   Min Shading Rate: 23
AA Quality Min/Max: 1/2   Threshold: 0.05

Column
width40%

Image Added

Shading Quality: 35%   Min Shading Rate: 23
AA Quality Min/Max: 1/6   Threshold: 0.01

Column
width10%

...