Intermediate mental ray Lighting

Written December 21st, 2008
Categories: Articles, Lighting, Rendering / Compositing
23 comments

Hello everyone!

Welcome to the second mental ray lighting tutorial.  In this feature, I’ll be walking you through a typical lighting project for a scene I built for one of my Monday Movies.  Remember that this isn’t the only way to illuminate a scene, and your render times could get pretty high.  We’ll be using mental ray Sun&Sky to get the base lighting, followed by a few area lights to illuminate the hallway section of the render.  I’ll show you some common settings you’ll need to set up along the way, and by the time we’re done you should have a well lit scene!

You can download the starter 3dsMax Scene Here.

Our final render.

Note that some of these images will have light leaks above the center divider wall.  I didn’t notice these until I was done writing the tutorial, so please excuse the error.  The scene I uploaded for you to start with has been fixed. In addition, at the end I changed the floor to carpet instead of hardwood, so don’t be surprised when you start rendering and notice there’s carpeting.

Our starting point.

Where the magic begins.

Go ahead and load up the file  You’ll notice that there isn’t any lighting, but the materials work together pretty well.  I’ve gone ahead and included some little details such as the coffee maker and the tree.  However, you’re free to add anything you’d like!  Throw in a conference table for good measure, or some blinds on the windows if you’d like to be extra classy.

Our unlit render.

If you take a quick render, you’ll notice that the lighting is unimpressive, but the materials are right and the modeling is diverse enough to give us a good outcome once we’ve started lighting.

mr Sun & Sky Light Source

Create a mental ray Sun & Sky light.

The first thing we need to do is create a daylight system in 3dsMax.  Day-time renders are a piece of cake because most of the lighting comes from outside.  Under the “Systems” tab of the modify panel, you’ll see “Daylight”.  Create a daylight system by clicking and dragging to create the compass rose, followed by another drag and a click to create the light.  If you get a dialogue asking if you’d like to use photographic exposure control, click “Yes”.  It will yield good results and is vital for this tutorial.  The direction of the light doesn’t matter.  Click on “Manual” under the “Position” group in the modify panel, and you can then drag the sunlight light wherever you want.  I recommend a glancing angle that bounces the light off the floor and wall.

Scene Overview

An overview of the scene and setup.

Ignore the box you see on the open face of the building.  It’s a little hack that lets you see inside a wall while keeping it inpermiable to light.  That box is renderable and only casts shadows.  The rest of the walls have a shell modifier on them.

The next step is to set the daylight object to mr Sun and mr Sky.  I know it seems like this should be on by default, but there are times when you’ll need to use IES.  This isn’t one of them though.  By setting the daylight to mental ray Sun and Sky, you’ll be tapping into a powerful natural lighting engine that can make just about anything look awesome.  If you get a dialogue asking if you’d like to set the background to the mr Sky map, click “Yes”.  It’s just a good idea if you’ve got nothing else for a background.

Sun & Sky Parameters

Setting up mental ray Sun & Sky.

Go ahead and take a quick render.  You’ll see that our scene’s lighting has changed dramatically, and Final Gather is now giving us a little more depth.

First Architectural Render

Our first render with only the outdoor light.

Comparable to a real-life photograph, the exposure is adjusted to make the outdoors look reasonable at the expense of making the indoors too dark. We’ll increase the exposure shortly. First, we’ll help mental ray understand that these windows boarder the outside world, and should therefore bring in a little more light.

Under the “Create” tab, under the “Lights” section, you’ll find mr Sky Portal under the “Photometric” group. The mr Sky Portal can be put in the window frames to boost the lighting, and basically earn us an additional Final Gather bounce for free.

Create area lights.

It’s important that they reasonably approximate the window frame. It’ll take some guessing and checking, but it’s worth it. You’ll also want to enable the “From ‘Outdoors’” checkbox, if available.

Setting up sky portals.

Set up your mental ray Sky Portals.

Now that the sky portals are set up, take another render.  Notice the difference between this and what you had before.  The additional light is clearest on the ceiling and the blueish glow on the wall.

Render

Render with your new Sky Portals.

But the image is still too dark!  Like I mentioned earlier, our exposure is set to make the outdoors look normal at the expense of how the indoors looks.  Let’s increase our exposure such that the indoors looks normal and the outdoors looks blown out.  Open your Environment and Effects window (hotkey ’8′) and set the exposure value to 11.  Don’t hesitate to try other values and see what you think.  This is a very powerful mechanism for altering the brightness of your renders.

Turn your exposure values up to 11.

Here’s what my render looks like with a value of 11.

Render at an exposure value of 11.

We’re looking good!  But the hallway still doesn’t have any light.  The client won’t like that one bit!  Let’s add some lights to the lamps hanging from the ceiling.  Select a “Free Light” from the photometric group in the lighting section of the create panel, and place it in the light trough of one of the lamps.

Place the light in the light trough.

In this case, we want to use long cylindrical lights like fluorescent tubes.  We’ll need to select “Cylinder” under the “Emit Light From (Shape)” group.  We’ll also need to alter the length and radius of the light to fit nicely in the trough.  Finally, be sure to enable “Light Shape Visible in Rendering” so that it actually appears as a tube!  It’ll look great with the semi-transparent material I used.  Finally, we need to set up the shadow casting.  Select “Raytraced” from the pulldown under the “Shadows” group, and then click the exclude button.  You want to exclude the light troughs because otherwise they’ll create abnormal shadows on the walls.  From the list that appears, select Cylinder02, Cylinder 03, Cylinder09, and Cylinder10.  Sorry for the lousy naming conventions- these are the troughs.  Finally, select Exclude from shadow casting only; we still want the troughs to light up!

Set the area light parameters.

Here’s a render showing where we are so far. The hallway is starting to light up nicely, and the conference room looks like it might actually make meetings fun. This is really going to blow away that client, but we’ve still got a little ways to go before it’s perfect.

The render's starting to come together.

From here, let’s bump up the mental ray settings a little.  The Final Gather bounces are still on zero and very low precision.  The bounces value can be changed to 1 and the Final Gather Precision slider can be moved to “Low”.  The renders will take longer, so don’t hesitate to lower these back down until the very end.  I’m just increasing these to get closer to my final render.

Increase the Final Gather bounces for more light.

Here’s what the render looks like after the increases.  There’s a little more light in the corners as the Final Gather bounce pushes the lighting into recessed corners.  It’s a subtle, but important difference.

A render after increasing bounces.

We’re almost done!  I just want to add two more things.

The first is a light around the corner in the hallway to show that it’s a corner and to imply that the building is larger than just what’s in the field of view.  I accomplished this by using a “Free Light” (like in the lamps), only this time I’ll be using a rectangular area light.  This will create better shadowing by the door, and make it look like there’s more natural light (like from the other side of the office building).  Be sure to increase the brightness a little (I used 2000 cd).

Add another area light for depth.

The last thing we want to do is boost up the lighting in the hallway.  Right now we’re only seeing what the four florescent lights are generating with the help of the Final Gather bounces.  Unfortunately, it’s a little rough between the two lamp units so we’ll want to throw in an ambient-only, standard omni light to brighten it up a bit.  Notice that you’ll need to use an abnormally high intensity in order to compete in the photographic exposure control solution.  If you didn’t have the exposure control on, the image would be pretty much all white.  You can use my setting of 200 intensity, or experiment to see what works for you.

Include an ambient-only light.

And that’s all there is to it!  Take a look at the render below to see the final outcome. Just for kicks, I changed out the floor material for a carpet because that suits the “office” theme a little closer.

Our final render.

I hope you enjoyed this tutorial, and learned a little more about lighting a scene using mental ray.  Stay tuned for my weekly Monday Movies, and, until next time, happy lighting.

Introductory mental ray Lighting

Written December 4th, 2008
Categories: Articles, Lighting, Modeling, Rendering / Compositing
8 comments

For this tutorial, we’re going to explore mental ray by making a simple room and lighting setup. I’ll be using 3dsMax 9 but you can follow along with any version. I’m also including my finished file so you can pick it apart if it suits you.

Final Render

Our final render, after some materials and direct light.

Mental Ray Room

Now I’m assuming a low, but non-zero level of previous knowledge during this tutorial. Specifically, that you’ve been using scanline for a few days or weeks and would like to extend your knowledge to include mental ray. While I’ll include images and try to go step-by-step, Remember that mental ray isn’t for those just starting the program for the first time.

Step 1: Build a box and flip its normals.

I’ll start off by making a box that’s 200x100x70 that’s the basis of my room.

Convert it to an editable poly object by right clicking and selecting editable poly.

Select all the polygons and in the Edit Polygons rollout, select “Flip”.

Box with Flipped Normals

Create a box with flipped normals.

Step 2: Make some windows and details.

Feel free to deviate slightly from the tutorial at this point if you’re feeling confident. I’m going to create a single window at one end of the long-ish room. However, you could do some pretty ambitious stuff with the roof, creating a long skylight and then putting up rafters and plants. Oh my! But for me, and for the sake of some beginners out there, I’m going to keep it easy and direct for now.

Select the polygon at the end of the hall and inset it, then extrude it with a negative value. If you want to resize the window you can. I’ve selected the bottom polygon of the window sill and moved it up a bit.

Delete this polygon. This will form our window!

A box with a window cut out

Cut out a window for the room.

Select the floor polygon. Inset it a little bit, and then extrude it down to form a baseboard. This is a minor stylistic thing that always adds a little realism to the room! I’ve also taken the artistic liberty of raising the base of the window a little higher.

Create a floor boarder

Create a border for the floor.

Now we have the makings of a basic room. Go ahead and save your work. Always a good practice.

Step 3: Switch to mental ray and create some lights.

We need to enable the mental ray renderer, since the scanline is being used by default. Hit F10 for your render settings panel and under the “Common” tab in the “Assign Renderer” rollout, hit the “…” next to production and select t the mental ray renderer. For a shortcut, in the little pink box in the lower left corner you can type

    renderers.production = mental_ray_renderer()

Super! Let’s get some lights in here. Under your create panel, go to the lights group, and select an “mr area omni”. Place it at the base of your window sill in the perspective viewport. Move it up so that it’s just outside your window.

Now for some lights.

Now for some lights!

Step 4: Scene adjustment.

Take a render (Shift-Q). Hmm…not quite what we want yet, is it? That’s ok, I know just the trick!

The first render

Not quite what we expected.

For starters, we need the polygons of the room to be double sided so that light doesn’t leak in from the walls. Hit your hotkey “M” and open the material browser. Drag and drop any grey material from the browser onto your room object and the material will be applied. Select the “2-sided” checkbox in the material you just dragged over.

Use a 2 sided material

Create and use a 2 sided material.

If you render again, you’ll realize that now we can’t see inside the room! That’s because the walls are now impenetrable. We need a camera on the inside of the room. Under your create tab, go to the cameras group and create a target camera inside the room by clicking and dragging.

You can switch to this camera by pressing the “C” key. Reposition the camera if you feel the need to. It was likely created at ground level, and that’s not quite right.

Now if you render you get a much better perspective on things. If you’re having trouble, it could be because the camera is not entirely inside the room, or it’s not pointed in the right direction.

Next, go ahead and hit your “8” key or go to the tool bar “Rendering”>”Environment” and click the black swatch under background color. Pick a very light blue color. That will make it look a little more like the light coming in the room is real.

Pick a Color

Pick an outdoors-y color.

Step 5: Use Final Gather.

Re-render the image, and you’ll see that it’s looking even better now!

Our second render

Our second render's looking good.

But something is still off with the light. I bet if we enable final gather it’ll look twice as good! Final gather is a light bouncing solution in mental ray similar to 3d Studio Max’s native radiosity. If we turn it on, the light will cast around the room in a much more realistic way. If you’re using 3dsMax 2009, final gather is probably on by default so you can effectively skip this step.

In your render settings window (F10) you’ll see an “Indirect Illumination” tab. Click on the checkbox that says “final gather”, select “Draft” from the quality preset pulldown, and change your bounces from 0 to 1.

Re-render your image. Now we’re cooking!

The render with Final Gather

Final Gather makes all the difference.

Step 6: Make the spherical light project properly.

What do you say we make that light source look like it’s really from outside? Select the mental ray light, and under the modify panel, click on the “area light parameters” rollout. We want to change the height and width of the area light to fit the window better. The window is the lightsource. Increase the radius of the light such that it can reach the left and right sides of the window, even if it starts protruding into the room. Use the scale tool to scale it such that it becomes a big flat disk right outside the window. You’ll have to twiddle the radius spinner to see the size of the disk, so don’t hesitate to do a guess-and-check kind of approach. Don’t worry too much, this isn’t that critical.

Proper Spherical Light Use

The spherical light is softer.

Re-render, and you’ll see the lighting solution really coming to life. It’s a little graining and dark, so we’ll have to increase the intensity of the light. In addition, change the samples on the light from 5 and 5 to 8 and 8. This will increase the sampling of the shadows and remove some of that grainy texture. Note that this change will increase render times, so if it becomes difficult for your system to handle, leave it low until you’re ready for a final render!

Render with more light.

We're getting more light now.

Cool beans! Now I’m going to let you try out whatever you want on this scene. Put some materials around the room and see how they render. Maybe make more windows or direct lights and let the light sources interact and brilliantly light up the place. It’s your call! I encourage you not to skip this step. Playing around is what really teaches you how to use this program, tutorials like this are supposed to get you to that stage.

Final Render

Our final render, after some materials and direct light.

I’ve done a few things to my scene, and you can check them out at your leisure. The biggest changes are the extra light sources, a few lighting tweaks like intensity, and the materials.

If you have any questions, you can always find me on the 3dTotal Forums and PM me (Bluesummers-3dt).

Until next time, happy rendering!

Precomputed vs Manual Lighting

Written November 30th, 2008
Categories: Lighting, Rendering / Compositing, Videos
1 Comment »

This Monday Movie is a good one, though it’s kind of a loosy-goosy topic so if I sound lost it’s because some things are hard to describe. Here we’re talking about the old-school way of lighting; omni lights and careful rendertime management. By using ambient-only omni lights and careful light projection, you can achieve results similar to what advanced automatic solutions could provide but at a fraction of the computational difficulty.

Bringing the render time down below 20 seconds per frame is critical in making an animation for a client or for yourself. No sense spending an entire weekend to render something that a little care and technique could have confined to a 3-hour stint. Enjoy this brief overview of how you can trim those minutes down to seconds.

How to use GI and Final Gather

Learn how to use mental ray’s Global Illumination and Final Gathering inside SOFTIMAGE|XSI for a photo-realistic render and learn industry tips and tricks on how to combine mental ray’s lighting features for higher quality renders.

Rendering for Animation with Final Gather

Written June 18th, 2008
Categories: Offsite, Rendering / Compositing, Softimage XSI, Videos
No Comments »

“In this video taken from our “Rendering with SOFTIMAGE|XSI v.I: mental ray” training product, we will get to see how to properly setup an architectural scene in preparation for camera animation using mental ray and Final Gathering. Without the right technique, rendering any type of animation with Final Gathering can produce undesirable flickering. However, in this video we will see a technique for solving this problem entirely and how to produce a rendered camera animation without any flickering at all.”

Pigeon: Impossible – Part 8

Written June 18th, 2008
Categories: Offsite, Rendering / Compositing, Softimage XSI, Videos
No Comments »

“Director/Animator Lucas Martell has started a video podcast covering the creation of his short film Pigeon: Impossible. Although the software used for the short was XSI, the podcasts are focused on CG techniques that should work in any 3D package. For more information about the film, please visit www.pigeonimpossible.com. This fourth part contains one podcasts from the film, hope you will enjoy this informative thing which helps you in your future projects.”

Making of Ingrid Bergman

Written June 18th, 2008
Categories: Articles, Lighting, Maya, Offsite
No Comments »

“At the age of 17, Ingrid Bergman auditioned for and was accepted to the Royal Dramatic Theatre in Stockholm. During her first summer break, she was hired at a Swedish film studio, which consequently led to her leaving the Royal Dramatic Theater to work in films full time, after having attended for only one year. At the age of 21, she married a dentist, Petter Lindstr’m (who would later become a neurosurgeon). In 1938, she gave birth to a daughter.”

Realistic Glass with Maya

Written June 18th, 2008
Categories: Articles, Maya, Offsite, Textures / Materials
No Comments »

“For this demo we will utilize Maya’s Blinn material, Ramp texture, and Sampler Info utility. We will also use Mental Ray’s Dielectric Material and new Mia_material. The user of this tutorial should note that I have also used Mental Ray as my renderer, with Final Gathering, Global Illumination, Caustics, and Image Based lighting used for optimal realism.”

Global Illumination with Mental Ray

Written June 18th, 2008
Categories: Articles, Lighting, Maya, Offsite, Rendering / Compositing
No Comments »

“Global Illumination, Final Gather and Caustics, these are the three individual elements that we commonly use as 3D artists to simulate the effects of bounced and focused light. We will explore each of these in the following sections with theory and practice.”

Designed by Alejo "Mr. Bluesummers" Grigera"
©2012 MrBluesummers.com