Tutorial: Lighting and Rendering
In order to render, you need to have lights in your scene. By default, there is an ambient light, which is a Maya light that shines everywhere and casts no shadows.
This tutorial will go through some basics of lighting, how to creating lights and control their settings, and some tips for lighting your rooms. I am borrowing techniques I've learned from years of film and CG lighting along with online tutorials and books.
Lights and what they do:
Lighting helps create a sense of a 3 dimensional space. Lighting defines the shape of objects by controlling contrasts in light levels, shadows, reflections, and color. Shadows contribute to the composition and mood of a scene.
These elements help the viewer focus on a desired object while understanding location, time of day, mood.
You can tell a lot about a light source by focusing on the shadows.
- Are there shadows in the scene?
- What direction are they falling in?
- Are they sharp or soft?
- Are they natural (from the sun) or artificial?
- Is there something between the light source and the object that creates shadow areas and patterns?
- How does the natural lighting and the incidental lighting (lighting inside the room, such as lamps and overhead lights) define the space?
The best way to learn about light is to observe it closely.
Shadows and Three Point Lighting
Three point lighting is a classic lighting set-up that includes a key light, a fill light and a back or rim light.
The key light, casts the main shadows and is the primary lighting source. Shadows that are long and soft represent morning or late afternoon sunlight. Sharp shadows generally mean bright sunshine or a close, bright, focused light source.
To control the contrast, a fill light is used. The fill light "fills" in the shadow area to lessen the contrast in a scene.
You will work with fill through bounced lighting created with ray-traced lighting, and through Ambient Occlusion.
Radiosity is a method of calculating each light as it bounces around a room from surface to surface. Arnold is an advanced Monte Carlo ray tracing renderer. Arnold and VRay use this to track how light bounces from a light source onto an object, and then, depending on the material of the object, reflects the light onto another object, which bounces onto another, etc. With each bounce, some light is absorbed into the object and some keeps bouncing until there is no light left to keep bouncing.
Ambient Occlusion is a way to help deepen the contrast in some shadow areas to create more of a feeling of depth.
Back or Rim light is a light that helps separate the subject from the background and add to the sense of depth in the scene. It is often overlooked but when it is used, it has enormous impact.
Below is an example of a three point lighting set up in Maya:
The nice thing about working in computer graphics, is that you can control the shadows and turn them on or off as needed so that every light doesn't need to cast a shadow.
You can use Maya lights in Arnold, but you need to adjust some settings quite a bit.
Maya lights are:
Ambient -- Produces a uniform light throughout the scene. Flattens the image, so keep it to a minimum---set it to a medium or dark gray. Equivalent to light that doesn't have an obvious source.
Area Light -- Two-dimensional, rectangular light source that emits light from the entire rectangle in the direction of a line perpendicular to the rectangle.
Directional Light -- Parallel light rays that wash light across the scene in one specific direction. Similar to sunlight or moonlight.
Point Light -- Radiates light out from its center in all directions. The farther an object is from this light, the less it is illuminated. Similar to a light bulb, LED or torch.
Spot Light -- Lights an area within a cone shape. The light comes from the center point and travels in a specified direction. Similar to a flashlight, street lamp, headlights, spotlights.
Volume Light -- Lights an area within a user-defined volume.
Maya lights are different from Arnold lights because Arnold lights and the Arnold renderer are set up for physically accurate lighting. That is one reason I feel more comfortable with Arnold--it is more like lighting in a real physical space.
In the real world, light has fall-off or decay. This means that the amount of light close to the light is much less than the light farther away. The intensity or brightness of light is a function of the distance from the light source and follows an inverse square relationship.
Maya lights, by contrast, have no decay. The result is that when you use Maya lights with the Arnold renderer, you have to turn the intensity way up to see anything. That can be a pain, so let's just keep it simple and use Arnold lights, although the TA's and I might want to encourage you to use Maya lights, too, from time to time.
Arnold's light nodes begin with ai- aiArea, aiMesh, aiPhotometricLight, aiSkyDomeLight, aiBarndoor, aiGobo, aiLightBlocker, aiLightDecay, aiAtmosphericVolume, aiFog
For a detailed guide to using Arnold in Maya, see the SolidAngle User Guide
It is difficult to separate lighting from rendering in computer graphics and modeling, so let's step back and look at some of the Arnold Render Settings. Open the Render Settings Window (The Film Clapboard Icon with the Settings Gear, just under the main menu),
or go to Windows>Rendering Editors>Render Settings in the Menu using the Marking Menu you get by holding down the space bar.
This opens the Render Setting Window
Make sure Arnold Renderer is showing in the Dropdown at the top for Render Using. If you don't see Arnold there, you probably don't have it loading and need to go to the Plug In Manager.
Make sure the mtoabundle is checked ON for load and autoload
You will notice several tabs, one Common Tab that works for any rendering software, and the other tabs are distinct for Arnold.
In the Commons Tab, the default settings are fine for now, but it is here that you set the type of image (exr is a great one to use), the camera you are rendering from (perspective camera by default), the image size, and a few other things we'll circle back to later. You will want to render out your final room images at a higher image size (HD1080 is good) and the EXR (OpenEXR) format, developed by Industrial Light and Magic, is a high dynamic raster file format.
In the Arnold Renderer Tab,
the first section is for Sampling.
Sampling sets the basic rendering quality. The higher the number of samples, the better the quality. But be careful, because small changes will increase your render time significantly, or lower your quality. The first option Camera (AA) is for overall quality.
For photrealistic rendering, you want that to be 3 or higher.
The other options allow you to adjust the sampling for specific channels, such as the diffuse, specular, transmission, sub surface scater (SSS), or Volume Indirect. These may sound familiar because they were settings we adjusted when we did our rendering practice on the first day of class.
The default settings are fine for now, but if you are doing something with glass or skin, you will want to adjust some of these settings (see Arnold user guide for more details).
Another important set of attributes is Ray Depth
Ray depth determines the way ray tracing will work in your scene--the more rays you send into the scene to bounce around, the higher the quality, and again, you can adjust it's overall quality or specific channels, to adjust the amount of rays used for just diffuse light, or just specular, etc.
Again, the default settings are fine for our initial purposes, but you will probably want to adjust them later on. Small changes here will, again, significantly alter your render times, so be careful.
Other tabs include Environment where you can upload atmosphere maps,
Motion blur (off by default), Lights (where you can set thresholds for the lowest amount of light you want to render in the scene, and Textures.
Arnold uses a .tx format for textures. This setting automatically converts texture files you upload to a .tx format.
We can look at the other Arnold tabs later, but mostly, you can leave them as they are.
You can close the Render Settings Window.
Let's play with lighting and rendering...
Open the scene: roomforlighting.ma
Create a SkyDome Light
Render (You can hit the play button in the Arnold Shelf, or go to Arnold>Arnold Render View in the Main Menu using the Marking Menu by holding the space bar down.
Remember to turn on RunIPR
Your room starts to show and for one single light source, it actually does a nice job, but it is very noisy (black spots throughout).
You can adjust sampling to fix it, but better is to add area lights.
Save this image in the Render Window by clicking on the little camera in the lower right corner.
Turn the intensity of the SkyDome light to 0, so we can focus on the other lights, first.
Let's start by creating an aiAreaLight.
Scale it up and move it up into the scene.
You will notice there is a line coming from the plane of the light, this shows the direction the light is shining.
An area light is a shape (usually a rectangle) but it can be a disc or a cylinder in Arnold) that casts lots of parallel light rays into the scene. Area lights are quite nice for a ray traced scene as they cast some realistic shadows.
The size of the area light determines the size of the area light is emitted from, so scale is important.
Move the light to the window, rotate it 180 degrees in x so it is facing in to the room and Scale the light up until it fits to the window in size.
A cool trick I like when setting lights, is to look through the light to see what the light "sees" and shines onto to.
With the aiAreaLight selected, In the Viewport Menu, go to Panels>Look Through Selected
You can set the light by looking through it to see what is being lit.
Your room may be upside down. You can fix that by rotating the area light 180 degrees in z. Then you can adjust from there more easily.
For now, we'll leave the light coming in at a straight angle as you will add the sunlight later that will be more directional.
Go back to the perspective camera view by going to the ViewPanel Menu and Panels>Perspective>persp.
Better yet, let's create a camera that will be used for rendering this shot out, allowing us to move around with the persp camera.
Rename it ShotCamera1. In the ViewPanel, be sure you are looking through ShotCamera1 and set it up so you see the window and some of the objects in the room as shown.
Save a Bookmark for this camera (In the ViewPanel Menu go to View>BookMarks>Edit Bookmarks and name your view. You can add this view to your custom shelf, if you'd like by choosing that option.
Try rendering. (You can hit the play button in the Arnold Shelf, or go to Arnold>Arnold Render View in the Main Menu (hold the space bar)
Remember to turn on RunIPR
Set the camera you are rendering through
You won't see anything. This is because the room is too big for this light and the decay of the light.
**Note: Gamma correction helps with the difference in the lighting curve of a computer monitor and most image formats. It is good to know about this, but for now, we will not use it as we can make the changes in Photoshop if we need to and we are using exr format that shouldn't need it.
Important: With Arnold, the scale of the room changes the amount of light you need to send into it to see anything.
The settings I give may or may not work for your room, depending on the scale.
There are a couple of super cool new filters in Maya 2018 that make lighting much easier. They can be found in the Viewport under the Menus. One shows just the lighting
Click that and you will notice thatit is super dark.
In this case, in the Attribute editor, try turning the intensity (the brightness of the lamp, basically) way up, to around 50,000.
And see that the rendered image is just barely starting to show.
You will also notice, that if you move the light further into the room, the objects get brighter (because of the inverse square rule)
Move it back to the window for now.
You could keep increasing the intensity, but you can also increase the exposure (like in a camera, when you open the aperture more and increase the shutter time).
Turn the Intensity back to 1.0
And crank up the Exposure to around 20
You can play around with the exposure setting until you get something that looks ok for just one light.
Notice how much less grainy this image looks than the one from the SkyDome. You will also notice that there are bright spots around the window, which is much more natural than with the SkyDome.
Set the Exposure to something that lights the room, but remember you will also have other lights in there, so you don't need to blow it away with the window light, unless you want it to replicate a super sunshiny day.
I like a setting between 17 and 18.
You can play around with some of the Attribute Editor Settings for the light. Increasing the softness of the edges will give some penumbra effect, upping the sample size makes the shadows look a bit better because they resolution is higher. Changing the shadow density can also help soften the shadows, and you can change the color of the shadows.
You can also uncheck Casts Shadows and the light won't cast any shadows at all!
You can make the light only create specular light, etc. Lots to play with.
For now, leave the settings as they were above
Turn off the Display Settings in the Render Window
Setting Color Temperature
Next, in the Att. Editor for the aiAreaLight (rename it to windowArea)
Turn on Color Temperature (all lights have a color temperature) and change it to around 7300 to give it a strong blue outdoor light color.
Save the Render Image
Let's play with some Render Settings!
You can increase your render times by eliminating any of the Sampling for materials and lights you aren't using. For example, in this scene, we aren't using most of them. Try turning the Volume Indirect, the SSS, the Transmission, and the Specular to 0.
But to demonstrate how the diffuse lighting works in Arnold, try turning Diffuse to 0.
You still get light, but the wall by the window is very black. This is because there is no bounce from the light onto that window, as there was before.
If you turn the Diffuse back to 1, you start to see what happens when you add bounces of the light.
As you increase the diffuse values, you see it doesn't change a ton, but you need to know more about what you actually want lit and where you want to decrease the noise, to determine how you set these values.
A handy utility for adjusting the lights and their relationship is the Light Manager
In the Main Menu, go to Arnold>Utilities>Light Manger
Here you will see all the lights in the scene and you can adjust their values.
You can also turn off the Enable check mark to isolate certain lights and see how they are impacting the scene-the light and shadows.