When V-Ray renders an image, it determines the color of each pixel to produce the image at the specified resolution. A literal, pixel-by-pixel interpretation of the objects and materials would not result in the best image; abrupt changes in color from one pixel to the next would result in jagged edges, and any lines smaller than one pixel wide would not be represented.

In order to resolve these issues, V-Ray looks at colors at the sub-pixel level and performs sampling on the colors. Sampling is a method of looking at colors within and around each pixel and using this information to determine the best color for each pixel. The goal is to color each pixel in such a way that the final image represents the scene as realistically as possible.

In V-Ray, an image sampler is an algorithm for sampling colors and producing the final array of pixels that constitute the rendered image. V-Ray includes two main image samplers, each with its own approach to sampling and its own parameters. The optimal choice of image sampler varies according to scene elements, the level of detail in textures, and many other factors. The best way to choose the right image sampler for a scene is to understand how they work, and their strengths and limitations.

Sampler type – pecifies the image sampler type. Depending on this choice, an additional rollout will below the Image sampler (Antialiasing) rollout with specific settings for that sampler type.

  • Progressive – Progressively samples the entire image and refines the details over time.
  • Bucket – 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 depending on the difference in pixel intensity.

Min shading rate – Controls the number of rays shot for Anti-aliasing (AA) versus rays for other effects like glossy reflections, GI, area shadows, etc. This setting 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.

Divide Shading Subdivs – When enabled, 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 in order to sample a particular blurry effect with more than one sample, its subdivs must be increased above (sometimes far above) those of the image sampler. However, some users (especially those coming from other render engines) might find this automatic division inconvenient. When this option is disabled, 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 DMC Sampler settings.The Min. shading rate parameter continues to be valid for convenience.

Use Local Subdivs – determines number of samples per pixel.

Render mask – Enables the use of a render mask to determine 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 as the render window and Type set to Bucket .

  • Disabled – A render mask is not used.
  • Texture – Render mask is a texture. Black values in the map define pixels which are not rendered. Pixels with any other values are rendered. The texture should use the screen mapping type.
  • Objects – Renders only objects.
  • Object IDs – Renders only objects with specified Object IDs. Separate Object IDs with a comma (,).

Antialiasing Filter

Filter On – Enables sub-pixel filtering of materials. When this option is disabled, an internal 1×1 pixel box filter is used. Using filters increases rendering time.

Filter – Specifies the filter type.

Filter Radius – Determines the size of the filter in pixels. Higher values yield blurrier results.

Blur – Smooths the result; available when Filter type is set to Mitchell-Netravali.

Ringing – Controls the edge-enhancement strength ; available when Filter type is set to Mitchell-Netravali. When it’s set too high ringing artifacts appear around geometry edges.

Note: Avoid using filters with negative components (sharpening filters) like Catmull-Rom or Mitchell-Netravali when using the Progressive sampler. Doing so might dramatically increase render time as the sampler needs to take additional image samples to resolve the filter.

Progressive Image Sampler

This rollout appears when the  Type in the Image sampler (Antialiasing)  rollout is set to  Progressive. The Progressive sampler is similar to the Bucket  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 image sampler, 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 by adjusting the  Ray bundle size and Min shading rate parameters.

Note: The Affect background option in the Color Mapping rollout is not supported when using Progressive sampler. Deep image output is not supported when using Progressive sampler.

Note: In contrast with the Bucket image sampler, the Progressive sampler doesn’t have a mechanism to recover if a DR server goes offline during rendering before sending back the results from its calculations. The render process might hang indefinitely waiting for the missing data to arrive. This will be corrected in a future release.

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.

Max. Render Time in Min – The maximum render time in minutes. When this number of minutes is reached, the renderer will stop. 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 – 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 AA mask – when enabled the user can see a mask that shows which parts of the image are currently being refined.

Progressive Adaptive Method – The regulary updates during the progressive rendering.

Bucket Sampler

This rollout appears when the Type in the Image sampler (Antialiasing) rollout is set to Bucket. This sampler adaptively makes a variable number of samples per pixel based on the difference in intensity between the pixel and its neighbors.

Use Max Subdivision – switch on to use Max Subdivision option.

Min Subdivision – 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 Subdivision – 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.

Threshold – The threshold used to determine if a pixel needs more samples.

Per-pixel Filtering – enables the antialiasing filter

Adaptive Method – Switches between Legacy and New adaptive sampling. By Default V-RAYforC4D ses the new adaptive sampling method. Choose this option unless you are working with older scenes that require the Legacy method.

Show samples– if this is on, V-RAYforC4D will show an image where the pixel brightness is directly proportional to the number of samples taken at this pixel. This is useful for fine-tuning the antialiasing of the image.

Adaptive Subdivision

Adaptive Subdivision – this is an advanced image sampler capable of under sampling (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-RAYforC4D. 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. Also note that this sampler takes up more RAM than the other two samplers – 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.

Jitter– displaces the samples slightly to produce better antialiasing of nearly horizontal or vertical.

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 under sampled.

Object outline– this will cause the image sampler to always super sample object edges (regardless of whether they actually need to be super sampled). This option has no effect if DOF or motion blur is enabled.

Material ID– uses the material id pass (change of material) to antialiasing the transition from one to the next material on surface.

Normals– this will super sample areas with sharply varying normals. This option has no effect if DOF or motion blur is enabled.

Normals threshold– this will super sample areas with sharply varying normals. This option has no effect if DOF or motion blur is enabled.

Z-Value– uses the z-depth pass (change of depth) to super sample the areas where a sudden depth change occurs.

Z-Value threshold– adjusts the threshold of the above depth sampler.

Show samples– if this is on, VrayC4D will show an image where the pixel brightness is directly proportional to the number of samples taken at this pixel. This is useful for fine-tuning the antialiasing of the image.

Example: What is anti-aliasing?

One of the purposes of sampling is to improve anti-aliasing. The following example shows the basic difference between an image with anti-aliasing and one without:

No anti-aliasing (Bucket rate sampler; Max subdivs Off, Min subdivs = 1)

No anti-aliasing (Close-up view)

Anti-aliasing on (Bucket sampler; Min subdivs = -1, Max subdivs = 2)

Anti-aliasing on (Close-up view)

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.

Example: Anti-aliasing Filters

Here is an example briefly demonstrating the effect of different anti-aliasing filters on the final result.

Note that rendering with a particular filter is not the same as rendering without a filter and then blurring the image in a post-processing program like Adobe Photoshop. Filters are applied on a sub-pixel level, over the individual sub-pixel samples. Therefore, applying the filter at render time produces a much more accurate and subtle result than applying it as a post effect.

The Bucket image sampler was used for the images below.

Filtering is off

Applies an internal 1×1 pixel box filter.

Filtering is off

Applies an internal 1×1 pixel box filter.

Example: Anti-aliasing Filters and Moire Effects

This example demonstrates the effect anti-aliasing filters have on moire effects in your images. Sharpening filters (Mitchell-Netralavli, Catmull-Rom) may enhance moire effects, even if your image sampling rate is very high. Blurring filters (Area, Quadratic, Cubic) reduce moire effects.

Note that moire effects are not necessarily a result of poor image sampling. In general, moire effects appear simply because the image is discretized into square pixels. As such, moire effects are inherent to digital images. The effect can be reduced through the usage of different anti-aliasing filters, but is not completely avoidable.

The scene is very simple: a sphere with a very fine checker map applied. The images were rendered with a very high sampling rate (15 subdivs, or 225 rays/pixel). This is enough to produce quite an accurate approximation to the pixel values. Note that the image looks quite different depending on the filter:

Filtering is off

Area
size = 1.5

Area size = 4.0

Quadratic

Sharp Quadratic

Cubic

Video

Soften size = 6.0

Cook Variable size = 2.5

Blend size = 8.0, blend = 0.3

Blackman

Mitchell-Netravali, blur = 0.333, ringing = 0.333

Catmull-Rom

Example: Stages of Rendering the Progressive Sampler

This example demonstrates the effect anti-aliasing filters have on moire effects in your images. Sharpening filters (Mitchell-Netralavli, Catmull-Rom) may enhance moire effects, even if your image sampling rate is very high. Blurring filters (Area, Quadratic, Cubic) reduce moire effects.

Note that moire effects are not necessarily a result of poor image sampling. In general, moire effects appear simply because the image is discretized into square pixels. As such, moire effects are inherent to digital images. The effect can be reduced through the usage of different anti-aliasing filters, but is not completely avoidable.

The scene is very simple: a sphere with a very fine checker map applied. The images were rendered with a very high sampling rate (15 subdivs, or 225 rays/pixel). This is enough to produce quite an accurate approximation to the pixel values. Note that the image looks quite different depending on the filter:

Image after 1 pass

Image after 16 passes

Image after 64 passes

Image after 256 passes