Search Unity

Unity 2019.3, Cinemachine 2.4, Post processing workflow for Depth of Field?

Discussion in 'Cinemachine' started by originalemanuel2, Dec 10, 2019.

  1. originalemanuel2

    originalemanuel2

    Joined:
    Mar 4, 2015
    Posts:
    21
    Hi,

    I just started using Cinemachine and I really like it. But I am having a problem with post processing. This video here seems to be obsolete because the way unity handles post processing changed, right?



    What I want to do is have several virtual cameras in a scene (with overlapping paths) that have different Depth of Field values. When I use the workflow that is described in the video, nothing happens.

    I do have a global volume like it is set up in Unity 2019.3 in the sample scene for HDRP. So the effects there work and I intentionally did not add Depth of Field. I tried that with the post processing as it is shown in the video but as I said, nothing happens then. My guess is something is over-ruled from the Standard Unity PostProcessing approach?

    I also tried using the standard volumes from Unity, make them really small and a child of the virtual camera. That does not work as well because as soon as the virtual camera starts moving, the volume is moving differently. So it´s not really following the camera as it should.

    Any ideas? Is there an updated workflow for Depth of Field for that?

    Thanks,
    Emanuel
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    If you're using the latest HDRP (7.x) then things have changed. PostProcessing is now built-in: you should uninstall the PostProcessing stack. Instead, use the standard volumes that are built into HDRP. Within the VolumeSettings, you'll find a subsection for PostProcessing. Use that instead of the old PostProcessing, and you don't need a PP layer on the camera.

    In the Cinemachine vcam, use the VolumeSettings extension instead of the PostProcessing extension.

    Apart from that, the workflow is the same.
     
  3. BigRookGames

    BigRookGames

    Joined:
    Nov 24, 2014
    Posts:
    330
    When using the VolumeSettings extension on 2 vCams blended in Cinemachine, the Depth Of Field doesn't seem to blend between the two. Is there a way to do this so that the blending is done by the Cinemachine active blend instead of blend by local collider? I was expecting the weight to blend according to Cinemachine, but it doesn't seem to blend with how I've set it up.
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    @EdBoon The depth of field does indeed blend along with the rest of the postprocessing. It's possible that your settings are such that it doesn't show. Can you post images of the DOF section of the profiles that you're trying to blend?
     
    BigRookGames likes this.
  5. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    It's because your resolution in the Depth of Field profile is set to Half, which is not sufficient for focus pulling. Change it in your profiles like this:

    upload_2020-1-22_10-41-17.png
     
  6. BigRookGames

    BigRookGames

    Joined:
    Nov 24, 2014
    Posts:
    330
    Thanks for the update. I changed it, ensured volume was enabled on the vCam, set the DOF on the second blended cam to nothing, set the first vCam to high DOF, and it seems whichever volume i click enable most recently, it stays with those values. After doing that the first shot has no DOF applied when running :
     
  7. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    You can't add a Volume directly to a vcam.

    If you want the vcam's volume settings to blend in along with the vcam, you have to use the CinemachineVolumeSettings extension instead. Delete the volume, and replace it with this:

    upload_2020-1-22_10-57-16.png

    Then assign your profile to it like this:

    upload_2020-1-22_10-57-50.png
     
  8. BigRookGames

    BigRookGames

    Joined:
    Nov 24, 2014
    Posts:
    330
    Okay, I see this in mine, which is why I added the volume to the cam:

    I'm assuming I need to remove the stack package?
     
  9. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    oh, yes, you must remove that! Post-processing is built into HDRP
     
  10. BigRookGames

    BigRookGames

    Joined:
    Nov 24, 2014
    Posts:
    330
    Is this the one that should be removed?
    When removing it, it removed cinemachine along with it, and adding cinemachine back afterwards didn't seem to help, as all cinemachine stuff is disabled now
     
  11. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    Sounds like your project is a bit messed up.

    Cinemachine should still be there - it's not connected to PostProcessing.
    Make sure to delete the CinemchinePostProcessingV2 folder from your assets - maybe that's the problem.

    If that fails, try creating a new HDRP project and adding Cinemachine. That will show you what you're supposed to have.
     
  12. BigRookGames

    BigRookGames

    Joined:
    Nov 24, 2014
    Posts:
    330
    Yeah I see a few conflicts between files so something must be lingering from the last build with the stack. Going to clean it up now.
     
  13. BigRookGames

    BigRookGames

    Joined:
    Nov 24, 2014
    Posts:
    330
    Awesome, it works now, and the blending on volume settings as well. Thanks so much for your help.
     
  14. zfh2773

    zfh2773

    Joined:
    Nov 16, 2019
    Posts:
    27
    Why does the sprite not have near and far depth of field blur, only 3d objects have it. If the sprite is in front of the 3d object, adjust the 3d object and the sprite has depth of field, for example: