Philip Graham - Stereoscopic Virtual Camera

Back to Portfolio

As a side project at Fathom I made a stereoscopic camera rig for Maya. This tutorial does not use the latest version of my stereo camera rig. The latest version uses the "center" camera as the right eye in order to reuse the renders from a traditional "flat" or "mono" production. This tutorial uses an older version where both the left and right cameras are moved away from the center camera, necessitating three renders for both mono and stereo productions.



The camera rig is 3 cameras, Center, Left, and Right. All of the controls are on Center, so you should not have to expand the group as shown here. I have connected the attributes of Center to the other cameras so you can adjust the focal length and clipping planes on Center and it will affect the others. The only case I can think of where you will select Left or Right is if you need to change the renderable status of each camera.

You can animate the Center camera just like any other camera, and you should only animate Center. If you already have an animated camera and you want to import the stereo rig, you can simply parent or parent constrain Center to your shot camera, then connect or copy the focal length and clipping planes attributes from the shot camera to Center.



To view the Left and Right cameras, I use a layout where Right is on the left and Left is on the right. This way I can use a cross-eyed viewing method to get an idea of how the camera is placed without rendering. If you can't do the cross-eyed method, it will probably be better to put Right on the right and Left on the left.



The stereoscopic controls are in the Extra Attributes section on the Center camera.

Screen Width is the horizontal width of the screen you are going to display the render on. It is very important to know the exact width of the final image if you want the 3D effect to feel realistic. If your Screen Width is bigger than your display, the 3D will look flatter than it should (but it will still look 3D). If your Screen Width is smaller than your display, your eyes will not be able to focus on "far away" objects and you will completely lose the 3D effect. Keep in mind that this is the horizontal measure of the image on the screen, not the diagonal measure used for televisions.

Stereo Disparity is the distance between the centers of your eyes. The default is 2.25 inches, which is a little bit smaller than average I think, but it still creates a lot of depth. If the Disparity is smaller than your eyes, the image will look flatter than it should, and if the Disparity is larger than your eyes, you will not be able to focus on far away objects. It is important that the Screen Width and Stereo Disparity are measured using the same units. If you keep 2.25 Disparity, you must measure the Screen Width in inches. If you measure the screen in feet, you must convert Disparity to feet as well.



Safe Zone displays the boundary of the area that both the left and right cameras can see. It ends at the depth of the "screen" in the 3D space. Because this is 3D, we can make objects that appear "in front" of the screen. It is a big problem if an object in front of the screen crosses the edge of the screen, because it will look like the object disappeared. It is a bigger problem if the object crosses the left or right sides of the screen, because it will disappear from one eye's view before it disappears in the other eye's view. This problem causes the 3D effect to be lost. The Safe Zone will show you if an object crosses the boundary of what both cameras can see. The Safe Zone obstructs the view of all 3 cameras. It is meant to be viewed from another camera to see if the boundary is crossed.



Screen Gate displays a rectangle around the edge of the "screen" in 3D space. The screen is really your only point of reference when watching a 3D movie, so you need to know how your scene is laid out relative to the screen. You don't want everything to be really far away, nor do you want everything to be "in front" of the screen. It is easiest to view if your subject is at screen depth or slightly behind it.

If you like the position and focal length of your camera, but your Screen Gate is not at the right distance, you can simply scale the Center camera, and the Screen Gate will scale toward and away from it. This will not mess up the 3D effect. Scaling the camera is like "scaling yourself." If you scale the camera down, the scene will appear larger and further away by comparison when you view it in 3D. If you scale the camera up, the scene will appear smaller and closer.

Once you've rendered out the Left and Right cameras, it's really easy to composite them for red/blue glasses. The left lens of the glasses is red, and the right lens is cyan so it lets through both green and blue. The network I used for the juggling shot looks like this.



The Copy node is set to copy the "gb" channels from the right image into the left, so the result has red from the left image and blue and green from the right image. I copy the green and blue channels with no change, so the final image has most of the color from the render. I use a Monochrome node on the red channel before copying the green and blue. Because the left eye only sees the red channel, it must have a blend of all the channels in order to have a similar luminance to the right eye. In this case, the original chameleon has a lot of green and very little red contribution, so it would create a disconnect between the left and right eyes. The Monochrome node brightens the red by blending in a lot of green. So the red gets brighter, and the green is already bright, so the chameleon appears more yellow. It doesn't look exactly right but it makes the 3D effect work a lot better.

The method in 3D theaters uses polarized projectors and glasses. With that method, the render retains all of its color information in both eyes, so the image has the right color and looks 3D at the same time.

I've also made a custom panel for viewing stereo cameras as red/blue renders. It's a modified version of an example plug-in that came with maya.

The panel simply lists all the stereo camera rigs in the scene, and when you choose one it renders it in the viewport as red and blue.

To make it really production ready, I would have to add a shelf with buttons to create new stereo cameras, constrain them to existing cameras, and load the stereo panel.