Navigation: Main Site | Blog Home

Posted: 2021-09-25

Updated: 2021-10-09

I have recently been working on a new pipeline that has moved away from using Maya as the core DCC. Instead we decided to move dressing, lookdev and lighting away from Maya to Houdini. This has pushed us to require accurate cameras within Houdini using Arnold, and after some investigation here are a few tips to guide you on your way.

The maya default camera has a standard film back set using two axis, horizontal and vertical, 36x24mm. They call it `aperture`

. Think of this as the size of film you are loading into the camera. In this case it appears to be a 35mm filmback.

The default aspect ratio is 1.50 which is not quite HD so be sure to setup your values to match your productions aspect ratio.

HD = 1.778 or 42.6x24mm

Scope = 2.35 or 56.4x24mm

The houdini camera also has an `aperture`

, however it is just a single value and that is simply grabbed from the horizontal value from Maya. So it could be 36, 42.6 or 56.4 from our example above.

The houdini docs recommend using a value of 41.4214 but we needed to match our Maya cameras 1:1.

The fun part comes into play when we begin to calulcate the Depth of Field settings for Arnold. A few notes before I begin:

- We decided to scale everything down by 100 in Houdini. So the camera is parented to a null set to 0.01
- Even though we have this null scaler, the
`attributes`

do not scale down - Maya units are cm. But we are working with lens info in mm (18mm, 50mm, etc), so we will need to convert mm to cm.

First we need to find the `Aperture Size`

now to me this is not the film back by the diameter of the iris in the lens. This is a realatively easy calculation thankfully.

- c = lens_mm/fstop
- 35.714 = 50/1.4

We now need to apply our scale values:

- mm_to_cm = 10
- c = (lens_mm/fstop)/mm_to_cm

we then need to scale down to houdini size:

- houdini_scale = 0.01
- c = (lens_mm/fstop)/mm2cm)*houdini_scale
- 0.035714 = ((50/1.4)/10)x0.01

this can be simplified to just:

- c = (lens_mm/fstop)/1000
- 0.035714 = (50/1.4)/1000

We are getting closer, however the first time I looked at the renders I felt as if the blur size was roughly double what it should be. I did some tests with my actual DSLR and a 50mm, f1.4 lens and sure enough my gut feelings were confirmed.

When we take a look at houdiniguides.com you’ll notice that on `Focal Length`

and `Aperture`

seem to divide thier calculations by 2. We will use this to round out our calculation

- c = ((lens_mm/fstop)/1000)/2
- 0.01785 = ((50/1.4)/1000)/2

You’re probably thinking these values are so small, that cannot be right?! Well when we look at the Arnold Documentation we see that thier numbers appear very small too

We are also having to adjust a bunch of other values by times by 0.01 or dividing by 100. Values such as the `near clip`

, `far clip`

, `focal distance`

, etc