Basic Light Settings

Maya Mental Ray: Lighting

This Is an out of date page

This page is out of date.
—————————–

Set 32 bit Linear Workflow

First set 32 bit linear workflow.

1. Open Render Globals
2. Switch to Mental Ray
3. Enable Color Management
– Default Input: sRGB
– Default Output: Linear sRGB
4. Change Image Format to – Open Exr
5. Set image size to HD
6. Switch Enable Default light to off
7. Go to Quality Tab, scroll to Framebuffer
8. Data Type to “RGBA (Float) 4×32 Bit

9. Open Render View
10. (render view menu) Display > 32bit should be on
11. Go (render view menu) Display > Color Management
– Image Color Profile: Linear sRGB
– Display Color Profile: sRGB

12. Open Hypershade
13. Create a mia material x and assign to objects
14. Gamma correct color swatches with .4545

 

Studio Lighting Setups

There are many ways to light an object, and in the real world there is big business in presenting products and people in their best light. Since we’re following a physically correct lighting setup we’ll want to think about real life studio lighting setups. We can mimic all the tricks real photographers use in the studio.

 

Materials

In reality light bounces off each object, more or less depending on the surface of the object. This is why we use mental ray materials which match the lights we’re using.

Mia Material X is a good tweakable shader that can shade most materials.

We’ll cover the material in more detail later.

For now use the mia material x presets, and remember to gamma correct swatch colours for linear workflow.

 

Setting The Camera Display Settings

Create a new camera and set up it’s display gate

(viewport window) view > camera settings > resolution gate

This can also be done in the attribute editor with more options…
In the attribute editor for the camera1 select the cameraShape1 tab
Scroll down to “Display Options” and open it
Change Overscan to 1.05
Change gate Mask Opacity to 1
Change Gate Mask Colour to black if you like. I use grey.
Fit Resolution Gate: fits the aspect ratio vertical or horizontal

Full information on camera settings can be found here

 

Light Types

In Mental Ray there’s 4 types of lights we commonly use, and two other light types for specific circumstances. Lets start with the 4 main types

Point Light
A light that emits out from a single point full 360 degrees
Small highlight

Spot Light
– Like a torch, comes with a cone angle that we can vary and some extra settings. Otherwise it’s the same as a point light.
– Small Highlight
– Sharp shadow by default

Directional
– Mimicking lights that are very very far away, eg sun moon. The light rays travel perfectly parallel. This is a fake however as the sun and moon are so far away it’s virtually undetectable the differences.
– Broad Highlight
– Sharp shadow by default

Area Light
– Mimicks light coming from an area, such as a big white bounce light in a studio, or broad tube lights in a light box.
– Is also commonly used for windows where a large amount of light passes through diffused. Sometimes it can be switched to a portal light which we’ll cover later.
– Very broad highlight depending on how close to an object
– realistic shadow effects, often a blurred shadow if large or placed close to an object

 

Setting Realistic Light Intensity and Light Falloff

By default all lights are set to an intensity of 1 with a falloff of “none”.
Intensity: 1 represents rough daylight intensity.
Falloff or none: Aim a torch at a mountain light the whole range. This isn’t realistic.

Light will falloff with distance. The equation of light falloff is “quadratic”.

This means as you get closer to the light the intensity will become more intense more quickly. Easily seen in a dark room with a lamp watching your hand as it gets closer to the light.

All lights follow this pattern.

So we set the falloff of all lights (except the sun and moon) to “quadratic” to get realistic results.

The sun and moon are so far away that you can’t tell the difference so leave falloff to none.

Quadratic falloff makes lights much dimmer. So bump up the intensity value. This value can be extremely high as much as 50,000 or more depending.

 

Scene Scale

Light affects objects of size differently. Think of a small jellybean, hold it up to the light and the light will pass through. Now think of mountain made of that same jelly bean material, the light won’t shine through.

So we need to correctly scale all our scenes for real world values. By default 1 maya unit equals 1cm. Use the distance tool to measure objects.

 

Blurring/Softening Shadows

By default all shadows will be sharp except for area lights. Sharp shadow render fast with raytracing, soft shadows require more calculation.

To create soft shadows on point, spot and directional lights select the light and go…
attribute editor > (shape tab) > Shadows > Raytrace Shadow Attributes

Set Light Radius to a bigger number, the larger the more blurry.

The larger the Light Radius the more grain will appear in renders, to fix this up the shadow rays. Shadow rays can go as high as 128

Light Radius = Amount of blur
Shadow Rays = Quality of the blur

Ray Depth Limit is used for transparent objects like glass and water.

 

Bounce Light

Check final gather “on” under indirect lighting tab in the render globals.

We’ll cover Final Gather and the indirect lighting options later. FG or global illumination can be extremely heavy on render times, so usually we want to optimise the settings.

One option which can speed test renders is to set

Point Density to .1, this will make renders faster, but best to switch back to 1 for final renders.

Please be careful fiddling with Final gather Settings, it’s important to know exactly what each attribute does, if it doubt don’t touch FG settings.

 

Ambient Occlusion (AO)

Ambient Occlusion (AO) is a texture type that fills darkness into all the crevasses/cracks/corners in our scenes.

In theory if the bounce lights were all working as they do in reality there would be no need for AO. But the final gather indirect lighting is only roughly accurate, so we usually combine final gather with an AO pass. Think of AO as the fine detail crevice shadows, where as final gather calculates the broad bounce light.

AO is a procedural texture meaning it’s automatically generated and as the scene changes so will the texture.

There are many ways we can use AO, we can combine it in each shader in the diffuse channel by mixing textures, but it’s usually easier to render AO as a separate pass and combine in a compositing program. This gives us the ability to tweak the effect we want without needing to re render.

To Set up an Ambient Occlusion Render Layer
1. Go to the Layers tab in the channel box and click the “Render” tab.
2. Right click on master layer and go “copy layer”
3. Rename the new layer to “AO”
4. Right click on the “AO” layer and go Attributes (this will bring up the attributes in the attribute editor)
5. Find the Presets button click it and set “Occlusion”. This puts a basic Ambient Occlusion on all objects.

You can render your image to test how it looks, it should look white with shadows in the cracks.

6. Open the hypershade (window > rendering editors > hypershade
7. Select an object and show it’s shader by clicking the icon “Graph Materials on Selected Objects”
8. You can see the preset of the render layer created a surface shader material with a “mib_amb_occlusion” texture assigned to it.
9. Double click on the “mib_amb_occlusion” texture to bring up it’s properties
10. Adjust the Max Distance to allow the crack detail to be limited, this value is in cms and will vary depending on the size of your scene. We want to see only crack detail and not much more, the image should be mostly white.
11. The image is most probably grainy set the Samples to 96 or 128
12. The image is probably still antialiased. Open the Render Settings Window and go to the Quality Tab
13. Right click on Quality and go “Create Layer Override” This assigns the value strictly to the current Render Layer, in this case it’s the AO render layer.
14. Now it’s orange set the quality to 2

The AO should render nicely. It will look mostly white with black only collecting in the cracks, we’ll use this to composite in After Effects or nuke.

 

Rendering Wireframes

For model turntables it’s common for student to show their wireframes. This proves they are production ready and not heavy ZBrush sculpts.

There’s many ways to render wireframes in May/Mental Ray, by far the easiest and fastest is to use viewport 2.0 with a playblast and comp in AE or Nuke.

To render wires follow these steps…
1. Switch the viewport to viewport 2.0
viewport menu > Renderer > Viewport 2.0
2. Set the antialias settings of the lines
viewport menu > Renderer > Viewport 2.0 (options)
Antialiasing > Line Anti-aliasing (also set the Sample Count to highest)
3. Hide all the lights in the scene
4. Switch lights on, since there are no lights it should go black
5. Turn the background clor to black by toggling “alt b” until the bg goes black
6. Turn off the grid. (viewport menu > Show > Grid)
7. In the viewport 2.0 settings
8. create a cube and place it off screen or hid it in another object
9. Select all the objects we want to have wireframes
10. Select the cube last (it will be green but is hidden so is ok)
11. Set the frame range and playblast to a quicktime or image sequence, save on the hard drive.
(right click in time line > playblast (options)
12. render to a full HD or even larger movie/image sequence, the larger the more accurate the wires will appear if scaled down. Set the image size in the Render Settings.

 

Compositing Wireframes in After Effects

In After Effects set the wireframe layer mode to screen.

If we can’t see the mode, toggle the “Toggle Switches / Modes” Button.

Adjust the transparency to suit (t)

We can also change the wireframe colours easily with a few AE tricks.

 

Grading Images in After Effects

We can grade the images in After Effect to enhance our results
Use curves or levels to adjust the contrast of an image.

We can use sharpen with a value of roughly 7 to sharpen images, Maya typically renders soft anti aliasing.

We can use many colour grading and effects in after effects to control the image.

 

Summary

1. Make our scene is at correct scale, 1 unit = cms

2. Directional Lights are mimicking sun or moonlight, so these lights won’t have any falloff because they are so far away we’ll never notice the drop off.

3. For lights other than sun/moon will have a light falloff, just like in the real world. The physically correct setting in Mental Ray is in the light settings…

Decay Rate to “Quadratic”

These lights will need much bigger numbers as values, up to 5000 or more. These are lumen values I believe, mimicking the real world.

4. Mental Ray is a Raytrace Engine
MR is a Raytracer, depth map shadows don’t work well with MR. Depth map shadows are for Viewport 2.0 or the maya software renderer. Raytracing is much more physically accurate anyway.

Switch all lights to raytrace shadows, no depth maps. Raytrace shadows are the default.

5. Assign MR shaders to all objects. Maya shaders will still work, but they are not ideal.

6. Blury Shadows
If we want blurry raytraced shadows on lights, usually spotlights or point lights (sometimes directionals) we change…

Raytrace shadow attributes “Light Radius” to a larger angle

Light Radius = Blur Amount as an Angle Value
Shadow Rays = make the shadow less grainy. Can be values of up to 50 or more.

7. Use an AO pass to collect crack shadows.

8. Composite AO and wires in a compositing program and grade the colours to your taste.

Instructor

Andrew Silke

Video 1.1: AE Setting Up Ambient Occlusion (0:38 mins)
 

Video Notes

Compositing AO in After Effects

In the comp, set the ambient occlusion layer’s mode to “multiply”

If we can’t see the mode, toggle the “Toggle Switches / Modes” Button.

We can also grade the AO pass with levels or curves for different effects.

AO is usually too strong so we can tone down it’s opacity by pressing “t” to bring up the opacity options for that layer.

Also here’s a link for having transparency in AO
https://www.youtube.com/watch?v=Bcqfd6jeSzo

Leave a reply