- Image Sampler Overview
- Image Sampler
- Fixed Rate Sampler
- Adaptive Sampler
- Adaptive Subdivision Sampler
- Progressive Sampler
Image Sampler Overview
In V-Ray, an image sampler refers to an algorithm for sampling and filtering the image function, and producing the final array of pixels that constitute the rendered image.
V-Ray implements several algorithms for sampling an image. All image samplers support Max's standard antialiasing filters, although, at the cost of increased rendering time. You can choose between Fixed rate sampler, Adaptive DMC sampler, and Adaptive subdivision sampler.
Type - specifies the image sampler type:
- Fixed - this sampler always takes the same number of samples per pixel;
- Adaptive - this sampler takes a variable number of samples per pixel depending on the difference in the intensity of the pixels;
- Adaptive subdivision - this sampler divides the image into an adaptive grid-like structure and refines it depending on the difference in pixel intensity.
- Progressive - this sampler progressively samples the entire image.
Min shading rate - this option allows you to control the number of rays shot for Antialiasing (AA) versus rays for other effects like glossy reflections, GI, area shadows, etc. It is especially useful with the Progressive image sampler. Higher values mean that less time will be spent on AA, and more effort will be put in the sampling of shading effects.
When loading scenes saved with V-Ray 2.x, the Min shading rate parameter is set to 1 in order to produce the same results as the previous V-Ray versions.
Divide shading subdivs - by default, for each image sample, V-Ray divides 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. For example, if you have 4 AA subdivs (=16 image samples) and 8 light subdivs (=64 shadow rays), V-Ray will trace 4 (=64/16) shadow rays for each image sample. This also means that if you want to sample a particular blurry effect with more than one sample, you need to increase its subdivs (sometimes way) above those of the image sampler. However, some users (especially those coming from other render engines) might find this inconvenient. This option allows them to turn off this feature and, in this case, the subdivs of lights, materials, etc. specify the number of subdivs for each image sample, thus allowing for more precise control of the sampling for these effects. With this option disabled, the above settings of 4 AA subdivs and 8 light subdivs will trace up to 1024 (=16*64) shadow rays, although V-Ray will still try to reduce that amount depending on the Global DMC sampler settings. The author is not fond of this approach, as (in his humble opinion) it does not make setting up a scene faster or simpler and may add more confusion than needed, but if that's what users want, so be it. Note that the Min. shading rate parameter continues to be valid for convenience.
Render mask - this option enables the render mask feature. The render mask allows you define which pixels of the image are calculated. The rest of the pixels are left intact. This feature works best with the V-Ray frame buffer and the Fixed or Adaptive image samplers. The following types are available:
- None - render mask is not used;
- Texture - a texture map is used for the render mask. Black values in the map define pixels which are not rendered. Pixels with any other values are rendered. The texture should use screen mapping type.
- Selected - only pixels that belong to the currently selected object(s) are rendered. V-Ray will still go through the entire image, but will only render parts that belong to the selected object(s). This mode is useful if you want to isolate or re-render just some objects from the scene.
- Include/Exclude list - same as Selected, but the selection is done by list
- Layers - renders only objects that belong to selected layer
- Object IDs - only objects with specified Object IDs will be rendered, you can list them separated by ","
For more information on how to use the Render mask feature see this tutorial.
Image filter - this enables sub-pixel filtering. When it is off, an internal 1x1 pixel box filter is used.
Filter - specifies the filter type. All standard 3ds Max filters are supported with the exception of the Plate Matchfilter. See below for more information on antialiasing filters. Avoid using filters with negative components (sharpening filters) like Catmull-Rom or Mitchell-Netravali when using the Progressive sampler as this may increase the render times quite a bit - the sampler needs to take additional image samples to resolve the filter.
Fixed Rate Sampler
This is the simplest image sampler, and it takes a fixed number of samples for each pixel.
Subdivs - determines the number of samples per pixel. When this is set to 1, one sample at the center of each pixel is taken. If this is greater than 1, the samples are distributed within the pixel. The actual number of pixels is the square of this parameter (e.g. 4 subdivs produce 16 samples per pixel).
This sampler makes a variable number of samples per pixel based on the difference in intensity between the pixel and its neighbors.
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.
This is the preferred sampler for images with lots of small details (like VRayFur, for example) and/or blurry effects (DOF, motion blur, glossy reflections etc). It also takes up less RAM than the Adaptive subdivision sampler.
Min subdivs - determines the initial (minimum) number of samples taken for each pixel. You will rarely need to set this to more than 1, except if you have very thin lines that are not captured correctly, or fast moving objects if you use motion blur. The actual number of pixels is the square of this number (e.g. 4 subdivs produce 16 samples per pixel).
Max subdivs - determines the maximum number of samples for a pixel. The actual maximum number of sampler is the square of this number (e.g. 4 subdivs produces a maximum of 16 samples). Note that V-Ray may take less than the maximum number of samples, if the difference in intensity of the neighboring pixels is small enough.
Use DMC sampler threshold - when this is on (the default), V-Ray will use the threshold specified in the DMC sampler to determine if more samples are needed for a pixel. When this is off, the Color threshold parameter will be used instead.
Color threshold - the threshold that will be used to determine if a pixel needs more samples. This is ignored if the Use DMC sampler threshold option is on.
Adaptive Subdivision Sampler
This is an advanced image sampler capable of undersampling (taking less than one sample per pixel). In the absence of blurry effects (direct GI, DOF, glossy reflection/refraction, etc.) this is the best preferred image sampler in V-Ray. On average, it takes fewer samples (and thus less time) to achieve the same image quality as the other image samplers. However, with detailed textures and/or blurry effects, it can be slower and produce worse results than the other two methods.
The following diagram shows visually the way V-Ray works when using the Adaptive subdivision image sampler. With this mode V-Ray creates a secondary grid on top of the pixel grid and uses this grid to position the samples. This allows it to use less than a sample per pixel. After the first pass, the samples are compared and, if the difference between two samples is bigger than the values in the thresholds, the grid is subdivided and more samples are added. During the whole time, V-Ray has to keep the whole grid in the memory, which makes this method less memory efficient compared to the other two methods - see the Notes below.
Min. rate - controls minimum number of samples per pixel. A value of zero means one sample per pixel; -1 means one sample every two pixels; -2 means one sample every 4 pixels, etc.
Max. rate - controls maximum number of samples per pixel; zero means one sample per pixel, 1 means four samples, 2 means eight samples etc.
Color threshold - determines the sensitivity of the sampler to changes in pixel intensity. Lower values will produce better results, while higher values will be faster, but may leave some areas of similar intensity undersampled.
DOF/moblur subd - determines the quality of depth of field and motion blur effects. Higher values reduce noise in those effects at the cost of render times.
Randomize samples - displaces the samples slightly to produce better antialiasing of nearly horizontal or vertical lines.
Object outline - this will cause the image sampler to always supersample object edges (regardless of whether they actually need to be supersampled). This option has no effect if DOF or motion blur is enabled.
Normals - this will supersample areas with sharply varying normals. This option has no effect if DOF or motion blur is enabled.
The Progressive sampler is similar to the Adaptive sampler, but instead of rendering the image in buckets, it renders the entire image progressively in passes.
The advantage of this sampler is that you can see an image very quickly, and then let it refine for as long as necessary as additional passes are being computed. This is in contrast to the bucket-based image samplers, where the image is not complete until the final bucket is done.
A disadvantage is that more data needs to be kept in memory, especially when working with render elements. Also, when using distributed rendering, because of the continuous refinement, frequent communication between the client machine and the render servers is required, which may reduce the CPU utilization on the render slaves. This effect can be controlled to some extent using the Ray bundle size and Min shading rate parameters.
Min. subdivs - controls the minimum number of samples that each pixel in the image will receive. The actual number of the samples is the square of the subdivs.
Max. subdivs - controls the maximum number of samples that each pixel in the image will receive. The actual number of the samples is the square of the subdivs.
Render time - the maximum render time in minutes. This is the render time for the final pixels only; it does not include any GI prepasses like light cache, irradiance map, etc. If this is 0.0, the render is not limited in time.
Noise threshold - the desired noise level in the image. If this is 0.0, the entire image is sampled uniformly until either the Max. subdivs value is reached or the Render time limit is reached.
Ray bundle size - this option is useful for distributed rendering in order to control the size of the chunk of work that is handed to each machine. When using distributed rendering, higher values may help to utilize CPUs on the render servers better.
Show adaptive mask - this option allows the user to see a mask of the pixels that remain to be sampled.
- Which sampler to use for a given scene? The answer is best found with experiments, but here are some tips:
- For smooth scenes with only a few blurry effects and smooth textures, the Adaptive subdivision sampler with its ability to undersample the image is unbeatable.
- For images with detailed textures or lots of geometry detail and only a few blurry effects, the Adaptive DMC sampler performs best. Also in the case of animations involving detailed textures, the Adaptive subdivision sampler might produce jittering which the Adaptive DMC sampler avoids.
- For complex scenes with lots of blurry effects and/or detailed textures, the Fixed rate sampler performs best and is very predictable with regards to the quality and render time.
- A note on RAM usage: image samplers require substantial amount of RAM to store information about each bucket. Using large bucket sizes may take a lot of RAM. This is especially true for the Adaptive subdivision sampler, which stores all individual sub-samples taken within a bucket. The Adaptive DMCsampler and the Fixed rate sampler on the other hand only store the summed result of all sub-samples for a pixel and so usually require less RAM. The Progressive sampler needs to store information about the entire image and so may take up large amounts of RAM.
- "Affect background" option in Color Mapping rollout is not supported when using Progressive sampler.
- Deep image output is not supported when using Progressive sampler.