Wednesday, June 25, 2008

VRay Global Photon Map


Ray Global Photon Map

General

The global photon map is somewhat similar to the irradiance map. It is also used to represent the lighting in the scene, and it is a collection of points in 3D space (a point cloud). However, the photon map is built in a different way. It is built by tracing particles (photons) emitted by the scene lights. Those photons bounce around the scene and hit various surfaces. The hit points are stored in the photon map.

Reconstructing the illumination from the photon map is also different from the irradiance map. With the irradiance map, a simple interpolation is used to blend the nearby GI samples. With the photon map, we need to estimate the photon density at a given point. The idea of density estimation is central to the photon map. VRay can use several methods for density estimation, each with its own advantages and disadvantages. Usually these methods are based on looking for the photons that are nearest to the shaded point.

Note that in general, the photon map provides a less accurate approximation of the scene illumination than the irradiance map, especially when it comes to small details. The irradiance map is built adaptively, whereas the photon map is not. Also a major disadvantage of the photon map is the boundary bias. This unwanted effect is mostly visible around corners and object edges, which appear darker than they should be. The irradiance map can also exhibit boundary bias, however its adaptive nature allows one to decrease the effect greatly. Another disadvantage of the photon map is that it cannot simulate illumination from skylight. This is because the photons need an actual surface to be emitted from. The skylight, at least in VRay, is not a surface actually present in the scene.

On the other hand, the photon map is view-independent and can be computed relatively quickly. This makes it ideal for approximating the scene illumination when used together with more accurate methods like direct computation or the irradiance map.

Parameters

Note that the building of the photon map is also controlled by the photon settings of individual lights in the scene. See the Light settings dialog for more information.

Bounces - this parameter controls the number of light bounces approximated by the photon map. More bounces produce a more reallistic result, but take more time and memory.

Auto search dist - when this is on, VRay will try to compute a suitable distance within which to search for photons. Sometimes the computed distance is ok, in other cases it might be too big (which will slow down the rendering) or too small (which will produce a more noisy result).

Search dist - this option is only available when Auto search dist is off. It allows you to specify the photon search distance manually. Keep in mind that this value depends on the size of your scene. Lower values will speed up the rendering but may produce more noisy results. Larger values will slow down the rendering but may produce smoother results.

Max photons - this option specifies how many photons will be taken into consideration when approximating the irradiance at the shaded point. More photons mean a smoother (and more blurry) result and may also slow down the rendering. Smaller values mean a more noisy result but will render faster.

Multipler - this allows you to control the brightness of the photon map.

Max density - this parameter allows you to limit the resolution (and thus the memory) of the photon map. Whenever VRay needs to store a new photon in the photon map, it will first look if there are any other photons within a distance specified by Max density. If there is already a suitable photon in the map, VRay will just add the energy of the new photon to the one in the map. Otherwise, VRay will store the new photon in the photon map. Using this options allows you to shoot many photons (and thus get smoother results) while keeping the size of the photon map manageable.

Convert to irradiance map - this will cause VRay to precompute the irradiance at the photon hit points stored in the photon map. This allows fewer photons to be used when interpolated the irradiance during rendering, while keeping the result relatively smooth. It is important to note that the resulting map stores irradiance, but is not the same as the irradiance cache used by VRay for primary diffuse bounces.

Interp. samples - this controls how many irradiance samples will be taken from the photon map once it is converted to an irradiance map. Larger values produce smoother results, but may be slower; smaller values produces more noisy results but rendering is faster.

Convex hull area estimate - when this is off, VRay will use a simplified algorithm for computing the area, covered by a number of photons (by only taking the distance to the farthest photon). This algorithm may cause corners to be darker. Using the convex hull area estimate avoids the dark corners problem, but is slower and not as robust.

Store direct light - when this is on, VRay will store direct illumination in the photon map as well. This may speed up the irradiance map or QMC GI, when used as a primary engine, and there are lots of lights in the scene. When this is off, direct lighting will be computed always by tracing the necessary rays. This may slow things down if there are lots of lights in the scene.

Retrace threshold - when this is greater than 0.0, VRay will use direct QMC GI near corners, instead of the photon map, in order to obtain a more accurate result and to avoid splotches in these areas. This may slow down the rendering. When this is 0.0, the photon map will be used always, which will be faster, but may produce artifacts near corners or in places where objects are close to each other.

Retrace bounces - controls how many bounces will be made when retracing corners. If Retrace threshold is 0.0, then this parameter is ignored. Typically this should be equal to the Bounces parameter.

Notes

  • The photon map cannot simulate secondary illumination due to skylight. The photon map is mostly useful for interior scenes with artificial lighting or relatively small windows.
  • The photon map works only with VRay materials. Standard materials will receive GI, but will not generate any photons.

VRay Quasi-Monte Carlo GI





VRay Quasi-Monte Carlo GI

Search Keywords: QMC, Quasi-Monte Carlo, GI

General

This section is available only if you have chosen Quasi-Monte Carlo GI as either the primary or the secondary GI engine.

The Quasi-Monte Carlo method for computing global illumination is a brute-force approach. It recomputes the GI value for every single shaded point separately and independently from other points. While very slow, this method is very accurate, especially if you have many small details in the scene.

To speed up Quasi-Monte Carlo GI, you can use a faster method (the photon map or the light map) for approximating secondary GI bounces, while using the Quasi-Monte Carlo method for the primary bounces.

Parameters

Subdivs - this determines the number of samples used to approximate GI. Note that this is not the exact number of rays that VRay will trace. The number of rays is proportional to the square of this number, but also depends on the settings in the QMC sampler rollout. Depth - this parameter is available only if Quasi-Monte Carlo GI is selected as a secondary GI engine. It co

VRay Light Cache















VRay Light Cache

General

Light caching (sometimes also called light mapping) is a technique for approximating the global illumination in a scene. This method was developed originally by Chaos Group specifically for the VRay renderer. It is very similar to photon mapping, but without many of its limitations.

The light cache is built by tracing many many eye paths from the camera. Each of the bounces in the path stores the illumination from the rest of the path into a 3d structure, very similar to the photon map. On the other hand, in a sense, it is the exact opposite of the photon map, which traces paths from the lights, and stores the accumulated energy from the beginning of the path into the photon map.

Although very simple, the light-caching approach has many advantages over the photon map:

  • It is easier to set up. We only have the camera to trace rays from, as opposed to the photon map, which must process each light in the scene and usually requires separate setup for each light.
  • The light-caching approach works efficiently with any lights - including skylight, self-illuminated objects, non-physical lights, photometric lights etc. In contrast, the photon map is limited in the lighting effects it can reproduce - for example, the photon map cannot reproduce the illumination from skylight or from standard omni lights without inverse-square falloff.
  • The light cache produces correct results in corners and around small objects. The photon map, on the other hand, relies on tricky density estimation schemes, which often produce wrong results in these cases, either darkening or brightening those areas.
  • In many cases the light cache can be visualized directly for very fast and smooth previews of the lighting in the scene.

Even with these advantages, light caching is similar in speed to the photon map and can produce approximations to the global lighting in a scene very quickly. In addition, the light cache can be used successfully for adding GI effects to animations.

Of course, the light cache has some limitations:

  • Like the irradiance map, it is view-dependent and is generated for a particular position of the camera.
  • Like the photon map, the light cache is not adaptive. The illumination is computed at a fixed resolution, which is determined by the user.
  • The light cache does not work very well with bump maps.

Parameters


Subdivs - this determines how many paths are traced from the camera. The actual number of paths is the square of the subdivs (the default 1000 subdivs mean that 1 000 000 paths will be traced from the camera).

Sample size - this determines the spacing of the samples in the light cache. Smaller numbers mean that the samples will be closer to each other, the light cache will preserve sharp details in lighting, but it will be more noisy and will take more memory. Larger numbers will smooth out the light cache but will loose detail. This value can be either in world units or relative to the image size, depending on light cache Scale mode.

Scale - this parameter determines the units of the Sample size and the Filter size:

Screen - the units are fractions of the final image (a value of 1.0 means the samples will be as large as the whole image). Samples that are closer to the camera will be smaller, and samples that are far away will be larger. Note that the units do not depend on the image resolution. This value is best suited for stills or animations where the light cache needs to be computed at each frame.

World - the sizes are fixed in world units everywhere. This can affect the quality of the samples - samples that are close to the camera will be sampled more often and will appear smoother, while samples that are far away will be noisier. This value might work better for fly-through animations, since it will force constant sample density everywhere.

Store direct light - with this option, the light cache will also store and interpolate direct light. This can be useful for scenes with many lights and irradiance map or direct GI method for the primary diffuse bounces, since direct lighting will be computed from the light cache, instead of sampling each and every light. Note that only the diffuse illumination produced by the scene lights will be stored. If you want to use the light cache directly for approximating the GI while keeping the direct lighting sharp, uncheck this option.

Show calc. phase - turning this option on will show the paths that are traced. This does not affect the calculation of the light cache and is provided only as a feedback to the user. This option is ignored when rendering to fields - in that case, the calculation phase is never displayed.

Pre-filter - when this is turned on, the samples in the light cache are filtered before rendering. Note that this is different from the normal light cache filtering (see below) which happens during rendering. Prefiltering is performed by examining each sample in turn, and modifying it so that it represents the average of the given number of nearby samples. More prefilter samples mean a more blurry and less noisy light cache. Prefiltering is computed once after a new light cache is computed or loaded from disk.

Filter - this determines the type of render-time filter for the light cache. The filter determines how irradiance is interpolated from the samples in the light cache.

None - no filtering is performed. The nearest sample to the shaded point is taken as the irradiance value. This is the fastest option, but it may produce artifacts near corners, if the light cache is noisy. You can use pre-filtering (see above) to decrease that noise. This option works best if the light cache is used for secondary bounces only or for testing purposes.

Nearest - this filter looks up the nearest samples to the shading point and averages their value. This filter is not suitable for direct visualization of the light cache, but is useful if you use the light cache for secondary bounces. A property of this filter is that is adapts to the sample density of the light cache and is computed for a nearly constant time. The Interpolation samples parameter determines how many of the nearest samples to look up from the light cache.

Fixed - this filter looks up and averages all samples from the light cache that fall within a certain distance from the shaded point. This filter produces smooth results and is suitable for direct visualization of the light cache (when it is used as the primary GI engine). The size of the filter is determined by the Filter size parameter. Larger values blur the light cache and smooth out noise. Typical values for the Filter size are 2-6 times larger than the Sample size. Note that Filter size uses the same scale as the Sample size and its meaning depends on the Scale parameter.

Use light cache for glossy rays - if this option is on, the light cache will be used to compute lighting for glossy rays as well, in addition to normal GI rays. This can speed up rendering of scenes with glossy reflections quite a lot.

Number of passes - the light cache is computed in several passes, which are then combined into the final light cache. Each pass is rendered in a separate thread independently of the other passes. This ensures that the light cache is consistent across computers with different number of CPUs. In general, a light cache computed with smaller number of passes may be less noisy than a light cache computed with more passes, for the same number of samples; however small number of passes cannot be distributed effectively across several threads.

For single-processor non-hyperthreading machines, the number of passes can be set to 1 for best results.

Mode - determines the rendering mode of the light cache:

Progressive path tracing - in this mode, the light cache algorithm is used to sample the final image progressively. For a discussion of this mode see the tutorial.

Single frame - this will compute a new light cache for each frame of an animation.

Fly-through - this will compute a light cache for an entire fly-through animation, assuming that the camera position/orientation is the only thing that changes. The movement of the camera in the active time segment only is taken in consideration. Note that it may be better to use World Scale for fly-through animations. The light cache is computed only at the first rendered frame and is reused without changes for subsequent frames.

From file - in this mode the light cache is loaded from a file. The light cache file does not include the prefiltering of the light cache; prefiltering is performed after the light cache is loaded, so that you can adjust it without the need to recompute the light cache.

Notes

  • Do not set the Adaptation by importance amount in the QMC sampler rollup to 0.0 when using the light cache, as this will cause excessive render times.
  • Do not apply perfectly white or very close to white materials to a majority of the objects in the scene, as this will cause excessive render times. This is because the amount of reflected light in the scene will decrease very gradually and the light cache will have to trace longer paths. Also avoid materials that have one of their RGB components set to maximum (255) or above.
  • If you want to use the light cache for animation, you should choose a large enough value for the Filter size in order to remove the flickering in the GI.
  • There is no difference between light caches computed for primary bounces (direct visualization) and for secondary bounces. You can safely use light caches computed in one of these modes for the other.
  • Similar to the photon map, you can get "light leaks" with the light cache around very thin surfaces with substantially different illumination on both sides. Currently there is no way to avoid this, except to avoid having very thin objects; also the effec

VRay Irradiance map


VRay Irradiance map

General

This section allows the user to control and fine-tune various aspects of the irradiance map. This section is enabled only when the irradiance map is chosen as the GI method for primary diffuse bounces.

Some background for understanding how the irradiance map works is necessary in order to grasp the meaning of these parameters.

Irradiance is a function defined for any point in the 3D space and represents the light arriving at this point from all possible directions. In general, irradiance is different in every point and in every direction. However, there are two useful restrictions that can be made. The first is the surface irradiance - which is the irradiance arriving at points which lie on the surface of objects in the scene. This is a natural restriction since we are usually interested in the illumination of objects in the scene, and objects are usually defined through their surface. The second restriction is that of diffuse surface irradiance - which is the total amount of light arriving at a given surface point, disregarding the direction from which it comes.

In more simple terms, one can think of the diffuse surface irradiance as being the visible color of a surface, if we assume that its material is purely white and diffuse.

In VRay, the term irradiance map refers to a method of efficiently computing the diffuse surface irradiance for objects in the scene. Since not all parts of the scene have the same detail in indirect illumination, it makes sense to compute GI more accurately in the important parts (e.g. where objects are close to each other, or in places with sharp GI shadows), and less accurately in uninteresting parts (e.g. large uniformly lit areas). The irradiance map is therefore built adaptively. This is done by rendering the image several times (each rendering is called a pass) with the rendering resolution being doubled with each pass. The idea is to start with a low resolution (say a quarter of the resolution of the final image) and work up to the final image resolution.

The irradiance map is in fact a collection of points in 3d space (a point cloud) along with the computed indirect illumination at those points. When an object is hit during a GI pass, VRay looks into the irradiance map to see if there are any points similar in position and orientation to the current one. From those already computed points, VRay can extract various information (i.e. if there are any objects close by, how fast the indirect illumination is varying etc). Based on that information, VRay decides if the indirect illumination for the current point can be adequately interpolated from the points already in the irradiance map, or not. If not, the indirect illumination for the current point is computed, and that point is stored in the irradiance map.

Parameters


Built-in presets

Current preset - this dropdown list allows you to choose from several presets for some of the irradiance map parameters. You can use these to quickly set the color, normal and distance thresholds, as well as the min/max rates. The following presets are available:

  • Very low - this preset is only useful for preview purposes to show the general lighting in the scene.
  • Low - a low-quality preset for preview purposes
  • Medium - a medium quality preset; works fine in many situations in scenes which have don't small details.
  • Medium animation - a medium quality preset targeted at reducing flickering in animations - the Distance threshold is higher.
  • High - a high-quality preset that works in most situations, even for scenes with small details as well as for most animations.
  • High animation - a high-quality preset that can be used if the High preset produces flickering in animations - the Distance threshold is higher.
  • Very high - a very high quality preset; can be used for scenes with extremely small and intricate details.

Note that the presets are targeted for a typical 640x480 image. Larger images usually can do with lower Min/Max rates than those specified in the presets.

Basic parameters

Min rate - this value determines the resolution for the first GI pass. A value of 0 means the resolution will be the same as the resolution of the final rendered image, which will make the irradiance map similar to the direct computation method. A value of -1 means the resolution will be half that of the final image and so on. You would usually want to keep this negative, so that GI is quickly computed for large and flat regions in the image. This parameter is similar to (although not the same as) the Min rate parameter of the Adaptive subdivision image sampler.

Max rate - this value determines the resolution of the last GI pass. This is similar to (although not the same as) the Max rate parameter of the Adaptive subdivision image sampler.

Color threshold (Clr thresh) - this parameter controls how sensitive the irradiance map algorithm is to changes in indirect lighting. Larger values mean less sensitivity; smaller values make the irradiance map more sensitive to light changes (thus producing higher quality images).

Normal threshold (Nrm thresh) - this parameter controls how sensitive the irradiance map is to changes in surface normals and small surface details. Larger values mean less sensitivity; smaller values make the irradiance map more sensitive to surface curvature and small details.

Distance threshold (Dist thresh) - this parameter controls how sensitive the irradiance map is to distance between surfaces. A value of 0.0 means the irradiance map will not depend on object proximity at all; higher values place more samples in places where objects are close to each other.

Hemispheric subdivs (HSph. subdivs) - this controls the quality of individual GI samples. Smaller values make things faster, but may produce blotchy result. Higher values produce smoother images. This is similar to the Subdivs parameter for direct computation. Note that this is not the actual number of rays that will be traced. The actual number of rays is proportional to the square of this value and also depends on the settings in the rQMC sampler rollout.

Interpolation samples (Interp. samples) - this is the number of GI samples that will be used to interpolate the indirect illumination at a given point. Larger values tend to blur the detail in GI although the result will be smoother. Smaller values produce results with more detail, but may produce blotchiness if low Hemispheric subdivs are used.

Options

Show samples - when this option is on, VRay will show visually the samples in the irradiance map as small dots in the scene.

Show calc phase - when this option is on, VRay will show the irradiance map passes as the irradiance map is calculated. This will give you a rough idea of the indirect illumination even before the final rendering is complete. Note that turning this on slows the calculations a little bit, especially for large images. This option is ignored when rendering to fields - in that case, the calculation phase is never displayed.

Show direct light - this option is only available when Show calc phase is on. It will cause VRay to show direct lighting for primary diffuse bounces in addition to indirect lighting while the irradiance map is being calculated. Note that VRay does not really need to compute this. The option is only for convenience. This does not mean that direct lighting is not calculated at all - it is, but only for secondary diffuse bounces (only for GI purposes).

Detail enhancement

Detail enhancement is a method for bringing additional detail to the irradiance map in the case where there are small details in the image. Due to its limited resolution, the irradiance map typically blurs the GI in these areas or produces splotchy and flickering results. The detail enhancement option is a way to calculate those smaller details with a high-precision QMC sampling method. This is similar to how an ambient occlusion pass works, but is more precise as it takes into account bounced light.

On - turns on detail enhancement for the irradiance map. Note that an irradiance map calculated in this mode should not be used without the detail option. When detail enhancement is On, you can use lower irradiance map settings and higher Interpolation samples. This is because the irradiance map is only used to capture the general far-off lighting, while direct sampling is used for the closer detail areas.

Scale - this determines the units for the Radius parameter:

Screen - the radius is in image pixels.

World - the radius is in world units.

Radius - this determines the radius for the detail enhancement effect. Smaller radius means that smaller parts around the details in the image are sampled with higher precision - this would be faster but may be less precise. Larger radius means that more of the scene will use the higher precision sampling and may be slower, but more precise. This is similar to a radius parameter for an ambient occlusion pass.

Subdivs mult. - this determines the number of samples taken for the high-precision sampling as a percentage of the irradiance map Hemispheric subdivs. A value of 1.0 means that the same number of subdivs will be used as for the regular irradiance map samples. Lower values will make the detail-enhanced areas more noisy, but faster to render.

Advanced options

Interpolation type - this option is used during rendering. It selects the method for interpolating the GI value from the samples in the irradiance map.

Weighted average - this method will do a simple blend between the GI samples in the irradiance map based on the distance to the point of interpolation and the difference in the normals. While simple and fast, this method tends to produce a blochiness in the result

Least squares fit - the default method; it will try to compute a GI value that best fits in among the samples from the irradiance map. Produces smoother results than the weighted average method, but is slower. Also, ringing artifacts may appear in places where both the contrast and density of the irradiance map samples change over a small area.

Delone triangulation - all other methods of interpolation are blurry methods - that is, they will tend to blur the details in indirect illumination. Also, the blurry methods are prone to density bias (see below for a description). In difference, the Delone triangulation method is a non-blurry method and will preserve the detail while avoiding density bias. Since it is non-blurry, the result might look more noisy (blurring tends to hide noise). More samples will be needed to get a sufficiently smooth result. This can be done either by increasing the hemispheric subdivs of the irradiance map samples, or by decreasing the Noise threshold value in the QMC sampler rollout.

Least squares with Voronoi weights - this is a modification of the least squares fit method aimed at avoiding the ringing at sharp boundaries by taking in consideration the density of the samples in the irradiance map. The method is quite slow and its effectiveness is currently somewhat questionable.

Although all interpolation types have their uses, it probably makes most sense to use either Least squares fit or Delone triangulation. Being a blurry method, Least squares fit will hide noise and will produce a smooth result. It is perfect for scenes with large smooth surfaces. Delone triangulation is a more exact method, which usually requires more hemispheric subdivs and high Max irradiance map rate (and therefore more rendering time), but produces accurate results without blurring. This is especially obvious in scenes where there are a lot of small details.

Sample lookup - this option is used during rendering. It selects the method of choosing suitable points from the irradiance map to be used as basis for the interpolation.

Nearest - this method will simply choose those samples from the irradiance map which are closest to the point of interpolation. (How many points will be chosen is determined by the value of the Interpolation samples parameter.) This is the fastest lookup method and was the only one available in early versions of VRay. A drawback of this method is that in places where the density of the samples in the irradiance map changes, it will pick more samples from the area with higher density. When a blurry interpolation method is used, this leads to the so-called density bias which may lead to incorrect interpolation and artifacts in such places (mostly GI shadow boundaries).

Nearest quad-balanced - this is an extension of the nearest lookup method aimed at avoiding density bias. It divides the space about the interpolated point in four areas and tries to find an equal number of samples in all of them (hence the name quad-balanced). The method is a little slower than the simple Nearest lookup, but in general performs very well. A drawback is that sometimes, in its attempt to find samples, it may pick samples that are far away and not relevant to the interpolated point.

Precalculated overlapping - this method was introduced in an attempt to avoid the drawbacks of the two previous ones. It requires a preprocessing step of the samples in the irradiance map during which a radius of influence is computed for each sample. This radius is larger for samples in places of low density, and smaller for places of higher density. When interpolating the irradiance at a point, the method will choose every sample that contains that point within its radius of influence. An advantage of this method is that when used with a blurry interpolation method it producses a continuous (smooth) function. Even though the method requires a preprocessing step, it is often faster than the other two. These two properties make it ideal for high-quality results. A drawback of this method is that sometimes lonely samples that are far-away can influence the wrong part of the scene. Also, it tends to blur the GI solution more than the other methods.

Density-based - the default method; it combines the Nearest and the Precalculated overlapping methods and is very effective in reducing ringing artifacts and artifacts due to low sampling rates. This method also requires a preprocessing step in order to compute sample density, but it performs a nearest neighbour look-up to choose the most suitable samples while taking sample density in account.

Being the fastest of the three methods, Nearest lookup may be used for preview purposes. Nearest quad-balanced performs fairly well in the majority of cases. Precalculated overlapping is fast and in many cases performs very well, but may tend to blur the GI solution. The Density-based method produces very good results in the majority of cases and is the default method.

Note that the lookup method is mostly important when using a blurry interpolation method. When using Delone triangulation, the sample lookup method does not influence the result very much.

Calc. pass interpolation samples - this is used during irradiance map calculation. It represents the number of already computed samples that will be used to guide the sampling algorithm. Good values are between 10 and 25. Low values may speed the calculation pass, but may not provide sufficient information. Higher values will be slower and will cause additional sampling. In general, this parameter should be left to the default value of 15.

Use current pass samples - this is used during irradiance map calculation. When checked, this will cause VRay to use all irradiance map samples computed so far. Unchecking it will allow VRay to use only samples collected during previous passes, but not those computing earlier during the current pass. Keeping this checked will usually cause VRay to take less samples (and therefore compute the irradiance map faster). That means that on multiprocessor machines, several threads will be modifying the irradiance map at the same time. Because of the asynchronous nature of this process, there is no guarantee that the rendering the same image twice will produce the same irradiance map. Normally this is not a problem at all and it is recommended to keep this option checked.

Randomize samples - this is used during irradiance map calculation. When it is checked, the image samples will be randomly jittered. Unchecking it will produce samples that are aligned in a grid on the screen. In general, this option should be kept checked in order to avoid artifacts caused by regular sampling.

Check sample visibility - this is used during rendering. It will cause VRay to use only those samples from the irradiance map, which are directly visible from the interpolated point. This may be useful for preventing "light leaks" through thin walls with very different illumination on both sides. However it will also slow the rendering, since VRay will trace additional rays to determine sample visibility.

Mode

Mode - this groups of controls allow the user to select the way the irradiance map is (re)used.

Bucket mode - in this mode, a separate irradiance map is used for each rendered region ("bucket"). This is especially useful since it allows the irradiance map computations to be effectively distributed among several computers when using distributed rendering. Bucket mode can be slower that the Single frame mode, since an additional border must be computed around each region in order to reduce edge artifacts between neighboring regions. Even so, there may be such artifacts. They can be further reduced by using higher settings for the irradiance map (the High preset, more hemispheric subdivs and/or smaller Noise threshold for the QMC sampler).

Single frame - the default mode; a single irradiance map is computed for the whole image, and a new irradiance map is computed for each frame. During distributed rendering, each render server will compute its own full-image irradiance map. This is the mode to use when rendering animations of moving objects. In doing so one must make sure that the irradiance map is of sufficiently high quality to avoid flickering.

Multiframe incremental - this mode is useful when rendering a sequence of frames (not necessarily consequtive) where only the camera moves around (so-called fly-through animations). VRay will compute a new full-image irradiance map for the first rendered frame; for all other frames VRay will try to reuse and refine the irradiance map that has been computed so far. If the irradiance map is of sufficiently high quality as to avoid flickering, this mode can also be used in network rendering - each rendering server will compute and refine its own local irradiance map.

From file - in this mode VRay will simply load the irradiance map from the supplied file at the start of the rendering sequence and will use this map for all the frames in the animation. No new irradiance map will be computed. This mode can be used for fly-through animations and will work well in network rendering mode.

Add to current map - in this mode VRay will compute a completely new irradiance map and will add it to the map that is already in memory. This mode is useful when compiling an irradiance map to render multiple views of a static scene.

Incremental add to current map - in this mode VRay will use the irradiance map that is already in memory and will only refine it in places that don't have enough detail. This mode is useful when compiling an irradiance map to render multiple views of a static scene or a fly-through animation.

The irradiance map mode that should be used depends on the particular rendering task - a static scene, a static scene rendered from multiple views, a fly-through animation or an animation with moving objects. Refer to the tutorials section for more information.

Irradiance map control buttons

There are some more buttons in this group that allow one to perform certain operations on the irradiance map:

Browse - this button allows the user to select the irradiance map file which will be loaded if the From file mode is selected. Alternatively, the user can enter the path and name of the file directly in the edit box.

Save to file - this will save to file the irradiance map which is currently in memory. Note that the Don't delete option in the On render end group must be turned on. Otherwise VRay will automatically delete the irradiance map at the end of the rendering process.

Reset irradiance map - this will clear the irradiance map from memory.

On render end

This group of controls instructs VRay what to do with the irradiance map at the end of the rendering process.

Don't delete - the default for this option is on, which means that VRay will keep the irradiance map in memory until the next rendering. If this option is cleared, VRay will delete the irradiance map when rendering is complete. This means that you will not be able to save the map manually afterwards.

Auto save - if this option is set, VRay will automatically save the irradiance map to the specified file at the end of the rendering. This mode is particularly useful if you want to send the irradiance map for rendering on a different machine through network rendering.

Switch to saved map - this option is only available if the Auto save option is turned on. If Switch to saved map is on, then VRay will also automatically set the irradiance map mode to From file and will set the file name to be that of the map that was just saved.

VRay Indirect illumination (GI)


VRay Indirect illumination (GI)

General

Approaches to indirect illumination

VRay implements several approaches for computing indirect illumination with different trade-offs between quality and speed:

  • Direct computation - this is the simplest approach; indirect illumination is computed independently for each shaded surface point by tracing a number of rays in different directions on the hemisphere above that point.

    Advantages:
    • this approach preserves all the detail (e.g. small and sharp shadows) in the indirect lighting;
    • direct computation is free from defects like flickering in animations;
    • no additional memory is required;
    • indirect illumination in the case of motion-blurred moving objects is computed correctly.
    Disadvantages:
    • the approach is very slow for complex images (e.g. interior lighting);
    • direct computation tends to produce noise in the images, which can be avoided only by shooting a larger number of rays, thus slowing it even more.
  • Irradiance map - this approach is based on irradiance caching; the basic idea is to compute the indirect illumination only at some points in the scene, and interpolate for the rest of the points.

    Advantages:
    • the irradiance map is very fast compared to direct computation, especially for scenes with large flat areas;
    • the noise inherent to direct computation is greatly reduced;
    • the irradiance map can be saved an re-used to speed up calculations of different views for the same scene and of fly-through animations;
    • the irradiance map can also be used to accelerate direct diffuse lighting from area light sources.
    Disadvantages:
    • some details in indirect lighting can be lost or blurred due to the interpolation;
    • if low settings are used, flickering may occur when rendering animations;
    • the irradiance map requires additional memory;
    • indirect illumination with motion-blurred moving objects is not entirely correct and may lead to noise (although in most cases this is not noticeable).
  • Photon map - this approach is based on tracing particles starting from the light sources and bouncing around the scene. This is useful for interior or semi-interior scenes whith lots of lights or small windows. The photon map usually does not produce good enough results to be used directly; however it can be used as a rough approximation to the lighting in the scene to speed the calculation of GI through direct computation or irradiance map.

    Advantages:
    • the photon map can produce a rough approximation of the lighting in the scene very quickly;
    • the photon map can be saved an re-used to speed up calculation of different views for the same scene and of fly-through animations;
    • the photon map is view-independent.
    Disadvantages:
    • the photon map usually is not suitable for direct visualization;
    • requires additional memory;
    • in VRay's implementation, illumination involving motion-blurred moving objects is not entirely correct (although this is not a problem in most cases).
    • the photon map needs actual lights in order to work; it cannot be used to produce indirect illumination caused by environment lights (skylight).
  • Light map - light mapping is a technique for approximating the global illumination in a scene. It is very similar to photon mapping, but without many of its limitations. The light map is built by tracing many many eye paths from the camera. Each of the bounces in the path stores the illumination from the rest of the path into a 3d structure, very similar to the photon map. The light map is a universal GI solution that can be used for both interior or exterior scenes, either directly or as a secondary bounce approximation when used with the irradiance map or the direct GI method.

    Advantages:
    • the lightmap is easy to set up. We only have the camera to trace rays from, as opposed to the photon map, which must process each light in the scene and usually requires separate setup for each light.
    • the light-mapping approach works efficiently with any lights - including skylight, self-illuminated objects, non-physical lights, photometric lights etc. In contrast, the photon map is limited in the lighting effects it can reproduce - for example, the photon map cannot reproduce the illumination from skylight or from standard omni lights without inverse-square falloff.
    • the light map produces correct results in corners and around small objects. The photon map, on the other hand, relies on tricky density estimation schemes, which often produce wrong results in these cases, either darkening or brightening those areas.
    • in many cases the light map can be visualized directly for very fast and smooth previews of the lighting in the scene.

    Disadvantages:

    • like the irradiance map, the light map is view-dependent and is generated for a particular position of the camera. However, it generates an approximation for indirectly visible parts of the scene as well - for example, one light map can approximate completely the GI in a closed room;
    • currently the light map works only with VRay materials;
    • like the photon map, the light map is not adaptive. The irradiance is computed at a fixed resolution, which is determined by the user;
    • the light map does not work very well with bump maps; use the irradiance map or direct GI if you want to achieve better results with bump maps.
    • lighting involving motion-blurred moving objects is not entirely correct, but is very smooth since the lightmap blurs GI in time as well (as opposed to the irradiance map, where each sample is computed at a particular instant of time).

Which method to use? That depends on the task at hand. The Examples section can help you in choosing a suitable method for your scene.

Primary and secondary bounces

The indirect illumination controls in VRay are divided into two large sections: controls concerning primary diffuse bounces and controls concerning secondary diffuse bounces. A primary diffuse bounce occurs when a shaded point is directly visible by the camera, or through specular reflective or refractive surfaces. A secondary bounce occurs when a shaded point is used in GI calculations.

Parameters

On - turns indirect illumination on and off.

GI caustics

GI caustics represent light that has gone through one diffuse, and one or several specular reflections (or refractions). GI caustics can can be generated by skylight, or self-illuminated objects, for example. However, caustics caused by direct lights cannot be simulated in this way. You must use the separate Caustics section to control direct light caustics. Note that GI caustics are usually hard to sample and may introduce noise in the GI solution.

Refractive GI caustics - this allows indirect lighting to pass through transparent objects (glass etc). Note that this is not the same as Caustics, which represent direct light going through transparent objects. You need refractive GI caustics to get skylight through windows, for example.

Reflective GI caustics - this allows indirect light to be reflected from specular objects (mirrors etc). Note that this is not the same as Caustics, which represent direct light going through specular surfaces. This is off by default, becase reflective GI caustics usually contribute little to the final illumination, while often they produce undesired sublte noise.

Post-processing

These controls allow additional modification of the indirect illumination, before it is added to the final rendering. The default values ensure a physically accurate result; however the user may want to modify the way GI looks for artistic purposes.

Saturation - controls the saturation of the GI; a value of 0.0 means that all color will be removed from the GI solution and will be in shades of grey only. The default value of 1.0 means the GI solution remains unmodified. Values above 1.0 boost the colors in the GI solution.

Contrast - this parameter works together with Contrast base to boost the contrast of the GI solution. When Contrast is 0.0, the GI solution becomes completely uniform with the value defined by Contrast base. A value of 1.0 means the solution remains unmodified. Values higher that 1.0 boost the contrast.

Contrast base - this parameter determines the base for the contrast boost. It defines the GI values that remain unchanged during the contrast calculations.

Save maps per frame - if this is on, VRay will save the GI maps (irradiance, photon, caustic, light maps) that have the auto-save option enabled, at the end of each frame. Note that the maps will always be written to the same file. If this option is off, VRay will write the maps only once at the end of the rendering.

First (primary) diffuse bounces

Multiplier - this value determines how much primary diffuse bounces contribute to the final image illumination. Note that the default value of 1.0 produces a physically accurate image. Other values are possible, but not physically plausible.

Primary GI engine - the list box specifies the method to be used for primary diffuse bounces.

Irradiance map - selecting this will cause VRay to use an irradiance map for primary diffuse bounces. See the Irradiance map section for more information.

Global photon map - selecting this option will cause VRay to use a photon map for primary diffuse bounces. This mode is useful when setting up the parameters of the global photon map. Usually it does not produce good enough results for final renderings when used as a primary GI engine. See the Global photon map section for more information.

Quasi-Monte Carlo - selecting this method will cause VRay to use direct computation for primary diffuse bounces. See the Quasi-Monte Carlo GI section for more information.

Light map - this chooses the light map as the primary GI engine. See the Light map section for more information.

Secondary diffuse bounces

Multiplier - this determines the effect of secondary diffuse bounces on the scene illumination. Values close to 1.0 may tend to wash out the scene, while values around 0.0 may produce a dark image. Note that the default value of 1.0 produces physically accurate results. While other values are possible, they are not physically plausible.

Secondary diffuse bounces method - this parameter determines how VRay will calculate secondary diffuse bounces.

None - no secondary bounces will be computed. Use this option to produce skylit images without indirect color bleeding.

Global photon map - selecting this option will cause VRay to use a photon map for primary diffuse bounces. This mode is useful when setting up the parameters of the global photon map. Usually it does not produce good enough results for final renderings when used as a primary GI engine. See the Global photon map section for more information.

Quasi-Monte Carlo - selecting this method will cause VRay to use direct computation for primary diffuse bounces. See the Quasi-Monte Carlo GI section for more information.

Light map - this chooses the light map as the primary GI engine. See the Light map section for more information.

Notes

  • VRay does not have a separate skylight system. The skylight effect can be achieved by setting the background color or environment map in MAX's environment dialog, or in VRay's own Environment rollout.
  • You will get physically accurate lighting if you set both the primary and secondary GI multipliers to their default value of 1.0. While other values are possible, they will not produce a physically accurate result.

VRay Image Sampler (Antialiasing)





VRay Image Sampler (Antialiasing)

General

In VRay, 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.

VRay 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 QMC sampler and Adaptive subdivision sampler.

Parameters


Fixed rate sampler

This is the simplest image sampler, and it takes a fixed number of samples for each pixel.

Subdivs - adjusts 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 generated from a low-discrepancy quasi-Monte Carlo sequence.

Note that due to clamping of samples to the [black, white] range for the RGB color channel, sometimes this sampler can produce darker results when used with blurry effects. The solution in this case is to increase the subdivs for the blurry effect, or to use the Real RGB color channel.

Adaptive QMC sampler

This sampler makes a variable number of samples per pixel based on the difference in intensity between the pixel and its neighbors. Note that this sampler is very strongy tied to the VRay QMC sampler. The sampler doesn't have its own threshold control; instead you should use the Noise threshold parameter of the VRay QMC sampler to control quality.

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.

Note that due to clamping of samples to the [black, white] range for the RGB color channel, sometimes this sampler can produce darker results when used with blurry effects. The solution in this case is to increase the subdivs for the blurry effect, or to use the Real RGB color channel.

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.

Max subdivs - determines the maximum number of samples for a pixel.

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/reftaction etc) this is the best preferred image sampler in VRay. 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.

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.

Rand - 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 on.

Normals - this will supersample areas with sharply varying normals. This option has no effect if DOF or motion blur is on.

Antialiasing filter

This section allows you to choose an antialiasing filter. All standard 3dsmax filters are supported with the exception of the Plate Match filter. See the Examples section for more information on antialiasing filters.

Notes

  • 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 Two-level sampler performs best. Also in the case of animations involving detailed textures, the Adaptive subdivision sampler might produce jittering which the Two-level 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 QMC sampler 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.

VRay Global Switches




VRay Global Switches

General

The global switches allow you to control various aspects of the renderer globally.

Parameters

Geometry section

Displacement - enables or disables VRay's own displacement mapping. Note that this has no effect on standard Max displacement mapping, which can be controlled via the corresponding parameter in the Render dialog.

Lighting section

Lights - enables or disables lights globally. Note that if you uncheck this, VRay will use the default lights. If you do not want any direct lighting in your scene, you must uncheck both this and the Default lights parameters.

Default lights - enables or disables the usage of the default lights when there are no light objects in the scene or when you have disabled lighting globally (see the Lights parameter).

Hidden lights - enables or disables the usage of hidden lights. When this is checked, lights are rendered regardless of whether they are hidden or not. When this option is off, any lights that are hidden for any reason (either explicitly or by type) will not be included in the rendering.

Shadows - enables or disables shadows globally.

Show GI only - when this option is on, direct lighting will not be included in the final rendering. Note that lights will still be considered for GI calculations, however in the end only the indirect lighting will be shown.

Materials section

Reflection/refraction - enables or disables the calculation of reflections and refractions in VRay maps and materials.

Max depth - enables the user to limit globally the reflection/refraction depth. When this is unchecked, the depth is controlled locally by the materials/maps. When this option is checked, all materials and maps use the depth specified here.

Maps - enables or disables texture maps.

Filter maps - enables or disables texture map filtering. When enabled, the depth is controlled locally by the settings of the texture maps. When disabled, no filtering is performed.

Max. transp levels - this controls to what depth transparent objects will be traced.

Transp. cutoff - this controls when tracing of transparent objects will be stopped. If the accumulated transparency of a ray is below this threshold, no further tracing will be performed.

Override mtl - this option allows the user to override the scene materials when rendering. All objects will be rendered with the chosen material, if one is selected, or with default materials if no material is specified.

Glossy effects - this option allows the user to replace all glossy reflections in the scene with non-glossy ones; useful for test renderings.

Indirect illumination section

Don't render final image - when this option is on, VRay will only calculate the relevant global illumination maps (photon maps, light maps, irradiance maps). This is a useful option if you are calculating maps for a fly-through animation.

Raytracing section

Secondary rays bias - a small positive offset that will be applied to all secondary rays; this can be used if you have overlapping faces in the scene to avoid the black splotches that may appear. See the Examples section for a demonstration on the effect of this parameter. This parameter is also useful when using the 3dsmax Render-to-texture feature