Reflections (I'll demo this in class 5.)
This tutorial is a quick recipe for getting reflections on your objects using both raytracing and reflection mapping. We’ll add a shiny, chrome tree to impress all the dull, wooden ones.
I took a photograph of some small objects on my desk sitting next to a tree ornament. This plate will used as the image plane for a match move camera. Note that EXIF data from your digital camera will tell you the focal distance of the lens, which can be helpful in match moving. You should also measure real world distances on set and the angle of the camera pointing at the scene if you’re being particularly anal about things.
--
Next, I duplicated the photo and cropped in on the ball. This will be my reflection map for filling in the gaps where my scene lacks 3D geometry to reflect. In this case, almost the entire scene's reflections will be faked with the map.
--
In Maya, I imported the plate.tif file as the image plane for my camera (not the perspective, but a new one I’ll lock down). This image will be used to line up a new piece of match moved geometry – I built a NURBS curve and revolved it into another tree. I lined the tree up with the background as best I could. (OK, that’s a lie, it was a pretty slapdash job, but YOU should take much care in this step.)
--
Rendering the scene now will show you a dull gray tree that doesn’t really fit into the scene. Perfect! We’re all done. Goodnight.
--
What. You want to keep going? Alright, let’s move on. Using three-point lighting basics and my keen powers of observation I placed some lights to match the plate roughly. (The chrome ball is a pretty good record of where the lights were in the real set.) Since most of the lighting on the tree will come from its reflectivity I’m not going to kill myself lighting it. I’m also going to change from the past to the present tense and back again many times throughout this tutorial.
--
Next, I wanted to place a shiny metal shader on the tree. For this, I built a Blinn material, set the color to black, the diffuse pretty low, gave it sharp highlights (low specular rolloff and high eccentricity), and very high reflectivity.
--
As a test I created a sphere to sit right where the ornament is in the plate. I turned raytracing on in the Render Globals and was not surprised to see a reflection of the ornament in the tree when rendered. The problem is that that’s the only solitary lonely little object that is reflected. What to do? Reflection maps are the answer.
--
In the reflection color slot of the Blinn material I created an environment texture of the type Environment Ball. This node is designed expressly for importing pictures of mirror balls. In the image slot I browsed for my cropped ornament photo. The manipulator for the 3D projection that gets created in the middle of the scene can be used to line up the reflection (akin to reorienting the whole room). Even better, since the environment reflection photo was taken at the same angle as the plate is to use the Eye Space option in the EnvBall node. This will line up the reflection with the render view.
--
Now when I rendered things looked much better and I was very happy and wandered off to get some cheese to eat.
--
On a fuller stomach I looked back upon my render and was less happy. Where are the shadows to tie it in? Why isn’t the green base of the plate showing up in the reflection map? What about the multiple specular hits?
I attacked the shadows thusly: I created a cube (a plane would’ve been smarter – I attribute this lapse of judgment to the wine that was consumed along with the cheese) and matched it to the green wooden base. I placed a shadow catching material on this cube – the Use Background material in fact. I set the visible in reflections flags off for the cube. I set my key light to cast shadows and there they are. You can also get a raytraced reflection of the cg tree to show up on the cube.
The green base should be reflected up onto the tree, but it doesn’t. This is because I used the ornament to create the reflection map and it was sitting on the desk, not the green base. There are three main remedies that spring to mind: 1.) shoot the picture of the chrome ball correctly in the first place, 2.) paint some green into the reflection map back in Photoshop, 3.) add some green geometry under the tree to be caught in a real raytraced reflection. Numbers one and two would be preferable, but too boring for this tutorial, so on to number three.
--
I duplicated my shadow catching cube and assigned a surface shader to it. The out color slot of the shader was mapped with a projection of the image plane. The projection was set to the shot cam, with a vertical film gate fit. (Just coloring it green would have been fine as well.) I only wanted this reflection cube to be used in the reflection on the tree, so I turned on Visible in Reflections and turned off primary visibility in the attribute editor of the reflection cube's shape node.
--
The renders were looking much better to me at this point. I turned off the Emit Specular setting on all my lights to avoid the multiple spec hits. The last thing I did to plus it a bit was add a post-render glow effect. By upping the shader glow threshold I got this to only glow around the bright reflections in the environment map of the overhead lights.
--
Reflection tree support files.