Match Light and Shadows to Background Image
Maya 2012 Tutorial
How to Match 3D Objects to a Background Image in Maya
Have you ever tried to composite a computer model into a still image or video sequence? It can be quite a challenge to match the lighting, shadows, reflections, perspective and other nuances in the image.
In this example we will start with a beach image taken on a semi-sunny day. Our goal is to create a cube in Maya and place the cube on the beach.
Begin by starting a new project and save your Maya scene in the scenes folder. For more information, see topic, Starting a Project.
Add a cube to the scene by choosing Create > Polygon Primitives > Cube.
Add a polygon plane to the scene by choosing Create > Polygon Primitives > Plane. The cube should be resting on the plane.
Scale the plane larger with the Scale tool (e key). The purpose of the plane is to catch the shadow cast by the cube.
Right-click the plane and choose Assign New Material. Choose Use Background from the Maya Surface section.
Place your jpg background image in your project's sourceimages folder. The image should match the size of your final output image.
Open the Outliner (Window > Outliner) and click the Perspective camera. Open the Attribute Editor to view the camera options.
Open the Environment section and click the Create button next to Image Plane.
In the Image Plane Attributes section, click the folder icon next to Image Plane to navigate to your background image.
Using the camera Dolly, Tumble and Track tools, rotate and move the Perspective view camera to match the background image. You may also need to change the camera focal length in the Attribute Editor, Camera tab to match the original camera lens.
Analyze your background image to better understand the light and shadows. In this example the light is coming from the left and the shadows are a bit soft.
Add lights to the scene so your cube's lighting matches the background image. For this image we added a Spot Light and an Ambient Light. Activate the shadows for the Spot Light.
Render your image and make adjustments as necessary. If your shadow appears to dark, adjust the Shadow Mask slider for the plane's Use Background texture.
Another Option is Compositing
In this example the entire image was rendered in one pass. Another option when doing this kind of work is to use render layers, shadow passes and render passes. For more information, see topics, Render Layers, Render Passes and Mental Ray and Render Passes and Mental Ray Multi Objects.
Use Camera Raw Meta Data
If you capture your original image as a Camera Raw file, you can open the meta data and find the Focal Length. The meta data appears in Bridge and the Camera Raw window.
You can also access the Focal Length in Photoshop by choosing File > File Info and clicking the Camera Data tab.