Search Unity

Cinemachine 2019 HDRP focus target post processing DOF not working

Discussion in 'Cinemachine' started by Mark_29, Jun 21, 2019.

  1. Mark_29

    Mark_29

    Joined:
    Aug 11, 2014
    Posts:
    79
    Hi

    Seems that the focus target in cinemachine is not working with HDRP depth of field n 2019.

    In previous version of cinemachine (and HDRP), prior to the volume update, it was possible to use a focus target to set the DOF of distance. Whilst the distance reads the target and is set in the extension, it does not seem to update the actual DOF.
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    Can you set up a small sample project that shows this and send it to me? It might be the way you're using it, because the DOF works for me.
     
  3. Mark_29

    Mark_29

    Joined:
    Aug 11, 2014
    Posts:
    79
    Sent a file via conversation - Just realised I can upload here too!

    Since this is 2019.1 and likewise the newest cinemachine, you may have to re-apply the DOF extension on the virtual camera.

    I would expect that the sphere should be the focus (i.e. not blurred) and when I move the sphere it should change the DOF

    This setup, used to work in the old way of creating targets with post process (V2) and older HDRP (5.7)

    Using unity 2019.1.5f1
    Cinemachine 2.3.4
    HDRP 5.16.1
    PostProcessing 2.1.7
     

    Attached Files:

  4. j-swan

    j-swan

    Joined:
    Oct 21, 2013
    Posts:
    19
    Did you figure this out? Also trying to work in the Cinemachine DOF along with HDRP
     
  5. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    Which versions? This is moving very fast and only the very latest will work.
     
  6. Banksy

    Banksy

    Joined:
    Mar 31, 2013
    Posts:
    376
    Am also interested in this thread as I am trying to change the DOF on each shot. Seems the only way to show DOF is to have "Global" turned on.

    NOTE: I can change DOF on the Main camera via script only... I thought it was possible to achieve DOF change on each camera shot by placing a separate PP on each vcam.

    If this is possible please enlighten me as I'm trying but to date nothing...
     
    Last edited: Oct 26, 2019
  7. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    It is indeed possible to have separate DOF settings on each vcam. Add a CinemachineVolumeSettings extension to the vcam, create a profile for it and set the DOF override there. It will be blended into your global settings whenever the vcam is active.
     
  8. Banksy

    Banksy

    Joined:
    Mar 31, 2013
    Posts:
    376
    Hi & I really appreciate your reply... as this is driving me nuts.

    I have One Main Cam + 2 Vcams.

    The only way I can show a post process effect is to turn on Global on a camera which overrides all other cameras.

    If I turn Global off I get nothing.
    I'm testing with a high color grade so I can see a harsh change.

    WhenI hit play I do see the Main camera change to each Vcam position.
     
  9. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    What do you mean turn on global?
    Are you using a CM VolumeSettings extension on the vcam with a profile?
    Can you show me the relevant inspectors?
     
  10. Banksy

    Banksy

    Joined:
    Mar 31, 2013
    Posts:
    376
    Hi,

    Every vCam's PP Volume script has a " Is Global " tick box.

    Each has a Profile with an effect added.

    I'm running Unity2019.1.5f & pulled in CM + PP via content manager.
     
    Last edited: Oct 28, 2019
  11. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    Can you paste images of the relevant inspectors here please?
     
  12. Banksy

    Banksy

    Joined:
    Mar 31, 2013
    Posts:
    376
    CMcam1.2.JPG CMcam1.JPG
     
    Last edited: Oct 28, 2019
    tigerleapgorge likes this.
  13. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    Thank you. Can you please also show the main camera inspector, with the brain and the PostProcessingLayer?
     
  14. Banksy

    Banksy

    Joined:
    Mar 31, 2013
    Posts:
    376
    CMain1.2.JPG
    CMain1.JPG
     
    Last edited: Oct 28, 2019
    tigerleapgorge likes this.
  15. Banksy

    Banksy

    Joined:
    Mar 31, 2013
    Posts:
    376
  16. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    ok good, you have a PostProcess layer on the main camera.

    On the vcam you have a PostProcessing volume. Delete that, and replace it with a CinemachinePostProcessing extension, which you'll find in the Extensions dropdown of the vcam. Connect your profile there.

    What the extension does, under the hood, is create a dynamic global profile, with the weight managed so that the profile's weight mimics the vcam's weight.
     
  17. Banksy

    Banksy

    Joined:
    Mar 31, 2013
    Posts:
    376
    ok.... making adjustments & testing out now...
     
  18. Banksy

    Banksy

    Joined:
    Mar 31, 2013
    Posts:
    376
    OK ALL GOOD... :)

    WOW .. what a mad mission that was... I spent days trying so many different setups (aka using Signals and Receivers ) learnt a lot though..

    TIP: If you plan to use a Vignette to test a PP effect.. make sure to turn up the "intensity"
    I had it turned off and was getting nothing in each shot.. thinking something else was wrong.


    thanks heaps Greg.

    Any other tips for all to benefit .. keep em coming.
     
    Last edited: Oct 29, 2019
    Gregoryl likes this.
  19. rodrigo_da_costa

    rodrigo_da_costa

    Joined:
    Feb 19, 2020
    Posts:
    5
    Hello guys! I am having a similar issue but even following the solutions that worked out for @Banksy I still haven't got it figured out.


    I am trying to apply post processing effects on the virtual cameras using the HDRP but they don't seem to work.
    The only thing I can apply is post process volumes do each virtual camera, but I wish I could use the CinemachinePostProcess component.
     
  20. rodrigo_da_costa

    rodrigo_da_costa

    Joined:
    Feb 19, 2020
    Posts:
    5
    MAIN CAMERA Inspector

    upload_2020-4-22_15-19-12.png
     
  21. rodrigo_da_costa

    rodrigo_da_costa

    Joined:
    Feb 19, 2020
    Posts:
    5
    VIRTUAL CAMERA Inspector

    upload_2020-4-22_15-20-35.png
     
  22. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    Which version of HDRP?
     
  23. rodrigo_da_costa

    rodrigo_da_costa

    Joined:
    Feb 19, 2020
    Posts:
    5
    Hi @Gregoryl Thanks for your time! Here are the versions of Unity and HDRP Package:

    upload_2020-4-23_14-25-29.png upload_2020-4-23_14-24-22.png
     
  24. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    Thanks. For HDRP 7, PostProcessing is built-in.
    So you should remove the PostProcessing package, and set up the volumes directly in HDRP.
    You don't need a layer on the Camera anymore.
    In CM, the PostProcessing extension is replaced by the VolumeSettings extension, which does pretty much an analogous thing in the HDRP context.
    Make sure you're using the very latest CM (2.6.0-preview).
     
    ben_unity723 likes this.
  25. rodrigo_da_costa

    rodrigo_da_costa

    Joined:
    Feb 19, 2020
    Posts:
    5
    Wonderful!! Thank you very much for these instructions.
    Happy to count with your quick response.
    All best!
     
    Gregoryl likes this.