Efficient Interior Lighting with mental ray

Posted on: Temmuz 1, 2010

Many folks have asked me to do an in-depth interior lighting tutorial.  The question you’re probably really asking is “how do you light an interior scene that renders quickly?”  To achieve this, it is more art than science.  To get quick render results you have to take shortcuts and cheat a little to get those fast results.  I’ll show you how I set up lighting for my interior scenes.  I’m assuming that the scene has already been textured.  Just a warning, my technique is not physically accurate by any means, but it renders quite fast and is a useful method for a fast production turnaround.  Disclaimer: This is not a tutorial for someone who is just learning Max (there are plenty of those out there), so I’m assuming that you know your way around the software.

Here is an outline of how I setup my lighting in my scenes, and I broke it up into 8 steps:

1. Create Daylight System (allow mr Photographic Exposure, and mr Physical Sky)
2. Set exposure Preset to Physically Based Lighting, Indoor Daylight
3. Turn OFF Final Gather (FG)
4. Turn ON Global Illumination (GI)
5. Tweak and save .pmap file, switch to Read Photons Only from Existing Map Files
6. Turn ON FG, create interior lights (photometric lights, mr Sky Portal)
7. Save .fgm, switch to Read FG Points Only from Existing Map Files
8. Turn off mr Sky Portal (optional), and render image

1. Create Daylight System

This one is fairly straight forward.  The settings that are most important for my sun are the ones that affect orientation.  Because every scene is different, orienting your sun to get the most light into your windows is key, and will help keep your render times down.  Even though simple, the North Direction / Time of the day and year are perhaps the most important factors in creating a well lit render.

2. Set exposure Preset to Physically Based Lighting, Indoor Daylight

Setting my exposure to the preset default of interior daylight gives me a good benchmark to know what to tweak my lighting against.  If you don’t have your exposure set up correctly, you could be cranking the lights up till the cows come home.  Having the proper exposure ensures that your light settings are within somewhat physically accurate ranges.

3.Turn OFF Final Gather

This is done due to the technique in using the combination of FG with GI.  GI is calculated first, then FG uses the light from GI to create a more efficient FG map.  Think of GI as the primer, and FG as the paint color that goes on-top of the primer.

4.Turn ON Global Illumination

This is really the first step in tweaking the lighting.  Once you turn on GI, this is what I get with the default settings:

The default setting is actually pretty good, and works for most scenarios.  However you will notice that you can see the photon disks on the geometry.  Typically you can leave it at the default setting because it usually gives the optimum lighting amount.  But I’ll explain how you can tweak GI to get rid of the disks if they really bother you.  But if you’re not interested in this portion, you can skip straight to step 6.  The disk visibility can be corrected by adjusting the Maximum Sampling Radius.  In mental ray if this setting is turned off, GI, by default, creates photon disks that are 1/100 of the scene size.  This is typically usable for most scenes, however sometimes the disks are too large or small for the rendering.

5.Tweak and save .pmap file

So the first thing I change for GI is the Maximum Sampling Radius.  I turn it on, and start with a small radius and work my way up.  As I increase the radius, I also increase the Average GI Photons per Light, just slightly.  The goal is to achieve a bright-even face on the geometry without getting changes in color on the same surface.  Any artifacts that are noticeable from GI will affect the way FG is calculated, so it’s important that the GI map is smooth.

Maximum Sampling Radius: 1’
Average GI Photons per Light: 20000

So out comes the photon disco ball you may have seen in other renderings.  What you are really seeing are 20000 photon disks at 1’ in radius.  There are really two approaches to getting a good GI solution from this point.  You can keep the radius at 1’, and increase the Average GI Photons per Light to crazy high numbers.  This could give you a smooth result with nice detailed soft shadows, but can take a very long time to calculate.  Rather, I prefer to increase the radius size until they overlap large enough to get a smooth result.  Then I turn up the Average GI Photons per Light, but not so high to make my GI calculation times go through the roof.  There is no one solution.  Play with the combination of settings of the radius size and photons per light count until you get something that looks reasonable.

Maximum Sampling Radius: 5’
Average GI Photons per Light: 20000

Maximum Sampling Radius: 10’
Average GI Photons per Light: 20000

Maximum Sampling Radius: 30’
Average GI Photons per Light: 20000

Maximum Sampling Radius: 30’
Average GI Photons per Light: 40000

Maximum Sampling Radius: 30’
Average GI Photons per Light: 60000

Maximum Sampling Radius: 30’
Average GI Photons per Light: 80000

Maximum Sampling Radius: 4’
Average GI Photons per Light: 2000000

For this scene I chose to set the Maximum Sampling Radius: 30’ & Average GI Photons per Light: 40000 was the best solution for what I was trying to achieve.  This number of photons was just enough to smooth out the disks, but setting it any higher would just darken the image more.  Interestingly enough, it seems to be very similar to the default GI settings.  I also rendered one with Maximum Sampling Radius: 4’ & Average GI Photons per Light: 2000000.  You’re probably wondering “if the settings are so high, why is it darker?”.  The lower setting images are brighter because they are taking a sample of a color and spreading it out 30’ in every direction.  So if a sample is taken just on the outside of the wall where the sun light is very bright, it will spread that color 30’ out and perhaps inside the building.  This is why the early results are in no way accurate, but give us the results we need.

Once you’re happy with your GI map set it to Read Photons Only from Existing Map Files, and click Generate Photon Map File Now, to save it to a file.
6.Turn ON FG, create interior lights

Now that you’ve saved your GI map, we’re ready to create the FG map.  But before calculating the FG map, I create all of the lights that will be present on the inside of the building.  So all the fixtures, wall sconces, can lights, etc….I create photometric lights for all of them.  I also create mr Sky Portals for significant windows.  In this scene I have 2; 1 on the left store-front, and 1 in the back.  These sky portals help focus the FG map where we want it to go. I try to keep most of my lights at their default values so they may render accurately.  For the photometric lights depending on the Shape/Area Shadow settings, you can have some really long render times.  Try to keep the Emit light from (Shape) to Point, and use the other shapes (Rectangle, Disc, etc) sparingly as they increase render times drastically.

As far as FG settings, I usually set the FG Precision Presets to Draft believe it or not.  I leave most everything else at their default value. Often I change the Noise Filtering from Standard to None.  This allows mental ray to use all of the FG bounces rather than dropping some of them to smooth it out.

7. Save .fgm, switch to Read FG Points Only from Existing Map Files

When you’re happy with your FG map, under the Reuse rollout, switch Final Gather Map to Read FG Points Only from Existing Map Files, then hit the Generate FG map button.  This will save it to a file, much like the GI map.  Another trick I do is to render the FG map at 50% of the actual render.  So if my render is going to be 1600 x 800 pixels, I generate a FG map at 800 x 400 px.

8. Turn off mr Sky Portal (optional), and render image

Now that you have your FG map saved to a file, we can create our render.  Another trick/time-saver: You can turn off the mr Sky Portals (yes another cheat).  So when the scene renders it is using a FG map with light information from the Sky Portals, but it’s not actually rendering those lights with their shadow samples. This is just to save rendering time.  If you can afford to leave them on, then do, but to get a fast rendering out this is a great shortcut.  At this point you can go back to your exposure settings and tweak them if the image is too bright or too dark.
This is my typical process for getting interior renders from a scene.  I usually go one step further and render an ambient occlusion pass, and add it to the rendering in Photoshop.  There I play with levels, color corrections, and other things to beautify the image.  There are so many other ways to do this with the same tools that you can tweak along the way to get your rendering right.  Rendering is a give and take process as well.  The more bells and whistles you add, the longer it will take to crank out, so it’s about finding that happy medium of time vs. quality. But in the end it’s all about an image that you’re happy with.
Reklamlar

Bir Cevap Yazın

Aşağıya bilgilerinizi girin veya oturum açmak için bir simgeye tıklayın:

WordPress.com Logosu

WordPress.com hesabınızı kullanarak yorum yapıyorsunuz. Çıkış  Yap /  Değiştir )

Google+ fotoğrafı

Google+ hesabınızı kullanarak yorum yapıyorsunuz. Çıkış  Yap /  Değiştir )

Twitter resmi

Twitter hesabınızı kullanarak yorum yapıyorsunuz. Çıkış  Yap /  Değiştir )

Facebook fotoğrafı

Facebook hesabınızı kullanarak yorum yapıyorsunuz. Çıkış  Yap /  Değiştir )

Connecting to %s

Reklamlar

Kategoriler

%d blogcu bunu beğendi: