3D Camera is glitching out of focus while moving camera and changing focus distance accordingly

New Here ,
May 18, 2022 May 18, 2022

Copy link to clipboard

Copied

Hey! I ran into this problem multiple times now. I need to use depth of field. I have a 3D Object, that is fixed in its position. I want to move the camera closer to the objects while the objects stays in focus, therefor I adjust the focus distance accordingly to the movement of the camera. Everthings fine until 5 frames before the camera comes to halt the object gets heavily out of focus from one frame to another, even though the focus distance is right and it should be in focus. When the camera stops everythings fine and in focus again. Enabling / Disabling motion blur doesn't change anything.
I just don't understand what's wrong or how I can keep it in focus. Can you help?

adobe help focus 1.pngadobe help focus 2.pngadobe help focus 3.png

TOPICS
Error or problem

Views

49

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
May 18, 2022 May 18, 2022

Copy link to clipboard

Copied

A pin hole camera is based on a cosine function, so the interpolation is never perfectly linear. You need to tweak the value graphs accordingly to mimic this behavior.

 

Mylenium

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
May 18, 2022 May 18, 2022

Copy link to clipboard

Copied

Is there a reason you are using such a long telephoto lens for the camera? Your angle of view appears to be about 15.9º. That would be about the same as a 2000 mm lens on a standard movie camera.  That angle of view and a zoom value of 13750 tells me that the comp must be 4K. The camera and the target layer (Layer 11) are also offset to the left of the comp center by almost twice the comp width.

 

The long lens and the distance from the comp center could be causing problems. If this were my project, I would put a 3D null in the same position as Layer 11, then parent all layers, including the camera, to the null, then reset the position of the 3D null to comp center to get things lined up with the compositions 3D world center. Just doing that may solve your focus shift problem.

 

I would also consider using a much shorter lens, like a 50 or 80mm lens, spacing the other layers farther apart, and using a wider aperture for a shallow depth of field. Only about 100 pixels are separating the layers. That means the aperture would have to be wider, but the results would also be better, and you would not be dealing with values that could possibly throw off the calculations.

 

You are also working with vector layers, so I suggest that you turn on Collapse Transformations. You should get a better-looking depth of field effect.

 

I would also use an expression to tie the Focus distance to the distance between the camera and the target layer. If you named the Layer 11 "Target Layer," the expression would look like this:

point1 = position;
point2 = thisComp.layer("Target Layer").position;
length(point1, point2)

That expression will keep the center of focus precisely on the anchor point of the target layer no matter where you put the camera. 

 

When I set up a shallow depth of field and need to change the focus from one layer to another, I use a null for the Target and then animate the null position using the position of each layer I need to bring into focus for the keyframe values. Tying focus to the null also gives you something you can see in the different comp views that tells you exactly where the center of focus is.

 

Let us know if any of these suggestions help.

 

 

 

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 22, 2022 May 22, 2022

Copy link to clipboard

Copied

Firstly I'd like to thank you a lot for your suggestions and explanation. Unfortunately I still have the same problem.
Yes you are right, the video is in 4K and I am nearly exclusively working with illustrator files. I keep continous rasterizing off usually while editing, otherwise my PC would get too slow for me to really be able to work properly. I thoght I had the camera set up with 35mm, although it seems now to be at 128,91mm. I tried and changed it to 35mm but after adjusting the view with moving the camera nearer to my object I ran into the same problem. Aperture is set at 500 pixels. In my previous video I had a fairly similar setup but with the layers way more apart from each other, mostly 500 pixels between. Same problem. That's why I chose less space between the layers in this projects hoping to fix this. The object from the screenshot above is so far from center of the composition because my composition is pretty wide, I have different scenes in this background to which I fly the camera (see the new screenshot attached).

I think I might have narrowed it down to what might the exact problem, but I still don't have a solution.

As you can see in the other screenshot even though the keyframe for the camera movement and the focus distance are exactly on the same frame and I only eased them simutanously with F9 their values don't go perfectly together on the last frames leading to the one with the next keyframe. If I switch all of the keyframe's interpolation to linear the problem is gone, but as you may think, the movement looks weird and stops abrupt. Do you know if there is a way to ease just exactly alike, so the focus distance is right?
Fixing the focus distance to a certain object or a null object is not really a possibility I think because my camera needs to focus thoughout the video on different objects with different  postions on the Z-axis.

What do you think?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 22, 2022 May 22, 2022

Copy link to clipboard

Copied

LATEST

Screenshot 2022-05-22 210145.pngScreenshot 2022-05-22 210232.pngScreenshot 2022-05-22 211723.png

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines