Best V-Ray Settings - Irradiance MapHello everyone! We continue to setting up the global illumination in V-Ray. In the previous tutorial on the general setups and the principles of Indirect Illumination, we have learned what the global illumination is and why is it needed. In this tutorial, we will look into the principles, parameters and arguments for and against the calculation algorithms of secondary GI bounces Brute Force and Irradiance Map.
Contents:This tutorial answers the following questions:
- Indifferent Brute force GI
- Adaptive Irradiance map
- Basic Irradiance Map settings
- Irradiance map detail enhancement
- Additional Irradiance Map options
- How does Brute force GI engine work?
- Where is the Quasi-Monte Carlo GI engine gone?
- How does the Irradiance Map algorithm work?
- How does the three-dimensional irradiance map look like?
- How IM detects the details of the scene?
- What is IM prepass?
- Why we should not set the same values of Min and Max rate?
- How does Detail enhancement option in the Irradiance Map work?
- What Multipass does?
- What value of interpolation gives smooth, but detailed Irradiance Map?
- Why there may be bright light spots on the rendering and how to get rid of them?
Indifferent Brute force GIBrute force GI is a basic algorithm that establishes a fixed number of rays reflected from a point in the scene after hitting it by original ray of light. If you remember, it was previously considered that the light ray from the light source falls on the surface of the scene object and is divided into a number of other rays, which in turn, bombard other objects of the scene (remember the example of the dandelion). Of course, the more diffusely reflected rays of the indirect light will the direct light ray be divided into, the more detail and less noise will be on the final image.
Screenshot of a roolot V-Ray:: Brute force GI of a Indirectc illumination tab of the Renders scene windows of main 3ds Max rendering options. Here present twor parameters: Sebdivs and Secondary bounces.
Secondary bounces is the value that specifies how many times will the secondary rays interreflect further. It is active only if the Brute force algorithm is set as an algorithm for rendering Secondary bounces in the corresponding dropdown list, because in this case, it will calculate the right amount of interreflections. If the Brute force is set as a Primary Bounces GI engine, the Secondary bounces parameter will be inactive.
Brute force algorithm is not adaptive, and simply calculates the GI for each pixel of the final image of the scene, not depending on its complexity, color and detail of objects. Thus, it spends the same amount of computing resources, both in clearly visible and in the unimportant parts of the scene. No wonder why it was named brute force :) We would also like to note that the Brute force is a direct calculation by the method of Quasi-Monte Carlo (QMC) and that is how it was called in earlier versions of V-Ray, which sometimes caused confusion when 3d artists have been long looking for a Quasi-Monte Carlo GI in the new interface.
The brute force of this algorithm is very irrational; its use leads to monstrous times for calculation, even on simple scenes at an adequate level of quality. Therefore, it is not worth to nominally use it in universal V-Ray settings as the render engine for primary or secondary bounces. Its use is justified only in special situations where other algorithms, because of their adaptability cannot cope with the calculation of small details in the scene, but more on that later.
Adaptive Irradiance mapIrradiance map is an adaptive algorithm of rendering global illumination bounces. The main feature of its work is to identify the most important areas of the rendered scene, calculate GI there and fill the GI information about the omitted areas by interpolating the information from the already computed ones.
In order to understand how works and what algorithm Irradiance map is, let us look at generated by it map, which, by the way, called the same – irradiance map.
Rendering of the test scene with the visible Irradiance map samples. This image showes the number of the white dots, which represent the GI samples. The detailed areas have more of them, while the flat surfaces have only few on a great distance between each other.
It is set of these points is the irradiance map, which we see on the image. These points contain information about the color and brightness of GI in those exact areas. The rest of the image is filled with gray color. Gray areas on the irradiance map is part of the scene where irradiance map contains no information about GI. However, it is fully compensated by interpolation between the already computed points of irradiance map. In other words, Irradiance map calculates the most important areas only. After this, the missing information on areas, which were not computed, it simply compensated by interpolation, taking information about the color and brightness from the already existing ones.
It is quite obviously, what the adaptability of the Irradiance map is. In contrast to the Brute force (BF), Irradiance map (IM) does not calculate each pixel of a scene. It calculates only important areas, because of what the very significant savings of computing resources is possible.
Irradiance map algorithm builds a three-dimensional map of points, containing information about the GI just on the surface of objects in the scene. In the volumetric view, the irradiance map of our example scene looks as follows:
The volumetric look of the Gi irradiance map produced by Irradiance map rendering algorithm. Here may be seend the actuad 3d-ness of the GI map and the disturbing of the samples. There are no samples at all at unvisible to camera scene geometry.
Screenshot of the Rendering window that pops up and stays along all rendering process. Here showed the Current Task of the IM calculation. Exactly is is a Prepass 1 of 4 means that the first of total four prepasses is performing at the moment.
Each phase of the GI rendering called pass. The pass, which determines the important areas of the scene, called Prepass. The progress of passes calculation, their total number, and what prepass is calculated at the moment, can be observed in the Rendering system window, which pops up after starting the rendering.
Let us see, how IM calculation looks like on the example of four prepasses.
Four renderings vith visible samples. There are four step by step prepasses of Irradiance map. The first one has no higher density of samples in detailed parts of the scene, while others have them. The last fourth prepass shows the final samples distribution on the irradiance map. All renderings have showed IM resolution.
Look at the first prepass. You may notice that it had not allocated any areas, the entire image calculated equally with the same accuracy as the BF algorithm does. But completely different picture can be seen already at the third and especially the last fourth prepass. It is clearly apparent how the IM algorithm highlighted the important details of the scene, strewed them with GI samples, and significantly thinned out flat not detailed surfaces. They are unimportant the parts, such as walls planes, the flat face of the cube, etc. They have only a few points that will later be simply interpolated between them by IM algorithm, filling the empty zones. Also, we can immediately see that the size of samples with respect to the entire image at different prepasses is different, because the higher the IM rendering resolution, the lower the value of a single sample, and so more detail and more accurate irradiance map is.
It is not hard to guess that GI map, calculated with IM even on the full final resolution without advance prepasses, so without calculating the important areas will be just as tough and not adaptable, as in the case of GI rendering using the BF algorithm. The time to calculate it will certainly be nearly as long, as in the case of BF.
Rendering if the test scene with the visible IM samples. It may seem that here no samples at all. But in fact all image consists of dense situated samples. They are equally placed on the detailed parts as well as on the not important flat homogenous surfaces.
When the map of important points that contain the GI color information, has been calculated, the interpolation of missing GI points is starting. Then on rendering, in each point, as in the case of BF, performed calculation of a fixed number of secondary light rays over the hemisphere, as described in the previous tutorial.
Basic Irradiance Map settingsFor that, which areas algorithm IM considers important, the number of secondary rays will take each point of IM, as well as the resolution of the probing details of the scene, respond the parameters located in the V-Ray:: Irradiance map rollout.
Screngrab of the V-Ray:: Irradiance map rollout of the Indirect illumination tab of the Render scene 3ds max window. Here are much parameters. The fisrs Built-in presets area has only drop-down list Current preset. Basic parameters zone contains parameters such as Min rate, Max rate, HSph, Subdivs, Interp. samples, Clr thesh, Nrm thresh, Dist. thresh, Interp. frames. Options zone is with Show calc. phase, Show direct light, and Show samples parameters. Thre are slo such zones as Detail enhancement, Advanced options, Mode, and On render end.
Next, the Basic parameters zone options come. These are obviously the basic IM parameters.
Min rate is a value that determines the resolution of the first prepass of GI.
Max rate is a value that determines the final resolution of rendering GI or simply the resolution of the last prepass.
As we already know, the IM algorithm with a few GI calculation steps selects the most important and detailed areas. If you look at the examples above, in the upper right corner you will find the value of rate, which determines the resolution of current prepass in rendering IM. Rate value 0 (zero) means that the calculation of GI will be in a resolution equal to the resolution of the final rendering. Rate value equal to -1 means that the calculation of GI will be in a twice lower resolution than the resolution of the final image. Rate value equal to -2 means that the calculation of GI will be in a twice lower resolution than the resolution of -1 rate, which means four times less than the final image resolution. By analogy, the rate value equal to 1 would mean that the calculation of GI will be doubled comparing to resolution than the resolution of the final image, etc.
Absolutely similar concept of undersampling and supersampling uses the anti-aliasing V-Ray Adaptive subdivision algorithm, discussed in detail in the first tutorial of the best V-Ray settings.
Algorithm Irradiance Map is a very flexible and high-tech tool. Despite the seeming logic of rendering the final GI prepass on the final resolution, i.e., with Max rate equal to 0, in practice there is absolutely no need to do this because of the small difference in quality, and the huge difference in computational cost.
The following examples illustrate this:
Renderinf of the test scene with different Min and Max rates. The first rendering shows beautiful image with the long rendering time. While the second rendering shows the quite acceptable image quality with the 5 times less rendering time.
Parameter HSph. subdivs (in a more expanded form HemiSphere Subdivisions) is the number of rays of GI, reflected from a point on the surface of the object. This parameter determines the amount of diffuse light rays taken of each secondary point IM, as mentioned earlier, in the form of a hemisphere. That is a complete analog parameter to a Subdivs in BF algorithm. In most cases, the HSph. Subdivs value, equal to 80 is enough and that it should be set for universal V-Ray configuration.
Interp. Samples is the parameter that determines the quality of interpolation of the IM. Remember the examples with IM samples, where the samples were marked with light dots, and missing areas with gray color. Interp. samples determines the quality of interpolation of not important gray areas with missing information, from the white-dotted important areas. The higher the value of Interp. samples, the higher the interpolation, resulting more blurred GI, while at low values of Interp. samples GI map is less "soapy", but more noisy with lots of artifacts. Default value of 20 samples is enough, and this value should not be changed.
As we already know, IM with help of prepasses feels for to the scene to identify its most detailed parts. IM does so, based on previous prepasses information, and it is guided by three main critical in terms of details properties. This is color, difference between the normals, and the relative position of objects. In the IM, these properties are presented with Clr thresh, Nrm thresh and Dist thresh parameters respectively.
Clr thresh determines the sensitivity threshold of the algorithm IM to the colors of the scene. The higher the threshold, the less color changes on the objects of the scene will be considered as important areas and the easier will be the calculation of IM. Lowering the sensitivity threshold of the algorithm will make IM more sensitive to color changes in the scene and would create more detailed IM, and so the better pictures. Clr thresh parameter value equal to 0.3 is quite acceptable to create an acceptable IM and in universal V-Ray settings we should use it.
Nrm thresh defines the sensitivity threshold of IM algorithm to the scene geometry, in particular to the intensity of change of the object’s normals in it. The lower the threshold, the more geometric details on the objects of the scene will be considered as an important area, respectively, higher quality will be the final image. The parameter Nrm thresh equal to 0.1 is enough for a well-detailed IM and it should be used in universal V-Ray settings.
Dist thresh defines the sensitivity threshold of the IM algorithm to neighboring geometric surfaces in the scene. The higher the threshold, the farther each to other surfaces will be considered as an important area and better will be the final image. Looking at the showed above example, you can easily understand the difference between parameter Dist thresh and parameter Nrm thresh. If from Nrm thresh in this scene will depend the density of the IM in the corners of the room, then Dist thresh will determine the detail of IM in the zone of the close location of the sphere and cube to each other. It should be noted that, when the threshold Dist thresh is lowered, it will take into account only the smaller distance between the surfaces of objects, thereby reducing the density of the samples of IM, and hence the quality of the final image. Pay attention that it is in contrast to the Clr and Nrm thresh, where the decrease of threshold improves image quality. The parameter Dist thresh of 0.1 is enough to create a good IM and we should use it in universal V-ray settings.
The last parameter, located in the zone of Basic parameters, it is inactive Interp. frames. It is responsible for a number of irradiance maps, calculated for different frames of animation in the mode of Animation (prepass), which V-Ray will use to render the current frame in Animation (rendering) mode. It is in the last case, this option will be active and available for change. However, these are very specific modes of IM, which will be described in the tutorial on rendering various types of animation in the V-Ray. By default, in the universal V-Ray settings this option may be left unchanged.
In Options zone of the V-Ray:: Irradiance map rollout can be enabled options, which are responsible for IM rendering in the frame buffer. These options enabling let us to observe clearly the IM prepasses calculation, to show direct light with the GI on the prepasses rendering and to watch the location of samples on the IM. For these functions response parameters Show calc phase, Show direct light and the Show samples, respectively. These are all test functions that do not affect the IM rendering, and in the universal starting V-Ray settings they should not be activated.
Irradiance map detail enhancementThe next area of IM parameters is the Detail enhancement.
As we know, the main highlight of IM is the calculation of important details of scenes with prepasses at lower resolutions. Option Detail enhancement allows us to create a hybrid between an adaptive, but making a little fuzzy samples map IM algorithm and a rough, but precise in details, Brute Force.
When the function Detail enhancement is activated, IM, as well as before, uses prepasses to calculate the details of the scene. However, at the last calculation pass, when the final information on the detail in the scene is obtained, the algorithm Detail enhancement comes into play. The principle of Detail enhancement work is that GI samples of the most important areas are calculated by the algorithm Brute Force at full resolution of the final rendering, without undersampling. All other areas, as in the normal mode of IM, are calculated by interpolation.
The algorithm of Detail enhancement for the determining of what samples in important areas should be calculated, based on the principle of the algorithm similar to the Ambient occlusion (AO), but, in contrast to AO, Detail enhancement algorithm takes into account the direction of light.
It is worth to note that when Detail enhancement is activated, IM algorithm is used only to determine the detail of the scene, and direct rendering of important details lies on the BF component of Detail enhancement. Knowing this, if the option Detail enhancement is active, we can lower all the parameters of the IM, except Interp. samples. Parameter Interp. samples can even be set to larger values.
Algorithm is activated by setting the tick in the checkbox On. Then become active settings such as Scale, Radius and Subdivs mult.
Scale defines the units of measurement of the following Radius parameter.
Radius is the value of the hemisphere radius, which defines the area in which the BF will calculate the GI samples from the reference point. Location of reference points of BF, as mentioned above, is determined at the stage of calculations of detail of the scene with prepasses.
Subdivs mult. is in fact a complete analog of Subdivs parameter of the BF algorithm, which determines the number of diffuse rays. It is set as a percentage of the current HSph. subdivs value.
To better understand what is the radius of the hemisphere, and what hemisphere point we are talking about, we should be closer acquainted with the concept of AO. Explanation of this concept is beyond the subject of this tutorial, but it will be discussed in detail in separate article on AO and, in particular, areas of application of the parametric VRayDirt map. In any case, Detail enhancement is a specific option, which greatly reduces the adaptability of IM and significantly increases the time of GI rendering. That is why it should not be activated unnecessarily and, of course, in the universal V-Ray renderer settings also.
Additional Irradiance Map optionsNext in the IM settings is a zone of Advanced Options.
Interpolation type is drop down list that allows us to choose the method of interpolation if IM samples, i.e., the algorithm that fills the missing areas in the IM, getting the absent sample data from already computed ones. This list contains four methods, they are Weighted average (good / robust), Least squares fit (good / smooth), Delone triangulation (good / exact), and Least squares with Voronoi weights. Technically, they have different mathematical principles to calculate the result. It is absolutely no need to delve into how they work. End user need only to look at the clues given in parenthesis at the end of each of them, and immediately become clear about their features. Optimal interpolation method is the default Least squares fit. That is it worth using in the starting V-Ray configuration.
Sample lookup is a drop-down list, allowing us to select a method that determines which of the calculated IM samples will take part in the interpolation of missing samples in the surrounding areas. There are four sample selection methods, they are Quad-balanced (good), Nearest (draft), Overlapping (very good / fast) and Density-based (best). These also are algorithms, each with its own mathematical peculiarities in the methods of selecting the desired samples, in which it is not necessary to delve without special need. Similarly to the Interpolation type methods, the tips in parenthesis next to their name perfectly explain their features. By default, the best method of Density-based (best) is set and exactly it we may use in universal V-Ray settings.
Calc. pass interpolation samples - a value that specifies the number of computed samples that will guide the IM interpolation algorithm during the last calculation pass. Nominally assigned value of 10 samples is enough to get good results. It should be used in universal settings of V-Ray.
Multipass is a feature that allows the current IM prepass to be able to use absolutely all available samples, calculated for the current particular moment. That is to say, the samples from previous lower resolution prepass, and samples that are already computed in the current own prepass.
Irradiance map is computed as the final render, in many threads to fully utilize the potential of modern computing systems, which are often multi-threaded through multiprocessing and multicore. Initially, when calculating IM by multithreaded system, every piece of IM is calculated by a separate thread, independently each from other. The data for this calculation is taken only from the previous prepasses. Because of this, it turns out that each piece of calculation of IM, without information about the surrounding portions gives inconsistent with them results. On the calculated in this manner IM become evident the boundaries of those portions in the form of lattice.
Rendering with the turned off Multipass function. It demonstrates that the obtained this way IM has evident lattice formed by rendering portions, that were not matched.
Enabling of Multipass function allows the IM algorithm to use information about the current prepass samples. That is, when rendering each portion, it allows the IM algorithm to use information about the adjacent calculated portions, giving a consistent smooth result. Thus, in practice, Multipass function allows to smooth the boundary between the IM calculation portions, giving homogeneous IM, without any visible artifacts in the form of a lattice. In the universal starting V-Ray configuration, this function should always be kept active.
Randomize samples is a feature that allows to generate samples of IM in a random order, making IM more realistic. Nominally, the IM algorithm selects the samples on scene objects with regular intervals, resembling a grid, even if the considered above option Multipass is enabled. This effect clearly can be seen in the image below.
Test scene rendering with the turned off function Randomize samples. It shows that by default, IM samples are placed with the predictable order, which can lower the photo-realism of the obtained image.
Check sample visibility is a feature that allows us to interpolate the samples of IM, only being in sight of each other. Very often, due to the low density of IM, in the process of interpolation of missing samples, the IM algorithm takes the neighboring samples that fall within the zone of sampling for a given point, even though they may be located outside the visible area relatively to each other in the scene. For example, we have a bookcase with a thin wooden shelf, lying close to the rear of this bookcase. On the top of the shelf is a light and it illuminates shelf’s upper part. Under the shelf, direct rays of light in no way can fall. Nevertheless, beneath a shelf at the rear can easily appear bright spots, despite the fact that they simply cannot be there. This happening because the IM algorithm to interpolate the missing samples in the area below the shelf, takes adjacent samples from the upper part of the shelf, without considering actual geometry. To avoid this, the IM interpolation algorithm is necessary to know that we want to check what samples are in the zone of direct mutual visibility, and what are not. Of course, such a check would require additional computational resources.
We suggest you to look an example from V-Ray Help, which perfectly illustrates how this function works.
This is a very useful feature, however, in most scenes, the above-described artifacts are absent, and there is absolutely no need to always verify visibility of samples, needlessly wasting computing resources. In the universal starting configuration of V-Ray, feature Check sample visibility should be disabled.
In areas Mode and On render end we can set the IM working mode, needed for animation rendering. We can specify a folder and name on the hard drive, under which the computed IM can be saved. As mentioned earlier, to the animation in V-Ray a separate tutorial will be devoted, in which these options will be discussed. In starting universal V-Ray settings these options should be left untouched as they are by default.
One last thing worth noting is that the algorithm Irradiance map can be used only for rendering the first diffuse bounce, that is, only as a Primary bounces GI engine. From the working algorithm of IM it is quite clear that the calculation of the avalanche of GI rays, produced after the first bounce, the methods of IM prepasses are inappropriate. When choosing Secondary diffuse bounces GI engine, in a V-Ray:: Indirect Illumination (GI) rollout, an Irradiance map option is absent, which excludes its use for these bounces in any case.
ConclusionIn this tutorial, we have thoroughly been acquainted with important aspects of setting two GI rendering algorithms, namely, the Brute Force and Irradiance Map. In particular, we exhaustively investigated all the details, aspects and tweaks of adaptive GI rendering engine Irradiance Map, and clearly were able to see everything on numerous examples.
Dear friends, we sincerely hope that after carefully reading this tutorial, you are much closer to understanding the essence of the Brute Force and Irradiance Map. We also hope that you are no more scared by a lot of IM settings, and their technical names do not mislead you anymore. Understanding of this critical information lets any V-Ray user easily customize and obtain great GI maps for photo-realistic 3d renderings.
In the next tutorial, we will learn about the GI bounces rendering algorithms Photon mapping and Light Cache. We will consider in detail how they work and each function of Light cache in particular, will learn about the best values of their settings.
All have easy settings and beautiful 3d renderings!
See you next tutorial, check for updates, and certainly support us by purchasing liked excellent premium 3d models :) You can do it!
Your questions and suggestions about this tutorial feel free to write in the comments, and we respond to help you.