15 Replies Latest reply on Sep 6, 2009 8:23 AM by Adolfo Rozenfeld

    Depth of Field

    Lost In My Mind Level 1

      Yes, I have searched this forum and spent several hours looking at YouTube and various other tutorials, and no I don't want to add the filter 'lens blur.' I am trying to achieve a shallow depth of field with my camera as I fly through 3D space. I increase the size of the apperature, but it seems to have no effect. Would someone please provide me with a link to somewhere that would explain this to me in plain English? Thank you in advance.

        • 1. Re: Depth of Field
          Adolfo Rozenfeld Adobe Employee

          Depth of Field for 3D cameras in AE follows the same rules as real lenses - it is governed by aperture, magnification factor and focus distance.

          If you set a really wide aperture (you can use f stops in the Camera Settings dialog if you're more comfortable with that), then it should be very, very evident.

          Is is possible that you have the Draft 3D button turned on?In that case, Depth of Field simulation doesn't work at all.

          Draft3D.jpg

          • 2. Re: Depth of Field
            Lost In My Mind Level 1

            Thank you Adolfo for your prompt, and correct answer. Much appreciated.

            • 3. Re: Depth of Field
              Lost In My Mind Level 1

              Ooops, one solution leads to more problems . If I have an object in Z space a distance of 100 (what are those...pixels, mm, foot long hotdogs?) and then I go to my camera focus distance and set it to 100 as well, thinking it should be perfectly in focus.............well, for those of you that know, that's not quite the effect I was looking for ! Any simple explanation would be appreciated. Thank you.

              • 4. Re: Depth of Field
                Adolfo Rozenfeld Adobe Employee

                Yes, focus distance is measured in pixels.

                So, if your layer has a value of 100 for Z position and assuming the camera has a value of 0 also for Z position, the thing is: given an extremely wide aperture, and if the camera and layer are not absolutely perpendicular to each other, then only a part of your layer will be in sharp focus. In other words, if either the camera or layer are orientated/rorated, some parts of the layer won't be at a distance of 100 pixels, and if the aperture was really wide, it could lead to other areas of the layer being outside the DOF area. If this was the case, you need a smaller aperture. Especially if the layer looks really big (magnification is one of the factors in the DOF equation).

                • 5. Re: Depth of Field
                  Lost In My Mind Level 1

                  Thank you again Adolfo for your helpful response. In line with that, I was wondering if I have 5 objects in Z space and want the initial camera focus to be on the middle object is there a way to do that other than 'by eye'? By knowing the Z coordinates, is there a more precise way of focusing on a specific object? Also, I've read so much about parenting a camera to a null object or not. Is there a rule of thumb as to when you need to do that, and when you don't? Thank you.

                  • 6. Re: Depth of Field
                    yenaphe Level 4

                    You can use a focus object.

                     

                    The easiest way to do this is to create a null and then add an expression on your camera focus point. Then you can animate the null so the focus follows it. Then you can easily rack focus & co.

                     

                    You can find the expression here on the AE documentation.

                     

                    Hope that helps

                    1 person found this helpful
                    • 7. Re: Depth of Field
                      Adolfo Rozenfeld Adobe Employee
                      I was wondering if I have 5 objects in Z space and want the initial camera focus to be on the middle object is there a way to do that other than 'by eye'?

                      It's only "by eye" when the Comp panel shows the Active Camera's point of view.

                      If you switch to any other view, you'll see the Active Camera from the outside, and you'll notice the location of the focal plane as you drag the focus distance parameter. That way, you can place the focal plane easily where you want it.

                       

                      By knowing the Z coordinates, is there a more precise way of focusing on a specific object?

                      Yes, but the problem is that focus distance is not measured as position coordiantes (XYZ), but as a distance from the camera (unidimensional).

                      You'd have to add an expression to the Focus Distance parameter to calculate the distance from a 3D layer to the camera, so that the focal plane is at the same distance.

                      This expression you would add in focus distance would be something like:

                       

                      posCam = thisComp.activeCamera.position;

                      posLayer = thisComp.layer("Nameof3Dlayer").position;

                      length(posCam, posLayer);

                       

                      Remember to change the layer name in posLayer to the 3D layer to want to focus in.

                       

                      I've read so much about parenting a camera to a null object or not. Is there a rule of thumb as to when you need to do that, and when you don't?

                      You need to parent the camera to a null when just animating the camera would produce undeseriable interpolation behaviors. For example, imagine you want to orbit around a scene. If you use the camera tool to orbit and add two keyframes, the camera won't orbit around the scene, because it will go through the shortest possible route from point A to point B. If you add a Null in the scene center, parent the camera to the null and just rotate the null in Y, the camera will rotate around the null and thus you'll achieve a perfect orbit.

                      • 8. Re: Depth of Field
                        Lost In My Mind Level 1

                        Thank you as always Sebastien for your help and link. They were both very helpful. I can't say thanks enough to you also Adolfo for so much and such helpful information. I learned more from this one post than I have from dozens of hours of practice and research . Thank you both again.

                        • 9. Re: Depth of Field
                          yenaphe Level 4

                          No problem, glad to be helpfull

                          • 10. Re: Depth of Field
                            Lost In My Mind Level 1

                            I don't mean to be dense (blonde is bad enough), but I'm really struggling with this whole camera thing. Maybe just a couple more general questions? 1. When you parent a camera to a null object, does it matter which one you move since they are parented? 2. Is there a difference between the 'orientation' setting, and the x,y,z rotation settings. They seem to do the exact same thing? 3. I used the different camera view as Adolfo suggested and that really helped, but I'm having a little trouble seeing the focal plane spatially on the screen and in my head. I can't seem to get it exact, and unfortunately I'm an A personality . Here is what I tried (please don't laugh), I parented the camera 'focus distance' to the 'point of interest' because I like how I can move the point of interest easily and precisely on the screen, thinking that would be the hot set up, but..............it didn't go according to plan, as my object still didn't seem to be in perfect focus, and not sure why. Finally, can anyone recommend a resource that would as non technically as possible explain how the film size, lens size, focal length, focal distance, zoom, etc. work and are interrelated? I've been all over the Internet, and just when I feel I'm getting it, I stumble again. Thanks for all the help so far.

                            • 11. Re: Depth of Field
                              yenaphe Level 4

                              When you parent a camera to a null, the null become the parent, and the camera the child.

                               

                              The child will inherit all the transformations of the parent, and the child transformations doesn't do anything at the parent.

                               

                              What you have to do is to link via an expression the focal distance to the null (do not parent it to the camera), and then you can animate the null in z space to change the focus distance.

                               

                              If you have 2 planes, one at 500 in Z and the other one at 700 in Z you'll just have to animate in Z your null at 500 or 700 according to the plane you wanna have in focus.

                               

                              Also, be sure to have a not too wide aperture, something around 20 shall be good, more and the plane of focus will really be thin. If needed you can push up the blur percentage.

                              • 12. Re: Depth of Field
                                Adolfo Rozenfeld Adobe Employee
                                What you have to do is to link via an expression the focal distance to the null (do not parent it to the camera), and then you can animate the null in z space to change the focus distance.

                                Sébastien: the problem with this is that position for the Null is a three dimensional array (XYZ), while Focus distance is an unidimensional value. It will give an error and it won't work.

                                The expression I posted above in this thread calculates the distance from the active camera to an user-defined layer and returns it as an unidimensional amount in pixels.

                                 

                                2. Is there a difference between the 'orientation' setting, and the x,y,z rotation settings. They seem to do the exact same thing?

                                Don't worry. You're not crazy. They do exactly the same thing when you drag with the rotation tool or edit the values. The difference is in how they go from one point to the other, rather than the start/end states themselves. Orientation offers three dimension in a single property, it means that the three terms in Orientation will work together to give you the most natural/shortest route from one point to the other, in a collaborative way. Rotation X, Y and Z don't have a clue about what the other two are doing, so the interpolation won't be as natural. This could be a bad or good thing - you want it smooth and natural, or crazy and wild? Also, Orientation can't go past 360 degrees, so if you want revolution (ie, spin multiple times) you need to use Rotation.

                                 

                                Finally, can anyone recommend a resource that would as non technically as possible explain how the film size, lens size, focal length, focal distance, zoom, etc. work and are interrelated?

                                 

                                They interact as in any real camera.

                                Here's the AE Help page on Camera Settings.

                                 

                                I would also recommend two books - Mark Christiansen's After Effects CS4 Studio Techniques and Chrs and Trish Meyer's Creating Motion Graphics with After Effects.

                                 

                                Anyway, here's a quick and dirty explanation:

                                 

                                The most important thing is to understand that DOF is affected only by aperture/f stop (the wider the aperture, the shallower the DOF) and magnification factor (if you take a photo of a bug, the larger you frame the bug, the shallower the depth of field).

                                 

                                So, under this light,

                                 

                                Film size: Affects magnification, by changing the definition for what a specific focal length means. Consider this: for a 35 mm film camera or full frame digital SLR, a 50 mm lens is a standard lens. For a medium format camera, with a larger film size, an 80 mm lens would work as a standard lens. In the same way, an APS-C sized sensor (smaller than 35mm, as used in afforable digital SLRs) means that a 30mm lens would be the standard lens. The AE camera presets are all in the 35mm still camera/full frame SLR scale, so you know that a 35mm lens is moderate wide angle, and an 80mm is moderate telephoto. If you're not doing match moving/camera tracking (ie, matching a real camera with a 3D camera with specialized software), I would stick to the 35mm equivalents. Changing the Film size, without changing the focal length alters the meaning of that focal length.

                                 

                                Lens size/focal length: 95 per cent of people will tell you that a telephoto lens gives you shallower DOF, whereas a wide angle will give you broader DOF. This depends on how you look at it. IMO, it's not really true - a telephoto lens is just a shorcut for a higher magnification value, ie a larger bug. If you walk close enough with a wide angle lens so the bug is just as big in the frame, DOF will be the same as with the telephoto lens. In AE, this is the same. Obviously, changing the focal length increases or decreases the angle of view (and viceversa).

                                 

                                Focus distance: The location of the focus plane, expressed in distance from the camera. The aperture value defines the size of the DOF area around the focus plane. Since the DOF area is 1/3 in front of focus distance, and 2/3 behind it, setting the focus distance really close, will give the impression of narrower DOF. Remember you can set an alternative view (top, left, etc) and then drag the Focus distance property as a slider in the timeline until it matches the location of a specific layer.

                                 

                                Zoom: it's a way to animate Focal length/Angle of view, since they don't exist as properties in the timeline. You can lock the focus distance to zoom, so that things stay in focus as you animate the zoom. FWIW, cinematic camera work usually favors tracking camera forwards/backwards over zooming, but nothing prevents you from doing it.

                                 

                                Of course, such a brief explanation will have many half-truths and half-lies

                                1 person found this helpful
                                • 13. Re: Depth of Field
                                  Lost In My Mind Level 1

                                      Thank you Sebastien for your help. I appreciate you taking the time to explain the parent child relationship, and the tip and advice on the aperature settings.

                                   

                                   

                                  Adolfo, 'such a brief explanation ', really???? I was worried I might have given you writers cramp!   Can't thank you enough for such a wealth of information. After your last post, you forced me into the dreaded world of expressions . Did some research, but was still afraid to try yours as I have trouble knowing when a part of the expression is just a note by the creator, or if I am actually supposed to add a name or value there. I entered yours as is and I got an error message that said something to the effect "Are you blonde, or just stupid?" Well, maybe it just came across that way . Actually, it was more like it couldn't find a layer named 'Nameof3Dlayer', so I put in the name of the layer I wanted to focus on and it seemed to work perfect, but in your earlier post you had mentioned that I need to change the name in 'posLayer'. When I tried that, I got another 'Adobe hates you' message, or something like that. Did I do something wrong?

                                  Also, thank you for your great explanation of the orientation versus the x,y,z rotation. I believe I would always prefer the smooth and natural effect at this time. Your explanation of the camera basics was easy to understand, and useful. I am going to order both books you recommended as soon as I am done here. Thank you both again.

                                  • 14. Re: Depth of Field
                                    yenaphe Level 4

                                    If you have $40 spare, I really encourage you to buy the Mark Christiansen book, a lot of in depth and usefull informations in it.

                                    • 15. Re: Depth of Field
                                      Adolfo Rozenfeld Adobe Employee

                                      Actually, it was more like it couldn't find a layer named 'Nameof3Dlayer', so I put in the name of the layer I wanted to focus on and it seemed to work perfect,

                                      Yes, that was exactly the idea. Change "Nameof3Dlayer" so that it's your chosen 3D layer. Don't change the name the posLayer variable

                                      BTW, once you´re done with those two books, there's also a book on expressions, which is really, really friendly and easy to follow for beginners called, mmmm, After Effects Expressions. I think it's really good at explaining such a complex topic so that it's not complex at all.