Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

Improving irradiance maps

Improving irradiance maps


Brief
Irradiance maps are a powerful tool in V-Rays GI armoury. However people are often overwhelmed by the settings on offer and as a result tend to use the presets provided. Without understanding what goes on behind the scenes, this can be more of a hindrance than help. This guide is aimed at helping you understand what irradiance maps are, what the settings actually do, and how to use the tools to improve your renders.

What are irradiance maps?


Irradiance maps are essentially point clouds. Each point contains illumination information used by V-Ray when lighting up the scene.

The irradiance map (IR map) engine is very good at calculating GI in the areas of your scene where it needs it most. The more samples in an area the more accurate the GI calculation is, but the beauty of the IR map is that its adaptive. The algorithm will use more samples in areas of high detail (surface transition points, shadow transitions etc) and use less samples in areas of low detail, for example large faces of fairly uniform illumination. IR maps are view dependant, which means that samples will only be taken in places the camera can see. This means if you were to move the camera to face a point at which no samples were ever taken, the rendering will not include any GI for that point. Consequently no samples means undesired results. All is not lost; you can add to already saved IR maps, so if the lighting and 1

Improving irradiance maps model conditions do not change, you can build up a quite detailed IR map that can be reused again and again.

Producing and controlling irradiance maps


So now we know what irradiance maps are lets find out how they are produced, and what settings there are to control them. To enable irradiance maps you must make sure that GI is turned on, and that it is set as the Primary GI engine (Diagram A.1).

Diagram A

In this guide we will use Quasi-Monte Carlo (Diagram A.2) as our secondary GI engine. This engine works very well with irradiance maps, a few of the settings even overlap and will be investigated further on into the guide.

Improving irradiance maps Diagram B

At the top of the IR map rollout are the built-in IR map presets (Diagram B.1). These are quick ways of controlling the basic parameters of the IR map engine. However, these presets were created for a render size of 640 x 480, a resolution typically not used in visualisation. The presets are also not streamlined, they are inefficient at producing the necessary level of quality expected from an IR map. So from here on in, we will not be using the built-in presets.

Improving irradiance maps Min & Max rates The min and max rates (Diagram C) have the most dramatic impact over the quality and speed of your IR maps. They give the most control over how V-Ray samples your scene to produce the final IR map. Diagram C

As we found out earlier the samples created when using an IR map are taken in areas, most often, where there is more detail. To do this efficently, we need to let V-Ray work out where exactly these areas are. This is done by allowing the IR map engine to make several passes of our scene. With each pass the engine will work out where more samples are needed and sample them accordingly. But, if you do not give the engine enough passes to do so, it may take samples in areas where it is not needed and consequently increase your render times. People get confused by the notion that less passes equals a faster render. That is not necessarily true. Lets have a look at what affect the min & max rates have. The first setting, the Min rate, tells the IR map engine at which resolution to start the first pass, and not surprisingly the last setting, the Max rate, sets the resolution of the final pass. The rates work such that a setting of 0 is of pixel-for-pixel (full) resolution. A rate of -1, is half of that, and -2 is half of that again. To make it clearer; if your bucket size was set at 64 pixels by 64 pixels, a setting of 0 would atempt to sample an area of the exact same resolution. A setting of -1 would atempt to sample an area of half that size, 32 pixels by 32 pixels. A setting of -2 would atempt to sample an area of a quarter the size of the full resolution, 16 pixels by 16 pixels. With each pass, the IR map engine will work out areas to take more or less samples. As we have established to do this we need to make passes. If we give the engine a low resolution first pass, it can look at a far larger area initally and make a quick decision of where to take samples on the next pass. A pass that is far quicker as a result. To prove this, lets see the IR map engine in action (Diagrams D & E).

Improving irradiance maps

Improving irradiance maps

Improving irradiance maps The first render (Diagram D) was created using a min rate of -6 and a max rate of -1. We can clearly see here that the IR map engine has correctly sampled areas of greater detail and illumination variation more than areas of less detail and less light variance (Diagram D.1). This has helped decrease the IR map calculation time without sacrificing quality. In the second render (Diagram E) we used a min rate of -3 and a max rate of -1. This time we have given V-Ray less of an opportunity of using adaptation to sample areas of the scene. As a result, samples have been taken all over, unnecessarily over-sampling areas (Diagram E.1), and increasing the IR map calculation time.

Min / Max rates and image size


Irradiance maps are very sensitive to image resolution. Settings that may work at 3000 x 1500 will probably not work as well for an image half that size. A big reason for this is incorrect Min / Max rates. When you are dealing with low resolution images, the details in the scene can become lost if you do not use quite high Min / Max settings. High settings would be a max rate of around -1 or 0. Using a setting 0 would become necessary for very fine details. This will not affect the render times as much as you would think due to the image being of a low resolution. On a high resolution image, the details that were small on the low resolution version become much larger. Because the IR map is resolution dependant, you can use a lower Max setting, something around -2. An image that is 500 x 500 across, with a Min -5 / Max rate of -1 should look almost exactly the same as an image that is 1000 x 1000 across, with a Min -6 / Max rate of -2. The IR map scales in this way. This metholodgy can be confusing at first, but when put into practice, can save you lots of time whilst rendering! It will also improve the quality of your images.

Improving irradiance maps

Tidying up IR maps
The Min and Max rates are only half the story. We now need to focus on the other main tools that have a dramatic affect over the speed and quality of the IR map, that is the Hemispheric Subdivisions and the Interpolation Samples (Diagram F). Diagram F

Hemispheric Subdivisions The quality of each sample is determined by the Hemispheric Subdivision (Hsph Subdivs) setting. Think of each IR map sample as a sphere, from this sphere rays are shot off in all directions. To figure out what illumination the point is receiving the number of rays is determined, in part, by the value selected for the Hsph Subdivs. The true amount of rays is the square of the figure you input. This can be increased further still by the Global subdivs multiplier under the rQMC Sampler settings. Remember: every single QMC subvision is affected by the Global subdivs multiplier, from IR maps, to glossy materials. As you can imagine, tracing rays from all these samples can take a long time. Increasing the Hsph Subdivs value can dramatically affect the time your render will take to finish. A recommended value to begin with is 20. If you get splotchiness1 increase the value slightly until artefacts are gone. The maximum value you should use is 50. Increasing the value beyond 50 can result in very long render times. Lowering the value of the Hsph Subdivs will increasingly give you unrealistic and inaccurate results. Interpolation Samples The spaces between the samples concerns the Interpolation Samples (Interp Samples) setting. V-Ray interpolates between samples. The input value determines the amount of smoothing that occurs during interpolation. Think of it as a gradient. The more steps you have in the gradient, the smoother the result. Where Interp Samples differs is that we are dealing with illumination; increasing the amount can result in some detail being lost in the final image. This can also increase the render time, however not quite as much as Hsph Subdivs. A good starting place value for Interp Samples is 20. Increase the value gradually if you wish to smooth out the GI, and lower it if you need that little bit extra detail. Remember, these two values are very closely tied together, increase and decrease the values slowly, until you are happy. Big changes could do the trick, but they may increase your render times by an unnecessarily large amount.

* 1 - Render artefact, consult glossary term Splotchiness

Improving irradiance maps

Extras
Detail enhancement (Diagram G) is meant to improve the quality of IR maps by reducing the blurring that can occur. In practice its much better to reduce the blurring using the other IR map settings. Using Detail enhancement can dramatically increase your render times for no discernible gain. Using this guide to improve your irradiance maps is a far better bet! Detail enhancement: steer clear! Diagram G

Advanced options (Diagram H) is a collection settings related to how V-Ray interpolates and picks samples. These settings can be left at the defaults. Interpolation type (Diagram H.1) the method for interpolating the illumination value from the samples in the IR map. The default value Least squares fit is perfect for the majority of scenes. Suited to renders with large smooth surfaces. You can change this value to Delone Triangulation if you need more detail. This method does not blur the GI. However, to use this successfully you will need to increase the Hsph Subdivs. value to get a smooth result. This method is considerably slower than Least squares fit. Check sample visibility (Diagram H.2) will make V-Ray trace rays from the camera to the samples in the IR map and will figure out if a sample is visible from a point in scene that is being interpolated. This is very useful for preventing light leaks, however, due to the extra rays that need to be cast, render times will increase. Use sparingly! Cal. pass interpolation samples (Diagram H.3) used to guide V-Rays sampling algorithm. A figure of 15 should be the default value. Diagram H

Improving irradiance maps Thresholds (Diagram I) in the Basic parameters group are a series of settings based on sensitivity. Clr threshold controls how sensitive IR maps are to changes in the indirect lighting. Larger values are less sensitive, but produce a result quicker. Base value of 0.3. Nrm threshold determines how sensitive IR maps are to changes in surface normals. This is important for curved objects, as the illumination can vary a lot over the length of the structure. It also determines how sensitive the IR map is to fine details, small bits of geometry that might reflect a lot of light and therefore change the illumination in a scene. Base value of 0.2. Dist threshold determines how sensitive IR maps are to distances between objects. As you increase the setting, more samples are taken in areas where surfaces are close. Base value of 0.5.

Diagram I

10

Improving irradiance maps

V-Ray standard settings


We can use the recommended values from this guide, to form a standard set of settings for future renders (Diagram J). These can be tweaked, as outlined in the guide, to work perfectly with your scenes. Diagram J

11

Improving irradiance maps

Working with animations


Animations require a slightly different setup to still images. The differences vary depending on how strict you have been with V-Rays settings. The resolutions of animations tend to be lower than still images. The max rate will need to be higher because the resolution is low. Just like a still image. A value of 0 can be necessary for animations. However, because the frame size is small, the time to calculate a pixel for pixel pass is not that large. Typical animation resolutions are 1280 x 720 (HD) and 768 x 576 (PAL). Calculating the IR map for an animation requires you to change the IR map mode. By default the mode is set to Single frame. Single frame is perfect for still images, but generally unsuitable for animations. For animations we use the Multi-frame Incremental mode (Diagram K). Diagram k

As stated previously IR maps are view dependant. Whatever the camera sees when creating the IR map, is what gets calculated and saved. However, animations are moving scenes. The view changes over time. If you were to move the viewpoint of a camera, the render will show artefacts, because no IR map calculations were made for the changed viewpoint. To create IR maps correctly for animations, we must calculate the IR map over several frames. We calculate the frames in increments. You might say that to create the IR map successfully you have calculate the IR map for each frame. Depending on the type of animation you are creating, this is often incorrect. For a walk-through animation, the view may not change very much from frame to frame. Which means that the increments, in frames, can be spaced out further. You will need to preview your final animation path, and workout the key points where the view changes. This can be vitally important when saving time and reducing errors. In an animation that has moving objects, it is necessary to calculate the IR map every frame. This is because the scene illumination is changing in every frame. It is completely possible to render out the static scene with one GI solution, and composite in the moving object later. These may have their own separate GI solution, if required.

12

Improving irradiance maps When you calculate incramental IR maps you generally do not want to render the final related frame. It would just increase the overall render time. To turn this off we use the Dont render final image control in the Global Switches rollout (Diagram L). Diagram L

Crawling A notorious problem when creating animations is image crawling. Crawling is noisy patches in your animation. These often appear in areas of high detail. The reason the crawling occurs is poor image sampling. Crawling appears on areas of small detail in your frames. The sampler needs to be told to do a better job in those areas by increasing the settings. The obvious trade off is time. However, the Quality vs. Time factor is all dependant on the type of image sampler you use and the type of filter applied, if any. On the subject of filters, try to avoid sharpening filters when creating animations. The sharpening can introduce artefacts and induce the crawling affect. Sharpening filters also greatly enhance the moire effect that occurs in computer generated renders. Softening filters are your best bet. For more information on image samplers and filters please refer to the Image Sampling guide.

13

Improving irradiance maps

Glossary
Splotchiness Artefact caused by low hsph subdivs. Increase the value until it disappears.

14

You might also like