Sunday, March 14th, 2010

Advanced Vray HDR Setup Tutorial

An Advanced Vray HDR Tutorial:

This is a slightly more advanced ver­sion of a Vray and 3dsmax HDR light­ing setup. You’ll obtain bet­ter images than using the stan­dard HDRs pro­vided all by them­selves. The first tuto­r­ial basi­cally used one of my HDRs for every­thing. Now I’m going to show you how to split the High Dynamic Range images up so that you get bet­ter look­ing results and also so that the ren­der­ing process itself is more effi­cient in terms of mem­ory and pro­cess­ing. It does take a lit­tle bit more time to set up how­ever, and that is why I gen­er­ally skip the first two tutorials/​methods listed here and sim­ply use the sIBL appli­ca­tion instead as it auto­mat­i­cally takes care many of the HDR inser­tion steps below. But if you don’t use sIBL, than you may find this infor­ma­tion helpful.

The first few sec­tions below (Steps 1 — 8) are a copy and paste from the pre­vi­ous tuto­r­ial on set­ting up your basic scene and using Lin­ear Work­flow (LWF.) If you’ve fol­lowed and under­stood the pre­vi­ous basic tuto­r­ial, then you may want to skip directly to Step 9 instead.

I am going to out­line a few easy steps for using High Dynamic Range Images with Vray 1.5 SP3 and 3dsMax. This should apply to any HDRs you may have in your tex­ture and light­ing libraries. Most of you are prob­a­bly already aware of most of these basic steps but for those that don’t, I will try to walk you from the begin­ning with­out going into too much detail and theory.

1) First, you will want to use Lin­ear Work­flow for more accu­rate color repro­duc­tion. Tech­ni­cally, you do not have to use LWF but you will often find your­self man­u­ally adjust­ing your images in post-​​production in order to get them to look real­is­tic. This is true regard­less of any scene using Vray. You will want to open up Max and browse to the top menu bar: \Customize\Preferences\Gamma and LUT\ and set the fol­low­ing parameters:

Vray Linear Workflow settings.

01. Lin­ear Work­flow Settings.

2) It’s gen­er­ally good prac­tice to set your scene dimen­sions to real world units. Again, this is not nec­es­sary but it is very help­ful for repro­duc­ing more accu­rate light­ing con­di­tions as well as work­ing with both archi­tec­tural and prod­uct mod­els. I almost always try to approx­i­mate the dimen­sions of my mod­els even if the mea­sure­ments aren’t com­pletely accu­rate. It is a very good habit to get into. Browse to: \Customize\Units Setup\ and set your para­me­ters (I often use US Stan­dard because I work with many US-​​based architects):

3dsmax Units Setup

02. Units Setup.

3) Insert your model into the scene or cre­ate a new item such as a teapot in the top view­port. I’ll set the teapot radius to 1′ as an example.

4) Right click your model, select move from the con­text menu, and zero out the coor­di­nates in the XYZ boxes at the bot­tom of your screen so this way your model is per­fectly cen­tered. Again, this isn’t nec­es­sary but it’s? just a good habit if you’re a modeler.

5) Cre­ate a plane in the top view­port near the cen­ter of the scene. Usu­ally, I start to drag out the object as I’m hold­ing the con­trol but­ton down — this way the plane is cre­ated from the cen­ter instead of an edge. I usu­ally zero out all of my objects. Your scene should look some­thing like this:

3dsmax basic scene.

03. Scene setup.

6) VRay works best if you use Vray mate­ri­als instead of stan­dard ones. On larger scenes, it can eas­ily shave off sev­eral min­utes of ren­der­ing time. I always avoid non-​​Vray mate­ri­als when­ever pos­si­ble. Cre­ate a plain white Vray Mate­r­ial and apply it to the plane. Please note with LWF, pure white col­ors can cause extremely long ren­der times. I usu­ally reduce my white val­ues by sev­eral points out of habit. In this case I’m set­ting it to 254:

White Vray Material.

04. White Vray Material.

7) Cre­ate another Vray mate­r­ial of your choice. For this exam­ple, I’m going to use a basic chrome type of mate­r­ial as it will show some good reflec­tions and apply it to your model/​teapot:

Chrome material settings.

05. Vray Chrome Material.

8) Cre­ate a Vray­Phys­i­cal­Cam in your scene like below:

Vray Physical Camera

06. VRay­Phys­i­cal­Cam

Hit ‘c’ after lay­ing out your cam­era in order to view the scene as the cam­era sees it. You may want to adjust the posi­tion of your cam­era with the rota­tion con­trols in the lower right-​​hand side of your screen. My Phys­i­cal Cam­era set­tings for my files usu­ally ren­der nicely at F1.2. Some­times I also set the White Bal­ance set­tings to neutral.

9) Here is the part that diverges from the pre­vi­ous “sim­ple” Vray HDR tuto­r­ial and we get a lit­tle more advanced.

Now we will add the HDR to a cou­ple dif­fer­ent slots in the Ren­der Setup win­dow. Open the Ren­der Setup win­dow if it isn’t already: Top Menu Bar \Rendering\Render Setup…\.? Under the Ren­der Setup win­dow, there should be a tab called: Vray:: Envi­ron­ment. Open that part and where it says GI Envi­ron­ment (sky­light) over­ride, check the on but­ton and where it says none, and browse to your HDR file located on your hard drive.

With this, you are essen­tially instruct­ing the 3d pro­gram to light your 3d model with this file. In real­ity, you really don’t need a large HDR to light your file. In fact, you can save mem­ory and pro­cess­ing by load­ing in a very small version/​copy of orig­i­nal HDR that is blurred. Here, I used a 137 KB HDR that’s been down­sized from the orig­i­nal 8,000 x 4,000 pix­els to 360 x 180 pix­els and blurred in Pho­to­shop and resaved with a dif­fer­ent name — usu­ally renam­ing it with the suf­fix “*_env.hdr” Com­pare that to the 88.3 megabyte file which most peo­ple would use!!! Of course, you could just use the orig­i­nal HDR instead. How­ever in a com­pli­cated scene, the ren­der­ing may go a lot slower — even run­ning into mem­ory issues or even worse a crash.

10) Now, you’ll want to do the same to the Reflection/​refraction envi­ron­ment over­ride in the same win­dow. This time, I won’t use a blur, but I’ll use a much smaller, resized ver­sion of the orig­i­nal HDR. In this case I’ve resized the orig­i­nal HDR down from 8,000 x 4,000 pix­els to 1,500 x 750 pix­els. I’ll rename it with the suf­fix “*_env.hdr” The file size is now 3.4 MB com­pared to the orig­i­nal 88.3 megabytes. Again, you don’t have to if you don’t want to — you can still use the orig­i­nal file.

Here is how my Steps 9 and 10 look:

Vray Environment Override Settings

07. Vray Envi­ron­ment Over­ride Settings.

11) Go to your main Envi­ron­ment win­dow \Rendering\Environment…\. In this case, I’ve saved out a tonemapped ver­sion of the orig­i­nal HDR to .jpg. I’ve kept the size 8,000 x 4,000 pix­els, but the file size is dras­ti­cally smaller while remain­ing crisp. This will be your actual back­ground image.

With the libraries on the HDR­Source web­site, you can just sim­ply use the tonemapped .jpg file which I have pro­vided. Tonemap­ping is a com­pletely dif­fer­ent step/​process than any­thing dis­cussed here, but if you’re really inter­ested, you can search the web for plenty of infor­ma­tion on how to tonemap HDRs your­self. Tonemapped images will look much bet­ter than using an orig­i­nal, plain HDR as a back­ground image.

Environment settings.

08. Envi­ron­ment settings.

12) Now we are ready to run a test ren­der­ing. Open up your ren­der­ing setup win­dow from the top menu bar: \Rendering\Render Setup…\ (short­cut =F10.) I’ve pro­vided a very effi­cient test ren­der­ing setup below:

09 VRay Test Settings 600x491 Advanced Vray HDR Setup Tutorial

09. VRay Test Ren­der­ing Settings.

13) Select your Cam­era in the view­port or hit the ‘c’ key after select­ing your view­port if it isn’t already. This should switch you to your cam­era view. Now you are ready to make your first ren­der­ing test. Hit ‘ren­der.’ Here is my result using my test set­tings and default cam­era values:

HDR Render Test Output.

10. HDR Ren­der Test Output.

13) The scene may look per­fect, too dark, or too bright depend­ing on the HDR used. There’s sev­eral dif­fer­ent options you have at this point. You can always change the cam­era angle, change the F-​​Stop (F Num­ber) of the cam­era (lower num­ber for a brighter scene and vice-​​versa), or adjust the bright­ness and con­trast in post with a pro­gram like Pho­to­shop. Also note that you may have vignetting turned on in the cam­era which may darken the image cor­ners. And last but not least is your cam­era White Bal­ance which may lend your image a cer­tain tint. I usu­ally turn mine to neu­tral but some­times the day­light set­tings (default) works well.

14) As an alter­nate option, some­times I add a Vray­light set to sphere (which I’ve done above), No Decay checked on, Affect Spec­u­lar checked off, Invis­i­ble turned on, and slightly tinted yel­low to my scenes in direct posi­tion of the sun. This will add a more defined shadow as well as a lit­tle bit more over­all tint to your scenes. You may have to dial up and down your light mul­ti­plier. This is really depen­dent on the HDR being used as well as the look you are going for.

15) If I wanted to spend more time on this, I’d prob­a­bly bring the final image into Pho­to­shop, add a lit­tle more con­trast, and give the scene a lit­tle more sat­u­ra­tion in order to boost its impact.

16) Keep in mind with HDRs, that you can rotate the cam­era and the back­ground will change accord­ing to the angle you use. So out of one HDR, you could poten­tially obtain many use­ful renderings.

17) When you are ready to ren­der the final image, adjust the ‘Width’ and ‘Out­put’ size under the ‘Com­mon’ ren­der tab to your lik­ing. You may want to turn on the ‘Antialias­ing fil­ter’ under the ‘Vray’ ren­der tab for sharper edges. Under the ‘Indi­rect Illu­mi­na­tion’ tab, you can change your ‘Pri­mary Bounces’ to ‘Brute Force’ (leave default) or ‘Irra­di­ance Map’ (change to medium or high set­tings) and set your ‘Light Cache’ to around 1500 ‘Sub­divs.’ Last but not least, under the ‘Set­tings’ tab, you can dial up the ‘Global sub­divs mul­ti­plier’ to some­thing like 2 or 3 (even higher) if you want to increase the over­all ren­der­ing set­tings. Please note that all of these set­tings will increase ren­der­ing times as well as quality.