When working in a 3D scene, reproducing natural lighting is important to achieve a realistic look
and highlight important details at render time.
In this movie, we’ll cover two illumination methods designed for this:
Physical Sun and Sky and Image Based Lighting.
Make sure to set the current project to the provided scene folder,
then open the file "01-Launch_platform_start.mb."
This scene consists of a rocket ship sitting on a platform ready for takeoff.
You'll also notice that Color Management is already enabled,
with the View Transform set to its default "sRGB gamma" setting.
For more information on using Color Management,
refer to our "Achieving accurate colors using Color Management" tutorial.
As you can see by activating the scene lights, there are currently no lights in our scene.
Open the Render Settings and make sure mental ray is set as the current renderer.
In the Indirect Lighting tab, you'll find two lighting methods:
Image Based Lighting and Physical Sun and Sky.
In this case, we're going to use a Physical Sun and Sky method,
which mimics the way light comes down from the sun and atmospheric skydome.
It's typically used for lighting outdoor scenes,
particularly in staging projects, such as architectural mockups,
since it allows you to see a building's profile and shadow casting at various times of the day.
Click the Create button next to Physical Sun and Sky.
Maya automatically creates the appropriate nodes for this lighting model.
As a result, the scene brightens up accordingly.
Notice Maya also automatically activates Final Gathering.
Final Gathering is a technique Maya uses to simulate the indirect light
that results from light rays bouncing from one object to another.
In order to view accurate results for this lighting model,
you’ll also need to go to the Common tab and turn off "Enable Default Light"
since we don't want any outside influence.
Maya also created a sunDirection node at the scene’s origin.
As we can see in the node network we showed you earlier,
this node is already connected to other render nodes
such that the lighting will respond appropriately when it is rotated.
For now, just move the node above the rocket and scale it up so it’s easier to see.
Don’t worry about this affecting your lighting,
since only the node’s rotation is taken into account.
Notice that it's currently angled downward in a way that should give us a mid-day sun.
Switch to the main camera and render the scene.
Sure enough, we're getting a very bright noon- day sun. A little too bright.
Select the sunDirection node. In the Attribute Editor, go to the mia_physicalsky tab.
This node controls how Maya renders our sky.
For now, let's just turn the multiplier down to 0.2
to greatly reduce the overall brightness of the light.
Render again.
The lighting isn't so overblown this time, but all the colors now look washed out.
This is because when you created the Physical Sun and Sky setup,
Maya automatically added a lens shader to your camera for gamma correction.
However, because we're already handling gamma correction with Color Management,
we're actually getting a double correction here.
Select the camera and go to its shape tab.
In the mental ray section,
break the Lens Shader’s connection to the “mia_exposure_simple” node.
Render again.
This time we’re getting a much nicer render.
However, notice how the horizon is too high.
Let's tweak that, along with a few of our other physicalsky settings.
First, lower Horizon Height to -0.7.
Also change Ground Color to a faint brown so it looks like the platform is out in the desert,
and increase Horizon Blur to 0.3 to make it look more distant.
Increase Haze to 3 to make it look like more of an overcast day.
Finally, tilt the sunDirection node toward the camera to simulate a dusk launch.
Render the scene.
This looks much more dramatic with the new settings we've applied.
Notice in particular that Maya automatically lowered the sun
and updated the sky environment to reflect the new time of day.
The sun itself looks a little too intense, so reduce Sun Disk Intensity to 0.2.
Feel free to tweak this look even further to get the desired result.
For now, let’s move on to light a scene using image based lighting.
Open the file "03-Apartment_room_start.mb".
The scene consists of a small apartment, with a window currently overlooking an empty exterior.
In a scene like this, there are a few places we'd expect as sources of light.
Most obviously, there's a standing lamp near the window
and a hanging light towards the back of the room.
Additionally, we'd expect some ambient light to filter in from the outside envrionment.
Let's take care of that ambient light first by using an Image Based Lighting setup.
This type of setup uses a High Dynamic Range image (HDRI)
projected onto a dome or sphere encompassing your scene to cast rays on the objects within it,
mimicking the way light in real life comes from multiple sources.
Open the Render Settings.
In the Indirect Lighting tab, create a new Image Based Lighting environment.
Like the Physical Sun and Sky setup, Maya automatically creates all the appropriate nodes.
Although it doesn't automatically enable Final Gathering like the Physical Sun & Sky setup,
we'll still turn it on since we want those secondary light bounces from our light rays.
Also don't forget to disable the Default Light in the Common tab
so Maya only uses the IBL setup as the main illumination source.
Notice this yellow wireframe sphere around your scene.
This represents the new mentalrayIbl node that manages your HDR background image.
In the Attribute Editor, set Image Name to the provided HDR background file.
Select the mentalrayIbl node and rotate it 45 degrees in Y
so the sun is right outside the window.
In the shape tab, also make sure to turn on Emit Light in the Light Emission section,
so the background actually casts rays into our scene.
Increase Quality to 1.
Switch to the main camera and render the scene.
The HDR image mapped to the incandescence channel of the IBL projection sphere
emits light rays that illuminate the room via final gathering.
However, looking at our render, it may not be enough since the scene is still quite dark.
You can boost the brightness of the incoming image based lighting
in the mentalrayIblShape node.
Go to the Advanced Section and click the Color Gain swatch. Double the HSV Value field.
Of course, the other major reason the room is still dark is that we haven’t added any lights in it yet.
Let’s start with this standing lamp.
Create a new Area Light and rename it “lamp_light”.
Translate it under the lampshade (-106, 138, 111).
So why are we using an area light rather than a point or spotlight?
Unlike those other types that emit light from a single point in space,
we can actually shape an area light to mimic our light emitting source.
Area light falloff is also more accurately calculated by renderers.
Go back to the shape tab.
Set Decay Rate to Quadratic to better emulate the physically accurate falloff of natural light,
then increase Intensity to 400.
In the mental ray section, turn on "Use Light Shape."
Set Type to Sphere to project light using a volume similar to a light bulb.
Render the scene.
The light emitted from the lamp looks pretty good with nice soft edges and realistic falloff,
but we're getting this odd halo-ing effect due to the stand getting in the way.
This is because our light is too small. Unlike a point light, which can't be resized,
the area light emulates the shape of an actual light emitting object.
Thus, increase the lamp light's scale to 4.5 and render again.
Now we get a much more even effect.
You can repeat the process to create a disc- shaped area light
for the overhead light on the far side of the room, if you wish to render from the opposite direction.
As we add more light to our scene though, notice that the render is starting to look a little patchy.
To fix this, go back to the Render Settings. In the Indirect Lighting tab’s Final Gathering section,
increase Point Interpolation to 30.
This increases the radius used by mental ray to blur the results of the sampling rays,
which smoothes out those patchy spots.
Note that if you ever opt to increase the number of rays in the scene via Point Density,
you’ll also need to increase Point Interpolation with it or the patchiness will return.
While you’re at it, set Secondary Diffuse Bounces to 2.
This increases the number of light ray bounces from one object to another in your scene,
which contributes to the overall indirect illumination.
Render the scene again.
The new render settings have successfully interpolated between the dark and light areas,
while the increased ray bounces have brightened up the scene a little more,
and also allowed just a bit of the red color from the red curtains to bleed into the walls.
You should now be more comfortable with basic lighting setups
using both a Physical Sun and Sky or Image Based Lighting approach.