Search Unity

Need help with Depth of Field

Discussion in 'Editor & General Support' started by Denisowator, Jun 23, 2017.

  1. Denisowator

    Denisowator

    Joined:
    Apr 22, 2014
    Posts:
    918
    I am using the Post Processing Stack "Depth of Field" effect, so just keep that in mind when answering.

    Okay so, I have two problems with the effect.

    The first problem I'm having is that I want to have 2 depths of field (one near the camera and one far away. And currently the way I achieved this, is by setting the "Aperture" to the minimum (0.1), and using the "Focus distance" to fine-tune where the two blurs' meeting point is in relation to the camera, and using the "Focal Length" to set how far apart they are.

    Here's a screenshot:
    upload_2017-6-23_10-9-3.png
    (The bottom one is nearer to the camera, and the top is the far away one)

    It may not be visible from the screenshot, but if I set these up like I want them, the bottom one is has a very clear line when it ends.

    This one shows the problem more clearly.
    upload_2017-6-23_10-10-50.png

    The more I set them apart, the clearer that bottom one becomes (the more visible the edge is).

    They both become really clear when placed really close together, but the bottom one consistently stays much more visible in terms of intensity.

    That's the first problem. And I understand that this effect probably wasn't ever intended to be used this way, but I can't think of any other way of doing this, with the post processing stack.

    The second problem is that the blur doesn't follow the actual camera like I want it to. If I jump, the bottom blur stays within that spot in world space, and disappears out of view. Same for the top one. If I jump, you can very clearly tell that they stay still in relation to the world space, rather than the camera's position.

    What I want to achieve in this second problem, is the bottom of the camera always having blur, while the far away blur only applies to world space (meaning if you jump, it doesn't change position). How can I achieve this? And how can I smooth out the bottom blur?

    Before you suggest it, I have tried changing the "Kernel Size", and while it does sort of help, it's not nearly as good as what I need, since it just increases and decreases the intensity of the effect (from how I understand it), while the sharp edge of the blur is still distinguishable.

    If you go to this manual page, and look at the 2 images below the first one, you'll see what I mean. I want both the background and foreground to be blurred, but I also want to be able to adjust how much each one is blurred. And I don't know how (if even) this can be made with the Post Processing Stack effect.

    And just for the sake of clarification. I'm putting this thread in "General" and not "Graphics", because it has to do directly with the settings and workings of the image effect (from Post Processing Stack) in the Inspector, and not the concept of depth of field as an image effect in general.

    P.S. Keep in mind I don't have the Pro version, hence why I'm using the Post Processing Stack.
     
    Last edited: Jun 23, 2017