# Focal depth from FOV

This topic is 2633 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Is it possible to calculate the focal depth when only a FOV is given? The way I understood it, the FOV depends on both the focal depth and the dimension of the "film". Specifically I wan't to know what focal depth I'm implicitly using when rendering to a cubemap (with a FOV of 90).

##### Share on other sites
Field of view is a function of the ratio of the focal depth and the size of the projection plane. If one is unknown, you cannot calculate the other. It is even meaningless to talk about one without a relation to the other.

##### Share on other sites
What is the size of the projection plane in this case? The cube spans [-1, 1], so is the size (2, 2) per face?

##### Share on other sites
That is the size of the view volume in projected space, which is a cube and has no concept of field of view angles.

You can have pretty much any projection plane you want. If you have real world units, then you can define a virtual plane corresponding to a 35mm film, and your focal depth will match that of a camera with a lens on a 35mm film. You can also use the near plane from the projection matrix, or perhaps the plane at Z=-1. In either case, you can only compare the focal depth to a camera if the projection planes are comparable.

##### Share on other sites
I'm not using a projection matrix in this case, so I suppose plane one unit from the center of the cube is the one I'm looking for.
But maybe I'm going about this in the wrong way. I'm mapping points onto a cubemap and now I want to approximate the area a sphere would take up when mapped onto the cubemap and found a formula: Sphere.radius * FocalDepth / Sphere.z.

##### Share on other sites
Oh, I think I see your point. I believe in this case, what you have as a focal depth is just the constant 1 if your field of view is 90 degrees. It is not really a focal depth, but just a scaling factor that maps the radius/z into its size on the projection plane. You don't need the focal depth for that, only the ratio of the focal depth and the projection plane size, which happens to be a function of the field of view.

Basically, I believe you want radius * 2*tan(fov/2) / z. The factor 2*tan(fov/2) is the ratio between the focal depth and the size of the projection plane.

##### Share on other sites
Thanks, that seems to be what I am looking for!

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 10
• 11
• 13
• 9
• 11
• ### Forum Statistics

• Total Topics
634090
• Total Posts
3015430
×