Is depth of field effect tied to scene scale?

circular05circular05 Posts: 0
edited August 2012 in Carrara Discussion

In the attached image I have the depth of field blur intensity set to the maximum of 400%. The defocused areas are not very blurry even at 400%. What attributes of my scene should I change to get greater blur? Thanks.

depth-test.jpg
640 x 480 - 61K
Post edited by circular05 on

Comments

  • JoeMamma2000JoeMamma2000 Posts: 2,615
    edited December 1969

    Sounds like you're looking for a "shallow" depth of field.

    In the real world, depth of field is a characteristic of cameras and lenses. Cameras focus on a single spot, and anything that is closer or further away from that spot are out of focus. It's just that it's so gradual in a certain area (called the depth of field) that we can't see the out of focus-ness, but it's there.

    Anyway, since it's a function of cameras and lenses, you need to adjust the camera and lens in your scene to see the effect. One way to decrease the DOF is to increase the magnification of the subject (ie, the sphere in your image). How do you increase the magnification? Well, you move the camera closer to the sphere, or use a zoom lens (higher mm).

    The other thing that affects it is the aperture of the lens (ie, the f-stop). A bigger opening will give a shallower DOF than a smaller opening.

    In Carrara and many other apps, you can't really select the f-stop of the lens (though you can in some newer render apps, called "physically based"). But you can monkey with the magnification by moving the camera closer or selecting a zoom lens. But each of those two options gives different results, so see which one works best.

    Keep in mind that if you have the flexibility with your particular scene to adjust the distance of the foreground/background relative to the subject, that's another way to get differing blurs given an existing DOF. So if your camera arrangement has a 20 foot DOF, for example, then obviously moving stuff in the background to be 40 feet away rather than 10 feet away will give you a blurrier background. But that might get messy in the future if you want the distances to be accurate.

    And don't use the built in Carrara DOF, it's really, really bad. Use Photoshop or AE or whatever.

  • JoeMamma2000JoeMamma2000 Posts: 2,615
    edited December 1969

    By the way, it goes without saying, but I'll say it anyway...

    If the distance between foreground and background in your scene (eg, the cylinder in your image) is very short, then it's gonna be real tough to make it really blurry, because the DOF is just a distance, and if you have scene objects that are within that small distance, they ain't gonna be blurry.

    So if you put something WAY behind the cylinder that the sphere is standing on, it's easier to configure your camera to make that blurry.

  • circular05circular05 Posts: 0
    edited December 1969

    Thanks, JoeMamma2000. That is helpful information and makes sense to me. I like that the DoF option is there, though I agree that it is a bit basic. I bought a book on AE today so I will see if I can make some use of its DoF effect in my animations.

  • JoeMamma2000JoeMamma2000 Posts: 2,615
    edited December 1969

    Carrara's DOF effect looks exactly like someone smeared Vaseline on the camera lens. It's really bad. And it takes forever to calculate, especially the darn preview. So slow (for significant blurring) that it's almost useless.

  • evilproducerevilproducer Posts: 9,050
    edited December 1969

    Has anybody tried the rendered DOF as opposed to the default post-render effect?

  • JoeMamma2000JoeMamma2000 Posts: 2,615
    edited December 1969

    Has anybody tried the rendered DOF as opposed to the default post-render effect?

    Yes. It's broken. And incredibly slow.

  • JoeMamma2000JoeMamma2000 Posts: 2,615
    edited December 1969

    Here's an example of the superior bad-ness of the raytraced DOF. First image was raytraced, second was post effect. No other changes between renders, just selected/de-selected raytraced DOF.

    First one took almost 8 minutes, second one took less than 10 seconds. And no, I have no idea what that weird black artifact is in the first image. Hence my proclamation that it's broken.

    DOFNone.jpg
    640 x 480 - 104K
    DOFRay.jpg
    640 x 480 - 118K
  • Salem2007Salem2007 Posts: 513
    edited August 2012

    Has anybody tried the rendered DOF as opposed to the default post-render effect?

    I like the DOF effect I get in Carrara, but it does take a while to set up. The camera type and distance have a lot to do with it, and I tend to use spheres (that I delete befroe rendering) to get the right focus point.

    Also, I'll have to check to be sure, but I think you can type in any value up to 999 in the DOF value rather than use the slider.

    vlad.jpg
    1280 x 586 - 224K
    Post edited by Salem2007 on
  • JoeMamma2000JoeMamma2000 Posts: 2,615
    edited December 1969

    Salem2007 said:
    I like the DOF effect I get in Carrara, but it does take a while to set up.

    And that's great if it works for you. But you do realize you can have FAR more flexibility, and get results far faster and with higher quality, if you do it in Photoshop (or whatever), right? No need to keep re-rendering in Carrara, just add a Depth pass and bring the image into Photoshop, and either use the Depth pass information or make your own gradient to define exactly where the focus point is, and how much de-focus happens on either side. You can do DOF effects that you couldn't even consider doing in Carrara.

  • thoromyrthoromyr Posts: 452
    edited December 1969

    Salem2007 said:
    I like the DOF effect I get in Carrara, but it does take a while to set up.

    And that's great if it works for you. But you do realize you can have FAR more flexibility, and get results far faster and with higher quality, if you do it in Photoshop (or whatever), right? No need to keep re-rendering in Carrara, just add a Depth pass and bring the image into Photoshop, and either use the Depth pass information or make your own gradient to define exactly where the focus point is, and how much de-focus happens on either side. You can do DOF effects that you couldn't even consider doing in Carrara.

    And it works for me as well. The default DOF is so sucky you could do better by doing a select and blur in any app that has it and the option should simply be removed.

    Apparently it is meaningful to you to have the flexibility of using AE or PS with the depth pass. For some, myself included, the render penalty isn't that bad, I don't have AE, I don't have PS (on Windows) and I don't need the flexibility. Basically, I don't bother with DOF effect until the end, set the focal point and render.

    I'm a very part time hobbyist so my scenes aren't tweaked to the max like Sub7th can do where the render times are extremely quick -- it is common for a final render to take a few hours on my computer. So taking longer for ray traced DOF just isn't a significant penalty for me.

    Sure, for someone who is picky about tweaking or needs to render on a schedule there are better options. But for those that Carrara is a once in a while thing and would like to have a DOF effect on a scene the provided ray traced does a good job and is flexible insofar as setting a focal point is concerned.

    Again, I'm not arguing against rendering a depth pass and using AE to tweak that into exactly what the vision calls for. And for an animation the Carrara DOF is plainly not usable. But (the ray traced) Carrara DOF *is* usable and does give good results. If a pic demonstrating this hadn't been posted I'd have done so myself.

    I'm also not arguing against DAZ improving the Carrara DOF. They should either fix the quick version to do *something* better or eliminate it. And improve the performance of the ray traced DOF (I get the impression it doesn't cache depth information so for each pixel it is calculating depth for nearby points to be used in the blur, whether or not it has already done so for another pixel).

  • JoeMamma2000JoeMamma2000 Posts: 2,615
    edited December 1969

    Yeah, can't argue with that. If you're doing renders that take hours, then a few more can't hurt... :)

    BTW, if you guys are also getting decent results with the raytraced DOF, I'm kinda curious why I got that weird artifact. My first thought was Snoopy was flying by, wearing a scarf blowing in the wind, and blocking out the sun to cause the shadow.

    Anyway, it's just a curiosity. Personally I can't see going from 10 seconds to 8 minutes for a render where the result is, well, the result you get with Carrara. Like I say, I'm all about designing images with a purpose in mind, and if I can get a better image by using something other than just a stock effect that whatever software gives you, then I'll go the other route. Sometimes (actually, often for me...) you want, for artistic reasons, to give your image an effect that might not be the technically accurate result that the software gives, but you want to "enhance" reality to give the viewer a certain experience. That's when you use different and more flexible tools.

  • thoromyrthoromyr Posts: 452
    edited December 1969

    BTW, if you guys are also getting decent results with the raytraced DOF, I'm kinda curious why I got that weird artifact. My first thought was Snoopy was flying by, wearing a scarf blowing in the wind, and blocking out the sun to cause the shadow.

    I really couldn't say. I've never seen anything remotely like that in any DOF render I've done. Since I'm happy with the default settings for the ray traced DOF (20% blur, fast quality) the only time I've ever changed them was once I increased the blur. I figure if I'm okay with the results for fast quality then there's no reason to bump that up. Maybe it is a result of adjusting the settings?

    And I've probably done no more than a dozen scenes where I used DOF at all. If I want it to look like a diorama or make renders with extreme DOF look less fake.

    I can say that if you want to see slow ray traced DOF in Carrara put something with refraction in the foreground and put the focal point well past that :) It doesn't slow down the whole render, just the parts affected by refraction (probably by an order of magnitude, its very noticeable). On that note, I wonder if a depth pass really captures all the information (e.g., if noticeable refraction is at work).

  • JoeMamma2000JoeMamma2000 Posts: 2,615
    edited December 1969

    By the way, any discussion of whether results are "good" or "acceptable" should be accompanied by reference photos. Presuming you are attempting to duplicate a real DOF effect, and make viewers believe that it's a DOF fuzziness, the "goodness" of the results should include an evaluation of whether the results look enough like the real thing, from real cameras and lenses, to fool the viewer. But that kind of discussion never happens. It's always a matter of personal preference, and "yeah, looks good to me". Which is fine if you goal is to make images only for yourself. But if anyone is trying to impress a viewer with their image, you don't want their first impression to be "gee, why did someone smear Vaseline on the lens?".

    If I get some time I might take a photo with significant DOF, knowing the parameters of the camera and lens and lighting, and try to duplicate that with Carrara's DOF and post a comparison. Or maybe someone who wants to learn can do that. It's a very good exercise to try to duplicate reference photos. It'll put hair on your chest.... :)

  • evilproducerevilproducer Posts: 9,050
    edited December 1969

    Salem2007 said:
    Has anybody tried the rendered DOF as opposed to the default post-render effect?

    I like the DOF effect I get in Carrara, but it does take a while to set up. The camera type and distance have a lot to do with it, and I tend to use spheres (that I delete befroe rendering) to get the right focus point.

    Also, I'll have to check to be sure, but I think you can type in any value up to 999 in the DOF value rather than use the slider.


    Thanks for the input. I know how to use the DOF, but I haven't used the DOF option for Raytraced DOF as the control panel for DOF suggests that it is slow. I also don't use blurry reflections for that reason.

  • de3ande3an Posts: 915
    edited December 1969

    In regard to transparent (and/or refracting) objects:

    The depth-of-field blurring that is obtained by using Carrara's default DOF "post render" option, or by using a depth pass render in conjunction with Photoshop's Lens Blur filter, will not render the DOF blur that occurs behind a transparency.

    However, Carrara's DOF "Raytraced" option will render the blur behind transparent areas. It's the only automatic way I’ve seen to render complete depth-of-field blur in such scenes.

    (Low quality settings were used in the following examples so as to expedite their creation. Smoother blurs are obtained with higher settings.)

    DOF-demo-carrara-raytraced.jpg
    800 x 600 - 100K
    DOF-demo-PS-depthpass-lensblur.jpg
    800 x 600 - 134K
    DOF-demo-carrara-post.jpg
    800 x 600 - 104K
  • CarltonMartinCarltonMartin Posts: 147
    edited August 2012

    de3an said:
    In regard to transparent (and/or refracting) objects:

    The depth-of-field blurring that is obtained by using Carrara's default DOF "post render" option, or by using a depth pass render in conjunction with Photoshop's Lens Blur filter, will not render the DOF blur that occurs behind a transparency.

    However, Carrara's DOF "Raytraced" option will render the blur behind transparent areas. It's the only automatic way I’ve seen to render complete depth-of-field blur in such scenes.

    (Low quality settings were used in the following examples so as to expedite their creation. Smoother blurs are obtained with higher settings.)

    Nice to know. Or rather, I guess, not nice to know. Is it worth a bug report? Has it been? It seems to me the depth pass *should* work through transparency.

    Post edited by CarltonMartin on
  • JoeMamma2000JoeMamma2000 Posts: 2,615
    edited August 2012

    I assume that when there's only open air between the camera and an object Carrara can calculate a post effect like DOF. But when there's some sort of transparent object in front, there are too many ways the image can vary in that region based upon the transparency/opacity settings, so you can't just come up with a standard DOF formula to vary the image. So you have to raytrace it to come up with the right DOF. In other words, how much do you blur for DOF when the transparent object is doing its own blurring and modification to what's behind it?

    Probably not a bug, but rather a "we can't do it because the result would look even worse than the standard crappy DOF".

    Post edited by JoeMamma2000 on
  • CarltonMartinCarltonMartin Posts: 147
    edited August 2012

    de3an pointed out the separate depth pass, like I use for PS, doesn't work with transparency. That's what I'd like fixed, personally; I don't really care about C's DOF, but I would like a somewhat accurate depth pass. But what do I know. It may not be worth the effort.

    Post edited by CarltonMartin on
  • JoeMamma2000JoeMamma2000 Posts: 2,615
    edited December 1969

    ...but I would like a somewhat accurate depth pass..

    I'm not sure what you mean by an "accurate depth pass". It seems to be correct as far as I can tell. The depth to a transparent object is just that. Do you want it to instead show the depth to the floor and background objects behind the transparent object? I suppose that could be an option, but technically that's not what a depth pass is.

    Still, you can modify the depth channel image in PS and make your own gradient image with whatever variation you want behind the transparent object.

  • evilproducerevilproducer Posts: 9,050
    edited December 1969

    I have used the depth pass and Photoshop quite a bit to get a DOF, and it's not hard to paint out the areas of an object that have an alpha applied. Usually takes me an extra five minutes.

  • JoeMamma2000JoeMamma2000 Posts: 2,615
    edited December 1969

    I have used the depth pass and Photoshop quite a bit to get a DOF, and it's not hard to paint out the areas of an object that have an alpha applied. Usually takes me an extra five minutes.

    Very true. And don't forget the Object Index pass which assigns a different level of grayscale to each object in the scene, so you can use that to instantly select just an object. Though sometimes the different grayscale levels are imperceptibly close, so you have to take that into account in your selection settings.

  • CarltonMartinCarltonMartin Posts: 147
    edited December 1969

    Take a look at the second of de3an's pictures—the image through the glass doesn't have any depth when the depth pass was run, so the PS blur doesn't work. It works around the glass, but the image in the glass has no depth. And it would, as the raytraced Carrara DOF shows in the third image.

    Thank you, though, I know how to use the depth pass. Take a look http://www.daz3d.com/forums/discussion/221/P90/#80282.

    I asked a simple question originally. It's not worth any more of my time. I doubt I'll ever have occasion for it to matter, but if I did, I'd be annoyed. I at least know what doesn't happen now.

  • evilproducerevilproducer Posts: 9,050
    edited December 1969

    Take a look at the second of de3an's pictures—the image through the glass doesn't have any depth when the depth pass was run, so the PS blur doesn't work. It works around the glass, but the image in the glass has no depth. And it would, as the raytraced Carrara DOF shows in the third image.

    Thank you, though, I know how to use the depth pass. Take a look http://www.daz3d.com/forums/discussion/221/P90/#80282.

    I asked a simple question originally. It's not worth any more of my time. I doubt I'll ever have occasion for it to matter, but if I did, I'd be annoyed. I at least know what doesn't happen now.

    You may not wish to know more, so disregard if you wish, but for anybody else reading this thread that may be interested:


    It would be nice for it to work through objects with an alpha, but since it is a post effect, there may be technical hurdles to overcome, as Joe mentioned.


    As I mentioned above, you can paint out the edges of offending objects with alphas. If you have a program that can handle masks, it should be a simple procedure. I use it quite a bit, especially for dynamic hair as the post render DOF effect doesn't respect dynamic hair. Neither does the depth pass or any other pass that I've tried. I usually use the polygonal lasso tool to mark the edges of where the DOF is supposed to be and depending on what I have to do, I either paint in the selected area or invert the selection.


    Here's an example. I used the DOF in Carrara, but I also rendered a depth pass because I was aware of the issue with alphas and wanted to fix any artifacts in my particles as they used alphas. The first image (assuming they display in the order in which I upload) is the raw image, the second one is the raw depth pass, the third is the painted depth pass and the last image is the final version.


    I did invert the depth pass because I wanted the background out of focus as well. since I rendered a DOF with the image, it didn't hurt the foreground's lack of focus.

    Breathing-fire-final.jpg
    2000 x 1500 - 709K
    Breathing-fire-fixed-depth.jpg
    2000 x 1500 - 223K
    Breathing-fire-raw-depth.jpg
    2000 x 1500 - 181K
    Breathing-fire.jpg
    2000 x 1500 - 899K
  • evilproducerevilproducer Posts: 9,050
    edited December 1969

    This is good to know: The raytraced DOF respects dynamic hair. I wasn't sure it would as the hair itself is a render time effect.

    hairy-ball.jpg
    800 x 600 - 144K
Sign In or Register to comment.