+1 tag for Google+

Thursday, 13 August 2015

What Is the Standard Lens Length in Maya 3D?

I recently wrote an answer on Quora to the following question: What Is the Standard Lens Length in Maya 3D?

The question:
This may be tricky for people who have only Maya 3D skills and no photography knowledge to answer.  A "standard lens" is a focal length which for a given size of film plane (or sensor) will neither widen nor magnify the image it captures.  For example, a 50 mm lens on a full frame 35mm sensor is considered a standard lens.

I know perspectives can be matched using Maya 3D camera options, but what is the default equivalent of the sensor size in the program?

My reply:
Indeed, many artists with no experience in photography will not be able to easily understand the relationships between focal length and sensor sizes / ratios.

Having worked in the "camera department" on Hollywood films, it has given me great insight into the relationships between the physical camera and the virtual one in Maya.

Maya does not make it easier. What we know in the VFX/Film world as "sensor size" / "film back" / "film format", is known in Maya as "Camera Aperture". This attribute is found in any Maya camera's shape node. In the attribute editor under the Film Back section you will see: Film Gate, Camera Aperture, Film Aspect Ratio, and Lens Squeeze Ratio.

Just like you said there is a relationship between focal length and the sensor size.

Back in the Attribute Editor for the Maya camera, the way we get the correct sensor size or film format for our camera gate is to set the Film Gate attribute to "35mm Full Aperture". This is actually a preset that sets the "Camera Aperture" attribute to 0.980 x 0.735.

From the Wikipedia page for Super 35 film formats of printed film strips, (4th para), I quote "If using 4-perf, the Super 35 camera aperture is 24.89 mm × 18.66 mm (0.980 in × 0.735 in)".

That is exactly what Maya is giving us (in inches, which is frustrating, when we are describing 35mm in millimeters).

From the same Wiki article we also learn of the film dimensions of 35mm Academy format which is  21.95 mm × 16.00 mm (0.864 in × 0.630 in). That is what the Maya Film Gate preset gives us if we switch to 35mm Academy.

However, we are not limited to only the presets found in the Film Gate attributes. Knowing that Maya is just filling in measurement of the film back dimensions now enables us to input measurements from our own camera sensors even if their measurements are non-standard.

In this context, whatever focal length that you now set, will give you the actual framing of a real world camera with the same sensor size / film back.

We do all these, to make sure that the numbers will all make sense: the dimensions of the sensor size and the focal length.

Moving forward, we are faced with 2 settings, and two different framings when you look at the viewport: one is our camera's film back / sensor ratio, and the render resolution. Maya gives us the flexibility to have both.

However it becomes wildly confusing if we do not know what we are doing. Without guides we will never know which object that is displayed in our viewport is going to get inside the rendered frame eventually. Even when you render, you are only seeing the framing of your render resolution, not the framing of your film gate.

Here is my standard workflow, so we see the edges of my resolution and my film gate. I do this for all my render cameras:

In the Camera's attribute editor:
- set "Fit Resolution Gate" to "Overscan",
under display options section
- turn on "display film gate". This displays our film back /sensor boundary
- turn on "display resolution". This displays our rendering resolution boundary
- turn off "display gate mask"
- set "overscan" to 1.05 (I like to be able to see a bit more beyond my frame)

All these will make sure you see 2 boundary boxes, one with a solid line, and the other one, drawn with a dotted line. The dotted box defines the film gate / sensor bounds, and the solid box defines your rendering boundary, defining the resolution of your rendered image.

If the aspect ratio of your film back and your render output resolution is the same, you will see only 1 set of framing guide. That is because both are drawn on top of each other. At this point we have successfully matched our film gate and resolution gate.

At this point our Maya camera's focal length will reflect that of the camera's real-world counterpart.

Unfortunately this is only part of the story. In order for our camera's framing in Maya and the real world to match, the scale of the CG objects and the distances in your scene must now be consistent with the real world. That is to say, if I want to find out what a 50mm lens would see and frame, for a subject that is 1.8 meters tall, standing 2 meters away, in the real world, I would need a CG character that is modelled to be 1.8 meters tall in scale, and placed 1.8 meters from the Maya camera in the scene.

If any of these are off scale, our measurements will become inaccurate, and all our calculations with the camera will end up as inaccurate framing once again.

In many aspects of film VFX production, CG elements need to integrate with live plates. Thus, the creating and laying out of assets in the right scale for a scene is critical. This is especially so in the camera tracking, simulation (water, smoke, cloth, fire, muscles) , and lighting departments.

When distances and scaling are not accurate, camera framing or surveyed measurments on the phsyical filming set will not be able to match up with the CG camera set-up in Maya.

In the lighting part of the workflow, light intensity will not be accurate, and light energy falling off across distances will become too slow or become too fast.

In simulation and dynamics, inaccurate scaling will cause forces to be either too weak or too strong, and thus unnatural.

If a production is fully CG, the matching of cameras' framing to their real world counterparts become less critical. But there will still be directors who strive for that extra bit of believability in their framing and camera work. So it is still a desirable skill to have for any CG artist that has to handle a CG camera.

I hope this helps.