How to calculate correct DOF

Discussions about rendering in SOFTIMAGE©
User avatar
Maximus
Posts: 1121
Joined: 09 Jun 2009, 13:45

How to calculate correct DOF

Post by Maximus » 18 Oct 2012, 14:21

Hey guys, i was wondering how you calculate the correct DOF provided a focal lenght.
Engines like octane/fryrender/maxwell has an automatic DoF based on camera, of course you can manually control it but out of the box is pretty much perfect.
I was wondering if there is a way to set it up with mental ray and its camera, cause at the moment i just use an "artistic" method meaning i just increase or decrease the focal plane and radius of effect depending on my taste.

Would be nice to have something more phisycally correct.

thank you, Max

User avatar
Rork
Posts: 1359
Joined: 09 Jul 2009, 06:59
Location: Close to The Hague, Netherlands

Re: How to calculate correct DOF

Post by Rork » 18 Oct 2012, 16:18

It should be:
(focal length/aperture)/2

example, an image shot with a 35mm lens and f-8:
(35/8)/2 = 2.1875mm
Divide by 10 for SI units.

Hope this helps,

rob
SI UI tutorials: Toolbar http://goo.gl/iYOL0l | Custom Layout http://goo.gl/6iP5xQ | RenderManager View http://goo.gl/b4ZkjQ
So long, and thanks for all the Fish!!

User avatar
Maximus
Posts: 1121
Joined: 09 Jun 2009, 13:45

Re: How to calculate correct DOF

Post by Maximus » 19 Oct 2012, 17:18

Rork wrote:It should be:
(focal length/aperture)/2

example, an image shot with a 35mm lens and f-8:
(35/8)/2 = 2.1875mm
Divide by 10 for SI units.

Hope this helps,

rob
Thanks rob, just have one more question. I'm creating a render, setup the camera at 35mm, but i'm not using any photo exposure shader, so where do i get the aperture? Do i have to use the photographic exposure to use the dof correctly then? I'm a bit confused on softimage camera parameters.

My setup is camera + bokeh lens.

User avatar
Rork
Posts: 1359
Joined: 09 Jul 2009, 06:59
Location: Close to The Hague, Netherlands

Re: How to calculate correct DOF

Post by Rork » 22 Oct 2012, 10:17

Hi Max,

Sorry for the latish reply, missed your question....

I have to admit I rarely use MR anymore, so this is more of a generic answer.
As you know, all this photography stuff is interconnected to one another, lens, f-stop, ISO etc..

In 'full 3D' land, this will only work properly if you start to use some kind of lens shader(s) that is mimicking this behavior 100%. Renderers like Maxwell do a pretty good job at this.
So when you want to keep it physically 'plausible' in 3D, you'll have to stick with some kind of system doing this. And in your case, also do some kind of tonemapping thing too.
But normally that would be part of that lens setup anyway.

When working with real footage, the thing that becomes important is the matching of the used lens and DOF. That's where the equation comes in. This is mostly only a matching of DOF (and perspective), as all the other stuff will end up in post after the (non linear if you're working like that) renders anyway.

If you want to play with DOF in a 3D still, you might be better off rendering some kind of depth map and play with that. The PS plugin from Richard Rosenman or Frischluft comes to mind.
Here a tut on the circle of confusion and DOF stuff: http://www.cambridgeincolour.com/tutori ... -field.htm

Hope this helps a bit,

rob
SI UI tutorials: Toolbar http://goo.gl/iYOL0l | Custom Layout http://goo.gl/6iP5xQ | RenderManager View http://goo.gl/b4ZkjQ
So long, and thanks for all the Fish!!