Versions Compared

Key

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

...

In this chapter we'll cover the main settings plugins in plugins in V-Ray. These include SettingsOutput, SettingsRTEngine, SettingsUnitsInfo, SettingsDMCSampler, SettingsDR, SettingsImageSampler, SettingsDMCGI, SettingsIrradianceMap, SettingsLightCache and SettingsColorMapping.

A general note on settings plugins: when you create a new Renderer object there are no instances of them, so you will need to create them before changing parameters. If you start rendering the AppSDK will create a SettingsOutput and if the render mode is Interactive it will create SettingsRTEngine. On the other hand, if you're loading a scene from file, it will have instances of most (but not all) settings plugins and settings plugins and you need to use them. This is because every time V-Ray exports a vrscene file it automatically writes out the settings even if they are at default values. 

UI Text Box
typenote

Recommended settings API

Starting with version 1.09 nightly builds after June 14th 2016, the VRayRenderer class includes the method setImprovedDefaultSettings(). It creates (if necessary) some settings plugin instances and sets several parameters to values different from the plugin defaults. These values match the defaults used in our main products, such as V-Ray for 3dsMax and Maya. The plugin defaults couldn't be changed for compatibility reasons (keep old scenes working as they were). But the UI default values have changed over time. Many of the parameters and respective values that are set by setImprovedDefaultSettings() are mentioned in the paragraphs below. These are just good initial values. Feel free to use them or not, or to overwrite some of them, for example reducing quality to get faster renders.

...



The progressive sampler produces whole images iteratively, refining them with each pass. The other samplers work on small "buckets" and only return an image when it is complete.

UI Text Box
typenote

For details on the adaptive and progressive sampler

see 

see this page. You can also see what our CTO has to say about sampling

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>

...

Fancy Bullets
  • progressive_minSubdivs - Keep at value 1.
  • progressive_maxSubdivs - Use between 60 and 100.
  • progressive_threshold - Similarly to dmc_threshold, start at 0.005 and reduce if noise persists. Don't go below 0.001.
  • progressive_maxTime - This is a render time limit in minutes, so unless you want a safety limit, leave it at 0.

...


Anchor
Filters
Filters
Filters

Most filters have just one size parameter for the kernel radius. Catmull-Rom has no parameters. The available filter plugins are:

Fancy Bullets
  • FilterBox  - All samples within a box with sides 2*size are taken with equal weight.
  • FilterArea - All samples within a circle with radius size are taken with equal weight.
  • FilterTriangle - Sample weight falls off as a triangular function of off-center distance.
  • FilterGaussian - The classical blur filter.
  • FilterSinc - Less blurry low-pass filter. See Wikipedia.
  • FilterLanczos (currently default in V-Ray for 3dsMax and Maya) - See Wikipedia.
  • FilterCatmullRom - A cubic edge-enhancing filter.
  • FilterCookVariable
  • FilterMitNet - Mitchell-Netravali cubic filter with subjectively optimized compromise of blurring and detail in the additional blur and ringing parameters which correspond to B and C from the original paper.

...


To apply a filter, just create an instance of one of those plugins. You can use only one at a time. Note: We already covered filters in the topic "Antialiasing Filters".

UI Text Box
typenote

Do not create a SettingsImageFilter. It is deprecated. Use the plugins described above.

Anchor
SettingsDMCSampler
SettingsDMCSampler
DMC sampler

UI Text Box
typenote

For details on the Deterministic Monte Carlo Sampler see this page.

We recommend leaving the parameters of of SettingsDMCSampler at their default values, with the exception of use_local_subdivs. Set this to 0, so that only the global subdivs settings are used.

Anchor
SettingsGI
SettingsGI
Global illumination

...

UI Text Box
typenote

See this page for details on the different GI engines.

By default global illumination (GI) is disabled in an empty scene (with the exception of GPU mode where you can't disable GI). You need to set SettingsGI::on to 1 to enable tracing of secondary rays. Any photorealistic render needs GI, so apart from some kind of debuggingof debugging, you will always want to enable GI.

...

The Irradiance map is configured through through SettingsIrradianceMap

UI Text Box
typenote

See this page for details on the algorithm and its parameters.

The main two parameters are:

Fancy Bullets
  • subdivs - The default is 50. Higher values can fix spot-like artifacts and lower values should improve render times.
  • interp_samples - The default is 20. Setting a lower value may help if surfaces seem too blurry.

...


Anchor
SettingsLightCache
SettingsLightCache
Light cache

The Light cache is configured through through SettingsLightCache

UI Text Box
typenote

See this page for details on the algorithm and its parameters.

There are a lot of parameters for fine tuning and fixing specific problems but the main parameter is:

...

You can also add scene-wide volumetric effects through the environment_volume list.

UI Text Box
typenote

See this page for details.

A special case is the Sun-Sky system. V-Ray has a special procedural texture, TexSky, for these environment slots that is coupled with SunLight. The color of the environment depends on the position of the Sun.

...

Fancy Bullets
  • meters_scale - Multiplying scene sizes by this value should yield object sizes in meters.
  • photometric_scale - Scale for photometric lights.
  • seconds_scale - When doing animation, this is the reciprocal of the framerate
  • scene_upDir - This needs to be set if the scene has an up-axis different from the default, which is +Z.
  • rgb_color_space - Affects Sun/Sky color, color temperatures and dispersion in refractive materials.

...


Anchor
CameraPhysical
CameraPhysical
Physical camera

...

Although the name doesn't hint at it, the CameraPhysical plugin plugin is a settings plugin (singleton). It modifies the way camera rays are shot for effects like DoF (depth of field) and distortion and how they are integrated into the image - exposure. The position and orientation of the camera is still defined by RenderView. Many of the parameters are exactly the same as on a real world DSLR or video/movie camera. 

UI Text Box
typenote

Most parameters are well described in this page, as well as in the previous lessons Introduction and DoF and MB.

We will only add a few things here:

...

This is controlled by SettingsColorMapping.  

UI Text Box
typenote

For parameter descriptions see this page.

The default values when you create a SettingsColorMapping plugin are different from the recommended values in 3dsMax and Maya for legacy reasons. These are the values you should use for new scenes:

...

Fancy Bullets
  • trace_depth - The maximum depth for tracing reflection and refraction rays. Defaults to 5.
  • gi_depth - The maximum depth for tracing diffuse GI rays. Defaults to 3. Lower if you need faster rendering and the scene is exterior. For interiors you may need to increase to get enough lighting, otherwise the scene may remain too dark.
  • coherent_tracing - Experimental grouping of rays for coherency (disabled by default). This can improve performance on GPUs because they handle non-divergent code better. The first few sampling passes will have lots of artifacts, because entire groups of rays move together. Over time this should disappear and the final result should converge to the same image as when this is turned off. This option is only useful for interiors with lots of GI on GPU.
  • cpu_bundle_size - A performance-related parameter. This is the number of rays that get processed together. The default value of 64 for CPU is good.
  • cpu_samples_per_pixel - Number of samples to take for each pixel at one sampling pass. If you set lower, you will get images more often, which is good for interactivity. If you set it higher, you may reach final quality a tiny bit faster, because of the fewer back-and-forth sampling passes, but you will have to wait more between images and it may feel unresponsive when trying to change something in the scene.
  • gpu_bundle_size - Analogous to cpu_bundle_size, but for GPU mode. The default is 256 and changing it may improve performance. The optimal value depends on GPU architecture and model, so you need to experiment. It may be below or above 256, but the default shouldn't be too far from the optimal performance.
  • gpu_samples_per_pixel - Analogous to cpu_samples_per_pixel, but values can be set higher, because GPUs have better performance. You can still set it to 1 for maximum interactivity.
  • progressive_samples_per_pixel - If set to true, set the samples per pixel to 1 for the first pass and double that number on each consecutive pass until cpu/gpu_samples_per_pixel is reached. This lets you get some faster feedback initially, because the image difference between the first passes is larger.
  • undersampling - When set above 0, start rendering at 1/(2^undersampling) resolution. So for example if the value is 4, sampling will start at 1/16 of the original resolution. When one pass is made at this resolution, the resolution is doubled and this repeats until the full resolution is reached. In our example this will return images sampled at 1:16 resolution and then 1:8, 1:4 and 1:2 (The images have the full resolution, but values are repeated for pixels that haven't been sampled). This is for faster feedback, but the images are highly pixelated.
  • max_sample_level - If set above zero, stop rendering when this amount of samples per pixels is reached. This is set through the renderer object's constructor.
  • max_render_time - If set above zero, stop after this many minutes (float number) have passed. This is set through the renderer object's constructor.
  • noise_threshold - If set above zero, stop rendering when the noise difference between neighboring pixels falls below this threshold for all pixels. The unit used is defined by the internal noise-calculating algorithm (same as the thresholds in SettingsImageSampler). Values are usually between 0.001 and 0.1. This is set through the renderer object's constructor.
  • max_draw_interval - Controls partial image updates if set above (the default) zero. This is the maximum time in milliseconds between image updates. So you get a potentially partial image update every time this time elapses. This lets the user see preliminary results earlier. The value in V-Ray for 3dsMax and Maya is 150.
  • min_draw_interval - This is the minimum time between image updates. Set above zero if you want to limit the amount of drawing in the VFB or your own viewport. This may help with CPU and memory utilization when the rendering is very fast. The value in V-Ray for 3dsMax and Maya is 50.
  • opencl_texsize - Despite the name, applies to both OpenCL and CUDA mode. This is the resolution to which textures are re-sampled if opencl_resizeTextures is true and the texture is larger than that. This is intended to help with limited GPU memory, but you may increase it from the default 512 to avoid losing detail if you have enough memory.
  • opencl_resizeTextures - If true, apply opencl_texsize.
  • opencl_textureFormat - Determines bit-depth of textures after reading into memory. 0=32-bit float, 1=16-bit float, 2=8-bit. Default is 16-bit.
  • disable_render_elements - False by default. If set to true, no render elements will be calculated, which may save some computation and memory.

...


The render stops when any one of max_sample_levelmax_render_time or noise_threshold is reached. If all are zero, the sampling goes on indefinitely.