Depth of Field improvement

Hello! I was thinking to a possible improvement of the Depth of Fields settings in the Camera properties. Actually Blender has the Focus on Object field that sets the focal point to the Object location, but the result actually depends on the object origin and not the object location. For example consider the image below. We have two objects: Suzanne on the front and Suzanne.001 on the back. The location of Suzanne coincides with the world origin. If we set the focal point to Suzanne.001 we get the result shown here:

But if we apply the transform (Object->Apply->All Transforms) to Suzanne.001 we get this:


because now also the origin of Suzanne.001 coincides with the world origin, even if its actual geometry does not.

Of course this can be fixed setting back the origin of Suzanne.001 to the origin of its geometry (Object->Set Origin->Origin to Geomtry), but I think it would be better and more intuitive to set the focal point to the origin of the geometry also after applying the transformations (i.e. independently on the actual origin). I made this post to collect some feedback before delving into the implementation of this feature.

6 Likes

Although selecting an object for the Target Focal plane is possible it really isn’t intuitive as there is no way to get a particular part of an object in focus this way or animate it. It is better to choose an Empty as a Target.

Using the object origin seems to be rather intuitive if you are not completely new to 3D.

It would be interesting to implement some kinda of autofocus like real cameras, some 9 x 9 grid where it averages or something even more advanced, however most users use an empty as the focus point and animate the empty instead. I think it would be neat improvement though but not only for DOF but for the whole camera

Please clarify if you are looking to work on this your self, or if you are just spit-balling ideas hoping someone else will work on them?

Yes I would like to work on this personally, but before I wanted to collect some feedback, I updated the post to make it clear, thank you

I would love the more intuitive way to pick the focal plane that other applications use, which is to pick the nearest surface under the cursor. By raycasting from the cursor into the screen to the first surface hit point is a very useful way to get the focal plane, especially in tight close up shots with heavy dof.

I see nothing wrong with the current way focus works. It focuses to a point in space, which can be set by an object and that is completely intuitive to me.
However, sure, there could be another way: “Surface nearest” i presume?

Yes I understand that is intuitive to focus on an object, I just think it’s less intuitive that the focus depends on the object’s origin and not its location in world space.

As an example consider the figure below:

The cube is at an arbitrary position and you want to orbit the sphere around the cube while keeping the focus on the sphere. The easiest way to orbit the sphere around the cube is to set the origin of the sphere at the origin of the cube and animate the Rotation Z angle of the sphere. But now if you select the “sphere” in the DOF settings, the cube will be in focus instead of the sphere. I hope I have expressed myself clearly.

However if you think that the actual way of selecting the focus makes more sense I can move on.

I’m not sure there can ever be a sure-fire way to derive a meaningful point from a given object. Meshes especially, can occupy an arbitrary volume in infinite ways. I think you’re suggesting to set the focal distance to the mesh’s center of mass? there’s no guarantee that this point will line up with the feature you actually want to focus on, it seems very unstable to me. Focal plane is something that one sets very intentionally, and it can already be controlled in such a way by using an object as target, so I don’t feel like there’s really a limitation waiting to be lifted here. In all my animation shots, I will have an empty acting as target, and sometimes it’ll be constrained to, say, the head bone of a character rig.

If you allow me to suggest something, is facilitate the manual placement of the focal distance with an eyedropper operator, same as the one used to pick an object. I don’t want to hijack your proposal, it just seems there are a few places (related to depth of field) that could use the work better.

I had not seen that but this is precisely what I meant :

The thing is, with any reasonably low f-stop value, this means the entirety of the object will be behind the focal plane. If you wanted to focus as much of the object as possible, I guess you could try to find the center of mass of all visible surfaces, but then choosing a point on the Z axis on that range is also completely arbitrary.

3 Likes

Ok sure, the purpose of the post was to understand if the feature could have been useful before implementing it. I grasp your arguments, thank you very much