Improving Irradiance Maps

Embed Size (px)

Citation preview

  • 7/27/2019 Improving Irradiance Maps

    1/14

    1

    Improving irradiance maps

    Improving irradiance maps

    Irradiance maps are a powerul tool in V-Rays GI armoury. However people are oten over-whelmed by the settings on oer and as a result tend to use the presets provided. Withoutunderstanding what goes on behind the scenes, this can be more o a hindrance than help.

    This guide is aimed at helping you understand what irradiance maps are, what the settings actu-ally do, and how to use the tools to improve your renders.

    Brief

    What are irradiance maps?

    Irradiance maps are essentially point clouds. Each point contains illumination inormation usedby V-Ray when lighting up the scene.

    The irradiance map (IR map) engine is very good at calculating GI in the areas o your scenewhere it needs it most. The more samples in an area the more accurate the GI calculation is,but the beauty o the IR map is that its adaptive. The algorithm will use more samples in areaso high detail (surace transition points, shadow transitions etc) and use less samples in areas olow detail, or example large aces o airly uniorm illumination.

    IR maps are view dependant, which means that samples will only be taken in places the cameracan see. This means i you were to move the camera to ace a point at which no samples wereever taken, the rendering will not include any GI or that point. Consequently no samples meansundesired results. All is not lost; you can add to already saved IR maps, so i the lighting and

  • 7/27/2019 Improving Irradiance Maps

    2/14

    2

    Improving irradiance maps

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

    Producing and controlling irradiance mapsSo now we know what irradiance maps are lets nd out how they are produced, and what set-tings 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 Pri-mary GI engine (Diagram A.1).

    In this guide we will use Quasi-Monte Carlo (Diagram A.2) as our secondary GI engine. This en-gine works very well with irradiance maps, a ew o the settings even overlap and will be investi-gated urther on into the guide.

    Diagram A

  • 7/27/2019 Improving Irradiance Maps

    3/14

    3

    Improving irradiance maps

    At the top o the IR map rollout are the built-in IR map presets (Diagram B.1). These are quickways o controlling the basic parameters o the IR map engine. However, these presets werecreated or a render size o 640 x 480, a resolution typically not used in visualisation. The presetsare also not streamlined, they are inecient at producing the necessary level o quality expectedrom an IR map. So rom here on in, we will not be using the built-in presets.

    Diagram B

  • 7/27/2019 Improving Irradiance Maps

    4/14

    4

    Improving irradiance maps

    Min & Max rates

    The min and max rates (Diagram C) have the most dramatic impact over the quality and speedo your IR maps. They give the most control over how V-Ray samples your scene to produce thenal IR map.

    As we ound out earlier the samples created when using an IR map are taken in areas, mostoten, where there is more detail. To do this ecently, we need to let V-Ray work out whereexactly these areas are. This is done by allowing the IR map engine to make several passes o ourscene. With each pass the engine will work out where more samples are needed and samplethem accordingly. But, i you do not give the engine enough passes to do so, it may take sam-

    ples in areas where it is not needed and consequently increase your render times. People getconused by the notion that less passes equals a aster render. That is not necessarily true. Letshave a look at what aect the min & max rates have.

    The rst setting, the Min rate, tells the IR map engine at which resolution to start the rst pass,and not surprisingly the last setting, the Max rate, sets the resolution o the nal pass.

    The rates work such that a setting o 0 is o pixel-or-pixel (ull) resolution. A rate o -1, is hal othat, and -2 is hal o that again. To make it clearer; i your bucket size was set at 64 pixels by 64pixels, a setting o 0 would atempt to sample an area o the exact same resolution. A setting o

    -1 would atempt to sample an area o hal that size, 32 pixels by 32 pixels. A setting o -2 wouldatempt to sample an area o a quarter the size o the ull 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 haveestablished to do this we need to make passes. I we give the engine a low resolution rst pass,it can look at a ar larger area initally and make a quick decision o where to take samples on thenext pass. A pass that is ar quicker as a result. To prove this, lets see the IR map engine in action(Diagrams D & E).

    Diagram C

  • 7/27/2019 Improving Irradiance Maps

    5/14

    5

    Improving irradiance maps

  • 7/27/2019 Improving Irradiance Maps

    6/14

    6

    Improving irradiance maps

  • 7/27/2019 Improving Irradiance Maps

    7/14

    7

    Improving irradiance maps

    The rst render (Diagram D) was created using a min rate o -6 and a max rate o -1. We canclearly see here that the IR map engine has correctly sampled areas o greater detail and illu-mination variation more than areas o less detail and less light variance (Diagram D.1). This hashelped decrease the IR map calculation time without sacricing quality.

    In the second render (Diagram E) we used a min rate o -3 and a max rate o -1. This time wehave given V-Ray less o an opportunity o using adaptation to sample areas o the scene. As aresult, samples have been taken all over, unnecessarily over-sampling areas (Diagram E.1), andincreasing 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 1500will probably not work as well or an image hal that size. A big reason or this is incorrect Min /Max rates.

    When you are dealing with low resolution images, the details in the scene can become lost iyou do not use quite high Min / Max settings. High settings would be a max rate o around -1 or0. Using a setting 0 would become necessary or very ne details. This will not aect the rendertimes as much as you would think due to the image being o a low resolution.

    On a high resolution image, the details that were small on the low resolution version becomemuch 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 o -1 should look almost exactly thesame as an image that is 1000 x 1000 across, with a Min -6 / Max rate o -2. The IR map scalesin this way.

    This metholodgy can be conusing at rst, but when put into practice, can save you lots o timewhilst rendering! It will also improve the quality o your images.

  • 7/27/2019 Improving Irradiance Maps

    8/14

    8

    Improving irradiance maps

    Tidying up IR maps

    The Min and Max rates are only hal the story. We now need to ocus on the other main toolsthat have a dramatic aect over the speed and quality o the IR map, that is the HemisphericSubdivisions and the Interpolation Samples (Diagram F).

    Hemispheric Subdivisions

    The quality o each sample is determined by the Hemispheric Subdivision (Hsph Subdivs) setting.Think o each IR map sample as a sphere, rom this sphere rays are shot o in all directions. Togure out what illumination the point is receiving the number o rays is determined, in part, by

    the value selected or the Hsph Subdivs. The true amount o rays is the square o the gure youinput. This can be increased urther still by the Global subdivs multiplier under the rQMC Sam-pler settings. Remember: every single QMC subvision is aected by the Global subdivs multiplier,rom IR maps, to glossy materials.

    As you can imagine, tracing rays rom all these samples can take a long time. Increasing theHsph Subdivs value can dramatically aect the time your render will take to nish. A recom-mended value to begin with is 20. I you get splotchiness1 increase the value slightly until ar-teacts are gone. The maximum value you should use is 50. Increasing the value beyond 50 canresult in very long render times.

    Lowering the value o the Hsph Subdivs will increasingly give you unrealistic and inaccurateresults.

    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 o smoothing thatoccurs during interpolation. Think o it as a gradient. The more steps you have in the gradient,the smoother the result. Where Interp Samples diers is that we are dealing with illumination;increasing the amount can result in some detail being lost in the nal image. This can also in-

    crease the render time, however not quite as much as Hsph Subdivs.

    A good starting place value or Interp Samples is 20. Increase the value gradually i you wish tosmooth out the GI, and lower it i you need that little bit extra detail.

    Remember, these two values are very closely tied together, increase and decrease the valuesslowly, until you are happy. Big changes could do the trick, but theymay increase your rendertimes by an unnecessarily large amount.

    * 1 - Render arteact, consult glossary term Splotchiness

    Diagram F

  • 7/27/2019 Improving Irradiance Maps

    9/14

    9

    Improving irradiance maps

    Extras

    Detail enhancement (Diagram G) is meant to improve the quality o IR maps by reducing theblurring that can occur. In practice its much better to reduce the blurring using the other IR mapsettings. Using Detail enhancement can dramatically increase your render times or no discern-ible gain. Using this guide to improve your irradiance maps is a ar better bet! Detail enhance-

    ment: steer clear!

    Advanced options (Diagram H) is a collection settings related to how V-Ray interpolates andpicks samples. These settings can be let at the deaults.

    Interpolation type (Diagram H.1) the method or interpolating the illumination value rom thesamples in the IR map. The deault value Least squares t is perect or the majority o scenes.Suited to renders with large smooth suraces. You can change this value to Delone Triangulationi you need more detail. This method does not blur the GI. However, to use this successully youwill need to increase the Hsph Subdivs. value to get a smooth result. This method is considerablyslower than Least squares t.

    Check sample visibility (Diagram H.2) will make V-Ray trace rays rom the camera to thesamples in the IR map and will gure out i a sample is visible rom a point in scene that is beinginterpolated. This is very useul or 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. Agure o 15 should be the deault value.

    Diagram G

    Diagram H

  • 7/27/2019 Improving Irradiance Maps

    10/14

    10

    Improving irradiance maps

    Thresholds (Diagram I) in the Basic parameters group are a series o settings based on sensitiv-ity.

    Clr threshold controls how sensitive IR maps are to changes in the indirect lighting. Larger valuesare less sensitive, but produce a result quicker. Base value o 0.3.

    Nrm threshold determines how sensitive IR maps are to changes in surace normals. This is

    important or curved objects, as the illumination can vary a lot over the length o the structure.It also determines how sensitive the IR map is to ne details, small bits o geometry that mightrefect a lot o light and thereore change the illumination in a scene. Base value o 0.2.

    Dist threshold determines how sensitive IR maps are to distances between objects. As you in-crease the setting, more samples are taken in areas where suraces are close. Base value o 0.5.

    Diagram I

  • 7/27/2019 Improving Irradiance Maps

    11/14

    11

    Improving irradiance maps

    V-Ray standard settings

    We can use the recommended values rom this guide, to orm a standard set o settings or u-ture renders (Diagram J). These can be tweaked, as outlined in the guide, to work perectly withyour scenes.

    Diagram J

  • 7/27/2019 Improving Irradiance Maps

    12/14

    12

    Improving irradiance maps

    Working with animations

    Animations require a slightly dierent setup to still images. The dierences vary depending onhow strict you have been with V-Rays settings.

    The resolutions o animations tend to be lower than still images. Themax rate will need to be

    higher because the resolution is low. Just like a still image. A value o 0 can be necessary oranimations. However, because the rame size is small, the time to calculate a pixel or pixel passis not that large. Typical animation resolutions are 1280 x 720 (HD) and 768 x 576 (PAL).

    Calculating the IR map or an animation requires you to change the IR map mode. By deault themode is set to Single rame. Single rame is perect or still images, but generally unsuitable oranimations. For animations we use the Multi-rame Incrementalmode (Diagram K).

    As stated previously IR maps are view dependant. Whatever the camera sees when creating theIR map, is what gets calculated and saved. However, animations are moving scenes. The viewchanges over time. I you were to move the viewpoint o a camera, the render will show arte-acts, because no IR map calculations were made or the changed viewpoint. To create IR mapscorrectly or animations, we must calculate the IR map over several rames. We calculate therames in increments.

    You might say that to create the IR map successully you have calculate the IR map or eachrame. Depending on the type o animation you are creating, this is oten incorrect.

    For a walk-through animation, the view may not change very much rom rame to rame. Whichmeans that the increments, in rames, can be spaced out urther. You will need to preview yournal animation path, and workout the key points where the view changes. This can be vitallyimportant when saving time and reducing errors.

    In an animation that has moving objects, it is necessary to calculate the IR map every rame. Thisis because the scene illumination is changing in every rame. It is completely possible to renderout the static scene with one GI solution, and composite in the moving object later. These mayhave their own separate GI solution, i required.

    Diagram k

  • 7/27/2019 Improving Irradiance Maps

    13/14

    13

    Improving irradiance maps

    Diagram L

    When you calculate incramental IR maps you generally do not want to render the nal relatedrame. It would just increase the overall render time. To turn this o we use the Dont renderfnal image control in the Global Switches rollout (Diagram L).

    Crawling

    A notorious problem when creating animations is image crawling. Crawling is noisy patches inyour animation. These oten appear in areas o high detail.

    The reason the crawling occurs is poor image sampling. Crawling appears on areas o small de-tail in your rames. The sampler needs to be told to do a better job in those areas by increasingthe settings. The obvious trade o is time. However, the Quality vs. Time actor is all dependanton the type o image sampler you use and the type o lter applied, i any.

    On the subject o lters, try to avoid sharpening lters when creating animations. The sharpen-ing can introduce arteacts and induce the crawling aect. Sharpening lters also greatly en-hance the moire eect that occurs in computer generated renders. Sotening lters are your bestbet.

    For more inormation on image samplers and lters please reer to the Image Sampling guide.

  • 7/27/2019 Improving Irradiance Maps

    14/14

    Improving irradiance maps

    Glossary

    Splotchiness

    Arteact caused by low hsph subdivs. Increase the value until it disappears.