This page will demonstrate the steps i took to complete my "Match to Live" project.
Step 1 :
First step is to choose a object that you wish to use for the exercise. I chose to match a Weight plate and Dumbbell. Following are some of the pictures i clicked for the exercise.
Following are some of the things to keep in mind while shooting :
* Make sure you note down the Focal Length of the image once you click the picture. It is also important to know the sensor size of the camera you are using. Most of the camera gives you "Meta Data" of the image. You can look for "35mm equivalent" parameter and directly use that number in the default camera setting in maya. At the end of this page, i also have a link to a page where i explain how to find the correct sensor/film back size for your camera.
*Make sure you have once picture with a grey cube. This will help to align the camera the CG camera in Maya or any other 3D application. If you dont have a cube, you can also measure the object. Having a picture with grey cube is always better since the object that you are using might be a organic shape.
*Click few pictures of the area where you are shooting. It might help you to place lights in the scene or to model the props in the scene.
*If you are using a reflective object, make sure to click a picture of chrome sphere(light probe). The reflective probe gives you a reflection map and the position of the lights. Place the light probe exactly on the spot where you had your object and click the picture. Make sure you dont move the camera during this process.
*Additionally you can also click a picture of a diffuse probe to know the color and intensity of the lights in the scene.
Step 2 : Setting up the scene in maya :
*Create a new project and copy all the reference images to the "source images" directory.
*Create a new scene and create a new camera, click on Panels --> Perspective --> New
*Name the camera appropriately. I named it "camMain". In the attribute editor of your camera scroll down to the "Environment" tab and click on "Create".
*Now browse for the image that has the reference cube in it.
*Now select the camera and input the camera information. View --> Select Camera.
Enter the 35MM equivalent focal length.
Enter the aspect ratio (Width/Height of the image) In my case 3888/2592 = 1.5
Since you are using 35MM equivalent focal length, you can leave the film back settings to default.
*Now enable the "Resolution Gate" for the camera. View --> Camera Settings --> Resolution Gate.
*Go to the Render Setting and change the image size and device aspect ratio.
*Now select the "Image Plane" that you created View-->Image Plane-->Image Plane Attributes-->imagePlane1
*In the attribute editor of the image place, scroll down to placement tab. From the "Fit" drop-down list select "To Size" options and click on "Fit to Resolution Gate" button.
With this we have the completed the basic camera setup.
Step 3 :
*Measure the reference cube in your image and create a cube in maya with same dimensions. In my case it was 4.8x4.8 cm.
*Once the box is created, change the shading to "wireframe on shaded" and turn on "xray" option. This will enable you to see through your object and it makes it very easy to align the CG box to the one in picture.
*Now move/rotate the camera until the CG box aligns to the one in picture. Please dont move the box, it should be left at the origin. Make sure you move only the camera to get the alignment.
*Now create a ground plane which will used to cast/receive shadows. Once you are satisfied with the alignment, lock the camera so you dont accidentally move the camera.
*Now select the image plane again and swap it with the actual picture you are going to use. Then bring in the CG duplicate of the object you wish to match and place it next to its real twin. Make sure its put on top of the ground plane you just created.
Step 4 : Adding Lights
*Before adding the lights, if you have painted texture maps for your object, please assign it to the object.
* Now depending on your image add the key light in and turn on "Raytraced Shadows". Render the scene and compare the result with the original picture. Adjust the intensity, color of the light accordingly. Adjust the light position until you get proper shadows. If you are using a spot light, you can adjust the "Light Radius" parameter to get softer shadows.
Step 5 : Creating Reflection Sphere
*Create a polygon sphere in the scene and make it very large. Assign a surface shader to it. Connect a file on its "Out Color" attribute as a "Projection".
*Load the cropped image of the chrome ball and change the projection type to "Ball". The world sphere setup is done.
Step 6 : Creating Render Layers
*Rendering in layers, refers to separating out different aspects of the scene, such as diffuse, shadows, highlights, or reflections, each into a separate image. This gives us flexibility to adjust the images using a composting package.
*Diffuse Layer :
Diffuse pass is the main, full-color rendering of your object, including diffuse illumination, color, and color maps. A diffuse pass will not include reflections, highlights, and shadows, which are usually separate passes.
To setup a diffuse layer, click on the "Render" tab which is next to the "Layers" tab in the bottom right side corner of the screen.
Once in the "Render Tab" you will see something called "Master Layer". This is the default layer which is created by maya.
To create a new layer click on the "create new empty layer" button. Once created, select the object and the lights in the scene and add it to the layer. Ground plane is not required.
Right-Click on the layer --> Attributes . Click on the "Presets" button and choose "diffuse" from the list.
Specular Layer:
*Create a new render layer and add the object, lights and the chrome sphere to it. Right click layer and choose --> Attributes. Click on the "Presets" and change the type to "Specular". In the shader properties of the object, change the diffuse color & ambient color to "0". So when you render this pass, you will see only the highlights.
Shadow Layer:
* Create a new layer and add the object, ground plane and the lights which casts shadows. In the layer's attributes, change the preset to Shadows. Note that the shadow information will be stored in the alpha channel.
Occlusion Layer :
*Create a new layer and add only the object and the ground plane. In the layer's attributes, change the preset to Occlusion. A new Surface shader will be created and automatically assigned to the object. Note that a "mib_amb_occlusion1" node is connected to the Out Color parameter of the surface shader. Increase the Samples to get a better quality. The Spread decides how soft or strong the contact shadow should be.
Select the object and in the attribute editor go to the shape tab. Scroll down until you find "Render Stats" tab and turn off "Primary Visibility". Make sure you dont add any lights in this layer.
Now all you have to do is "Batch Render" the images. I will add a tutorial on how to combine the pictures in Nuke. Hope this was useful. Thanks !!








*

















