Tuesday, 8 November 2011

Rendering Tip for Interior Scenes using Mental Ray and 3dsmax

A great detailed tutorial on rendering tip for interior scene by Jeff Patton on his blog:

I want to share a few tips for rendering architectural interior scenes with mental ray, using the mr Physical Sky and portal lights.  These are some fairly specific tips that will hopefully allow you to achieve a smooth indirect illumination solution as well as control the intensity of the sun and other contributing lights.

I’m not going to start from the absolute beginning here.   To get the most from these tips you should already be familiar with the basic fundamentals like how to add a daylight system to your scene, enable the photon target option on the mrSun, enable global illumination, etc..  If you’re not, then you’ll need to spend some “quality time” with the 3ds Max documentation/tutorials.  With that out of the way, I’ll dive right in.

I’m going to use the Evermotion bathroom scene that shipped with 3ds Max a version or two back.  At the end of this article I’ll post a link to my completed .max file for further reference.

I started by stripping any lights from the scene, hiding the window glass, and applying a single material to everything.  That’s primarily so I can focus on the lighting tips for this article.

I then created a daylight system and let it assign the mr Physical Sky to the scene environment and assign the mr Photographic Exposure control.

I then edited the daylight system to remove the mr skylight.  It’s not needed since I’m going to place portal lights at the windows.  You can click the screen capture to view a larger version if needed.

From that point I added four portal lights to the windows (set to use the environment, not skylight since I don’t have one in the scene) and enabled GI (Global Illumination) & FG (Final Gather) and fired off a test render:

Notice the large spots/circles?  You may want to spend time tweaking the GI settings or the mr Sun settings to try and remove these but that’s not the actual problem here.  I’ll disable the mrSun and render again to show that it’s not related to that light source:

As you can see, the spots are still there even though the mr Sun is disabled.  The reason I’m not getting a smooth GI solution here is actually due to the mr Physical Sky of all things.  Notice all the white spots where the direct sunlight should be?  That’s from the visible sun disk in the mr Physical Sky and picked up by the portal lights & FG.  I prefer to remove that because if you don’t you’ll need a lot of sample to clear that noise, plus it of course adds to the direct sun light which can often become too hot/over-exposed.

NOTE:  I believe that it’s also mentioned in the 3ds Max documentation that the mrSun shouldn’t be behind the portal lights.  I assume for this reason or something similar.  So hopefully this adjustment will allow you to place the sun wherever you want/need and still prevent these lighting artifacts.

To “fix” this problem I’ll instance copy the mr Physical Sky shader from the scene environment to the material editor to make adjustments. Here’s what the default sky looks like:

I will adjust the Disk Intensity and Glow Intensity values to 0.0 and decrease the sun disk scale from 4.0 to 1.0, although that doesn’t really matter when the disk & glow values are set to 0.0.  The adjusted sky looks like this:

Now the super bright sun disk is no longer there.  It’s now just a nice soft gradient that will play much nicer with your photons (GI) and/or final gather options.

I’m now ready to render again after making this simple change to the mr Physical Sky, and nothing else:

Yaay!  No more big white circles/spots/etc…just some more easily fixed blotches due to the low quality FG settings I used in this test.  So with that resolved I will now enable the mrSun, increase the FG preset to medium, increase the anti-aliasing (min:1 / max:16) and render again:

Not bad.  It’s missing a small detail though, and that’s photons from the mrSun.  Notice how cool feeling the image is?  During my tests I prevented the mrSun from generating GI photons therefore I’m not getting any warm colored photons from the sun in this scene.  Some may actually prefer this look since the sun photons are typically a lot stronger and can overpower a scene unless you manually edit it’s values.  Here it is with the sun photons enabled (and adjusted, more info on that below):

It’s a bit warmer and brighter with those photons from the mrSun.  In case you’re not sure how to disable photon generation on a light, here’s some captures to help explain that:

With the mrSun/daylight system selected, scroll down to the mental ray Indirect Illumination rollout.  By default it’s configured to emit photons when GI is enabled via the “Automatically Calculate Energy and Photons” option.  Uncheck that option and also leave the Manual Settings disabled and no photons will be emitted from the light source, in this case the mrSun.

Also make note that I have decrease the multiplier on the mrSun from the default value of 1.0 to 0.2.  I did this because at the default value it often seems like the mrSun is just too strong (IMHO).  It is quite powerful on the indirect illumination side of things as well and that’s why I have also decreased the GI Global Multipliers on the mrSun (also located in the mental ray Indirect Illumination rollout of the mrSun).  I decreased the energy to 0.5 and the photon multipliers to 0.25.

If you don’t do this edit to the mrSun photon energy then the mrSun will generate most of the photons in the scene, unless you specify a number of photons in the manual settings.  I know this may be somewhat confusing, that’s why I’m providing the scene file at the end of this article.  I discuss it further in some of the gnomon videos I made a while back.  But basically if you’ll open the mental ray message window and follow the information it generates as it prepares the scene you’ll discover how brighter light sources generate more photons than less bright light sources (as to be expected).  However, I would usually prefer to modify that behavior a bit to achieve more even light distribution in my scenes.  At the cost of physical accuracy I suppose…but hey, it’s all about getting the desired look no?

While I’m discussing all this, let me address another frequently asked question.  Why do I have so much blue in my scenes?  Simple answer, it’s because the sky is blue.  The portal lights are picking up their color from the sky and the sky is blue in this case.  What if I wanted less blue?  Easy.  There are controls on the mr Physical Sky for this.  Just uncheck the “Inherit from mr Sky” option on the mr Physical Sky so that you can edit it’s settings.

In the Non-Physical Tuning parameters, decrease the saturation level as desired to reduce the intensity of the blue in the sky.  You can also try tuning the kelvin values on the mr Physical Exposure control, but that affects the entire image which may not be desired.  This only affects the sky itself and thus the color of the light produced by the portal lights.

Less blue as you can see…a little to flat for my taste so I increased the saturation to something like .35 for the final image:

I know that’s a lot to cover in a blog post, so HERE’s the file that you can download and explore. Sorry, I can only save back to 3ds Max 2010 format.

UPDATE: Here’s an OBJ version of the scene for those not using 3ds Max.

Via jeffpatton.net



No comments: